From 2b0e75401e1c1e628896081c44374683ea9e20cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Maierh=C3=B6fer?= Date: Tue, 9 Jun 2026 15:00:18 +0200 Subject: [PATCH 1/8] Rewrite plugin from Python to TypeScript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the Python Stop hook with a self-contained, pre-bundled TypeScript hook so the plugin runs on Node.js (>=20) instead of requiring Python and the langfuse Python SDK — which was painful to set up on macOS. - src/: hook entry, config resolution, transcript parsing, Langfuse emit, incremental sidecar state, OTel instrumentation - dist/index.mjs: committed self-contained bundle (tsdown), run directly by the Stop hook with no install step - Spans sent via the Langfuse TypeScript SDK over OpenTelemetry, batched - Incremental byte-offset reader + per-transcript dedup sidecar replaces the global state file and file lock - vitest tests for parsing and config resolution - Updated hooks.json to invoke node, refreshed README, bumped to 2.0.0 Co-Authored-By: Claude Opus 4.8 --- .claude-plugin/plugin.json | 2 +- .gitignore | 12 + .prettierignore | 4 + .prettierrc.json | 4 + README.md | 154 +- dist/index.mjs | 47029 +++++++++++++++++++++++++++++++++++ hooks/hooks.json | 3 +- hooks/langfuse_hook.py | 783 - package.json | 56 + pnpm-lock.yaml | 1743 ++ src/config.ts | 183 + src/index.ts | 72 + src/instrumentation.ts | 47 + src/parse.ts | 188 + src/state.ts | 119 + src/trace.ts | 182 + src/types.ts | 90 + src/utils.ts | 92 + test/config.test.ts | 56 + test/parse.test.ts | 126 + tsconfig.json | 17 + tsdown.config.ts | 23 + 22 files changed, 50161 insertions(+), 824 deletions(-) create mode 100644 .gitignore create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 dist/index.mjs delete mode 100644 hooks/langfuse_hook.py create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 src/config.ts create mode 100644 src/index.ts create mode 100644 src/instrumentation.ts create mode 100644 src/parse.ts create mode 100644 src/state.ts create mode 100644 src/trace.ts create mode 100644 src/types.ts create mode 100644 src/utils.ts create mode 100644 test/config.test.ts create mode 100644 test/parse.test.ts create mode 100644 tsconfig.json create mode 100644 tsdown.config.ts diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 4e6495e..2af8dec 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "langfuse", "description": "The Langfuse x Claude Code Observability Plugin", - "version": "1.0.0", + "version": "2.0.0", "author": { "name": "Langfuse" }, diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0da25b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +node_modules/ +*.log +.DS_Store + +# Claude Code writes a per-transcript dedup/state sidecar at runtime. +*.jsonl.langfuse + +# Local debugging +debug.log + +# Note: dist/ is intentionally committed — Claude Code runs the bundled hook +# directly without an install/build step. diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..e854151 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +node_modules +dist +pnpm-lock.yaml +.claude diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..c4b4336 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "printWidth": 100, + "trailingComma": "all" +} diff --git a/README.md b/README.md index cb99d5c..0e4c3af 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,137 @@ # Langfuse Observability Plugin for Claude Code - Trace every Claude Code session to [Langfuse](https://langfuse.com) — turns, generations, tool calls, and token usage — with zero code changes. +A [Claude Code](https://docs.claude.com/en/docs/claude-code) plugin that traces every session — turns, generations, tool calls, and token usage — to [Langfuse](https://langfuse.com) with zero code changes. - ## Install - - ```bash - claude plugin marketplace add langfuse/Claude-Observability-Plugin - claude plugin install langfuse@langfuse-observability +Once enabled, each Claude Code turn shows up in Langfuse as a trace you can inspect, debug, evaluate, and monitor for cost — turning Claude Code from a black box into an observable agent. - Restart Claude Code after install. +## What gets traced - On enable, you'll be prompted for: +After each turn, a `Stop` hook reads the new part of the session transcript and uploads it to Langfuse as a [trace](https://langfuse.com/docs/observability/data-model). The structure mirrors how Claude Code actually works: - ┌─────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Field │ Description │ - ├─────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┤ - │ LANGFUSE_SECRET_KEY │ Your Langfuse secret key (sk-lf-...). Stored in your OS keychain. │ - ├─────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┤ - │ LANGFUSE_PUBLIC_KEY │ Your Langfuse public key (pk-lf-...). │ - ├─────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┤ - │ LANGFUSE_BASE_URL │ https://us.cloud.langfuse.com (default), https://cloud.langfuse.com for EU, or your self-hosted URL. │ - ├─────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┤ - │ CC_LANGFUSE_DEBUG │ Verbose logging to ~/.claude/state/langfuse_hook.log. │ - └─────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────┘ +- **Turn** (`Claude Code - Turn N`) — one trace per turn, from your prompt to the final answer. +- **Generations** — one per assistant message within the turn, with the model name, assistant text, the tool calls it requested, and token usage (including cache reads/writes). +- **Tool calls** — `Bash`, `Read`, `Edit`, MCP tools, etc., each nested under the generation that issued it, with its input and output. +- **Sessions** — all turns from one Claude Code session are grouped via the session id, so you can replay the whole session in Langfuse's [Sessions](https://langfuse.com/docs/observability/features/sessions) view. - Get keys from your Langfuse project settings → API Keys. +Original timestamps are preserved on every span, so the Langfuse timeline reflects real wall-clock timing. - Requirements +## Prerequisites - - Python 3.9+ available as python3 - - langfuse SDK 4.x: pip install "langfuse>=4.0,<5" +- [Node.js](https://nodejs.org) >= 20 +- A [Langfuse Cloud](https://cloud.langfuse.com) account (or a [self-hosted](https://langfuse.com/self-hosting) instance) and API keys - If the SDK isn't importable, the hook exits silently — no impact on Claude Code. +No Python and no `pip install` — the hook ships as a single self-contained JavaScript bundle that runs on the Node.js already required by most dev environments. - How it works +## Installation - A Stop hook reads the session transcript incrementally on every turn and emits a Langfuse trace with one span per turn, nested generations per assistant message, and child - tool spans for every tool call. Token usage is captured when present. +### 1. Add the plugin marketplace - State is kept in ~/.claude/state/langfuse_state.json so re-runs only emit new turns. +```bash +claude plugin marketplace add langfuse/Claude-Observability-Plugin +``` + +### 2. Install the plugin + +```bash +claude plugin install langfuse@langfuse-observability +``` + +Restart Claude Code after installing. + +### 3. Configure your Langfuse credentials + +On install you'll be prompted for: - Reconfigure +| Field | Description | +| --------------------- | -------------------------------------------------------------------------------------------------------- | +| `LANGFUSE_SECRET_KEY` | Your Langfuse secret key (`sk-lf-...`). Stored in your OS keychain. | +| `LANGFUSE_PUBLIC_KEY` | Your Langfuse public key (`pk-lf-...`). | +| `LANGFUSE_BASE_URL` | `https://us.cloud.langfuse.com` (default), `https://cloud.langfuse.com` for EU, or your self-hosted URL. | +| `CC_LANGFUSE_DEBUG` | Verbose logging to stderr (off by default). | - claude plugin disable langfuse - claude plugin enable langfuse +Tracing is active as soon as the public and secret keys are set — there is no separate enable flag. - Uninstall +### 4. Get your Langfuse API keys - claude plugin uninstall langfuse +1. Go to [cloud.langfuse.com](https://cloud.langfuse.com) (or your self-hosted instance). +2. Create a project (or open an existing one). +3. Go to **Settings → API Keys → Create new API keys**. +4. Copy the **public** key (`pk-lf-...`) and **secret** key (`sk-lf-...`). - Troubleshooting +Run a Claude Code turn, then open your Langfuse project to see the trace. - - Nothing in Langfuse: check ~/.claude/state/langfuse_hook.log (enable CC_LANGFUSE_DEBUG). - - Hook not firing: confirm with claude plugin list that langfuse is enabled; restart Claude Code. - - langfuse import errors: ensure the python3 on your PATH has the SDK installed. +## Configuration - License +Configuration is resolved as **defaults → `~/.claude/langfuse.json` → `/.claude/langfuse.json` → environment variables** (environment wins). For each setting, the Claude Code plugin-config form (`CLAUDE_PLUGIN_OPTION_`, set by the install prompt) takes precedence over the matching plain environment variable. - MIT +### Environment variables + +| Variable | Required | Default | Description | +| ---------------------------------------------------------- | -------- | ------------------------------- | --------------------------------------------------------- | +| `LANGFUSE_PUBLIC_KEY` / `CC_LANGFUSE_PUBLIC_KEY` | Yes | — | Langfuse public key (`pk-lf-...`) | +| `LANGFUSE_SECRET_KEY` / `CC_LANGFUSE_SECRET_KEY` | Yes | — | Langfuse secret key (`sk-lf-...`) | +| `LANGFUSE_BASE_URL` / `CC_LANGFUSE_BASE_URL` | No | `https://us.cloud.langfuse.com` | Langfuse host / data region | +| `LANGFUSE_TRACING_ENVIRONMENT` / `CC_LANGFUSE_ENVIRONMENT` | No | — | Environment label for the traces (e.g. `production`) | +| `CC_LANGFUSE_USER_ID` | No | — | Attach a user id to all traces | +| `CC_LANGFUSE_TAGS` | No | — | Extra tags for all traces (JSON array or comma-separated) | +| `CC_LANGFUSE_METADATA` | No | — | JSON object of metadata to attach to all traces | +| `CC_LANGFUSE_MAX_CHARS` | No | `20000` | Truncate inputs/outputs longer than this many characters | +| `CC_LANGFUSE_DEBUG` | No | `false` | Set to `"true"` for verbose logging to stderr | +| `CC_LANGFUSE_FAIL_ON_ERROR` | No | `false` | Set to `"true"` to make hook upload errors fail the hook | + +### JSON config file + +Instead of environment variables you can create `~/.claude/langfuse.json` (global) or `/.claude/langfuse.json` (per-project): + +```json +{ + "public_key": "pk-lf-...", + "secret_key": "sk-lf-...", + "base_url": "https://us.cloud.langfuse.com" +} ``` + +### Data regions + +| Region | `LANGFUSE_BASE_URL` | +| -------- | ---------------------------------- | +| 🇺🇸 US | `https://us.cloud.langfuse.com` | +| 🇪🇺 EU | `https://cloud.langfuse.com` | +| 🇯🇵 Japan | `https://jp.cloud.langfuse.com` | +| ⚕️ HIPAA | `https://hipaa.cloud.langfuse.com` | + +## How it works + +A `Stop` hook runs `node "${CLAUDE_PLUGIN_ROOT}/dist/index.mjs"` after every turn. The hook reads the session transcript **incrementally**: a small sidecar file next to the transcript (`.jsonl.langfuse`) records the byte offset already processed and the number of turns emitted, so each turn is uploaded exactly once even though the hook fires repeatedly over the life of a session. + +Spans are sent via the [Langfuse TypeScript SDK](https://langfuse.com/docs/sdk/typescript) on top of OpenTelemetry, batched, and flushed once at the end of the hook (capped by the hook's 30s timeout). The hook **fails open**: any error is swallowed (logged in debug mode) so a tracing problem never blocks your Claude Code session. + +## Development + +The hook ships as a committed, pre-bundled `dist/index.mjs` so it runs without an install step. To work on it: + +```bash +pnpm install +pnpm run build # bundle src/ → dist/index.mjs (tsdown) +pnpm run test # vitest +pnpm run lint # prettier + tsc --noEmit + verify dist is up to date +``` + +All runtime dependencies (Langfuse SDK, OpenTelemetry, zod) are bundled into the single `dist/index.mjs`; only Node.js built-ins stay external. Rebuild and commit `dist/index.mjs` after any change to `src/`. + +## Troubleshooting + +- **Nothing appears in Langfuse** — run with `CC_LANGFUSE_DEBUG=true` to log to stderr; confirm with `claude plugin list` that the plugin is enabled and that you restarted Claude Code. +- **Authentication fails** — check that the public/secret keys are valid and that `LANGFUSE_BASE_URL` matches the region the keys belong to (US is the default here). +- **Traces land in the wrong project** — API keys are project-scoped in Langfuse; use the keys for the project you want. +- **Testing hook failures** — set `CC_LANGFUSE_FAIL_ON_ERROR=true` together with `CC_LANGFUSE_DEBUG=true` to surface upload or flush errors instead of failing open. +- **Re-uploading a session** — delete the `.jsonl.langfuse` sidecar to reprocess the transcript from the start. +- **Self-hosting** — the TypeScript SDK requires Langfuse platform version >= 3.95.0. + +## Data sent to Langfuse + +When enabled, the plugin uploads transcript data to Langfuse: prompts, assistant messages, tool-call inputs and outputs, model metadata, and token usage. Do not enable tracing for sessions containing data you do not want stored in Langfuse. Use `CC_LANGFUSE_MAX_CHARS` to cap how much of large inputs/outputs is captured. + +## License + +MIT diff --git a/dist/index.mjs b/dist/index.mjs new file mode 100644 index 0000000..2155c30 --- /dev/null +++ b/dist/index.mjs @@ -0,0 +1,47029 @@ +import { createRequire } from "node:module"; +import * as fs from "node:fs/promises"; +import * as os$2 from "node:os"; +import * as path from "node:path"; +import * as zlib from "zlib"; +import { Readable } from "stream"; + +//#region rolldown:runtime +var __create = Object.create; +var __defProp$1 = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); +var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); +var __exportAll = (all, symbols) => { + let target = {}; + for (var name in all) { + __defProp$1(target, name, { + get: all[name], + enumerable: true + }); + } + if (symbols) { + __defProp$1(target, Symbol.toStringTag, { value: "Module" }); + } + return target; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) { + __defProp$1(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + } + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); +var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp$1({}, "__esModule", { value: true }), mod); +var __require = /* @__PURE__ */ createRequire(import.meta.url); + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js +var _a$2; +function $constructor(name, initializer$2, params) { + function init(inst, def) { + if (!inst._zod) Object.defineProperty(inst, "_zod", { + value: { + def, + constr: _, + traits: /* @__PURE__ */ new Set() + }, + enumerable: false + }); + if (inst._zod.traits.has(name)) return; + inst._zod.traits.add(name); + initializer$2(inst, def); + const proto = _.prototype; + const keys = Object.keys(proto); + for (let i = 0; i < keys.length; i++) { + const k = keys[i]; + if (!(k in inst)) inst[k] = proto[k].bind(inst); + } + } + const Parent = params?.Parent ?? Object; + class Definition extends Parent {} + Object.defineProperty(Definition, "name", { value: name }); + function _(def) { + var _a$3; + const inst = params?.Parent ? new Definition() : this; + init(inst, def); + (_a$3 = inst._zod).deferred ?? (_a$3.deferred = []); + for (const fn of inst._zod.deferred) fn(); + return inst; + } + Object.defineProperty(_, "init", { value: init }); + Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => { + if (params?.Parent && inst instanceof params.Parent) return true; + return inst?._zod?.traits?.has(name); + } }); + Object.defineProperty(_, "name", { value: name }); + return _; +} +var $ZodAsyncError = class extends Error { + constructor() { + super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); + } +}; +var $ZodEncodeError = class extends Error { + constructor(name) { + super(`Encountered unidirectional transform during encode: ${name}`); + this.name = "ZodEncodeError"; + } +}; +(_a$2 = globalThis).__zod_globalConfig ?? (_a$2.__zod_globalConfig = {}); +const globalConfig = globalThis.__zod_globalConfig; +function config(newConfig) { + if (newConfig) Object.assign(globalConfig, newConfig); + return globalConfig; +} + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js +function getEnumValues(entries) { + const numericValues = Object.values(entries).filter((v) => typeof v === "number"); + return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); +} +function jsonStringifyReplacer(_, value) { + if (typeof value === "bigint") return value.toString(); + return value; +} +function cached(getter) { + return { get value() { + { + const value = getter(); + Object.defineProperty(this, "value", { value }); + return value; + } + throw new Error("cached value already set"); + } }; +} +function nullish(input) { + return input === null || input === void 0; +} +function cleanRegex(source) { + const start = source.startsWith("^") ? 1 : 0; + const end = source.endsWith("$") ? source.length - 1 : source.length; + return source.slice(start, end); +} +function floatSafeRemainder(val, step) { + const ratio = val / step; + const roundedRatio = Math.round(ratio); + const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1); + if (Math.abs(ratio - roundedRatio) < tolerance) return 0; + return ratio - roundedRatio; +} +const EVALUATING = /* @__PURE__ */ Symbol("evaluating"); +function defineLazy(object$1, key, getter) { + let value = void 0; + Object.defineProperty(object$1, key, { + get() { + if (value === EVALUATING) return; + if (value === void 0) { + value = EVALUATING; + value = getter(); + } + return value; + }, + set(v) { + Object.defineProperty(object$1, key, { value: v }); + }, + configurable: true + }); +} +function assignProp(target, prop, value) { + Object.defineProperty(target, prop, { + value, + writable: true, + enumerable: true, + configurable: true + }); +} +function mergeDefs(...defs) { + const mergedDescriptors = {}; + for (const def of defs) { + const descriptors = Object.getOwnPropertyDescriptors(def); + Object.assign(mergedDescriptors, descriptors); + } + return Object.defineProperties({}, mergedDescriptors); +} +function esc(str) { + return JSON.stringify(str); +} +function slugify(input) { + return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, ""); +} +const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {}; +function isObject(data) { + return typeof data === "object" && data !== null && !Array.isArray(data); +} +const allowsEval = /* @__PURE__ */ cached(() => { + if (globalConfig.jitless) return false; + if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false; + try { + new Function(""); + return true; + } catch (_) { + return false; + } +}); +function isPlainObject(o) { + if (isObject(o) === false) return false; + const ctor = o.constructor; + if (ctor === void 0) return true; + if (typeof ctor !== "function") return true; + const prot = ctor.prototype; + if (isObject(prot) === false) return false; + if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false; + return true; +} +function shallowClone(o) { + if (isPlainObject(o)) return { ...o }; + if (Array.isArray(o)) return [...o]; + if (o instanceof Map) return new Map(o); + if (o instanceof Set) return new Set(o); + return o; +} +const propertyKeyTypes = /* @__PURE__ */ new Set([ + "string", + "number", + "symbol" +]); +function escapeRegex(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +} +function clone(inst, def, params) { + const cl = new inst._zod.constr(def ?? inst._zod.def); + if (!def || params?.parent) cl._zod.parent = inst; + return cl; +} +function normalizeParams(_params) { + const params = _params; + if (!params) return {}; + if (typeof params === "string") return { error: () => params }; + if (params?.message !== void 0) { + if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params"); + params.error = params.message; + } + delete params.message; + if (typeof params.error === "string") return { + ...params, + error: () => params.error + }; + return params; +} +function optionalKeys(shape) { + return Object.keys(shape).filter((k) => { + return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; + }); +} +const NUMBER_FORMAT_RANGES = { + safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], + int32: [-2147483648, 2147483647], + uint32: [0, 4294967295], + float32: [-34028234663852886e22, 34028234663852886e22], + float64: [-Number.MAX_VALUE, Number.MAX_VALUE] +}; +function pick(schema, mask) { + const currDef = schema._zod.def; + const checks = currDef.checks; + if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements"); + return clone(schema, mergeDefs(schema._zod.def, { + get shape() { + const newShape = {}; + for (const key in mask) { + if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`); + if (!mask[key]) continue; + newShape[key] = currDef.shape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + })); +} +function omit(schema, mask) { + const currDef = schema._zod.def; + const checks = currDef.checks; + if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements"); + return clone(schema, mergeDefs(schema._zod.def, { + get shape() { + const newShape = { ...schema._zod.def.shape }; + for (const key in mask) { + if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`); + if (!mask[key]) continue; + delete newShape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + })); +} +function extend(schema, shape) { + if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object"); + const checks = schema._zod.def.checks; + if (checks && checks.length > 0) { + const existingShape = schema._zod.def.shape; + for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); + } + return clone(schema, mergeDefs(schema._zod.def, { get shape() { + const _shape = { + ...schema._zod.def.shape, + ...shape + }; + assignProp(this, "shape", _shape); + return _shape; + } })); +} +function safeExtend(schema, shape) { + if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object"); + return clone(schema, mergeDefs(schema._zod.def, { get shape() { + const _shape = { + ...schema._zod.def.shape, + ...shape + }; + assignProp(this, "shape", _shape); + return _shape; + } })); +} +function merge(a, b) { + if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead."); + return clone(a, mergeDefs(a._zod.def, { + get shape() { + const _shape = { + ...a._zod.def.shape, + ...b._zod.def.shape + }; + assignProp(this, "shape", _shape); + return _shape; + }, + get catchall() { + return b._zod.def.catchall; + }, + checks: b._zod.def.checks ?? [] + })); +} +function partial(Class, schema, mask) { + const checks = schema._zod.def.checks; + if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements"); + return clone(schema, mergeDefs(schema._zod.def, { + get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) for (const key in mask) { + if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`); + if (!mask[key]) continue; + shape[key] = Class ? new Class({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + } + else for (const key in oldShape) shape[key] = Class ? new Class({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + assignProp(this, "shape", shape); + return shape; + }, + checks: [] + })); +} +function required(Class, schema, mask) { + return clone(schema, mergeDefs(schema._zod.def, { get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) for (const key in mask) { + if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`); + if (!mask[key]) continue; + shape[key] = new Class({ + type: "nonoptional", + innerType: oldShape[key] + }); + } + else for (const key in oldShape) shape[key] = new Class({ + type: "nonoptional", + innerType: oldShape[key] + }); + assignProp(this, "shape", shape); + return shape; + } })); +} +function aborted(x, startIndex = 0) { + if (x.aborted === true) return true; + for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true; + return false; +} +function explicitlyAborted(x, startIndex = 0) { + if (x.aborted === true) return true; + for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true; + return false; +} +function prefixIssues(path$1, issues) { + return issues.map((iss) => { + var _a$3; + (_a$3 = iss).path ?? (_a$3.path = []); + iss.path.unshift(path$1); + return iss; + }); +} +function unwrapMessage(message) { + return typeof message === "string" ? message : message?.message; +} +function finalizeIssue(iss, ctx, config$1) { + const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config$1.customError?.(iss)) ?? unwrapMessage(config$1.localeError?.(iss)) ?? "Invalid input"; + const { inst: _inst, continue: _continue, input: _input, ...rest } = iss; + rest.path ?? (rest.path = []); + rest.message = message; + if (ctx?.reportInput) rest.input = _input; + return rest; +} +function getLengthableOrigin(input) { + if (Array.isArray(input)) return "array"; + if (typeof input === "string") return "string"; + return "unknown"; +} +function issue(...args) { + const [iss, input, inst] = args; + if (typeof iss === "string") return { + message: iss, + code: "custom", + input, + inst + }; + return { ...iss }; +} + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js +const initializer$1 = (inst, def) => { + inst.name = "$ZodError"; + Object.defineProperty(inst, "_zod", { + value: inst._zod, + enumerable: false + }); + Object.defineProperty(inst, "issues", { + value: def, + enumerable: false + }); + inst.message = JSON.stringify(def, jsonStringifyReplacer, 2); + Object.defineProperty(inst, "toString", { + value: () => inst.message, + enumerable: false + }); +}; +const $ZodError = $constructor("$ZodError", initializer$1); +const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error }); +function flattenError(error, mapper = (issue$1) => issue$1.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of error.issues) if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } else formErrors.push(mapper(sub)); + return { + formErrors, + fieldErrors + }; +} +function formatError(error, mapper = (issue$1) => issue$1.message) { + const fieldErrors = { _errors: [] }; + const processError = (error$1, path$1 = []) => { + for (const issue$1 of error$1.issues) if (issue$1.code === "invalid_union" && issue$1.errors.length) issue$1.errors.map((issues) => processError({ issues }, [...path$1, ...issue$1.path])); + else if (issue$1.code === "invalid_key") processError({ issues: issue$1.issues }, [...path$1, ...issue$1.path]); + else if (issue$1.code === "invalid_element") processError({ issues: issue$1.issues }, [...path$1, ...issue$1.path]); + else { + const fullpath = [...path$1, ...issue$1.path]; + if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue$1)); + else { + let curr = fieldErrors; + let i = 0; + while (i < fullpath.length) { + const el = fullpath[i]; + if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] }; + else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue$1)); + } + curr = curr[el]; + i++; + } + } + } + }; + processError(error); + return fieldErrors; +} + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js +const _parse = (_Err) => (schema, value, _ctx, _params) => { + const ctx = _ctx ? { + ..._ctx, + async: false + } : { async: false }; + const result = schema._zod.run({ + value, + issues: [] + }, ctx); + if (result instanceof Promise) throw new $ZodAsyncError(); + if (result.issues.length) { + const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, _params?.callee); + throw e; + } + return result.value; +}; +const parse$1 = /* @__PURE__ */ _parse($ZodRealError); +const _parseAsync = (_Err) => async (schema, value, _ctx, params) => { + const ctx = _ctx ? { + ..._ctx, + async: true + } : { async: true }; + let result = schema._zod.run({ + value, + issues: [] + }, ctx); + if (result instanceof Promise) result = await result; + if (result.issues.length) { + const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, params?.callee); + throw e; + } + return result.value; +}; +const parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError); +const _safeParse = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { + ..._ctx, + async: false + } : { async: false }; + const result = schema._zod.run({ + value, + issues: [] + }, ctx); + if (result instanceof Promise) throw new $ZodAsyncError(); + return result.issues.length ? { + success: false, + error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { + success: true, + data: result.value + }; +}; +const safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError); +const _safeParseAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? { + ..._ctx, + async: true + } : { async: true }; + let result = schema._zod.run({ + value, + issues: [] + }, ctx); + if (result instanceof Promise) result = await result; + return result.issues.length ? { + success: false, + error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { + success: true, + data: result.value + }; +}; +const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError); +const _encode = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { + ..._ctx, + direction: "backward" + } : { direction: "backward" }; + return _parse(_Err)(schema, value, ctx); +}; +const encode$1 = /* @__PURE__ */ _encode($ZodRealError); +const _decode = (_Err) => (schema, value, _ctx) => { + return _parse(_Err)(schema, value, _ctx); +}; +const decode$1 = /* @__PURE__ */ _decode($ZodRealError); +const _encodeAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? { + ..._ctx, + direction: "backward" + } : { direction: "backward" }; + return _parseAsync(_Err)(schema, value, ctx); +}; +const encodeAsync$1 = /* @__PURE__ */ _encodeAsync($ZodRealError); +const _decodeAsync = (_Err) => async (schema, value, _ctx) => { + return _parseAsync(_Err)(schema, value, _ctx); +}; +const decodeAsync$1 = /* @__PURE__ */ _decodeAsync($ZodRealError); +const _safeEncode = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { + ..._ctx, + direction: "backward" + } : { direction: "backward" }; + return _safeParse(_Err)(schema, value, ctx); +}; +const safeEncode$1 = /* @__PURE__ */ _safeEncode($ZodRealError); +const _safeDecode = (_Err) => (schema, value, _ctx) => { + return _safeParse(_Err)(schema, value, _ctx); +}; +const safeDecode$1 = /* @__PURE__ */ _safeDecode($ZodRealError); +const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? { + ..._ctx, + direction: "backward" + } : { direction: "backward" }; + return _safeParseAsync(_Err)(schema, value, ctx); +}; +const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync($ZodRealError); +const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => { + return _safeParseAsync(_Err)(schema, value, _ctx); +}; +const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError); + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js +/** +* @deprecated CUID v1 is deprecated by its authors due to information leakage +* (timestamps embedded in the id). Use {@link cuid2} instead. +* See https://github.com/paralleldrive/cuid. +*/ +const cuid = /^[cC][0-9a-z]{6,}$/; +const cuid2 = /^[0-9a-z]+$/; +const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; +const xid = /^[0-9a-vA-V]{20}$/; +const ksuid = /^[A-Za-z0-9]{27}$/; +const nanoid = /^[a-zA-Z0-9_-]{21}$/; +/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */ +const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; +/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */ +const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; +/** Returns a regex for validating an RFC 9562/4122 UUID. +* +* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */ +const uuid = (version$1) => { + if (!version$1) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; + return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$1}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); +}; +/** Practical email validation */ +const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; +const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +function emoji() { + return new RegExp(_emoji$1, "u"); +} +const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; +const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; +const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; +const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; +const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; +const base64url = /^[A-Za-z0-9_-]*$/; +const httpProtocol = /^https?$/; +const e164 = /^\+[1-9]\d{6,14}$/; +const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; +const date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`); +function timeSource(args) { + const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; + return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; +} +function time$1(args) { + return /* @__PURE__ */ new RegExp(`^${timeSource(args)}$`); +} +function datetime$1(args) { + const time$2 = timeSource({ precision: args.precision }); + const opts = ["Z"]; + if (args.local) opts.push(""); + if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); + const timeRegex = `${time$2}(?:${opts.join("|")})`; + return /* @__PURE__ */ new RegExp(`^${dateSource}T(?:${timeRegex})$`); +} +const string$1 = (params) => { + const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; + return /* @__PURE__ */ new RegExp(`^${regex}$`); +}; +const integer = /^-?\d+$/; +const number$1 = /^-?\d+(?:\.\d+)?$/; +const boolean$1 = /^(?:true|false)$/i; +const lowercase = /^[^A-Z]*$/; +const uppercase = /^[^a-z]*$/; + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js +const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { + var _a$3; + inst._zod ?? (inst._zod = {}); + inst._zod.def = def; + (_a$3 = inst._zod).onattach ?? (_a$3.onattach = []); +}); +const numericOriginMap = { + number: "number", + bigint: "bigint", + object: "date" +}; +const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => { + $ZodCheck.init(inst, def); + const origin = numericOriginMap[typeof def.value]; + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; + if (def.value < curr) if (def.inclusive) bag.maximum = def.value; + else bag.exclusiveMaximum = def.value; + }); + inst._zod.check = (payload) => { + if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return; + payload.issues.push({ + origin, + code: "too_big", + maximum: typeof def.value === "object" ? def.value.getTime() : def.value, + input: payload.value, + inclusive: def.inclusive, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => { + $ZodCheck.init(inst, def); + const origin = numericOriginMap[typeof def.value]; + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; + if (def.value > curr) if (def.inclusive) bag.minimum = def.value; + else bag.exclusiveMinimum = def.value; + }); + inst._zod.check = (payload) => { + if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return; + payload.issues.push({ + origin, + code: "too_small", + minimum: typeof def.value === "object" ? def.value.getTime() : def.value, + input: payload.value, + inclusive: def.inclusive, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => { + $ZodCheck.init(inst, def); + inst._zod.onattach.push((inst$1) => { + var _a$3; + (_a$3 = inst$1._zod.bag).multipleOf ?? (_a$3.multipleOf = def.value); + }); + inst._zod.check = (payload) => { + if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check."); + if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return; + payload.issues.push({ + origin: typeof payload.value, + code: "not_multiple_of", + divisor: def.value, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => { + $ZodCheck.init(inst, def); + def.format = def.format || "float64"; + const isInt = def.format?.includes("int"); + const origin = isInt ? "int" : "number"; + const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format]; + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + bag.format = def.format; + bag.minimum = minimum; + bag.maximum = maximum; + if (isInt) bag.pattern = integer; + }); + inst._zod.check = (payload) => { + const input = payload.value; + if (isInt) { + if (!Number.isInteger(input)) { + payload.issues.push({ + expected: origin, + format: def.format, + code: "invalid_type", + continue: false, + input, + inst + }); + return; + } + if (!Number.isSafeInteger(input)) { + if (input > 0) payload.issues.push({ + input, + code: "too_big", + maximum: Number.MAX_SAFE_INTEGER, + note: "Integers must be within the safe integer range.", + inst, + origin, + inclusive: true, + continue: !def.abort + }); + else payload.issues.push({ + input, + code: "too_small", + minimum: Number.MIN_SAFE_INTEGER, + note: "Integers must be within the safe integer range.", + inst, + origin, + inclusive: true, + continue: !def.abort + }); + return; + } + } + if (input < minimum) payload.issues.push({ + origin: "number", + input, + code: "too_small", + minimum, + inclusive: true, + inst, + continue: !def.abort + }); + if (input > maximum) payload.issues.push({ + origin: "number", + input, + code: "too_big", + maximum, + inclusive: true, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { + var _a$3; + $ZodCheck.init(inst, def); + (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst$1) => { + const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY; + if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + if (input.length <= def.maximum) return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_big", + maximum: def.maximum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => { + var _a$3; + $ZodCheck.init(inst, def); + (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst$1) => { + const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; + if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + if (input.length >= def.minimum) return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_small", + minimum: def.minimum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => { + var _a$3; + $ZodCheck.init(inst, def); + (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + bag.minimum = def.length; + bag.maximum = def.length; + bag.length = def.length; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length === def.length) return; + const origin = getLengthableOrigin(input); + const tooBig = length > def.length; + payload.issues.push({ + origin, + ...tooBig ? { + code: "too_big", + maximum: def.length + } : { + code: "too_small", + minimum: def.length + }, + inclusive: true, + exact: true, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => { + var _a$3, _b; + $ZodCheck.init(inst, def); + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + bag.format = def.format; + if (def.pattern) { + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(def.pattern); + } + }); + if (def.pattern) (_a$3 = inst._zod).check ?? (_a$3.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: def.format, + input: payload.value, + ...def.pattern ? { pattern: def.pattern.toString() } : {}, + inst, + continue: !def.abort + }); + }); + else (_b = inst._zod).check ?? (_b.check = () => {}); +}); +const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + inst._zod.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "regex", + input: payload.value, + pattern: def.pattern.toString(), + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => { + def.pattern ?? (def.pattern = lowercase); + $ZodCheckStringFormat.init(inst, def); +}); +const $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => { + def.pattern ?? (def.pattern = uppercase); + $ZodCheckStringFormat.init(inst, def); +}); +const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => { + $ZodCheck.init(inst, def); + const escapedRegex = escapeRegex(def.includes); + const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); + def.pattern = pattern; + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.includes(def.includes, def.position)) return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "includes", + includes: def.includes, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = /* @__PURE__ */ new RegExp(`^${escapeRegex(def.prefix)}.*`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.startsWith(def.prefix)) return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "starts_with", + prefix: def.prefix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = /* @__PURE__ */ new RegExp(`.*${escapeRegex(def.suffix)}$`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst$1) => { + const bag = inst$1._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.endsWith(def.suffix)) return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "ends_with", + suffix: def.suffix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => { + $ZodCheck.init(inst, def); + inst._zod.check = (payload) => { + payload.value = def.tx(payload.value); + }; +}); + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js +var Doc = class { + constructor(args = []) { + this.content = []; + this.indent = 0; + if (this) this.args = args; + } + indented(fn) { + this.indent += 1; + fn(this); + this.indent -= 1; + } + write(arg) { + if (typeof arg === "function") { + arg(this, { execution: "sync" }); + arg(this, { execution: "async" }); + return; + } + const lines = arg.split("\n").filter((x) => x); + const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length)); + const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x); + for (const line of dedented) this.content.push(line); + } + compile() { + const F = Function; + const args = this?.args; + const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)]; + return new F(...args, lines.join("\n")); + } +}; + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js +const version = { + major: 4, + minor: 4, + patch: 3 +}; + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js +const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { + var _a$3; + inst ?? (inst = {}); + inst._zod.def = def; + inst._zod.bag = inst._zod.bag || {}; + inst._zod.version = version; + const checks = [...inst._zod.def.checks ?? []]; + if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst); + for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst); + if (checks.length === 0) { + (_a$3 = inst._zod).deferred ?? (_a$3.deferred = []); + inst._zod.deferred?.push(() => { + inst._zod.run = inst._zod.parse; + }); + } else { + const runChecks = (payload, checks$1, ctx) => { + let isAborted = aborted(payload); + let asyncResult; + for (const ch of checks$1) { + if (ch._zod.def.when) { + if (explicitlyAborted(payload)) continue; + if (!ch._zod.def.when(payload)) continue; + } else if (isAborted) continue; + const currLen = payload.issues.length; + const _ = ch._zod.check(payload); + if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError(); + if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { + await _; + if (payload.issues.length === currLen) return; + if (!isAborted) isAborted = aborted(payload, currLen); + }); + else { + if (payload.issues.length === currLen) continue; + if (!isAborted) isAborted = aborted(payload, currLen); + } + } + if (asyncResult) return asyncResult.then(() => { + return payload; + }); + return payload; + }; + const handleCanaryResult = (canary, payload, ctx) => { + if (aborted(canary)) { + canary.aborted = true; + return canary; + } + const checkResult = runChecks(payload, checks, ctx); + if (checkResult instanceof Promise) { + if (ctx.async === false) throw new $ZodAsyncError(); + return checkResult.then((checkResult$1) => inst._zod.parse(checkResult$1, ctx)); + } + return inst._zod.parse(checkResult, ctx); + }; + inst._zod.run = (payload, ctx) => { + if (ctx.skipChecks) return inst._zod.parse(payload, ctx); + if (ctx.direction === "backward") { + const canary = inst._zod.parse({ + value: payload.value, + issues: [] + }, { + ...ctx, + skipChecks: true + }); + if (canary instanceof Promise) return canary.then((canary$1) => { + return handleCanaryResult(canary$1, payload, ctx); + }); + return handleCanaryResult(canary, payload, ctx); + } + const result = inst._zod.parse(payload, ctx); + if (result instanceof Promise) { + if (ctx.async === false) throw new $ZodAsyncError(); + return result.then((result$1) => runChecks(result$1, checks, ctx)); + } + return runChecks(result, checks, ctx); + }; + } + defineLazy(inst, "~standard", () => ({ + validate: (value) => { + try { + const r = safeParse$1(inst, value); + return r.success ? { value: r.data } : { issues: r.error?.issues }; + } catch (_) { + return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues }); + } + }, + vendor: "zod", + version: 1 + })); +}); +const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag); + inst._zod.parse = (payload, _) => { + if (def.coerce) try { + payload.value = String(payload.value); + } catch (_$1) {} + if (typeof payload.value === "string") return payload; + payload.issues.push({ + expected: "string", + code: "invalid_type", + input: payload.value, + inst + }); + return payload; + }; +}); +const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + $ZodString.init(inst, def); +}); +const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => { + def.pattern ?? (def.pattern = guid); + $ZodStringFormat.init(inst, def); +}); +const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { + if (def.version) { + const v = { + v1: 1, + v2: 2, + v3: 3, + v4: 4, + v5: 5, + v6: 6, + v7: 7, + v8: 8 + }[def.version]; + if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`); + def.pattern ?? (def.pattern = uuid(v)); + } else def.pattern ?? (def.pattern = uuid()); + $ZodStringFormat.init(inst, def); +}); +const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => { + def.pattern ?? (def.pattern = email); + $ZodStringFormat.init(inst, def); +}); +const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + try { + const trimmed = payload.value.trim(); + if (!def.normalize && def.protocol?.source === httpProtocol.source) { + if (!/^https?:\/\//i.test(trimmed)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid URL format", + input: payload.value, + inst, + continue: !def.abort + }); + return; + } + } + const url = new URL(trimmed); + if (def.hostname) { + def.hostname.lastIndex = 0; + if (!def.hostname.test(url.hostname)) payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid hostname", + pattern: def.hostname.source, + input: payload.value, + inst, + continue: !def.abort + }); + } + if (def.protocol) { + def.protocol.lastIndex = 0; + if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid protocol", + pattern: def.protocol.source, + input: payload.value, + inst, + continue: !def.abort + }); + } + if (def.normalize) payload.value = url.href; + else payload.value = trimmed; + return; + } catch (_) { + payload.issues.push({ + code: "invalid_format", + format: "url", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => { + def.pattern ?? (def.pattern = emoji()); + $ZodStringFormat.init(inst, def); +}); +const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { + def.pattern ?? (def.pattern = nanoid); + $ZodStringFormat.init(inst, def); +}); +/** +* @deprecated CUID v1 is deprecated by its authors due to information leakage +* (timestamps embedded in the id). Use {@link $ZodCUID2} instead. +* See https://github.com/paralleldrive/cuid. +*/ +const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => { + def.pattern ?? (def.pattern = cuid); + $ZodStringFormat.init(inst, def); +}); +const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => { + def.pattern ?? (def.pattern = cuid2); + $ZodStringFormat.init(inst, def); +}); +const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => { + def.pattern ?? (def.pattern = ulid); + $ZodStringFormat.init(inst, def); +}); +const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => { + def.pattern ?? (def.pattern = xid); + $ZodStringFormat.init(inst, def); +}); +const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => { + def.pattern ?? (def.pattern = ksuid); + $ZodStringFormat.init(inst, def); +}); +const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => { + def.pattern ?? (def.pattern = datetime$1(def)); + $ZodStringFormat.init(inst, def); +}); +const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => { + def.pattern ?? (def.pattern = date$1); + $ZodStringFormat.init(inst, def); +}); +const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => { + def.pattern ?? (def.pattern = time$1(def)); + $ZodStringFormat.init(inst, def); +}); +const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => { + def.pattern ?? (def.pattern = duration$1); + $ZodStringFormat.init(inst, def); +}); +const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => { + def.pattern ?? (def.pattern = ipv4); + $ZodStringFormat.init(inst, def); + inst._zod.bag.format = `ipv4`; +}); +const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { + def.pattern ?? (def.pattern = ipv6); + $ZodStringFormat.init(inst, def); + inst._zod.bag.format = `ipv6`; + inst._zod.check = (payload) => { + try { + new URL(`http://[${payload.value}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "ipv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => { + def.pattern ?? (def.pattern = cidrv4); + $ZodStringFormat.init(inst, def); +}); +const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => { + def.pattern ?? (def.pattern = cidrv6); + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + const parts = payload.value.split("/"); + try { + if (parts.length !== 2) throw new Error(); + const [address, prefix] = parts; + if (!prefix) throw new Error(); + const prefixNum = Number(prefix); + if (`${prefixNum}` !== prefix) throw new Error(); + if (prefixNum < 0 || prefixNum > 128) throw new Error(); + new URL(`http://[${address}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "cidrv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +function isValidBase64(data) { + if (data === "") return true; + if (/\s/.test(data)) return false; + if (data.length % 4 !== 0) return false; + try { + atob(data); + return true; + } catch { + return false; + } +} +const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { + def.pattern ?? (def.pattern = base64); + $ZodStringFormat.init(inst, def); + inst._zod.bag.contentEncoding = "base64"; + inst._zod.check = (payload) => { + if (isValidBase64(payload.value)) return; + payload.issues.push({ + code: "invalid_format", + format: "base64", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +function isValidBase64URL(data) { + if (!base64url.test(data)) return false; + const base64$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); + return isValidBase64(base64$1.padEnd(Math.ceil(base64$1.length / 4) * 4, "=")); +} +const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => { + def.pattern ?? (def.pattern = base64url); + $ZodStringFormat.init(inst, def); + inst._zod.bag.contentEncoding = "base64url"; + inst._zod.check = (payload) => { + if (isValidBase64URL(payload.value)) return; + payload.issues.push({ + code: "invalid_format", + format: "base64url", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => { + def.pattern ?? (def.pattern = e164); + $ZodStringFormat.init(inst, def); +}); +function isValidJWT(token, algorithm = null) { + try { + const tokensParts = token.split("."); + if (tokensParts.length !== 3) return false; + const [header] = tokensParts; + if (!header) return false; + const parsedHeader = JSON.parse(atob(header)); + if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false; + if (!parsedHeader.alg) return false; + if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false; + return true; + } catch { + return false; + } +} +const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + if (isValidJWT(payload.value, def.alg)) return; + payload.issues.push({ + code: "invalid_format", + format: "jwt", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = inst._zod.bag.pattern ?? number$1; + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) try { + payload.value = Number(payload.value); + } catch (_) {} + const input = payload.value; + if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload; + const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0; + payload.issues.push({ + expected: "number", + code: "invalid_type", + input, + inst, + ...received ? { received } : {} + }); + return payload; + }; +}); +const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => { + $ZodCheckNumberFormat.init(inst, def); + $ZodNumber.init(inst, def); +}); +const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = boolean$1; + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) try { + payload.value = Boolean(payload.value); + } catch (_) {} + const input = payload.value; + if (typeof input === "boolean") return payload; + payload.issues.push({ + expected: "boolean", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload) => payload; +}); +const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + payload.issues.push({ + expected: "never", + code: "invalid_type", + input: payload.value, + inst + }); + return payload; + }; +}); +function handleArrayResult(result, final, index) { + if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues)); + final.value[index] = result.value; +} +const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!Array.isArray(input)) { + payload.issues.push({ + expected: "array", + code: "invalid_type", + input, + inst + }); + return payload; + } + payload.value = Array(input.length); + const proms = []; + for (let i = 0; i < input.length; i++) { + const item = input[i]; + const result = def.element._zod.run({ + value: item, + issues: [] + }, ctx); + if (result instanceof Promise) proms.push(result.then((result$1) => handleArrayResult(result$1, payload, i))); + else handleArrayResult(result, payload, i); + } + if (proms.length) return Promise.all(proms).then(() => payload); + return payload; + }; +}); +function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) { + const isPresent = key in input; + if (result.issues.length) { + if (isOptionalIn && isOptionalOut && !isPresent) return; + final.issues.push(...prefixIssues(key, result.issues)); + } + if (!isPresent && !isOptionalIn) { + if (!result.issues.length) final.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: void 0, + path: [key] + }); + return; + } + if (result.value === void 0) { + if (isPresent) final.value[key] = void 0; + } else final.value[key] = result.value; +} +function normalizeDef(def) { + const keys = Object.keys(def.shape); + for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`); + const okeys = optionalKeys(def.shape); + return { + ...def, + keys, + keySet: new Set(keys), + numKeys: keys.length, + optionalKeys: new Set(okeys) + }; +} +function handleCatchall(proms, input, payload, ctx, def, inst) { + const unrecognized = []; + const keySet = def.keySet; + const _catchall = def.catchall._zod; + const t = _catchall.def.type; + const isOptionalIn = _catchall.optin === "optional"; + const isOptionalOut = _catchall.optout === "optional"; + for (const key in input) { + if (key === "__proto__") continue; + if (keySet.has(key)) continue; + if (t === "never") { + unrecognized.push(key); + continue; + } + const r = _catchall.run({ + value: input[key], + issues: [] + }, ctx); + if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalIn, isOptionalOut))); + else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); + } + if (unrecognized.length) payload.issues.push({ + code: "unrecognized_keys", + keys: unrecognized, + input, + inst + }); + if (!proms.length) return payload; + return Promise.all(proms).then(() => { + return payload; + }); +} +const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { + $ZodType.init(inst, def); + if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) { + const sh = def.shape; + Object.defineProperty(def, "shape", { get: () => { + const newSh = { ...sh }; + Object.defineProperty(def, "shape", { value: newSh }); + return newSh; + } }); + } + const _normalized = cached(() => normalizeDef(def)); + defineLazy(inst._zod, "propValues", () => { + const shape = def.shape; + const propValues = {}; + for (const key in shape) { + const field = shape[key]._zod; + if (field.values) { + propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set()); + for (const v of field.values) propValues[key].add(v); + } + } + return propValues; + }); + const isObject$1 = isObject; + const catchall = def.catchall; + let value; + inst._zod.parse = (payload, ctx) => { + value ?? (value = _normalized.value); + const input = payload.value; + if (!isObject$1(input)) { + payload.issues.push({ + expected: "object", + code: "invalid_type", + input, + inst + }); + return payload; + } + payload.value = {}; + const proms = []; + const shape = value.shape; + for (const key of value.keys) { + const el = shape[key]; + const isOptionalIn = el._zod.optin === "optional"; + const isOptionalOut = el._zod.optout === "optional"; + const r = el._zod.run({ + value: input[key], + issues: [] + }, ctx); + if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalIn, isOptionalOut))); + else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); + } + if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload; + return handleCatchall(proms, input, payload, ctx, _normalized.value, inst); + }; +}); +const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => { + $ZodObject.init(inst, def); + const superParse = inst._zod.parse; + const _normalized = cached(() => normalizeDef(def)); + const generateFastpass = (shape) => { + const doc = new Doc([ + "shape", + "payload", + "ctx" + ]); + const normalized = _normalized.value; + const parseStr = (key) => { + const k = esc(key); + return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`; + }; + doc.write(`const input = payload.value;`); + const ids = Object.create(null); + let counter = 0; + for (const key of normalized.keys) ids[key] = `key_${counter++}`; + doc.write(`const newResult = {};`); + for (const key of normalized.keys) { + const id = ids[key]; + const k = esc(key); + const schema = shape[key]; + const isOptionalIn = schema?._zod?.optin === "optional"; + const isOptionalOut = schema?._zod?.optout === "optional"; + doc.write(`const ${id} = ${parseStr(key)};`); + if (isOptionalIn && isOptionalOut) doc.write(` + if (${id}.issues.length) { + if (${k} in input) { + payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${k}, ...iss.path] : [${k}] + }))); + } + } + + if (${id}.value === undefined) { + if (${k} in input) { + newResult[${k}] = undefined; + } + } else { + newResult[${k}] = ${id}.value; + } + + `); + else if (!isOptionalIn) doc.write(` + const ${id}_present = ${k} in input; + if (${id}.issues.length) { + payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${k}, ...iss.path] : [${k}] + }))); + } + if (!${id}_present && !${id}.issues.length) { + payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: undefined, + path: [${k}] + }); + } + + if (${id}_present) { + if (${id}.value === undefined) { + newResult[${k}] = undefined; + } else { + newResult[${k}] = ${id}.value; + } + } + + `); + else doc.write(` + if (${id}.issues.length) { + payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${k}, ...iss.path] : [${k}] + }))); + } + + if (${id}.value === undefined) { + if (${k} in input) { + newResult[${k}] = undefined; + } + } else { + newResult[${k}] = ${id}.value; + } + + `); + } + doc.write(`payload.value = newResult;`); + doc.write(`return payload;`); + const fn = doc.compile(); + return (payload, ctx) => fn(shape, payload, ctx); + }; + let fastpass; + const isObject$1 = isObject; + const jit = !globalConfig.jitless; + const allowsEval$1 = allowsEval; + const fastEnabled = jit && allowsEval$1.value; + const catchall = def.catchall; + let value; + inst._zod.parse = (payload, ctx) => { + value ?? (value = _normalized.value); + const input = payload.value; + if (!isObject$1(input)) { + payload.issues.push({ + expected: "object", + code: "invalid_type", + input, + inst + }); + return payload; + } + if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) { + if (!fastpass) fastpass = generateFastpass(def.shape); + payload = fastpass(payload, ctx); + if (!catchall) return payload; + return handleCatchall([], input, payload, ctx, value, inst); + } + return superParse(payload, ctx); + }; +}); +function handleUnionResults(results, final, inst, ctx) { + for (const result of results) if (result.issues.length === 0) { + final.value = result.value; + return final; + } + const nonaborted = results.filter((r) => !aborted(r)); + if (nonaborted.length === 1) { + final.value = nonaborted[0].value; + return nonaborted[0]; + } + final.issues.push({ + code: "invalid_union", + input: final.value, + inst, + errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + }); + return final; +} +const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0); + defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0); + defineLazy(inst._zod, "values", () => { + if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); + }); + defineLazy(inst._zod, "pattern", () => { + if (def.options.every((o) => o._zod.pattern)) { + const patterns = def.options.map((o) => o._zod.pattern); + return /* @__PURE__ */ new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); + } + }); + const first = def.options.length === 1 ? def.options[0]._zod.run : null; + inst._zod.parse = (payload, ctx) => { + if (first) return first(payload, ctx); + let async = false; + const results = []; + for (const option of def.options) { + const result = option._zod.run({ + value: payload.value, + issues: [] + }, ctx); + if (result instanceof Promise) { + results.push(result); + async = true; + } else { + if (result.issues.length === 0) return result; + results.push(result); + } + } + if (!async) return handleUnionResults(results, payload, inst, ctx); + return Promise.all(results).then((results$1) => { + return handleUnionResults(results$1, payload, inst, ctx); + }); + }; +}); +const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + const left = def.left._zod.run({ + value: input, + issues: [] + }, ctx); + const right = def.right._zod.run({ + value: input, + issues: [] + }, ctx); + if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left$1, right$1]) => { + return handleIntersectionResults(payload, left$1, right$1); + }); + return handleIntersectionResults(payload, left, right); + }; +}); +function mergeValues(a, b) { + if (a === b) return { + valid: true, + data: a + }; + if (a instanceof Date && b instanceof Date && +a === +b) return { + valid: true, + data: a + }; + if (isPlainObject(a) && isPlainObject(b)) { + const bKeys = Object.keys(b); + const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { + ...a, + ...b + }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) return { + valid: false, + mergeErrorPath: [key, ...sharedValue.mergeErrorPath] + }; + newObj[key] = sharedValue.data; + } + return { + valid: true, + data: newObj + }; + } + if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) return { + valid: false, + mergeErrorPath: [] + }; + const newArray = []; + for (let index = 0; index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) return { + valid: false, + mergeErrorPath: [index, ...sharedValue.mergeErrorPath] + }; + newArray.push(sharedValue.data); + } + return { + valid: true, + data: newArray + }; + } + return { + valid: false, + mergeErrorPath: [] + }; +} +function handleIntersectionResults(result, left, right) { + const unrecKeys = /* @__PURE__ */ new Map(); + let unrecIssue; + for (const iss of left.issues) if (iss.code === "unrecognized_keys") { + unrecIssue ?? (unrecIssue = iss); + for (const k of iss.keys) { + if (!unrecKeys.has(k)) unrecKeys.set(k, {}); + unrecKeys.get(k).l = true; + } + } else result.issues.push(iss); + for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) { + if (!unrecKeys.has(k)) unrecKeys.set(k, {}); + unrecKeys.get(k).r = true; + } + else result.issues.push(iss); + const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k); + if (bothKeys.length && unrecIssue) result.issues.push({ + ...unrecIssue, + keys: bothKeys + }); + if (aborted(result)) return result; + const merged = mergeValues(left.value, right.value); + if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`); + result.value = merged.data; + return result; +} +const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!isPlainObject(input)) { + payload.issues.push({ + expected: "record", + code: "invalid_type", + input, + inst + }); + return payload; + } + const proms = []; + const values = def.keyType._zod.values; + if (values) { + payload.value = {}; + const recordKeys = /* @__PURE__ */ new Set(); + for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { + recordKeys.add(typeof key === "number" ? key.toString() : key); + const keyResult = def.keyType._zod.run({ + value: key, + issues: [] + }, ctx); + if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); + if (keyResult.issues.length) { + payload.issues.push({ + code: "invalid_key", + origin: "record", + issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), + input: key, + path: [key], + inst + }); + continue; + } + const outKey = keyResult.value; + const result = def.valueType._zod.run({ + value: input[key], + issues: [] + }, ctx); + if (result instanceof Promise) proms.push(result.then((result$1) => { + if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues)); + payload.value[outKey] = result$1.value; + })); + else { + if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); + payload.value[outKey] = result.value; + } + } + let unrecognized; + for (const key in input) if (!recordKeys.has(key)) { + unrecognized = unrecognized ?? []; + unrecognized.push(key); + } + if (unrecognized && unrecognized.length > 0) payload.issues.push({ + code: "unrecognized_keys", + input, + inst, + keys: unrecognized + }); + } else { + payload.value = {}; + for (const key of Reflect.ownKeys(input)) { + if (key === "__proto__") continue; + if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue; + let keyResult = def.keyType._zod.run({ + value: key, + issues: [] + }, ctx); + if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); + if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) { + const retryResult = def.keyType._zod.run({ + value: Number(key), + issues: [] + }, ctx); + if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); + if (retryResult.issues.length === 0) keyResult = retryResult; + } + if (keyResult.issues.length) { + if (def.mode === "loose") payload.value[key] = input[key]; + else payload.issues.push({ + code: "invalid_key", + origin: "record", + issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), + input: key, + path: [key], + inst + }); + continue; + } + const result = def.valueType._zod.run({ + value: input[key], + issues: [] + }, ctx); + if (result instanceof Promise) proms.push(result.then((result$1) => { + if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues)); + payload.value[keyResult.value] = result$1.value; + })); + else { + if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); + payload.value[keyResult.value] = result.value; + } + } + } + if (proms.length) return Promise.all(proms).then(() => payload); + return payload; + }; +}); +const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { + $ZodType.init(inst, def); + const values = getEnumValues(def.entries); + const valuesSet = new Set(values); + inst._zod.values = valuesSet; + inst._zod.pattern = /* @__PURE__ */ new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (valuesSet.has(input)) return payload; + payload.issues.push({ + code: "invalid_value", + values, + input, + inst + }); + return payload; + }; +}); +const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name); + const _out = def.transform(payload.value, payload); + if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => { + payload.value = output; + payload.fallback = true; + return payload; + }); + if (_out instanceof Promise) throw new $ZodAsyncError(); + payload.value = _out; + payload.fallback = true; + return payload; + }; +}); +function handleOptionalResult(result, input) { + if (input === void 0 && (result.issues.length || result.fallback)) return { + issues: [], + value: void 0 + }; + return result; +} +const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + inst._zod.optout = "optional"; + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0; + }); + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; + }); + inst._zod.parse = (payload, ctx) => { + if (def.innerType._zod.optin === "optional") { + const input = payload.value; + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input)); + return handleOptionalResult(result, input); + } + if (payload.value === void 0) return payload; + return def.innerType._zod.run(payload, ctx); + }; +}); +const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => { + $ZodOptional.init(inst, def); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern); + inst._zod.parse = (payload, ctx) => { + return def.innerType._zod.run(payload, ctx); + }; +}); +const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; + }); + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0; + }); + inst._zod.parse = (payload, ctx) => { + if (payload.value === null) return payload; + return def.innerType._zod.run(payload, ctx); + }; +}); +const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); + if (payload.value === void 0) { + payload.value = def.defaultValue; + /** + * $ZodDefault returns the default value immediately in forward direction. + * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */ + return payload; + } + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) return result.then((result$1) => handleDefaultResult(result$1, def)); + return handleDefaultResult(result, def); + }; +}); +function handleDefaultResult(payload, def) { + if (payload.value === void 0) payload.value = def.defaultValue; + return payload; +} +const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); + if (payload.value === void 0) payload.value = def.defaultValue; + return def.innerType._zod.run(payload, ctx); + }; +}); +const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => { + const v = def.innerType._zod.values; + return v ? new Set([...v].filter((x) => x !== void 0)) : void 0; + }); + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) return result.then((result$1) => handleNonOptionalResult(result$1, inst)); + return handleNonOptionalResult(result, inst); + }; +}); +function handleNonOptionalResult(payload, inst) { + if (!payload.issues.length && payload.value === void 0) payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: payload.value, + inst + }); + return payload; +} +const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) return result.then((result$1) => { + payload.value = result$1.value; + if (result$1.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { issues: result$1.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, + input: payload.value + }); + payload.issues = []; + payload.fallback = true; + } + return payload; + }); + payload.value = result.value; + if (result.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, + input: payload.value + }); + payload.issues = []; + payload.fallback = true; + } + return payload; + }; +}); +const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => def.in._zod.values); + defineLazy(inst._zod, "optin", () => def.in._zod.optin); + defineLazy(inst._zod, "optout", () => def.out._zod.optout); + defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + const right = def.out._zod.run(payload, ctx); + if (right instanceof Promise) return right.then((right$1) => handlePipeResult(right$1, def.in, ctx)); + return handlePipeResult(right, def.in, ctx); + } + const left = def.in._zod.run(payload, ctx); + if (left instanceof Promise) return left.then((left$1) => handlePipeResult(left$1, def.out, ctx)); + return handlePipeResult(left, def.out, ctx); + }; +}); +function handlePipeResult(left, next, ctx) { + if (left.issues.length) { + left.aborted = true; + return left; + } + return next._zod.run({ + value: left.value, + issues: left.issues, + fallback: left.fallback + }, ctx); +} +const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin); + defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) return result.then(handleReadonlyResult); + return handleReadonlyResult(result); + }; +}); +function handleReadonlyResult(payload) { + payload.value = Object.freeze(payload.value); + return payload; +} +const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { + $ZodCheck.init(inst, def); + $ZodType.init(inst, def); + inst._zod.parse = (payload, _) => { + return payload; + }; + inst._zod.check = (payload) => { + const input = payload.value; + const r = def.fn(input); + if (r instanceof Promise) return r.then((r$1) => handleRefineResult(r$1, payload, input, inst)); + handleRefineResult(r, payload, input, inst); + }; +}); +function handleRefineResult(result, payload, input, inst) { + if (!result) { + const _iss = { + code: "custom", + input, + inst, + path: [...inst._zod.def.path ?? []], + continue: !inst._zod.def.abort + }; + if (inst._zod.def.params) _iss.params = inst._zod.def.params; + payload.issues.push(issue(_iss)); + } +} + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js +var _a$1; +var $ZodRegistry = class { + constructor() { + this._map = /* @__PURE__ */ new WeakMap(); + this._idmap = /* @__PURE__ */ new Map(); + } + add(schema, ..._meta) { + const meta$2 = _meta[0]; + this._map.set(schema, meta$2); + if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.set(meta$2.id, schema); + return this; + } + clear() { + this._map = /* @__PURE__ */ new WeakMap(); + this._idmap = /* @__PURE__ */ new Map(); + return this; + } + remove(schema) { + const meta$2 = this._map.get(schema); + if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.delete(meta$2.id); + this._map.delete(schema); + return this; + } + get(schema) { + const p = schema._zod.parent; + if (p) { + const pm = { ...this.get(p) ?? {} }; + delete pm.id; + const f = { + ...pm, + ...this._map.get(schema) + }; + return Object.keys(f).length ? f : void 0; + } + return this._map.get(schema); + } + has(schema) { + return this._map.has(schema); + } +}; +function registry() { + return new $ZodRegistry(); +} +(_a$1 = globalThis).__zod_globalRegistry ?? (_a$1.__zod_globalRegistry = registry()); +const globalRegistry = globalThis.__zod_globalRegistry; + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js +/* @__NO_SIDE_EFFECTS__ */ +function _string(Class, params) { + return new Class({ + type: "string", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _email(Class, params) { + return new Class({ + type: "string", + format: "email", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _guid(Class, params) { + return new Class({ + type: "string", + format: "guid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _uuid(Class, params) { + return new Class({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _uuidv4(Class, params) { + return new Class({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v4", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _uuidv6(Class, params) { + return new Class({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v6", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _uuidv7(Class, params) { + return new Class({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v7", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _url(Class, params) { + return new Class({ + type: "string", + format: "url", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _emoji(Class, params) { + return new Class({ + type: "string", + format: "emoji", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _nanoid(Class, params) { + return new Class({ + type: "string", + format: "nanoid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/** +* @deprecated CUID v1 is deprecated by its authors due to information leakage +* (timestamps embedded in the id). Use {@link _cuid2} instead. +* See https://github.com/paralleldrive/cuid. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _cuid(Class, params) { + return new Class({ + type: "string", + format: "cuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _cuid2(Class, params) { + return new Class({ + type: "string", + format: "cuid2", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _ulid(Class, params) { + return new Class({ + type: "string", + format: "ulid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _xid(Class, params) { + return new Class({ + type: "string", + format: "xid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _ksuid(Class, params) { + return new Class({ + type: "string", + format: "ksuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _ipv4(Class, params) { + return new Class({ + type: "string", + format: "ipv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _ipv6(Class, params) { + return new Class({ + type: "string", + format: "ipv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _cidrv4(Class, params) { + return new Class({ + type: "string", + format: "cidrv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _cidrv6(Class, params) { + return new Class({ + type: "string", + format: "cidrv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _base64(Class, params) { + return new Class({ + type: "string", + format: "base64", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _base64url(Class, params) { + return new Class({ + type: "string", + format: "base64url", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _e164(Class, params) { + return new Class({ + type: "string", + format: "e164", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _jwt(Class, params) { + return new Class({ + type: "string", + format: "jwt", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _isoDateTime(Class, params) { + return new Class({ + type: "string", + format: "datetime", + check: "string_format", + offset: false, + local: false, + precision: null, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _isoDate(Class, params) { + return new Class({ + type: "string", + format: "date", + check: "string_format", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _isoTime(Class, params) { + return new Class({ + type: "string", + format: "time", + check: "string_format", + precision: null, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _isoDuration(Class, params) { + return new Class({ + type: "string", + format: "duration", + check: "string_format", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _number(Class, params) { + return new Class({ + type: "number", + checks: [], + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _int(Class, params) { + return new Class({ + type: "number", + check: "number_format", + abort: false, + format: "safeint", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _boolean(Class, params) { + return new Class({ + type: "boolean", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _unknown(Class) { + return new Class({ type: "unknown" }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _never(Class, params) { + return new Class({ + type: "never", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _lt(value, params) { + return new $ZodCheckLessThan({ + check: "less_than", + ...normalizeParams(params), + value, + inclusive: false + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _lte(value, params) { + return new $ZodCheckLessThan({ + check: "less_than", + ...normalizeParams(params), + value, + inclusive: true + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _gt(value, params) { + return new $ZodCheckGreaterThan({ + check: "greater_than", + ...normalizeParams(params), + value, + inclusive: false + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _gte(value, params) { + return new $ZodCheckGreaterThan({ + check: "greater_than", + ...normalizeParams(params), + value, + inclusive: true + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _multipleOf(value, params) { + return new $ZodCheckMultipleOf({ + check: "multiple_of", + ...normalizeParams(params), + value + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _maxLength(maximum, params) { + return new $ZodCheckMaxLength({ + check: "max_length", + ...normalizeParams(params), + maximum + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _minLength(minimum, params) { + return new $ZodCheckMinLength({ + check: "min_length", + ...normalizeParams(params), + minimum + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _length(length, params) { + return new $ZodCheckLengthEquals({ + check: "length_equals", + ...normalizeParams(params), + length + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _regex(pattern, params) { + return new $ZodCheckRegex({ + check: "string_format", + format: "regex", + ...normalizeParams(params), + pattern + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _lowercase(params) { + return new $ZodCheckLowerCase({ + check: "string_format", + format: "lowercase", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _uppercase(params) { + return new $ZodCheckUpperCase({ + check: "string_format", + format: "uppercase", + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _includes(includes, params) { + return new $ZodCheckIncludes({ + check: "string_format", + format: "includes", + ...normalizeParams(params), + includes + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _startsWith(prefix, params) { + return new $ZodCheckStartsWith({ + check: "string_format", + format: "starts_with", + ...normalizeParams(params), + prefix + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _endsWith(suffix, params) { + return new $ZodCheckEndsWith({ + check: "string_format", + format: "ends_with", + ...normalizeParams(params), + suffix + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _overwrite(tx) { + return new $ZodCheckOverwrite({ + check: "overwrite", + tx + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _normalize(form) { + return /* @__PURE__ */ _overwrite((input) => input.normalize(form)); +} +/* @__NO_SIDE_EFFECTS__ */ +function _trim() { + return /* @__PURE__ */ _overwrite((input) => input.trim()); +} +/* @__NO_SIDE_EFFECTS__ */ +function _toLowerCase() { + return /* @__PURE__ */ _overwrite((input) => input.toLowerCase()); +} +/* @__NO_SIDE_EFFECTS__ */ +function _toUpperCase() { + return /* @__PURE__ */ _overwrite((input) => input.toUpperCase()); +} +/* @__NO_SIDE_EFFECTS__ */ +function _slugify() { + return /* @__PURE__ */ _overwrite((input) => slugify(input)); +} +/* @__NO_SIDE_EFFECTS__ */ +function _array(Class, element, params) { + return new Class({ + type: "array", + element, + ...normalizeParams(params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _refine(Class, fn, _params) { + return new Class({ + type: "custom", + check: "custom", + fn, + ...normalizeParams(_params) + }); +} +/* @__NO_SIDE_EFFECTS__ */ +function _superRefine(fn, params) { + const ch = /* @__PURE__ */ _check((payload) => { + payload.addIssue = (issue$1) => { + if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def)); + else { + const _issue = issue$1; + if (_issue.fatal) _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = ch); + _issue.continue ?? (_issue.continue = !ch._zod.def.abort); + payload.issues.push(issue(_issue)); + } + }; + return fn(payload.value, payload); + }, params); + return ch; +} +/* @__NO_SIDE_EFFECTS__ */ +function _check(fn, params) { + const ch = new $ZodCheck({ + check: "custom", + ...normalizeParams(params) + }); + ch._zod.check = fn; + return ch; +} +/* @__NO_SIDE_EFFECTS__ */ +function describe$1(description) { + const ch = new $ZodCheck({ check: "describe" }); + ch._zod.onattach = [(inst) => { + const existing = globalRegistry.get(inst) ?? {}; + globalRegistry.add(inst, { + ...existing, + description + }); + }]; + ch._zod.check = () => {}; + return ch; +} +/* @__NO_SIDE_EFFECTS__ */ +function meta$1(metadata) { + const ch = new $ZodCheck({ check: "meta" }); + ch._zod.onattach = [(inst) => { + const existing = globalRegistry.get(inst) ?? {}; + globalRegistry.add(inst, { + ...existing, + ...metadata + }); + }]; + ch._zod.check = () => {}; + return ch; +} + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js +function initializeContext(params) { + let target = params?.target ?? "draft-2020-12"; + if (target === "draft-4") target = "draft-04"; + if (target === "draft-7") target = "draft-07"; + return { + processors: params.processors ?? {}, + metadataRegistry: params?.metadata ?? globalRegistry, + target, + unrepresentable: params?.unrepresentable ?? "throw", + override: params?.override ?? (() => {}), + io: params?.io ?? "output", + counter: 0, + seen: /* @__PURE__ */ new Map(), + cycles: params?.cycles ?? "ref", + reused: params?.reused ?? "inline", + external: params?.external ?? void 0 + }; +} +function process$5(schema, ctx, _params = { + path: [], + schemaPath: [] +}) { + var _a$3; + const def = schema._zod.def; + const seen = ctx.seen.get(schema); + if (seen) { + seen.count++; + if (_params.schemaPath.includes(schema)) seen.cycle = _params.path; + return seen.schema; + } + const result = { + schema: {}, + count: 1, + cycle: void 0, + path: _params.path + }; + ctx.seen.set(schema, result); + const overrideSchema = schema._zod.toJSONSchema?.(); + if (overrideSchema) result.schema = overrideSchema; + else { + const params = { + ..._params, + schemaPath: [..._params.schemaPath, schema], + path: _params.path + }; + if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params); + else { + const _json = result.schema; + const processor = ctx.processors[def.type]; + if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`); + processor(schema, ctx, _json, params); + } + const parent = schema._zod.parent; + if (parent) { + if (!result.ref) result.ref = parent; + process$5(parent, ctx, params); + ctx.seen.get(parent).isParent = true; + } + } + const meta$2 = ctx.metadataRegistry.get(schema); + if (meta$2) Object.assign(result.schema, meta$2); + if (ctx.io === "input" && isTransforming(schema)) { + delete result.schema.examples; + delete result.schema.default; + } + if (ctx.io === "input" && "_prefault" in result.schema) (_a$3 = result.schema).default ?? (_a$3.default = result.schema._prefault); + delete result.schema._prefault; + return ctx.seen.get(schema).schema; +} +function extractDefs(ctx, schema) { + const root = ctx.seen.get(schema); + if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); + const idToSchema = /* @__PURE__ */ new Map(); + for (const entry of ctx.seen.entries()) { + const id = ctx.metadataRegistry.get(entry[0])?.id; + if (id) { + const existing = idToSchema.get(id); + if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); + idToSchema.set(id, entry[0]); + } + } + const makeURI = (entry) => { + const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions"; + if (ctx.external) { + const externalId = ctx.external.registry.get(entry[0])?.id; + const uriGenerator = ctx.external.uri ?? ((id$1) => id$1); + if (externalId) return { ref: uriGenerator(externalId) }; + const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`; + entry[1].defId = id; + return { + defId: id, + ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` + }; + } + if (entry[1] === root) return { ref: "#" }; + const defUriPrefix = `#/${defsSegment}/`; + const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`; + return { + defId, + ref: defUriPrefix + defId + }; + }; + const extractToDef = (entry) => { + if (entry[1].schema.$ref) return; + const seen = entry[1]; + const { ref, defId } = makeURI(entry); + seen.def = { ...seen.schema }; + if (defId) seen.defId = defId; + const schema$1 = seen.schema; + for (const key in schema$1) delete schema$1[key]; + schema$1.$ref = ref; + }; + if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) { + const seen = entry[1]; + if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); + } + for (const entry of ctx.seen.entries()) { + const seen = entry[1]; + if (schema === entry[0]) { + extractToDef(entry); + continue; + } + if (ctx.external) { + const ext = ctx.external.registry.get(entry[0])?.id; + if (schema !== entry[0] && ext) { + extractToDef(entry); + continue; + } + } + if (ctx.metadataRegistry.get(entry[0])?.id) { + extractToDef(entry); + continue; + } + if (seen.cycle) { + extractToDef(entry); + continue; + } + if (seen.count > 1) { + if (ctx.reused === "ref") { + extractToDef(entry); + continue; + } + } + } +} +function finalize(ctx, schema) { + const root = ctx.seen.get(schema); + if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); + const flattenRef = (zodSchema) => { + const seen = ctx.seen.get(zodSchema); + if (seen.ref === null) return; + const schema$1 = seen.def ?? seen.schema; + const _cached = { ...schema$1 }; + const ref = seen.ref; + seen.ref = null; + if (ref) { + flattenRef(ref); + const refSeen = ctx.seen.get(ref); + const refSchema = refSeen.schema; + if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) { + schema$1.allOf = schema$1.allOf ?? []; + schema$1.allOf.push(refSchema); + } else Object.assign(schema$1, refSchema); + Object.assign(schema$1, _cached); + if (zodSchema._zod.parent === ref) for (const key in schema$1) { + if (key === "$ref" || key === "allOf") continue; + if (!(key in _cached)) delete schema$1[key]; + } + if (refSchema.$ref && refSeen.def) for (const key in schema$1) { + if (key === "$ref" || key === "allOf") continue; + if (key in refSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(refSeen.def[key])) delete schema$1[key]; + } + } + const parent = zodSchema._zod.parent; + if (parent && parent !== ref) { + flattenRef(parent); + const parentSeen = ctx.seen.get(parent); + if (parentSeen?.schema.$ref) { + schema$1.$ref = parentSeen.schema.$ref; + if (parentSeen.def) for (const key in schema$1) { + if (key === "$ref" || key === "allOf") continue; + if (key in parentSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(parentSeen.def[key])) delete schema$1[key]; + } + } + } + ctx.override({ + zodSchema, + jsonSchema: schema$1, + path: seen.path ?? [] + }); + }; + for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]); + const result = {}; + if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema"; + else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#"; + else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#"; + else if (ctx.target === "openapi-3.0") {} + if (ctx.external?.uri) { + const id = ctx.external.registry.get(schema)?.id; + if (!id) throw new Error("Schema is missing an `id` property"); + result.$id = ctx.external.uri(id); + } + Object.assign(result, root.def ?? root.schema); + const rootMetaId = ctx.metadataRegistry.get(schema)?.id; + if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id; + const defs = ctx.external?.defs ?? {}; + for (const entry of ctx.seen.entries()) { + const seen = entry[1]; + if (seen.def && seen.defId) { + if (seen.def.id === seen.defId) delete seen.def.id; + defs[seen.defId] = seen.def; + } + } + if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs; + else result.definitions = defs; + try { + const finalized = JSON.parse(JSON.stringify(result)); + Object.defineProperty(finalized, "~standard", { + value: { + ...schema["~standard"], + jsonSchema: { + input: createStandardJSONSchemaMethod(schema, "input", ctx.processors), + output: createStandardJSONSchemaMethod(schema, "output", ctx.processors) + } + }, + enumerable: false, + writable: false + }); + return finalized; + } catch (_err) { + throw new Error("Error converting schema to JSON."); + } +} +function isTransforming(_schema, _ctx) { + const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() }; + if (ctx.seen.has(_schema)) return false; + ctx.seen.add(_schema); + const def = _schema._zod.def; + if (def.type === "transform") return true; + if (def.type === "array") return isTransforming(def.element, ctx); + if (def.type === "set") return isTransforming(def.valueType, ctx); + if (def.type === "lazy") return isTransforming(def.getter(), ctx); + if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx); + if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx); + if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx); + if (def.type === "pipe") { + if (_schema._zod.traits.has("$ZodCodec")) return true; + return isTransforming(def.in, ctx) || isTransforming(def.out, ctx); + } + if (def.type === "object") { + for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true; + return false; + } + if (def.type === "union") { + for (const option of def.options) if (isTransforming(option, ctx)) return true; + return false; + } + if (def.type === "tuple") { + for (const item of def.items) if (isTransforming(item, ctx)) return true; + if (def.rest && isTransforming(def.rest, ctx)) return true; + return false; + } + return false; +} +/** +* Creates a toJSONSchema method for a schema instance. +* This encapsulates the logic of initializing context, processing, extracting defs, and finalizing. +*/ +const createToJSONSchemaMethod = (schema, processors = {}) => (params) => { + const ctx = initializeContext({ + ...params, + processors + }); + process$5(schema, ctx); + extractDefs(ctx, schema); + return finalize(ctx, schema); +}; +const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => { + const { libraryOptions, target } = params ?? {}; + const ctx = initializeContext({ + ...libraryOptions ?? {}, + target, + io, + processors + }); + process$5(schema, ctx); + extractDefs(ctx, schema); + return finalize(ctx, schema); +}; + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js +const formatMap = { + guid: "uuid", + url: "uri", + datetime: "date-time", + json_string: "json-string", + regex: "" +}; +const stringProcessor = (schema, ctx, _json, _params) => { + const json = _json; + json.type = "string"; + const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag; + if (typeof minimum === "number") json.minLength = minimum; + if (typeof maximum === "number") json.maxLength = maximum; + if (format) { + json.format = formatMap[format] ?? format; + if (json.format === "") delete json.format; + if (format === "time") delete json.format; + } + if (contentEncoding) json.contentEncoding = contentEncoding; + if (patterns && patterns.size > 0) { + const regexes = [...patterns]; + if (regexes.length === 1) json.pattern = regexes[0].source; + else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({ + ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {}, + pattern: regex.source + }))]; + } +}; +const numberProcessor = (schema, ctx, _json, _params) => { + const json = _json; + const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag; + if (typeof format === "string" && format.includes("int")) json.type = "integer"; + else json.type = "number"; + const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY); + const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY); + const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0"; + if (exMin) if (legacy) { + json.minimum = exclusiveMinimum; + json.exclusiveMinimum = true; + } else json.exclusiveMinimum = exclusiveMinimum; + else if (typeof minimum === "number") json.minimum = minimum; + if (exMax) if (legacy) { + json.maximum = exclusiveMaximum; + json.exclusiveMaximum = true; + } else json.exclusiveMaximum = exclusiveMaximum; + else if (typeof maximum === "number") json.maximum = maximum; + if (typeof multipleOf === "number") json.multipleOf = multipleOf; +}; +const booleanProcessor = (_schema, _ctx, json, _params) => { + json.type = "boolean"; +}; +const neverProcessor = (_schema, _ctx, json, _params) => { + json.not = {}; +}; +const unknownProcessor = (_schema, _ctx, _json, _params) => {}; +const enumProcessor = (schema, _ctx, json, _params) => { + const def = schema._zod.def; + const values = getEnumValues(def.entries); + if (values.every((v) => typeof v === "number")) json.type = "number"; + if (values.every((v) => typeof v === "string")) json.type = "string"; + json.enum = values; +}; +const customProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema"); +}; +const transformProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema"); +}; +const arrayProcessor = (schema, ctx, _json, params) => { + const json = _json; + const def = schema._zod.def; + const { minimum, maximum } = schema._zod.bag; + if (typeof minimum === "number") json.minItems = minimum; + if (typeof maximum === "number") json.maxItems = maximum; + json.type = "array"; + json.items = process$5(def.element, ctx, { + ...params, + path: [...params.path, "items"] + }); +}; +const objectProcessor = (schema, ctx, _json, params) => { + const json = _json; + const def = schema._zod.def; + json.type = "object"; + json.properties = {}; + const shape = def.shape; + for (const key in shape) json.properties[key] = process$5(shape[key], ctx, { + ...params, + path: [ + ...params.path, + "properties", + key + ] + }); + const allKeys = new Set(Object.keys(shape)); + const requiredKeys = new Set([...allKeys].filter((key) => { + const v = def.shape[key]._zod; + if (ctx.io === "input") return v.optin === void 0; + else return v.optout === void 0; + })); + if (requiredKeys.size > 0) json.required = Array.from(requiredKeys); + if (def.catchall?._zod.def.type === "never") json.additionalProperties = false; + else if (!def.catchall) { + if (ctx.io === "output") json.additionalProperties = false; + } else if (def.catchall) json.additionalProperties = process$5(def.catchall, ctx, { + ...params, + path: [...params.path, "additionalProperties"] + }); +}; +const unionProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + const isExclusive = def.inclusive === false; + const options = def.options.map((x, i) => process$5(x, ctx, { + ...params, + path: [ + ...params.path, + isExclusive ? "oneOf" : "anyOf", + i + ] + })); + if (isExclusive) json.oneOf = options; + else json.anyOf = options; +}; +const intersectionProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + const a = process$5(def.left, ctx, { + ...params, + path: [ + ...params.path, + "allOf", + 0 + ] + }); + const b = process$5(def.right, ctx, { + ...params, + path: [ + ...params.path, + "allOf", + 1 + ] + }); + const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1; + json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]]; +}; +const recordProcessor = (schema, ctx, _json, params) => { + const json = _json; + const def = schema._zod.def; + json.type = "object"; + const keyType = def.keyType; + const patterns = keyType._zod.bag?.patterns; + if (def.mode === "loose" && patterns && patterns.size > 0) { + const valueSchema = process$5(def.valueType, ctx, { + ...params, + path: [ + ...params.path, + "patternProperties", + "*" + ] + }); + json.patternProperties = {}; + for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema; + } else { + if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$5(def.keyType, ctx, { + ...params, + path: [...params.path, "propertyNames"] + }); + json.additionalProperties = process$5(def.valueType, ctx, { + ...params, + path: [...params.path, "additionalProperties"] + }); + } + const keyValues = keyType._zod.values; + if (keyValues) { + const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number"); + if (validKeyValues.length > 0) json.required = validKeyValues; + } +}; +const nullableProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + const inner = process$5(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + if (ctx.target === "openapi-3.0") { + seen.ref = def.innerType; + json.nullable = true; + } else json.anyOf = [inner, { type: "null" }]; +}; +const nonoptionalProcessor = (schema, ctx, _json, params) => { + const def = schema._zod.def; + process$5(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; +}; +const defaultProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process$5(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + json.default = JSON.parse(JSON.stringify(def.defaultValue)); +}; +const prefaultProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process$5(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue)); +}; +const catchProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process$5(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + let catchValue; + try { + catchValue = def.catchValue(void 0); + } catch { + throw new Error("Dynamic catch values are not supported in JSON Schema"); + } + json.default = catchValue; +}; +const pipeProcessor = (schema, ctx, _json, params) => { + const def = schema._zod.def; + const inIsTransform = def.in._zod.traits.has("$ZodTransform"); + const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out; + process$5(innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = innerType; +}; +const readonlyProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process$5(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + json.readOnly = true; +}; +const optionalProcessor = (schema, ctx, _json, params) => { + const def = schema._zod.def; + process$5(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; +}; + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js +const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => { + $ZodISODateTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function datetime(params) { + return _isoDateTime(ZodISODateTime, params); +} +const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => { + $ZodISODate.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function date(params) { + return _isoDate(ZodISODate, params); +} +const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => { + $ZodISOTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function time(params) { + return _isoTime(ZodISOTime, params); +} +const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => { + $ZodISODuration.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function duration(params) { + return _isoDuration(ZodISODuration, params); +} + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js +const initializer = (inst, issues) => { + $ZodError.init(inst, issues); + inst.name = "ZodError"; + Object.defineProperties(inst, { + format: { value: (mapper) => formatError(inst, mapper) }, + flatten: { value: (mapper) => flattenError(inst, mapper) }, + addIssue: { value: (issue$1) => { + inst.issues.push(issue$1); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); + } }, + addIssues: { value: (issues$1) => { + inst.issues.push(...issues$1); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); + } }, + isEmpty: { get() { + return inst.issues.length === 0; + } } + }); +}; +const ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer, { Parent: Error }); + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js +const parse = /* @__PURE__ */ _parse(ZodRealError); +const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError); +const safeParse = /* @__PURE__ */ _safeParse(ZodRealError); +const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError); +const encode = /* @__PURE__ */ _encode(ZodRealError); +const decode = /* @__PURE__ */ _decode(ZodRealError); +const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError); +const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError); +const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError); +const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError); +const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError); +const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError); + +//#endregion +//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js +const _installedGroups = /* @__PURE__ */ new WeakMap(); +function _installLazyMethods(inst, group, methods) { + const proto = Object.getPrototypeOf(inst); + let installed = _installedGroups.get(proto); + if (!installed) { + installed = /* @__PURE__ */ new Set(); + _installedGroups.set(proto, installed); + } + if (installed.has(group)) return; + installed.add(group); + for (const key in methods) { + const fn = methods[key]; + Object.defineProperty(proto, key, { + configurable: true, + enumerable: false, + get() { + const bound = fn.bind(this); + Object.defineProperty(this, key, { + configurable: true, + writable: true, + enumerable: true, + value: bound + }); + return bound; + }, + set(v) { + Object.defineProperty(this, key, { + configurable: true, + writable: true, + enumerable: true, + value: v + }); + } + }); + } +} +const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { + $ZodType.init(inst, def); + Object.assign(inst["~standard"], { jsonSchema: { + input: createStandardJSONSchemaMethod(inst, "input"), + output: createStandardJSONSchemaMethod(inst, "output") + } }); + inst.toJSONSchema = createToJSONSchemaMethod(inst, {}); + inst.def = def; + inst.type = def.type; + Object.defineProperty(inst, "_def", { value: def }); + inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse }); + inst.safeParse = (data, params) => safeParse(inst, data, params); + inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync }); + inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params); + inst.spa = inst.safeParseAsync; + inst.encode = (data, params) => encode(inst, data, params); + inst.decode = (data, params) => decode(inst, data, params); + inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params); + inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params); + inst.safeEncode = (data, params) => safeEncode(inst, data, params); + inst.safeDecode = (data, params) => safeDecode(inst, data, params); + inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params); + inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params); + _installLazyMethods(inst, "ZodType", { + check(...chks) { + const def$1 = this.def; + return this.clone(mergeDefs(def$1, { checks: [...def$1.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: { + check: ch, + def: { check: "custom" }, + onattach: [] + } } : ch)] }), { parent: true }); + }, + with(...chks) { + return this.check(...chks); + }, + clone(def$1, params) { + return clone(this, def$1, params); + }, + brand() { + return this; + }, + register(reg, meta$2) { + reg.add(this, meta$2); + return this; + }, + refine(check, params) { + return this.check(refine(check, params)); + }, + superRefine(refinement, params) { + return this.check(superRefine(refinement, params)); + }, + overwrite(fn) { + return this.check(_overwrite(fn)); + }, + optional() { + return optional(this); + }, + exactOptional() { + return exactOptional(this); + }, + nullable() { + return nullable(this); + }, + nullish() { + return optional(nullable(this)); + }, + nonoptional(params) { + return nonoptional(this, params); + }, + array() { + return array(this); + }, + or(arg) { + return union([this, arg]); + }, + and(arg) { + return intersection(this, arg); + }, + transform(tx) { + return pipe(this, transform(tx)); + }, + default(d) { + return _default(this, d); + }, + prefault(d) { + return prefault(this, d); + }, + catch(params) { + return _catch(this, params); + }, + pipe(target) { + return pipe(this, target); + }, + readonly() { + return readonly(this); + }, + describe(description) { + const cl = this.clone(); + globalRegistry.add(cl, { description }); + return cl; + }, + meta(...args) { + if (args.length === 0) return globalRegistry.get(this); + const cl = this.clone(); + globalRegistry.add(cl, args[0]); + return cl; + }, + isOptional() { + return this.safeParse(void 0).success; + }, + isNullable() { + return this.safeParse(null).success; + }, + apply(fn) { + return fn(this); + } + }); + Object.defineProperty(inst, "description", { + get() { + return globalRegistry.get(inst)?.description; + }, + configurable: true + }); + return inst; +}); +/** @internal */ +const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { + $ZodString.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params); + const bag = inst._zod.bag; + inst.format = bag.format ?? null; + inst.minLength = bag.minimum ?? null; + inst.maxLength = bag.maximum ?? null; + _installLazyMethods(inst, "_ZodString", { + regex(...args) { + return this.check(_regex(...args)); + }, + includes(...args) { + return this.check(_includes(...args)); + }, + startsWith(...args) { + return this.check(_startsWith(...args)); + }, + endsWith(...args) { + return this.check(_endsWith(...args)); + }, + min(...args) { + return this.check(_minLength(...args)); + }, + max(...args) { + return this.check(_maxLength(...args)); + }, + length(...args) { + return this.check(_length(...args)); + }, + nonempty(...args) { + return this.check(_minLength(1, ...args)); + }, + lowercase(params) { + return this.check(_lowercase(params)); + }, + uppercase(params) { + return this.check(_uppercase(params)); + }, + trim() { + return this.check(_trim()); + }, + normalize(...args) { + return this.check(_normalize(...args)); + }, + toLowerCase() { + return this.check(_toLowerCase()); + }, + toUpperCase() { + return this.check(_toUpperCase()); + }, + slugify() { + return this.check(_slugify()); + } + }); +}); +const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { + $ZodString.init(inst, def); + _ZodString.init(inst, def); + inst.email = (params) => inst.check(_email(ZodEmail, params)); + inst.url = (params) => inst.check(_url(ZodURL, params)); + inst.jwt = (params) => inst.check(_jwt(ZodJWT, params)); + inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.uuid = (params) => inst.check(_uuid(ZodUUID, params)); + inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params)); + inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params)); + inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params)); + inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.cuid = (params) => inst.check(_cuid(ZodCUID, params)); + inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params)); + inst.ulid = (params) => inst.check(_ulid(ZodULID, params)); + inst.base64 = (params) => inst.check(_base64(ZodBase64, params)); + inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params)); + inst.xid = (params) => inst.check(_xid(ZodXID, params)); + inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params)); + inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params)); + inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params)); + inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params)); + inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params)); + inst.e164 = (params) => inst.check(_e164(ZodE164, params)); + inst.datetime = (params) => inst.check(datetime(params)); + inst.date = (params) => inst.check(date(params)); + inst.time = (params) => inst.check(time(params)); + inst.duration = (params) => inst.check(duration(params)); +}); +function string(params) { + return _string(ZodString, params); +} +const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => { + $ZodStringFormat.init(inst, def); + _ZodString.init(inst, def); +}); +const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => { + $ZodEmail.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => { + $ZodGUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => { + $ZodUUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => { + $ZodURL.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => { + $ZodEmoji.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { + $ZodNanoID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +/** +* @deprecated CUID v1 is deprecated by its authors due to information leakage +* (timestamps embedded in the id). Use {@link ZodCUID2} instead. +* See https://github.com/paralleldrive/cuid. +*/ +const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => { + $ZodCUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => { + $ZodCUID2.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => { + $ZodULID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => { + $ZodXID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => { + $ZodKSUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => { + $ZodIPv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => { + $ZodIPv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => { + $ZodCIDRv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => { + $ZodCIDRv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => { + $ZodBase64.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => { + $ZodBase64URL.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => { + $ZodE164.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => { + $ZodJWT.init(inst, def); + ZodStringFormat.init(inst, def); +}); +const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => { + $ZodNumber.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params); + _installLazyMethods(inst, "ZodNumber", { + gt(value, params) { + return this.check(_gt(value, params)); + }, + gte(value, params) { + return this.check(_gte(value, params)); + }, + min(value, params) { + return this.check(_gte(value, params)); + }, + lt(value, params) { + return this.check(_lt(value, params)); + }, + lte(value, params) { + return this.check(_lte(value, params)); + }, + max(value, params) { + return this.check(_lte(value, params)); + }, + int(params) { + return this.check(int(params)); + }, + safe(params) { + return this.check(int(params)); + }, + positive(params) { + return this.check(_gt(0, params)); + }, + nonnegative(params) { + return this.check(_gte(0, params)); + }, + negative(params) { + return this.check(_lt(0, params)); + }, + nonpositive(params) { + return this.check(_lte(0, params)); + }, + multipleOf(value, params) { + return this.check(_multipleOf(value, params)); + }, + step(value, params) { + return this.check(_multipleOf(value, params)); + }, + finite() { + return this; + } + }); + const bag = inst._zod.bag; + inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null; + inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null; + inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5); + inst.isFinite = true; + inst.format = bag.format ?? null; +}); +function number(params) { + return _number(ZodNumber, params); +} +const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => { + $ZodNumberFormat.init(inst, def); + ZodNumber.init(inst, def); +}); +function int(params) { + return _int(ZodNumberFormat, params); +} +const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { + $ZodBoolean.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params); +}); +function boolean(params) { + return _boolean(ZodBoolean, params); +} +const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => { + $ZodUnknown.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params); +}); +function unknown() { + return _unknown(ZodUnknown); +} +const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => { + $ZodNever.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params); +}); +function never(params) { + return _never(ZodNever, params); +} +const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { + $ZodArray.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params); + inst.element = def.element; + _installLazyMethods(inst, "ZodArray", { + min(n, params) { + return this.check(_minLength(n, params)); + }, + nonempty(params) { + return this.check(_minLength(1, params)); + }, + max(n, params) { + return this.check(_maxLength(n, params)); + }, + length(n, params) { + return this.check(_length(n, params)); + }, + unwrap() { + return this.element; + } + }); +}); +function array(element, params) { + return _array(ZodArray, element, params); +} +const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => { + $ZodObjectJIT.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params); + defineLazy(inst, "shape", () => { + return def.shape; + }); + _installLazyMethods(inst, "ZodObject", { + keyof() { + return _enum(Object.keys(this._zod.def.shape)); + }, + catchall(catchall) { + return this.clone({ + ...this._zod.def, + catchall + }); + }, + passthrough() { + return this.clone({ + ...this._zod.def, + catchall: unknown() + }); + }, + loose() { + return this.clone({ + ...this._zod.def, + catchall: unknown() + }); + }, + strict() { + return this.clone({ + ...this._zod.def, + catchall: never() + }); + }, + strip() { + return this.clone({ + ...this._zod.def, + catchall: void 0 + }); + }, + extend(incoming) { + return extend(this, incoming); + }, + safeExtend(incoming) { + return safeExtend(this, incoming); + }, + merge(other) { + return merge(this, other); + }, + pick(mask) { + return pick(this, mask); + }, + omit(mask) { + return omit(this, mask); + }, + partial(...args) { + return partial(ZodOptional, this, args[0]); + }, + required(...args) { + return required(ZodNonOptional, this, args[0]); + } + }); +}); +function object(shape, params) { + return new ZodObject({ + type: "object", + shape: shape ?? {}, + ...normalizeParams(params) + }); +} +const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => { + $ZodUnion.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params); + inst.options = def.options; +}); +function union(options, params) { + return new ZodUnion({ + type: "union", + options, + ...normalizeParams(params) + }); +} +const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => { + $ZodIntersection.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params); +}); +function intersection(left, right) { + return new ZodIntersection({ + type: "intersection", + left, + right + }); +} +const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => { + $ZodRecord.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params); + inst.keyType = def.keyType; + inst.valueType = def.valueType; +}); +function record(keyType, valueType, params) { + if (!valueType || !valueType._zod) return new ZodRecord({ + type: "record", + keyType: string(), + valueType: keyType, + ...normalizeParams(valueType) + }); + return new ZodRecord({ + type: "record", + keyType, + valueType, + ...normalizeParams(params) + }); +} +const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { + $ZodEnum.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params); + inst.enum = def.entries; + inst.options = Object.values(def.entries); + const keys = new Set(Object.keys(def.entries)); + inst.extract = (values, params) => { + const newEntries = {}; + for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value]; + else throw new Error(`Key ${value} not found in enum`); + return new ZodEnum({ + ...def, + checks: [], + ...normalizeParams(params), + entries: newEntries + }); + }; + inst.exclude = (values, params) => { + const newEntries = { ...def.entries }; + for (const value of values) if (keys.has(value)) delete newEntries[value]; + else throw new Error(`Key ${value} not found in enum`); + return new ZodEnum({ + ...def, + checks: [], + ...normalizeParams(params), + entries: newEntries + }); + }; +}); +function _enum(values, params) { + return new ZodEnum({ + type: "enum", + entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values, + ...normalizeParams(params) + }); +} +const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { + $ZodTransform.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params); + inst._zod.parse = (payload, _ctx) => { + if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name); + payload.addIssue = (issue$1) => { + if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def)); + else { + const _issue = issue$1; + if (_issue.fatal) _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = inst); + payload.issues.push(issue(_issue)); + } + }; + const output = def.transform(payload.value, payload); + if (output instanceof Promise) return output.then((output$1) => { + payload.value = output$1; + payload.fallback = true; + return payload; + }); + payload.value = output; + payload.fallback = true; + return payload; + }; +}); +function transform(fn) { + return new ZodTransform({ + type: "transform", + transform: fn + }); +} +const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => { + $ZodOptional.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function optional(innerType) { + return new ZodOptional({ + type: "optional", + innerType + }); +} +const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => { + $ZodExactOptional.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function exactOptional(innerType) { + return new ZodExactOptional({ + type: "optional", + innerType + }); +} +const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => { + $ZodNullable.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function nullable(innerType) { + return new ZodNullable({ + type: "nullable", + innerType + }); +} +const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => { + $ZodDefault.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeDefault = inst.unwrap; +}); +function _default(innerType, defaultValue) { + return new ZodDefault({ + type: "default", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue); + } + }); +} +const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => { + $ZodPrefault.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function prefault(innerType, defaultValue) { + return new ZodPrefault({ + type: "prefault", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue); + } + }); +} +const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => { + $ZodNonOptional.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function nonoptional(innerType, params) { + return new ZodNonOptional({ + type: "nonoptional", + innerType, + ...normalizeParams(params) + }); +} +const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => { + $ZodCatch.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeCatch = inst.unwrap; +}); +function _catch(innerType, catchValue) { + return new ZodCatch({ + type: "catch", + innerType, + catchValue: typeof catchValue === "function" ? catchValue : () => catchValue + }); +} +const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => { + $ZodPipe.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params); + inst.in = def.in; + inst.out = def.out; +}); +function pipe(in_, out) { + return new ZodPipe({ + type: "pipe", + in: in_, + out + }); +} +const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => { + $ZodReadonly.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function readonly(innerType) { + return new ZodReadonly({ + type: "readonly", + innerType + }); +} +const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => { + $ZodCustom.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params); +}); +function refine(fn, _params = {}) { + return _refine(ZodCustom, fn, _params); +} +function superRefine(fn, params) { + return _superRefine(fn, params); +} +const describe = describe$1; +const meta = meta$1; + +//#endregion +//#region src/config.ts +/** +* Resolved tracer configuration. +* +* Resolution order (lowest → highest precedence): +* defaults → ~/.claude/langfuse.json → /.claude/langfuse.json → env +* +* Claude Code exposes a plugin's `userConfig` values as +* `CLAUDE_PLUGIN_OPTION_` environment variables. For every setting we +* read the `CLAUDE_PLUGIN_OPTION_` form first, then the plain `` +* environment variable, so the plugin works whether configured through the +* Claude Code install prompt or a shell export. +*/ +const ConfigSchema = object({ + public_key: string().optional(), + secret_key: string().optional(), + base_url: string(), + environment: string().optional(), + user_id: string().optional(), + tags: array(string()).optional(), + metadata: record(string(), string()).optional(), + max_chars: number().int().positive(), + debug: boolean(), + fail_on_error: boolean() +}); +const PartialConfigSchema = ConfigSchema.partial(); +const DEFAULTS = { + base_url: "https://us.cloud.langfuse.com", + max_chars: 2e4, + debug: false, + fail_on_error: false +}; +function parseBoolean(value) { + if (typeof value === "boolean") return value; + if (typeof value !== "string") return void 0; + const normalized = value.trim().toLowerCase(); + if ([ + "1", + "true", + "yes", + "on" + ].includes(normalized)) return true; + if ([ + "0", + "false", + "no", + "off" + ].includes(normalized)) return false; +} +function parseTags(value) { + if (Array.isArray(value)) return value.map(String); + if (typeof value !== "string" || value.trim().length === 0) return void 0; + const trimmed = value.trim(); + if (trimmed.startsWith("[")) try { + const parsed = JSON.parse(trimmed); + if (Array.isArray(parsed)) return parsed.map(String); + } catch {} + return trimmed.split(",").map((t) => t.trim()).filter(Boolean); +} +function parseMetadata(value) { + let obj = value; + if (typeof value === "string") { + if (value.trim().length === 0) return void 0; + try { + obj = JSON.parse(value); + } catch { + return; + } + } + if (obj == null || typeof obj !== "object" || Array.isArray(obj)) return; + const out = {}; + for (const [k, v] of Object.entries(obj)) out[k] = typeof v === "string" ? v : JSON.stringify(v); + return out; +} +function parseInteger(value) { + if (typeof value === "number" && Number.isFinite(value)) return value; + if (typeof value !== "string") return void 0; + const parsed = Number.parseInt(value.trim(), 10); + return Number.isFinite(parsed) ? parsed : void 0; +} +function stripUndefined(value) { + return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0)); +} +async function readConfigFile(file) { + try { + const raw = JSON.parse(await fs.readFile(file, "utf-8")); + return PartialConfigSchema.parse(stripUndefined({ + ...raw, + tags: raw.tags != null ? parseTags(raw.tags) : void 0, + metadata: raw.metadata != null ? parseMetadata(raw.metadata) : void 0, + max_chars: raw.max_chars != null ? parseInteger(raw.max_chars) : void 0, + debug: raw.debug != null ? parseBoolean(raw.debug) : void 0, + fail_on_error: raw.fail_on_error != null ? parseBoolean(raw.fail_on_error) : void 0 + })); + } catch { + return; + } +} +/** +* Read an option, preferring the Claude Code plugin-config form +* (`CLAUDE_PLUGIN_OPTION_`) over the plain environment variable. +*/ +function opt(name, env) { + return env[`CLAUDE_PLUGIN_OPTION_${name}`] ?? env[name]; +} +/** Resolve `LANGFUSE_` with a `CC_LANGFUSE_` fallback. */ +function getVar(suffix, env) { + return opt(`LANGFUSE_${suffix}`, env) ?? opt(`CC_LANGFUSE_${suffix}`, env); +} +function readEnvConfig(env) { + return PartialConfigSchema.parse(stripUndefined({ + public_key: getVar("PUBLIC_KEY", env), + secret_key: getVar("SECRET_KEY", env), + base_url: getVar("BASE_URL", env), + environment: opt("LANGFUSE_TRACING_ENVIRONMENT", env) ?? opt("CC_LANGFUSE_ENVIRONMENT", env), + user_id: opt("CC_LANGFUSE_USER_ID", env), + tags: parseTags(opt("CC_LANGFUSE_TAGS", env)), + metadata: parseMetadata(opt("CC_LANGFUSE_METADATA", env)), + max_chars: parseInteger(opt("CC_LANGFUSE_MAX_CHARS", env)), + debug: parseBoolean(opt("CC_LANGFUSE_DEBUG", env)), + fail_on_error: parseBoolean(opt("CC_LANGFUSE_FAIL_ON_ERROR", env)) + })); +} +const getHomeDir = () => process.env.HOME ?? os$2.homedir(); +async function getConfig(options) { + const home = options?.home ?? getHomeDir(); + const cwd = options?.cwd ?? process.cwd(); + const env = options?.env ?? process.env; + const [globalConfig$1, localConfig] = await Promise.all([readConfigFile(path.join(home, ".claude", "langfuse.json")), readConfigFile(path.join(cwd, ".claude", "langfuse.json"))]); + const envConfig = readEnvConfig(env); + return ConfigSchema.parse({ + ...DEFAULTS, + ...globalConfig$1, + ...localConfig, + ...envConfig + }); +} + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js +var VERSION; +var init_version = __esmMin((() => { + VERSION = "1.9.1"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js +/** +* Create a function to test an API version to see if it is compatible with the provided ownVersion. +* +* The returned function has the following semantics: +* - Exact match is always compatible +* - Major versions must match exactly +* - 1.x package cannot use global 2.x package +* - 2.x package cannot use global 1.x package +* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API +* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects +* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 +* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor +* - Patch and build tag differences are not considered at this time +* +* @param ownVersion version which should be checked against +*/ +function _makeCompatibilityCheck(ownVersion) { + const acceptedVersions = new Set([ownVersion]); + const rejectedVersions = /* @__PURE__ */ new Set(); + const myVersionMatch = ownVersion.match(re); + if (!myVersionMatch) return () => false; + const ownVersionParsed = { + major: +myVersionMatch[1], + minor: +myVersionMatch[2], + patch: +myVersionMatch[3], + prerelease: myVersionMatch[4] + }; + if (ownVersionParsed.prerelease != null) return function isExactmatch(globalVersion) { + return globalVersion === ownVersion; + }; + function _reject(v) { + rejectedVersions.add(v); + return false; + } + function _accept(v) { + acceptedVersions.add(v); + return true; + } + return function isCompatible$1(globalVersion) { + if (acceptedVersions.has(globalVersion)) return true; + if (rejectedVersions.has(globalVersion)) return false; + const globalVersionMatch = globalVersion.match(re); + if (!globalVersionMatch) return _reject(globalVersion); + const globalVersionParsed = { + major: +globalVersionMatch[1], + minor: +globalVersionMatch[2], + patch: +globalVersionMatch[3], + prerelease: globalVersionMatch[4] + }; + if (globalVersionParsed.prerelease != null) return _reject(globalVersion); + if (ownVersionParsed.major !== globalVersionParsed.major) return _reject(globalVersion); + if (ownVersionParsed.major === 0) { + if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) return _accept(globalVersion); + return _reject(globalVersion); + } + if (ownVersionParsed.minor <= globalVersionParsed.minor) return _accept(globalVersion); + return _reject(globalVersion); + }; +} +var re, isCompatible; +var init_semver = __esmMin((() => { + init_version(); + re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; + isCompatible = _makeCompatibilityCheck(VERSION); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js +function registerGlobal(type, instance, diag$2, allowOverride = false) { + var _a$3; + const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a$3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a$3 !== void 0 ? _a$3 : { version: VERSION }; + if (!allowOverride && api[type]) { + const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); + diag$2.error(err.stack || err.message); + return false; + } + if (api.version !== VERSION) { + const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`); + diag$2.error(err.stack || err.message); + return false; + } + api[type] = instance; + diag$2.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`); + return true; +} +function getGlobal(type) { + var _a$3, _b; + const globalVersion = (_a$3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a$3 === void 0 ? void 0 : _a$3.version; + if (!globalVersion || !isCompatible(globalVersion)) return; + return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; +} +function unregisterGlobal(type, diag$2) { + diag$2.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`); + const api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (api) delete api[type]; +} +var major, GLOBAL_OPENTELEMETRY_API_KEY, _global; +var init_global_utils = __esmMin((() => { + init_version(); + init_semver(); + major = VERSION.split(".")[0]; + GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); + _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {}; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js +function logProxy(funcName, namespace, args) { + const logger = getGlobal("diag"); + if (!logger) return; + return logger[funcName](namespace, ...args); +} +var DiagComponentLogger; +var init_ComponentLogger = __esmMin((() => { + init_global_utils(); + DiagComponentLogger = class { + constructor(props) { + this._namespace = props.namespace || "DiagComponentLogger"; + } + debug(...args) { + return logProxy("debug", this._namespace, args); + } + error(...args) { + return logProxy("error", this._namespace, args); + } + info(...args) { + return logProxy("info", this._namespace, args); + } + warn(...args) { + return logProxy("warn", this._namespace, args); + } + verbose(...args) { + return logProxy("verbose", this._namespace, args); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js +var DiagLogLevel; +var init_types$1 = __esmMin((() => { + ; + (function(DiagLogLevel$1) { + /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ + DiagLogLevel$1[DiagLogLevel$1["NONE"] = 0] = "NONE"; + /** Identifies an error scenario */ + DiagLogLevel$1[DiagLogLevel$1["ERROR"] = 30] = "ERROR"; + /** Identifies a warning scenario */ + DiagLogLevel$1[DiagLogLevel$1["WARN"] = 50] = "WARN"; + /** General informational log message */ + DiagLogLevel$1[DiagLogLevel$1["INFO"] = 60] = "INFO"; + /** General debug log message */ + DiagLogLevel$1[DiagLogLevel$1["DEBUG"] = 70] = "DEBUG"; + /** + * Detailed trace level logging should only be used for development, should only be set + * in a development environment. + */ + DiagLogLevel$1[DiagLogLevel$1["VERBOSE"] = 80] = "VERBOSE"; + /** Used to set the logging level to include all logging */ + DiagLogLevel$1[DiagLogLevel$1["ALL"] = 9999] = "ALL"; + })(DiagLogLevel || (DiagLogLevel = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js +function createLogLevelDiagLogger(maxLevel, logger) { + if (maxLevel < DiagLogLevel.NONE) maxLevel = DiagLogLevel.NONE; + else if (maxLevel > DiagLogLevel.ALL) maxLevel = DiagLogLevel.ALL; + logger = logger || {}; + function _filterFunc(funcName, theLevel) { + const theFunc = logger[funcName]; + if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger); + return function() {}; + } + return { + error: _filterFunc("error", DiagLogLevel.ERROR), + warn: _filterFunc("warn", DiagLogLevel.WARN), + info: _filterFunc("info", DiagLogLevel.INFO), + debug: _filterFunc("debug", DiagLogLevel.DEBUG), + verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE) + }; +} +var init_logLevelLogger = __esmMin((() => { + init_types$1(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js +var API_NAME$4, DiagAPI; +var init_diag = __esmMin((() => { + init_ComponentLogger(); + init_logLevelLogger(); + init_types$1(); + init_global_utils(); + API_NAME$4 = "diag"; + DiagAPI = class DiagAPI { + /** Get the singleton instance of the DiagAPI API */ + static instance() { + if (!this._instance) this._instance = new DiagAPI(); + return this._instance; + } + /** + * Private internal constructor + * @private + */ + constructor() { + function _logProxy(funcName) { + return function(...args) { + const logger = getGlobal("diag"); + if (!logger) return; + return logger[funcName](...args); + }; + } + const self$1 = this; + const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => { + var _a$3, _b, _c; + if (logger === self$1) { + const err = /* @__PURE__ */ new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); + self$1.error((_a$3 = err.stack) !== null && _a$3 !== void 0 ? _a$3 : err.message); + return false; + } + if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel }; + const oldLogger = getGlobal("diag"); + const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger); + if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { + const stack = (_c = (/* @__PURE__ */ new Error()).stack) !== null && _c !== void 0 ? _c : ""; + oldLogger.warn(`Current logger will be overwritten from ${stack}`); + newLogger.warn(`Current logger will overwrite one already registered from ${stack}`); + } + return registerGlobal("diag", newLogger, self$1, true); + }; + self$1.setLogger = setLogger; + self$1.disable = () => { + unregisterGlobal(API_NAME$4, self$1); + }; + self$1.createComponentLogger = (options) => { + return new DiagComponentLogger(options); + }; + self$1.verbose = _logProxy("verbose"); + self$1.debug = _logProxy("debug"); + self$1.info = _logProxy("info"); + self$1.warn = _logProxy("warn"); + self$1.error = _logProxy("error"); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js +var BaggageImpl; +var init_baggage_impl = __esmMin((() => { + BaggageImpl = class BaggageImpl { + constructor(entries) { + this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map(); + } + getEntry(key) { + const entry = this._entries.get(key); + if (!entry) return; + return Object.assign({}, entry); + } + getAllEntries() { + return Array.from(this._entries.entries()); + } + setEntry(key, entry) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.set(key, entry); + return newBaggage; + } + removeEntry(key) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.delete(key); + return newBaggage; + } + removeEntries(...keys) { + const newBaggage = new BaggageImpl(this._entries); + for (const key of keys) newBaggage._entries.delete(key); + return newBaggage; + } + clear() { + return new BaggageImpl(); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js +var baggageEntryMetadataSymbol; +var init_symbol = __esmMin((() => { + baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata"); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/utils.js +/** +* Create a new Baggage with optional entries +* +* @param entries An array of baggage entries the new baggage should contain +*/ +function createBaggage(entries = {}) { + return new BaggageImpl(new Map(Object.entries(entries))); +} +/** +* Create a serializable BaggageEntryMetadata object from a string. +* +* @param str string metadata. Format is currently not defined by the spec and has no special meaning. +* +* @since 1.0.0 +*/ +function baggageEntryMetadataFromString(str) { + if (typeof str !== "string") { + diag$1.error(`Cannot create baggage metadata from unknown type: ${typeof str}`); + str = ""; + } + return { + __TYPE__: baggageEntryMetadataSymbol, + toString() { + return str; + } + }; +} +var diag$1; +var init_utils$2 = __esmMin((() => { + init_diag(); + init_baggage_impl(); + init_symbol(); + diag$1 = DiagAPI.instance(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js +/** +* Get a key to uniquely identify a context value +* +* @since 1.0.0 +*/ +function createContextKey(description) { + return Symbol.for(description); +} +var BaseContext, ROOT_CONTEXT; +var init_context$1 = __esmMin((() => { + BaseContext = class BaseContext { + /** + * Construct a new context which inherits values from an optional parent context. + * + * @param parentContext a context from which to inherit values + */ + constructor(parentContext) { + const self$1 = this; + self$1._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map(); + self$1.getValue = (key) => self$1._currentContext.get(key); + self$1.setValue = (key, value) => { + const context$1 = new BaseContext(self$1._currentContext); + context$1._currentContext.set(key, value); + return context$1; + }; + self$1.deleteValue = (key) => { + const context$1 = new BaseContext(self$1._currentContext); + context$1._currentContext.delete(key); + return context$1; + }; + } + }; + ROOT_CONTEXT = new BaseContext(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js +var consoleMap, _originalConsoleMethods, DiagConsoleLogger; +var init_consoleLogger = __esmMin((() => { + consoleMap = [ + { + n: "error", + c: "error" + }, + { + n: "warn", + c: "warn" + }, + { + n: "info", + c: "info" + }, + { + n: "debug", + c: "debug" + }, + { + n: "verbose", + c: "trace" + } + ]; + _originalConsoleMethods = {}; + if (typeof console !== "undefined") { + for (const key of [ + "error", + "warn", + "info", + "debug", + "trace", + "log" + ]) if (typeof console[key] === "function") _originalConsoleMethods[key] = console[key]; + } + DiagConsoleLogger = class { + constructor() { + function _consoleFunc(funcName) { + return function(...args) { + let theFunc = _originalConsoleMethods[funcName]; + if (typeof theFunc !== "function") theFunc = _originalConsoleMethods["log"]; + if (typeof theFunc !== "function" && console) { + theFunc = console[funcName]; + if (typeof theFunc !== "function") theFunc = console.log; + } + if (typeof theFunc === "function") return theFunc.apply(console, args); + }; + } + for (let i = 0; i < consoleMap.length; i++) this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js +/** +* Create a no-op Meter +* +* @since 1.3.0 +*/ +function createNoopMeter() { + return NOOP_METER; +} +var NoopMeter, NoopMetric, NoopCounterMetric, NoopUpDownCounterMetric, NoopGaugeMetric, NoopHistogramMetric, NoopObservableMetric, NoopObservableCounterMetric, NoopObservableGaugeMetric, NoopObservableUpDownCounterMetric, NOOP_METER, NOOP_COUNTER_METRIC, NOOP_GAUGE_METRIC, NOOP_HISTOGRAM_METRIC, NOOP_UP_DOWN_COUNTER_METRIC, NOOP_OBSERVABLE_COUNTER_METRIC, NOOP_OBSERVABLE_GAUGE_METRIC, NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; +var init_NoopMeter = __esmMin((() => { + NoopMeter = class { + constructor() {} + /** + * @see {@link Meter.createGauge} + */ + createGauge(_name, _options) { + return NOOP_GAUGE_METRIC; + } + /** + * @see {@link Meter.createHistogram} + */ + createHistogram(_name, _options) { + return NOOP_HISTOGRAM_METRIC; + } + /** + * @see {@link Meter.createCounter} + */ + createCounter(_name, _options) { + return NOOP_COUNTER_METRIC; + } + /** + * @see {@link Meter.createUpDownCounter} + */ + createUpDownCounter(_name, _options) { + return NOOP_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableGauge} + */ + createObservableGauge(_name, _options) { + return NOOP_OBSERVABLE_GAUGE_METRIC; + } + /** + * @see {@link Meter.createObservableCounter} + */ + createObservableCounter(_name, _options) { + return NOOP_OBSERVABLE_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableUpDownCounter} + */ + createObservableUpDownCounter(_name, _options) { + return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.addBatchObservableCallback} + */ + addBatchObservableCallback(_callback, _observables) {} + /** + * @see {@link Meter.removeBatchObservableCallback} + */ + removeBatchObservableCallback(_callback) {} + }; + NoopMetric = class {}; + NoopCounterMetric = class extends NoopMetric { + add(_value, _attributes) {} + }; + NoopUpDownCounterMetric = class extends NoopMetric { + add(_value, _attributes) {} + }; + NoopGaugeMetric = class extends NoopMetric { + record(_value, _attributes) {} + }; + NoopHistogramMetric = class extends NoopMetric { + record(_value, _attributes) {} + }; + NoopObservableMetric = class { + addCallback(_callback) {} + removeCallback(_callback) {} + }; + NoopObservableCounterMetric = class extends NoopObservableMetric {}; + NoopObservableGaugeMetric = class extends NoopObservableMetric {}; + NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {}; + NOOP_METER = new NoopMeter(); + NOOP_COUNTER_METRIC = new NoopCounterMetric(); + NOOP_GAUGE_METRIC = new NoopGaugeMetric(); + NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric(); + NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric(); + NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric(); + NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric(); + NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/Metric.js +var ValueType; +var init_Metric = __esmMin((() => { + ; + (function(ValueType$1) { + ValueType$1[ValueType$1["INT"] = 0] = "INT"; + ValueType$1[ValueType$1["DOUBLE"] = 1] = "DOUBLE"; + })(ValueType || (ValueType = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js +var defaultTextMapGetter, defaultTextMapSetter; +var init_TextMapPropagator = __esmMin((() => { + defaultTextMapGetter = { + get(carrier, key) { + if (carrier == null) return; + return carrier[key]; + }, + keys(carrier) { + if (carrier == null) return []; + return Object.keys(carrier); + } + }; + defaultTextMapSetter = { set(carrier, key, value) { + if (carrier == null) return; + carrier[key] = value; + } }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js +var NoopContextManager; +var init_NoopContextManager = __esmMin((() => { + init_context$1(); + NoopContextManager = class { + active() { + return ROOT_CONTEXT; + } + with(_context, fn, thisArg, ...args) { + return fn.call(thisArg, ...args); + } + bind(_context, target) { + return target; + } + enable() { + return this; + } + disable() { + return this; + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js +var API_NAME$3, NOOP_CONTEXT_MANAGER, ContextAPI; +var init_context = __esmMin((() => { + init_NoopContextManager(); + init_global_utils(); + init_diag(); + API_NAME$3 = "context"; + NOOP_CONTEXT_MANAGER = new NoopContextManager(); + ContextAPI = class ContextAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() {} + /** Get the singleton instance of the Context API */ + static getInstance() { + if (!this._instance) this._instance = new ContextAPI(); + return this._instance; + } + /** + * Set the current context manager. + * + * @returns true if the context manager was successfully registered, else false + */ + setGlobalContextManager(contextManager) { + return registerGlobal(API_NAME$3, contextManager, DiagAPI.instance()); + } + /** + * Get the currently active context + */ + active() { + return this._getContextManager().active(); + } + /** + * Execute a function with an active context + * + * @param context context to be active during function execution + * @param fn function to execute in a context + * @param thisArg optional receiver to be used for calling fn + * @param args optional arguments forwarded to fn + */ + with(context$1, fn, thisArg, ...args) { + return this._getContextManager().with(context$1, fn, thisArg, ...args); + } + /** + * Bind a context to a target function or event emitter + * + * @param context context to bind to the event emitter or function. Defaults to the currently active context + * @param target function or event emitter to bind + */ + bind(context$1, target) { + return this._getContextManager().bind(context$1, target); + } + _getContextManager() { + return getGlobal(API_NAME$3) || NOOP_CONTEXT_MANAGER; + } + /** Disable and remove the global context manager */ + disable() { + this._getContextManager().disable(); + unregisterGlobal(API_NAME$3, DiagAPI.instance()); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js +var TraceFlags; +var init_trace_flags = __esmMin((() => { + ; + (function(TraceFlags$1) { + /** Represents no flag set. */ + TraceFlags$1[TraceFlags$1["NONE"] = 0] = "NONE"; + /** Bit to represent whether trace is sampled in trace flags. */ + TraceFlags$1[TraceFlags$1["SAMPLED"] = 1] = "SAMPLED"; + })(TraceFlags || (TraceFlags = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js +var INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT; +var init_invalid_span_constants = __esmMin((() => { + init_trace_flags(); + INVALID_SPANID = "0000000000000000"; + INVALID_TRACEID = "00000000000000000000000000000000"; + INVALID_SPAN_CONTEXT = { + traceId: INVALID_TRACEID, + spanId: INVALID_SPANID, + traceFlags: TraceFlags.NONE + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js +var NonRecordingSpan; +var init_NonRecordingSpan = __esmMin((() => { + init_invalid_span_constants(); + NonRecordingSpan = class { + constructor(spanContext = INVALID_SPAN_CONTEXT) { + this._spanContext = spanContext; + } + spanContext() { + return this._spanContext; + } + setAttribute(_key, _value) { + return this; + } + setAttributes(_attributes) { + return this; + } + addEvent(_name, _attributes) { + return this; + } + addLink(_link) { + return this; + } + addLinks(_links) { + return this; + } + setStatus(_status) { + return this; + } + updateName(_name) { + return this; + } + end(_endTime) {} + isRecording() { + return false; + } + recordException(_exception, _time) {} + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js +/** +* Return the span if one exists +* +* @param context context to get span from +*/ +function getSpan(context$1) { + return context$1.getValue(SPAN_KEY) || void 0; +} +/** +* Gets the span from the current context, if one exists. +*/ +function getActiveSpan() { + return getSpan(ContextAPI.getInstance().active()); +} +/** +* Set the span on a context +* +* @param context context to use as parent +* @param span span to set active +*/ +function setSpan(context$1, span) { + return context$1.setValue(SPAN_KEY, span); +} +/** +* Remove current span stored in the context +* +* @param context context to delete span from +*/ +function deleteSpan(context$1) { + return context$1.deleteValue(SPAN_KEY); +} +/** +* Wrap span context in a NoopSpan and set as span in a new +* context +* +* @param context context to set active span on +* @param spanContext span context to be wrapped +*/ +function setSpanContext(context$1, spanContext) { + return setSpan(context$1, new NonRecordingSpan(spanContext)); +} +/** +* Get the span context of the span if it exists. +* +* @param context context to get values from +*/ +function getSpanContext(context$1) { + var _a$3; + return (_a$3 = getSpan(context$1)) === null || _a$3 === void 0 ? void 0 : _a$3.spanContext(); +} +var SPAN_KEY; +var init_context_utils = __esmMin((() => { + init_context$1(); + init_NonRecordingSpan(); + init_context(); + SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN"); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js +function isValidHex(id, length) { + if (typeof id !== "string" || id.length !== length) return false; + let r = 0; + for (let i = 0; i < id.length; i += 4) r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0); + return r === length; +} +/** +* @since 1.0.0 +*/ +function isValidTraceId(traceId) { + return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID; +} +/** +* @since 1.0.0 +*/ +function isValidSpanId(spanId) { + return isValidHex(spanId, 16) && spanId !== INVALID_SPANID; +} +/** +* Returns true if this {@link SpanContext} is valid. +* @return true if this {@link SpanContext} is valid. +* +* @since 1.0.0 +*/ +function isSpanContextValid(spanContext) { + return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId); +} +/** +* Wrap the given {@link SpanContext} in a new non-recording {@link Span} +* +* @param spanContext span context to be wrapped +* @returns a new non-recording {@link Span} with the provided context +*/ +function wrapSpanContext(spanContext) { + return new NonRecordingSpan(spanContext); +} +var isHex; +var init_spancontext_utils = __esmMin((() => { + init_invalid_span_constants(); + init_NonRecordingSpan(); + isHex = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1 + ]); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js +function isSpanContext(spanContext) { + return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number"; +} +var contextApi, NoopTracer; +var init_NoopTracer = __esmMin((() => { + init_context(); + init_context_utils(); + init_NonRecordingSpan(); + init_spancontext_utils(); + contextApi = ContextAPI.getInstance(); + NoopTracer = class { + startSpan(name, options, context$1 = contextApi.active()) { + if (Boolean(options === null || options === void 0 ? void 0 : options.root)) return new NonRecordingSpan(); + const parentFromContext = context$1 && getSpanContext(context$1); + if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext); + else return new NonRecordingSpan(); + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) return; + else if (arguments.length === 2) fn = arg2; + else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = setSpan(parentContext, span); + return contextApi.with(contextWithSpanSet, fn, void 0, span); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js +var NOOP_TRACER, ProxyTracer; +var init_ProxyTracer = __esmMin((() => { + init_NoopTracer(); + NOOP_TRACER = new NoopTracer(); + ProxyTracer = class { + constructor(provider, name, version$1, options) { + this._provider = provider; + this.name = name; + this.version = version$1; + this.options = options; + } + startSpan(name, options, context$1) { + return this._getTracer().startSpan(name, options, context$1); + } + startActiveSpan(_name, _options, _context, _fn) { + const tracer = this._getTracer(); + return Reflect.apply(tracer.startActiveSpan, tracer, arguments); + } + /** + * Try to get a tracer from the proxy tracer provider. + * If the proxy tracer provider has no delegate, return a noop tracer. + */ + _getTracer() { + if (this._delegate) return this._delegate; + const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); + if (!tracer) return NOOP_TRACER; + this._delegate = tracer; + return this._delegate; + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js +var NoopTracerProvider; +var init_NoopTracerProvider = __esmMin((() => { + init_NoopTracer(); + NoopTracerProvider = class { + getTracer(_name, _version, _options) { + return new NoopTracer(); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js +var NOOP_TRACER_PROVIDER, ProxyTracerProvider; +var init_ProxyTracerProvider = __esmMin((() => { + init_ProxyTracer(); + init_NoopTracerProvider(); + NOOP_TRACER_PROVIDER = new NoopTracerProvider(); + ProxyTracerProvider = class { + /** + * Get a {@link ProxyTracer} + */ + getTracer(name, version$1, options) { + var _a$3; + return (_a$3 = this.getDelegateTracer(name, version$1, options)) !== null && _a$3 !== void 0 ? _a$3 : new ProxyTracer(this, name, version$1, options); + } + getDelegate() { + var _a$3; + return (_a$3 = this._delegate) !== null && _a$3 !== void 0 ? _a$3 : NOOP_TRACER_PROVIDER; + } + /** + * Set the delegate tracer provider + */ + setDelegate(delegate) { + this._delegate = delegate; + } + getDelegateTracer(name, version$1, options) { + var _a$3; + return (_a$3 = this._delegate) === null || _a$3 === void 0 ? void 0 : _a$3.getTracer(name, version$1, options); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js +var SamplingDecision; +var init_SamplingResult = __esmMin((() => { + ; + (function(SamplingDecision$1) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision$1[SamplingDecision$1["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision$1[SamplingDecision$1["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision$1[SamplingDecision$1["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; + })(SamplingDecision || (SamplingDecision = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js +var SpanKind; +var init_span_kind = __esmMin((() => { + ; + (function(SpanKind$1) { + /** Default value. Indicates that the span is used internally. */ + SpanKind$1[SpanKind$1["INTERNAL"] = 0] = "INTERNAL"; + /** + * Indicates that the span covers server-side handling of an RPC or other + * remote request. + */ + SpanKind$1[SpanKind$1["SERVER"] = 1] = "SERVER"; + /** + * Indicates that the span covers the client-side wrapper around an RPC or + * other remote request. + */ + SpanKind$1[SpanKind$1["CLIENT"] = 2] = "CLIENT"; + /** + * Indicates that the span describes producer sending a message to a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind$1[SpanKind$1["PRODUCER"] = 3] = "PRODUCER"; + /** + * Indicates that the span describes consumer receiving a message from a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind$1[SpanKind$1["CONSUMER"] = 4] = "CONSUMER"; + })(SpanKind || (SpanKind = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js +var SpanStatusCode; +var init_status = __esmMin((() => { + ; + (function(SpanStatusCode$1) { + /** + * The default status. + */ + SpanStatusCode$1[SpanStatusCode$1["UNSET"] = 0] = "UNSET"; + /** + * The operation has been validated by an Application developer or + * Operator to have completed successfully. + */ + SpanStatusCode$1[SpanStatusCode$1["OK"] = 1] = "OK"; + /** + * The operation contains an error. + */ + SpanStatusCode$1[SpanStatusCode$1["ERROR"] = 2] = "ERROR"; + })(SpanStatusCode || (SpanStatusCode = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js +/** +* Key is opaque string up to 256 characters printable. It MUST begin with a +* lowercase letter, and can only contain lowercase letters a-z, digits 0-9, +* underscores _, dashes -, asterisks *, and forward slashes /. +* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the +* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. +* see https://www.w3.org/TR/trace-context/#key +*/ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +/** +* Value is opaque string up to 256 characters printable ASCII RFC0020 +* characters (i.e., the range 0x20 to 0x7E) except comma , and =. +*/ +function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); +} +var VALID_KEY_CHAR_RANGE, VALID_KEY, VALID_VENDOR_KEY, VALID_KEY_REGEX, VALID_VALUE_BASE_REGEX, INVALID_VALUE_COMMA_EQUAL_REGEX; +var init_tracestate_validators = __esmMin((() => { + VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js +var MAX_TRACE_STATE_ITEMS, MAX_TRACE_STATE_LEN, LIST_MEMBERS_SEPARATOR, LIST_MEMBER_KEY_VALUE_SPLITTER, TraceStateImpl; +var init_tracestate_impl = __esmMin((() => { + init_tracestate_validators(); + MAX_TRACE_STATE_ITEMS = 32; + MAX_TRACE_STATE_LEN = 512; + LIST_MEMBERS_SEPARATOR = ","; + LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + TraceStateImpl = class TraceStateImpl { + constructor(rawTraceState) { + this._internalState = /* @__PURE__ */ new Map(); + if (rawTraceState) this._parse(rawTraceState); + } + set(key, value) { + const traceState = this._clone(); + if (traceState._internalState.has(key)) traceState._internalState.delete(key); + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return Array.from(this._internalState.keys()).reduceRight((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reduceRight((agg, part) => { + const listMember = part.trim(); + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if (validateKey(key) && validateValue(value)) agg.set(key, value); + } + return agg; + }, /* @__PURE__ */ new Map()); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceStateImpl(); + traceState._internalState = new Map(this._internalState); + return traceState; + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js +/** +* @since 1.1.0 +*/ +function createTraceState(rawTraceState) { + return new TraceStateImpl(rawTraceState); +} +var init_utils$1 = __esmMin((() => { + init_tracestate_impl(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js +var context; +var init_context_api = __esmMin((() => { + init_context(); + context = ContextAPI.getInstance(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag-api.js +var diag; +var init_diag_api = __esmMin((() => { + init_diag(); + diag = DiagAPI.instance(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js +var NoopMeterProvider, NOOP_METER_PROVIDER; +var init_NoopMeterProvider = __esmMin((() => { + init_NoopMeter(); + NoopMeterProvider = class { + getMeter(_name, _version, _options) { + return NOOP_METER; + } + }; + NOOP_METER_PROVIDER = new NoopMeterProvider(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/metrics.js +var API_NAME$2, MetricsAPI; +var init_metrics = __esmMin((() => { + init_NoopMeterProvider(); + init_global_utils(); + init_diag(); + API_NAME$2 = "metrics"; + MetricsAPI = class MetricsAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() {} + /** Get the singleton instance of the Metrics API */ + static getInstance() { + if (!this._instance) this._instance = new MetricsAPI(); + return this._instance; + } + /** + * Set the current global meter provider. + * Returns true if the meter provider was successfully registered, else false. + */ + setGlobalMeterProvider(provider) { + return registerGlobal(API_NAME$2, provider, DiagAPI.instance()); + } + /** + * Returns the global meter provider. + */ + getMeterProvider() { + return getGlobal(API_NAME$2) || NOOP_METER_PROVIDER; + } + /** + * Returns a meter from the global meter provider. + */ + getMeter(name, version$1, options) { + return this.getMeterProvider().getMeter(name, version$1, options); + } + /** Remove the global meter provider */ + disable() { + unregisterGlobal(API_NAME$2, DiagAPI.instance()); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics-api.js +var metrics; +var init_metrics_api = __esmMin((() => { + init_metrics(); + metrics = MetricsAPI.getInstance(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js +var NoopTextMapPropagator; +var init_NoopTextMapPropagator = __esmMin((() => { + NoopTextMapPropagator = class { + /** Noop inject function does nothing */ + inject(_context, _carrier) {} + /** Noop extract function does nothing and returns the input context */ + extract(context$1, _carrier) { + return context$1; + } + fields() { + return []; + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js +/** +* Retrieve the current baggage from the given context +* +* @param {Context} Context that manage all context values +* @returns {Baggage} Extracted baggage from the context +*/ +function getBaggage(context$1) { + return context$1.getValue(BAGGAGE_KEY) || void 0; +} +/** +* Retrieve the current baggage from the active/current context +* +* @returns {Baggage} Extracted baggage from the context +*/ +function getActiveBaggage() { + return getBaggage(ContextAPI.getInstance().active()); +} +/** +* Store a baggage in the given context +* +* @param {Context} Context that manage all context values +* @param {Baggage} baggage that will be set in the actual context +*/ +function setBaggage(context$1, baggage) { + return context$1.setValue(BAGGAGE_KEY, baggage); +} +/** +* Delete the baggage stored in the given context +* +* @param {Context} Context that manage all context values +*/ +function deleteBaggage(context$1) { + return context$1.deleteValue(BAGGAGE_KEY); +} +var BAGGAGE_KEY; +var init_context_helpers = __esmMin((() => { + init_context(); + init_context$1(); + BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key"); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/propagation.js +var API_NAME$1, NOOP_TEXT_MAP_PROPAGATOR, PropagationAPI; +var init_propagation = __esmMin((() => { + init_global_utils(); + init_NoopTextMapPropagator(); + init_TextMapPropagator(); + init_context_helpers(); + init_utils$2(); + init_diag(); + API_NAME$1 = "propagation"; + NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); + PropagationAPI = class PropagationAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { + this.createBaggage = createBaggage; + this.getBaggage = getBaggage; + this.getActiveBaggage = getActiveBaggage; + this.setBaggage = setBaggage; + this.deleteBaggage = deleteBaggage; + } + /** Get the singleton instance of the Propagator API */ + static getInstance() { + if (!this._instance) this._instance = new PropagationAPI(); + return this._instance; + } + /** + * Set the current propagator. + * + * @returns true if the propagator was successfully registered, else false + */ + setGlobalPropagator(propagator) { + return registerGlobal(API_NAME$1, propagator, DiagAPI.instance()); + } + /** + * Inject context into a carrier to be propagated inter-process + * + * @param context Context carrying tracing data to inject + * @param carrier carrier to inject context into + * @param setter Function used to set values on the carrier + */ + inject(context$1, carrier, setter = defaultTextMapSetter) { + return this._getGlobalPropagator().inject(context$1, carrier, setter); + } + /** + * Extract context from a carrier + * + * @param context Context which the newly created context will inherit from + * @param carrier Carrier to extract context from + * @param getter Function used to extract keys from a carrier + */ + extract(context$1, carrier, getter = defaultTextMapGetter) { + return this._getGlobalPropagator().extract(context$1, carrier, getter); + } + /** + * Return a list of all fields which may be used by the propagator. + */ + fields() { + return this._getGlobalPropagator().fields(); + } + /** Remove the global propagator */ + disable() { + unregisterGlobal(API_NAME$1, DiagAPI.instance()); + } + _getGlobalPropagator() { + return getGlobal(API_NAME$1) || NOOP_TEXT_MAP_PROPAGATOR; + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation-api.js +var propagation; +var init_propagation_api = __esmMin((() => { + init_propagation(); + propagation = PropagationAPI.getInstance(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js +var API_NAME, TraceAPI; +var init_trace$1 = __esmMin((() => { + init_global_utils(); + init_ProxyTracerProvider(); + init_spancontext_utils(); + init_context_utils(); + init_diag(); + API_NAME = "trace"; + TraceAPI = class TraceAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { + this._proxyTracerProvider = new ProxyTracerProvider(); + this.wrapSpanContext = wrapSpanContext; + this.isSpanContextValid = isSpanContextValid; + this.deleteSpan = deleteSpan; + this.getSpan = getSpan; + this.getActiveSpan = getActiveSpan; + this.getSpanContext = getSpanContext; + this.setSpan = setSpan; + this.setSpanContext = setSpanContext; + } + /** Get the singleton instance of the Trace API */ + static getInstance() { + if (!this._instance) this._instance = new TraceAPI(); + return this._instance; + } + /** + * Set the current global tracer. + * + * @returns true if the tracer provider was successfully registered, else false + */ + setGlobalTracerProvider(provider) { + const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance()); + if (success) this._proxyTracerProvider.setDelegate(provider); + return success; + } + /** + * Returns the global tracer provider. + */ + getTracerProvider() { + return getGlobal(API_NAME) || this._proxyTracerProvider; + } + /** + * Returns a tracer from the global tracer provider. + */ + getTracer(name, version$1) { + return this.getTracerProvider().getTracer(name, version$1); + } + /** Remove the global tracer provider */ + disable() { + unregisterGlobal(API_NAME, DiagAPI.instance()); + this._proxyTracerProvider = new ProxyTracerProvider(); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js +var trace; +var init_trace_api = __esmMin((() => { + init_trace$1(); + trace = TraceAPI.getInstance(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/index.js +var esm_exports$2 = /* @__PURE__ */ __exportAll({ + DiagConsoleLogger: () => DiagConsoleLogger, + DiagLogLevel: () => DiagLogLevel, + INVALID_SPANID: () => INVALID_SPANID, + INVALID_SPAN_CONTEXT: () => INVALID_SPAN_CONTEXT, + INVALID_TRACEID: () => INVALID_TRACEID, + ProxyTracer: () => ProxyTracer, + ProxyTracerProvider: () => ProxyTracerProvider, + ROOT_CONTEXT: () => ROOT_CONTEXT, + SamplingDecision: () => SamplingDecision, + SpanKind: () => SpanKind, + SpanStatusCode: () => SpanStatusCode, + TraceFlags: () => TraceFlags, + ValueType: () => ValueType, + baggageEntryMetadataFromString: () => baggageEntryMetadataFromString, + context: () => context, + createContextKey: () => createContextKey, + createNoopMeter: () => createNoopMeter, + createTraceState: () => createTraceState, + default: () => esm_default, + defaultTextMapGetter: () => defaultTextMapGetter, + defaultTextMapSetter: () => defaultTextMapSetter, + diag: () => diag, + isSpanContextValid: () => isSpanContextValid, + isValidSpanId: () => isValidSpanId, + isValidTraceId: () => isValidTraceId, + metrics: () => metrics, + propagation: () => propagation, + trace: () => trace +}); +var esm_default; +var init_esm$2 = __esmMin((() => { + init_utils$2(); + init_context$1(); + init_consoleLogger(); + init_types$1(); + init_NoopMeter(); + init_Metric(); + init_TextMapPropagator(); + init_ProxyTracer(); + init_ProxyTracerProvider(); + init_SamplingResult(); + init_span_kind(); + init_status(); + init_trace_flags(); + init_utils$1(); + init_spancontext_utils(); + init_invalid_span_constants(); + init_context_api(); + init_diag_api(); + init_metrics_api(); + init_propagation_api(); + init_trace_api(); + esm_default = { + context, + diag, + metrics, + propagation, + trace + }; +})); + +//#endregion +//#region node_modules/.pnpm/@langfuse+core@5.4.1_@opentelemetry+api@1.9.1/node_modules/@langfuse/core/dist/index.mjs +init_esm$2(); +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); +}; +function getEnv(key) { + if (typeof process !== "undefined" && process.env[key]) return process.env[key]; + else if (typeof globalThis !== "undefined") return globalThis[key]; +} +function base64ToBytes(base64$1) { + const binString = atob(base64$1); + return Uint8Array.from(binString, (m) => m.codePointAt(0)); +} +function bytesToBase64(bytes) { + const binString = Array.from(bytes, (byte) => String.fromCharCode(byte)).join(""); + return btoa(binString); +} +function base64Encode(input) { + if (typeof Buffer !== "undefined") return Buffer.from(input, "utf8").toString("base64"); + return bytesToBase64(new TextEncoder().encode(input)); +} +var LogLevel = /* @__PURE__ */ ((LogLevel2) => { + LogLevel2[LogLevel2["NONE"] = 4] = "NONE"; + LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR"; + LogLevel2[LogLevel2["WARN"] = 2] = "WARN"; + LogLevel2[LogLevel2["INFO"] = 1] = "INFO"; + LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG"; + return LogLevel2; +})(LogLevel || {}); +function parseLogLevelFromEnv() { + var _a2; + if (typeof process === "object" && "env" in process) { + if (((_a2 = getEnv("LANGFUSE_DEBUG")) == null ? void 0 : _a2.toLowerCase()) === "true") return 0; + const envValue = getEnv("LANGFUSE_LOG_LEVEL"); + switch ((envValue != null ? envValue : "").toUpperCase()) { + case "NONE": return 4; + case "ERROR": return 3; + case "WARN": return 2; + case "INFO": return 1; + case "DEBUG": return 0; + default: return; + } + } +} +var Logger = class { + /** + * Creates a new Logger instance. + * + * @param config - Configuration options for the logger + */ + constructor(config$1 = { level: 1 }) { + this.config = { + enableTimestamp: true, + ...config$1 + }; + } + /** + * Determines if a message should be logged based on the current log level. + * + * @param level - The log level to check + * @returns True if the message should be logged, false otherwise + */ + shouldLog(level) { + return level >= this.config.level; + } + /** + * Formats a log message with timestamp, prefix, and log level. + * + * @param level - The log level string + * @param message - The message to format + * @returns The formatted message string + */ + formatMessage(level, message) { + return [ + this.config.enableTimestamp ? (/* @__PURE__ */ new Date()).toISOString() : "", + this.config.prefix || "[Langfuse SDK]", + `[${level}]`, + message + ].filter(Boolean).join(" "); + } + /** + * Logs an error message. + * + * @param message - The error message to log + * @param args - Additional arguments to pass to console.error + */ + error(message, ...args) { + if (this.shouldLog(3)) console.error(this.formatMessage("ERROR", message), ...args); + } + /** + * Logs a warning message. + * + * @param message - The warning message to log + * @param args - Additional arguments to pass to console.warn + */ + warn(message, ...args) { + if (this.shouldLog(2)) console.warn(this.formatMessage("WARN", message), ...args); + } + /** + * Logs an informational message. + * + * @param message - The info message to log + * @param args - Additional arguments to pass to console.info + */ + info(message, ...args) { + if (this.shouldLog(1)) console.info(this.formatMessage("INFO", message), ...args); + } + /** + * Logs a debug message. + * + * @param message - The debug message to log + * @param args - Additional arguments to pass to console.debug + */ + debug(message, ...args) { + if (this.shouldLog(0)) console.debug(this.formatMessage("DEBUG", message), ...args); + } + /** + * Sets the minimum log level. + * + * @param level - The new log level + */ + setLevel(level) { + this.config.level = level; + } + /** + * Gets the current log level. + * + * @returns The current log level + */ + getLevel() { + return this.config.level; + } + /** + * Checks if a given log level is enabled. + * Use this to guard expensive operations (like JSON.stringify) before debug logging. + * + * @param level - The log level to check + * @returns True if the level is enabled, false otherwise + * + * @example + * ```typescript + * if (logger.isLevelEnabled(LogLevel.DEBUG)) { + * logger.debug('Expensive data:', JSON.stringify(largeObject)); + * } + * ``` + */ + isLevelEnabled(level) { + return this.shouldLog(level); + } +}; +var _a; +var _LoggerSingleton = class _LoggerSingleton$1 { + /** + * Gets the singleton logger instance, creating it if it doesn't exist. + * + * @returns The singleton logger instance + */ + static getInstance() { + if (!_LoggerSingleton$1.instance) _LoggerSingleton$1.instance = new Logger(_LoggerSingleton$1.defaultConfig); + return _LoggerSingleton$1.instance; + } + /** + * Configures the global logger with new settings. + * This will replace the existing logger instance. + * + * @param config - The new logger configuration + */ + static configure(config$1) { + _LoggerSingleton$1.defaultConfig = config$1; + _LoggerSingleton$1.instance = new Logger(config$1); + } + /** + * Resets the singleton logger instance and configuration. + * Useful for testing or reinitializing the logger. + */ + static reset() { + _LoggerSingleton$1.instance = null; + _LoggerSingleton$1.defaultConfig = { level: 1 }; + } +}; +_LoggerSingleton.instance = null; +_LoggerSingleton.defaultConfig = { level: (_a = parseLogLevelFromEnv()) != null ? _a : 1 }; +var LoggerSingleton = _LoggerSingleton; +var getGlobalLogger = () => { + return LoggerSingleton.getInstance(); +}; +var package_default = { + name: "@langfuse/core", + version: "5.4.1", + description: "Core functions and utilities for Langfuse packages", + type: "module", + sideEffects: false, + main: "./dist/index.cjs", + module: "./dist/index.mjs", + types: "./dist/index.d.ts", + exports: { ".": { + types: "./dist/index.d.ts", + import: "./dist/index.mjs", + require: "./dist/index.cjs" + } }, + scripts: { + build: "tsup", + test: "vitest run", + "test:watch": "vitest", + format: "prettier --write \"src/**/*.ts\"", + "format:check": "prettier --check \"src/**/*.ts\"", + clean: "rm -rf dist" + }, + author: "Langfuse", + license: "MIT", + repository: { + type: "git", + url: "https://github.com/langfuse/langfuse-js.git", + directory: "packages/core" + }, + files: ["dist"], + peerDependencies: { "@opentelemetry/api": "^1.9.0" }, + devDependencies: { "@types/node": "^24.1.0" } +}; +var LANGFUSE_TRACER_NAME = "langfuse-sdk"; +var LANGFUSE_SDK_VERSION = package_default.version; +var LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT = "sdk-experiment"; +var LangfuseOtelSpanAttributes = /* @__PURE__ */ ((LangfuseOtelSpanAttributes2) => { + LangfuseOtelSpanAttributes2["TRACE_NAME"] = "langfuse.trace.name"; + LangfuseOtelSpanAttributes2["TRACE_USER_ID"] = "user.id"; + LangfuseOtelSpanAttributes2["TRACE_SESSION_ID"] = "session.id"; + LangfuseOtelSpanAttributes2["TRACE_TAGS"] = "langfuse.trace.tags"; + LangfuseOtelSpanAttributes2["TRACE_PUBLIC"] = "langfuse.trace.public"; + LangfuseOtelSpanAttributes2["TRACE_METADATA"] = "langfuse.trace.metadata"; + LangfuseOtelSpanAttributes2["TRACE_INPUT"] = "langfuse.trace.input"; + LangfuseOtelSpanAttributes2["TRACE_OUTPUT"] = "langfuse.trace.output"; + LangfuseOtelSpanAttributes2["OBSERVATION_TYPE"] = "langfuse.observation.type"; + LangfuseOtelSpanAttributes2["OBSERVATION_METADATA"] = "langfuse.observation.metadata"; + LangfuseOtelSpanAttributes2["OBSERVATION_LEVEL"] = "langfuse.observation.level"; + LangfuseOtelSpanAttributes2["OBSERVATION_STATUS_MESSAGE"] = "langfuse.observation.status_message"; + LangfuseOtelSpanAttributes2["OBSERVATION_INPUT"] = "langfuse.observation.input"; + LangfuseOtelSpanAttributes2["OBSERVATION_OUTPUT"] = "langfuse.observation.output"; + LangfuseOtelSpanAttributes2["OBSERVATION_COMPLETION_START_TIME"] = "langfuse.observation.completion_start_time"; + LangfuseOtelSpanAttributes2["OBSERVATION_MODEL"] = "langfuse.observation.model.name"; + LangfuseOtelSpanAttributes2["OBSERVATION_MODEL_PARAMETERS"] = "langfuse.observation.model.parameters"; + LangfuseOtelSpanAttributes2["OBSERVATION_USAGE_DETAILS"] = "langfuse.observation.usage_details"; + LangfuseOtelSpanAttributes2["OBSERVATION_COST_DETAILS"] = "langfuse.observation.cost_details"; + LangfuseOtelSpanAttributes2["OBSERVATION_PROMPT_NAME"] = "langfuse.observation.prompt.name"; + LangfuseOtelSpanAttributes2["OBSERVATION_PROMPT_VERSION"] = "langfuse.observation.prompt.version"; + LangfuseOtelSpanAttributes2["ENVIRONMENT"] = "langfuse.environment"; + LangfuseOtelSpanAttributes2["RELEASE"] = "langfuse.release"; + LangfuseOtelSpanAttributes2["VERSION"] = "langfuse.version"; + LangfuseOtelSpanAttributes2["AS_ROOT"] = "langfuse.internal.as_root"; + LangfuseOtelSpanAttributes2["IS_APP_ROOT"] = "langfuse.internal.is_app_root"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ID"] = "langfuse.experiment.id"; + LangfuseOtelSpanAttributes2["EXPERIMENT_NAME"] = "langfuse.experiment.name"; + LangfuseOtelSpanAttributes2["EXPERIMENT_DESCRIPTION"] = "langfuse.experiment.description"; + LangfuseOtelSpanAttributes2["EXPERIMENT_METADATA"] = "langfuse.experiment.metadata"; + LangfuseOtelSpanAttributes2["EXPERIMENT_DATASET_ID"] = "langfuse.experiment.dataset.id"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_ID"] = "langfuse.experiment.item.id"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_EXPECTED_OUTPUT"] = "langfuse.experiment.item.expected_output"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_METADATA"] = "langfuse.experiment.item.metadata"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_ROOT_OBSERVATION_ID"] = "langfuse.experiment.item.root_observation_id"; + LangfuseOtelSpanAttributes2["TRACE_COMPAT_USER_ID"] = "langfuse.user.id"; + LangfuseOtelSpanAttributes2["TRACE_COMPAT_SESSION_ID"] = "langfuse.session.id"; + return LangfuseOtelSpanAttributes2; +})(LangfuseOtelSpanAttributes || {}); +var annotationQueues_exports = {}; +__export(annotationQueues_exports, { + AnnotationQueueObjectType: () => AnnotationQueueObjectType, + AnnotationQueueStatus: () => AnnotationQueueStatus +}); +var AnnotationQueueStatus = { + Pending: "PENDING", + Completed: "COMPLETED" +}; +var AnnotationQueueObjectType = { + Trace: "TRACE", + Observation: "OBSERVATION", + Session: "SESSION" +}; +var blobStorageIntegrations_exports = {}; +__export(blobStorageIntegrations_exports, { + BlobStorageExportFieldGroup: () => BlobStorageExportFieldGroup, + BlobStorageExportFrequency: () => BlobStorageExportFrequency, + BlobStorageExportMode: () => BlobStorageExportMode, + BlobStorageExportSource: () => BlobStorageExportSource, + BlobStorageIntegrationFileType: () => BlobStorageIntegrationFileType, + BlobStorageIntegrationType: () => BlobStorageIntegrationType, + BlobStorageSyncStatus: () => BlobStorageSyncStatus +}); +var BlobStorageIntegrationType = { + S3: "S3", + S3Compatible: "S3_COMPATIBLE", + AzureBlobStorage: "AZURE_BLOB_STORAGE" +}; +var BlobStorageIntegrationFileType = { + Json: "JSON", + Csv: "CSV", + Jsonl: "JSONL" +}; +var BlobStorageExportMode = { + FullHistory: "FULL_HISTORY", + FromToday: "FROM_TODAY", + FromCustomDate: "FROM_CUSTOM_DATE" +}; +var BlobStorageExportFrequency = { + Every20Minutes: "every_20_minutes", + Hourly: "hourly", + Daily: "daily", + Weekly: "weekly" +}; +var BlobStorageExportSource = { + LegacyTracesObservations: "LEGACY_TRACES_OBSERVATIONS", + ObservationsV2: "OBSERVATIONS_V2", + LegacyTracesAndEnrichedObservations: "LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS" +}; +var BlobStorageExportFieldGroup = { + Core: "core", + Basic: "basic", + Time: "time", + Io: "io", + Metadata: "metadata", + Model: "model", + Usage: "usage", + Prompt: "prompt", + Metrics: "metrics", + Tools: "tools", + TraceContext: "trace_context" +}; +var BlobStorageSyncStatus = { + Idle: "idle", + Queued: "queued", + UpToDate: "up_to_date", + Disabled: "disabled", + Error: "error" +}; +var commons_exports = {}; +__export(commons_exports, { + AccessDeniedError: () => AccessDeniedError, + CommentObjectType: () => CommentObjectType, + DatasetStatus: () => DatasetStatus, + Error: () => Error2, + MethodNotAllowedError: () => MethodNotAllowedError, + ModelUsageUnit: () => ModelUsageUnit, + NotFoundError: () => NotFoundError, + ObservationLevel: () => ObservationLevel, + PricingTierOperator: () => PricingTierOperator, + ScoreConfigDataType: () => ScoreConfigDataType, + ScoreDataType: () => ScoreDataType, + ScoreSource: () => ScoreSource, + UnauthorizedError: () => UnauthorizedError +}); +var PricingTierOperator = { + Gt: "gt", + Gte: "gte", + Lt: "lt", + Lte: "lte", + Eq: "eq", + Neq: "neq" +}; +var ModelUsageUnit = { + Characters: "CHARACTERS", + Tokens: "TOKENS", + Milliseconds: "MILLISECONDS", + Seconds: "SECONDS", + Images: "IMAGES", + Requests: "REQUESTS" +}; +var ObservationLevel = { + Debug: "DEBUG", + Default: "DEFAULT", + Warning: "WARNING", + Error: "ERROR" +}; +var CommentObjectType = { + Trace: "TRACE", + Observation: "OBSERVATION", + Session: "SESSION", + Prompt: "PROMPT" +}; +var DatasetStatus = { + Active: "ACTIVE", + Archived: "ARCHIVED" +}; +var ScoreSource = { + Annotation: "ANNOTATION", + Api: "API", + Eval: "EVAL" +}; +var ScoreConfigDataType = { + Numeric: "NUMERIC", + Boolean: "BOOLEAN", + Categorical: "CATEGORICAL", + Text: "TEXT" +}; +var ScoreDataType = { + Numeric: "NUMERIC", + Boolean: "BOOLEAN", + Categorical: "CATEGORICAL", + Correction: "CORRECTION", + Text: "TEXT" +}; +var toJson = (value, replacer, space) => { + return JSON.stringify(value, replacer, space); +}; +function fromJson(text, reviver) { + return JSON.parse(text, reviver); +} +var LangfuseAPIError = class _LangfuseAPIError extends Error { + constructor({ message, statusCode, body, rawResponse }) { + super(buildMessage({ + message, + statusCode, + body + })); + Object.setPrototypeOf(this, _LangfuseAPIError.prototype); + this.statusCode = statusCode; + this.body = body; + this.rawResponse = rawResponse; + } +}; +function buildMessage({ message, statusCode, body }) { + let lines = []; + if (message != null) lines.push(message); + if (statusCode != null) lines.push(`Status code: ${statusCode.toString()}`); + if (body != null) lines.push(`Body: ${toJson(body, void 0, 2)}`); + return lines.join("\n"); +} +var LangfuseAPITimeoutError = class _LangfuseAPITimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, _LangfuseAPITimeoutError.prototype); + } +}; +var Error2 = class _Error extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "Error", + statusCode: 400, + body, + rawResponse + }); + Object.setPrototypeOf(this, _Error.prototype); + } +}; +var UnauthorizedError = class _UnauthorizedError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "UnauthorizedError", + statusCode: 401, + body, + rawResponse + }); + Object.setPrototypeOf(this, _UnauthorizedError.prototype); + } +}; +var AccessDeniedError = class _AccessDeniedError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "AccessDeniedError", + statusCode: 403, + body, + rawResponse + }); + Object.setPrototypeOf(this, _AccessDeniedError.prototype); + } +}; +var NotFoundError = class _NotFoundError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "NotFoundError", + statusCode: 404, + body, + rawResponse + }); + Object.setPrototypeOf(this, _NotFoundError.prototype); + } +}; +var MethodNotAllowedError = class _MethodNotAllowedError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "MethodNotAllowedError", + statusCode: 405, + body, + rawResponse + }); + Object.setPrototypeOf(this, _MethodNotAllowedError.prototype); + } +}; +var health_exports = {}; +__export(health_exports, { ServiceUnavailableError: () => ServiceUnavailableError }); +var ServiceUnavailableError = class _ServiceUnavailableError extends LangfuseAPIError { + constructor(rawResponse) { + super({ + message: "ServiceUnavailableError", + statusCode: 503, + rawResponse + }); + Object.setPrototypeOf(this, _ServiceUnavailableError.prototype); + } +}; +var ingestion_exports = {}; +__export(ingestion_exports, { ObservationType: () => ObservationType }); +var ObservationType = { + Span: "SPAN", + Generation: "GENERATION", + Event: "EVENT", + Agent: "AGENT", + Tool: "TOOL", + Chain: "CHAIN", + Retriever: "RETRIEVER", + Evaluator: "EVALUATOR", + Embedding: "EMBEDDING", + Guardrail: "GUARDRAIL" +}; +var legacy_exports = {}; +__export(legacy_exports, { + CreateScoreSource: () => CreateScoreSource, + metricsV1: () => metricsV1_exports, + observationsV1: () => observationsV1_exports, + scoreV1: () => scoreV1_exports +}); +var metricsV1_exports = {}; +var observationsV1_exports = {}; +var scoreV1_exports = {}; +__export(scoreV1_exports, { CreateScoreSource: () => CreateScoreSource }); +var CreateScoreSource = { + Api: "API", + Annotation: "ANNOTATION" +}; +var llmConnections_exports = {}; +__export(llmConnections_exports, { LlmAdapter: () => LlmAdapter }); +var LlmAdapter = { + Anthropic: "anthropic", + OpenAi: "openai", + Azure: "azure", + Bedrock: "bedrock", + GoogleVertexAi: "google-vertex-ai", + GoogleAiStudio: "google-ai-studio" +}; +var media_exports = {}; +__export(media_exports, { MediaContentType: () => MediaContentType }); +var MediaContentType = { + ImagePng: "image/png", + ImageJpeg: "image/jpeg", + ImageJpg: "image/jpg", + ImageWebp: "image/webp", + ImageGif: "image/gif", + ImageSvgXml: "image/svg+xml", + ImageTiff: "image/tiff", + ImageBmp: "image/bmp", + ImageAvif: "image/avif", + ImageHeic: "image/heic", + AudioMpeg: "audio/mpeg", + AudioMp3: "audio/mp3", + AudioWav: "audio/wav", + AudioOgg: "audio/ogg", + AudioOga: "audio/oga", + AudioAac: "audio/aac", + AudioMp4: "audio/mp4", + AudioFlac: "audio/flac", + AudioOpus: "audio/opus", + AudioWebm: "audio/webm", + VideoMp4: "video/mp4", + VideoWebm: "video/webm", + VideoOgg: "video/ogg", + VideoMpeg: "video/mpeg", + VideoQuicktime: "video/quicktime", + VideoXMsvideo: "video/x-msvideo", + VideoXMatroska: "video/x-matroska", + TextPlain: "text/plain", + TextHtml: "text/html", + TextCss: "text/css", + TextCsv: "text/csv", + TextMarkdown: "text/markdown", + TextXPython: "text/x-python", + ApplicationJavascript: "application/javascript", + TextXTypescript: "text/x-typescript", + ApplicationXYaml: "application/x-yaml", + ApplicationPdf: "application/pdf", + ApplicationMsword: "application/msword", + ApplicationMsExcel: "application/vnd.ms-excel", + ApplicationOpenxmlSpreadsheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + ApplicationZip: "application/zip", + ApplicationJson: "application/json", + ApplicationXml: "application/xml", + ApplicationOctetStream: "application/octet-stream", + ApplicationOpenxmlWord: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + ApplicationOpenxmlPresentation: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + ApplicationRtf: "application/rtf", + ApplicationXNdjson: "application/x-ndjson", + ApplicationParquet: "application/vnd.apache.parquet", + ApplicationGzip: "application/gzip", + ApplicationXTar: "application/x-tar", + ApplicationX7ZCompressed: "application/x-7z-compressed" +}; +var organizations_exports = {}; +__export(organizations_exports, { MembershipRole: () => MembershipRole }); +var MembershipRole = { + Owner: "OWNER", + Admin: "ADMIN", + Member: "MEMBER", + Viewer: "VIEWER" +}; +var prompts_exports = {}; +__export(prompts_exports, { + ChatMessageType: () => ChatMessageType, + CreateChatPromptType: () => CreateChatPromptType, + CreateTextPromptType: () => CreateTextPromptType, + PlaceholderMessageType: () => PlaceholderMessageType, + PromptType: () => PromptType +}); +var PromptType = { + Chat: "chat", + Text: "text" +}; +var ChatMessageType = { Chatmessage: "chatmessage" }; +var PlaceholderMessageType = { Placeholder: "placeholder" }; +var CreateChatPromptType = { Chat: "chat" }; +var CreateTextPromptType = { Text: "text" }; +var unstable_exports = {}; +__export(unstable_exports, { + AccessDeniedError: () => AccessDeniedError2, + BadRequestError: () => BadRequestError, + ConflictError: () => ConflictError, + EvaluationRuleArrayOptionsFilterOperator: () => EvaluationRuleArrayOptionsFilterOperator, + EvaluationRuleBooleanFilterOperator: () => EvaluationRuleBooleanFilterOperator, + EvaluationRuleMappingSource: () => EvaluationRuleMappingSource, + EvaluationRuleNullFilterOperator: () => EvaluationRuleNullFilterOperator, + EvaluationRuleNumberFilterOperator: () => EvaluationRuleNumberFilterOperator, + EvaluationRuleOptionsFilterOperator: () => EvaluationRuleOptionsFilterOperator, + EvaluationRuleStatus: () => EvaluationRuleStatus, + EvaluationRuleStringFilterOperator: () => EvaluationRuleStringFilterOperator, + EvaluationRuleTarget: () => EvaluationRuleTarget, + EvaluatorOutputDataType: () => EvaluatorOutputDataType, + EvaluatorScope: () => EvaluatorScope, + EvaluatorType: () => EvaluatorType, + InternalServerError: () => InternalServerError, + MethodNotAllowedError: () => MethodNotAllowedError2, + NotFoundError: () => NotFoundError2, + PublicApiErrorCode: () => PublicApiErrorCode, + TooManyRequestsError: () => TooManyRequestsError, + UnauthorizedError: () => UnauthorizedError2, + UnprocessableContentError: () => UnprocessableContentError, + commons: () => commons_exports2, + errors: () => errors_exports2, + evaluationRules: () => evaluationRules_exports, + evaluators: () => evaluators_exports +}); +var commons_exports2 = {}; +__export(commons_exports2, { + EvaluationRuleArrayOptionsFilterOperator: () => EvaluationRuleArrayOptionsFilterOperator, + EvaluationRuleBooleanFilterOperator: () => EvaluationRuleBooleanFilterOperator, + EvaluationRuleMappingSource: () => EvaluationRuleMappingSource, + EvaluationRuleNullFilterOperator: () => EvaluationRuleNullFilterOperator, + EvaluationRuleNumberFilterOperator: () => EvaluationRuleNumberFilterOperator, + EvaluationRuleOptionsFilterOperator: () => EvaluationRuleOptionsFilterOperator, + EvaluationRuleStatus: () => EvaluationRuleStatus, + EvaluationRuleStringFilterOperator: () => EvaluationRuleStringFilterOperator, + EvaluationRuleTarget: () => EvaluationRuleTarget, + EvaluatorOutputDataType: () => EvaluatorOutputDataType, + EvaluatorScope: () => EvaluatorScope, + EvaluatorType: () => EvaluatorType +}); +var EvaluatorType = { LlmAsJudge: "llm_as_judge" }; +var EvaluatorScope = { + Project: "project", + Managed: "managed" +}; +var EvaluationRuleTarget = { + Observation: "observation", + Experiment: "experiment" +}; +var EvaluationRuleStatus = { + Active: "active", + Inactive: "inactive", + Paused: "paused" +}; +var EvaluationRuleMappingSource = { + Input: "input", + Output: "output", + Metadata: "metadata", + ExpectedOutput: "expected_output", + ExperimentItemMetadata: "experiment_item_metadata" +}; +var EvaluatorOutputDataType = { + Numeric: "NUMERIC", + Boolean: "BOOLEAN", + Categorical: "CATEGORICAL" +}; +var EvaluationRuleStringFilterOperator = { + Equals: "=", + Contains: "contains", + DoesNotContain: "does not contain", + StartsWith: "starts with", + EndsWith: "ends with" +}; +var EvaluationRuleNumberFilterOperator = { + Equals: "=", + GreaterThan: ">", + LessThan: "<", + GreaterThanOrEqual: ">=", + LessThanOrEqual: "<=" +}; +var EvaluationRuleOptionsFilterOperator = { + AnyOf: "any of", + NoneOf: "none of" +}; +var EvaluationRuleArrayOptionsFilterOperator = { + AnyOf: "any of", + NoneOf: "none of", + AllOf: "all of" +}; +var EvaluationRuleBooleanFilterOperator = { + Equals: "=", + NotEquals: "<>" +}; +var EvaluationRuleNullFilterOperator = { + IsNull: "is null", + IsNotNull: "is not null" +}; +var errors_exports2 = {}; +__export(errors_exports2, { + AccessDeniedError: () => AccessDeniedError2, + BadRequestError: () => BadRequestError, + ConflictError: () => ConflictError, + InternalServerError: () => InternalServerError, + MethodNotAllowedError: () => MethodNotAllowedError2, + NotFoundError: () => NotFoundError2, + PublicApiErrorCode: () => PublicApiErrorCode, + TooManyRequestsError: () => TooManyRequestsError, + UnauthorizedError: () => UnauthorizedError2, + UnprocessableContentError: () => UnprocessableContentError +}); +var PublicApiErrorCode = { + AuthenticationFailed: "authentication_failed", + AccessDenied: "access_denied", + InvalidRequest: "invalid_request", + InvalidQuery: "invalid_query", + InvalidBody: "invalid_body", + InvalidFilterValue: "invalid_filter_value", + InvalidJsonPath: "invalid_json_path", + InvalidVariableMapping: "invalid_variable_mapping", + MissingVariableMapping: "missing_variable_mapping", + DuplicateVariableMapping: "duplicate_variable_mapping", + ResourceNotFound: "resource_not_found", + NameConflict: "name_conflict", + EvaluatorPreflightFailed: "evaluator_preflight_failed", + Conflict: "conflict", + UnprocessableContent: "unprocessable_content", + RateLimited: "rate_limited", + MethodNotAllowed: "method_not_allowed", + InternalError: "internal_error" +}; +var BadRequestError = class _BadRequestError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "BadRequestError", + statusCode: 400, + body, + rawResponse + }); + Object.setPrototypeOf(this, _BadRequestError.prototype); + } +}; +var UnauthorizedError2 = class _UnauthorizedError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "UnauthorizedError", + statusCode: 401, + body, + rawResponse + }); + Object.setPrototypeOf(this, _UnauthorizedError.prototype); + } +}; +var AccessDeniedError2 = class _AccessDeniedError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "AccessDeniedError", + statusCode: 403, + body, + rawResponse + }); + Object.setPrototypeOf(this, _AccessDeniedError.prototype); + } +}; +var NotFoundError2 = class _NotFoundError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "NotFoundError", + statusCode: 404, + body, + rawResponse + }); + Object.setPrototypeOf(this, _NotFoundError.prototype); + } +}; +var MethodNotAllowedError2 = class _MethodNotAllowedError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "MethodNotAllowedError", + statusCode: 405, + body, + rawResponse + }); + Object.setPrototypeOf(this, _MethodNotAllowedError.prototype); + } +}; +var ConflictError = class _ConflictError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "ConflictError", + statusCode: 409, + body, + rawResponse + }); + Object.setPrototypeOf(this, _ConflictError.prototype); + } +}; +var UnprocessableContentError = class _UnprocessableContentError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "UnprocessableContentError", + statusCode: 422, + body, + rawResponse + }); + Object.setPrototypeOf(this, _UnprocessableContentError.prototype); + } +}; +var TooManyRequestsError = class _TooManyRequestsError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "TooManyRequestsError", + statusCode: 429, + body, + rawResponse + }); + Object.setPrototypeOf(this, _TooManyRequestsError.prototype); + } +}; +var InternalServerError = class _InternalServerError extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "InternalServerError", + statusCode: 500, + body, + rawResponse + }); + Object.setPrototypeOf(this, _InternalServerError.prototype); + } +}; +var evaluationRules_exports = {}; +var evaluators_exports = {}; +var utils_exports = {}; +__export(utils_exports, { pagination: () => pagination_exports }); +var pagination_exports = {}; +function mergeHeaders$1(...headersArray) { + const result = {}; + for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) if (value != null) result[key] = value; + else if (key in result) delete result[key]; + return result; +} +function mergeOnlyDefinedHeaders(...headersArray) { + const result = {}; + for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) if (value != null) result[key] = value; + return result; +} +var defaultQsOptions = { + arrayFormat: "indices", + encode: true +}; +function encodeValue(value, shouldEncode) { + if (value === void 0) return ""; + if (value === null) return ""; + const stringValue = String(value); + return shouldEncode ? encodeURIComponent(stringValue) : stringValue; +} +function stringifyObject(obj, prefix = "", options) { + const parts = []; + for (const [key, value] of Object.entries(obj)) { + const fullKey = prefix ? `${prefix}[${key}]` : key; + if (value === void 0) continue; + if (Array.isArray(value)) { + if (value.length === 0) continue; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + if (item === void 0) continue; + if (typeof item === "object" && !Array.isArray(item) && item !== null) { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + parts.push(...stringifyObject(item, arrayKey, options)); + } else { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; + parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } + } + } else if (typeof value === "object" && value !== null) { + if (Object.keys(value).length === 0) continue; + parts.push(...stringifyObject(value, fullKey, options)); + } else { + const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; + parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`); + } + } + return parts; +} +function toQueryString(obj, options) { + if (obj == null || typeof obj !== "object") return ""; + return stringifyObject(obj, "", { + ...defaultQsOptions, + ...options + }).join("&"); +} +function createRequestUrl(baseUrl, queryParameters) { + const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" }); + return queryString ? `${baseUrl}?${queryString}` : baseUrl; +} +function getBinaryResponse(response) { + const binaryResponse = { + get bodyUsed() { + return response.bodyUsed; + }, + stream: () => response.body, + arrayBuffer: response.arrayBuffer.bind(response), + blob: response.blob.bind(response) + }; + if ("bytes" in response && typeof response.bytes === "function") binaryResponse.bytes = response.bytes.bind(response); + return binaryResponse; +} +function isResponseWithBody(response) { + return response.body != null; +} +async function getResponseBody(response, responseType) { + if (!isResponseWithBody(response)) return; + switch (responseType) { + case "binary-response": return getBinaryResponse(response); + case "blob": return await response.blob(); + case "arrayBuffer": return await response.arrayBuffer(); + case "sse": return response.body; + case "streaming": return response.body; + case "text": return await response.text(); + } + const text = await response.text(); + if (text.length > 0) try { + return fromJson(text); + } catch (err) { + return { + ok: false, + error: { + reason: "non-json", + statusCode: response.status, + rawBody: text + } + }; + } +} +async function getErrorResponseBody(response) { + var _a2, _b, _c; + let contentType = (_a2 = response.headers.get("Content-Type")) == null ? void 0 : _a2.toLowerCase(); + if (contentType == null || contentType.length === 0) return getResponseBody(response); + if (contentType.indexOf(";") !== -1) contentType = (_c = (_b = contentType.split(";")[0]) == null ? void 0 : _b.trim()) != null ? _c : ""; + switch (contentType) { + case "application/hal+json": + case "application/json": + case "application/ld+json": + case "application/problem+json": + case "application/vnd.api+json": + case "text/json": + const text = await response.text(); + return text.length > 0 ? fromJson(text) : void 0; + default: + if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { + const text2 = await response.text(); + return text2.length > 0 ? fromJson(text2) : void 0; + } + return await response.text(); + } +} +async function getFetchFn() { + return fetch; +} +async function getRequestBody({ body, type }) { + if (type.includes("json")) return toJson(body); + else return body; +} +var TIMEOUT = "timeout"; +function getTimeoutSignal(timeoutMs) { + const controller = new AbortController(); + const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs); + return { + signal: controller.signal, + abortId + }; +} +function anySignal(...args) { + const signals = args.length === 1 && Array.isArray(args[0]) ? args[0] : args; + const controller = new AbortController(); + for (const signal of signals) { + if (signal.aborted) { + controller.abort(signal == null ? void 0 : signal.reason); + break; + } + signal.addEventListener("abort", () => controller.abort(signal == null ? void 0 : signal.reason), { signal: controller.signal }); + } + return controller.signal; +} +var makeRequest = async (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex) => { + const signals = []; + let timeoutAbortId = void 0; + if (timeoutMs != null) { + const { signal, abortId } = getTimeoutSignal(timeoutMs); + timeoutAbortId = abortId; + signals.push(signal); + } + if (abortSignal != null) signals.push(abortSignal); + const response = await fetchFn(url, { + method, + headers, + body: requestBody, + signal: anySignal(signals), + credentials: withCredentials ? "include" : void 0, + duplex + }); + if (timeoutAbortId != null) clearTimeout(timeoutAbortId); + return response; +}; +var Headers; +if (typeof globalThis.Headers !== "undefined") Headers = globalThis.Headers; +else Headers = class Headers2 { + constructor(init) { + this.headers = /* @__PURE__ */ new Map(); + if (init) if (init instanceof Headers2) init.forEach((value, key) => this.append(key, value)); + else if (Array.isArray(init)) for (const [key, value] of init) if (typeof key === "string" && typeof value === "string") this.append(key, value); + else throw new TypeError("Each header entry must be a [string, string] tuple"); + else for (const [key, value] of Object.entries(init)) if (typeof value === "string") this.append(key, value); + else throw new TypeError("Header values must be strings"); + } + append(name, value) { + const key = name.toLowerCase(); + const existing = this.headers.get(key) || []; + this.headers.set(key, [...existing, value]); + } + delete(name) { + const key = name.toLowerCase(); + this.headers.delete(key); + } + get(name) { + const key = name.toLowerCase(); + const values = this.headers.get(key); + return values ? values.join(", ") : null; + } + has(name) { + const key = name.toLowerCase(); + return this.headers.has(key); + } + set(name, value) { + const key = name.toLowerCase(); + this.headers.set(key, [value]); + } + forEach(callbackfn, thisArg) { + const boundCallback = thisArg ? callbackfn.bind(thisArg) : callbackfn; + this.headers.forEach((values, key) => boundCallback(values.join(", "), key, this)); + } + getSetCookie() { + return this.headers.get("set-cookie") || []; + } + *entries() { + for (const [key, values] of this.headers.entries()) yield [key, values.join(", ")]; + } + *keys() { + yield* this.headers.keys(); + } + *values() { + for (const values of this.headers.values()) yield values.join(", "); + } + [Symbol.iterator]() { + return this.entries(); + } +}; +var abortRawResponse = { + headers: new Headers(), + redirected: false, + status: 499, + statusText: "Client Closed Request", + type: "error", + url: "" +}; +var unknownRawResponse = { + headers: new Headers(), + redirected: false, + status: 0, + statusText: "Unknown Error", + type: "error", + url: "" +}; +function toRawResponse(response) { + return { + headers: response.headers, + redirected: response.redirected, + status: response.status, + statusText: response.statusText, + type: response.type, + url: response.url + }; +} +var INITIAL_RETRY_DELAY = 1e3; +var MAX_RETRY_DELAY = 6e4; +var DEFAULT_MAX_RETRIES = 2; +var JITTER_FACTOR = .2; +function addPositiveJitter(delay) { + return delay * (1 + Math.random() * JITTER_FACTOR); +} +function addSymmetricJitter(delay) { + return delay * (1 + (Math.random() - .5) * JITTER_FACTOR); +} +function getRetryDelayFromHeaders(response, retryAttempt) { + const retryAfter = response.headers.get("Retry-After"); + if (retryAfter) { + const retryAfterSeconds = parseInt(retryAfter, 10); + if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) return Math.min(retryAfterSeconds * 1e3, MAX_RETRY_DELAY); + const retryAfterDate = new Date(retryAfter); + if (!isNaN(retryAfterDate.getTime())) { + const delay = retryAfterDate.getTime() - Date.now(); + if (delay > 0) return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); + } + } + const rateLimitReset = response.headers.get("X-RateLimit-Reset"); + if (rateLimitReset) { + const resetTime = parseInt(rateLimitReset, 10); + if (!isNaN(resetTime)) { + const delay = resetTime * 1e3 - Date.now(); + if (delay > 0) return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); + } + } + return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY)); +} +async function requestWithRetries(requestFn, maxRetries = DEFAULT_MAX_RETRIES) { + let response = await requestFn(); + for (let i = 0; i < maxRetries; ++i) if ([408, 429].includes(response.status) || response.status >= 500) { + const delay = getRetryDelayFromHeaders(response, i); + await new Promise((resolve) => setTimeout(resolve, delay)); + response = await requestFn(); + } else break; + return response; +} +var Supplier = { get: async (supplier) => { + if (typeof supplier === "function") return supplier(); + else return supplier; +} }; +async function getHeaders(args) { + const newHeaders = {}; + if (args.body !== void 0 && args.contentType != null) newHeaders["Content-Type"] = args.contentType; + if (args.headers == null) return newHeaders; + for (const [key, value] of Object.entries(args.headers)) { + const result = await Supplier.get(value); + if (typeof result === "string") { + newHeaders[key] = result; + continue; + } + if (result == null) continue; + newHeaders[key] = `${result}`; + } + return newHeaders; +} +async function fetcherImpl(args) { + const url = createRequestUrl(args.url, args.queryParameters); + const requestBody = await getRequestBody({ + body: args.body, + type: args.requestType === "json" ? "json" : "other" + }); + const fetchFn = await getFetchFn(); + try { + const response = await requestWithRetries(async () => makeRequest(fetchFn, url, args.method, await getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex), args.maxRetries); + if (response.status >= 200 && response.status < 400) return { + ok: true, + body: await getResponseBody(response, args.responseType), + headers: response.headers, + rawResponse: toRawResponse(response) + }; + else return { + ok: false, + error: { + reason: "status-code", + statusCode: response.status, + body: await getErrorResponseBody(response) + }, + rawResponse: toRawResponse(response) + }; + } catch (error) { + if (args.abortSignal != null && args.abortSignal.aborted) return { + ok: false, + error: { + reason: "unknown", + errorMessage: "The user aborted a request" + }, + rawResponse: abortRawResponse + }; + else if (error instanceof Error && error.name === "AbortError") return { + ok: false, + error: { reason: "timeout" }, + rawResponse: abortRawResponse + }; + else if (error instanceof Error) return { + ok: false, + error: { + reason: "unknown", + errorMessage: error.message + }, + rawResponse: unknownRawResponse + }; + return { + ok: false, + error: { + reason: "unknown", + errorMessage: toJson(error) + }, + rawResponse: unknownRawResponse + }; + } +} +var fetcher = fetcherImpl; +var HttpResponsePromise = class _HttpResponsePromise extends Promise { + constructor(promise) { + super((resolve) => { + resolve(void 0); + }); + this.innerPromise = promise; + } + /** + * Creates an `HttpResponsePromise` from a function that returns a promise. + * + * @param fn - A function that returns a promise resolving to a `WithRawResponse` object. + * @param args - Arguments to pass to the function. + * @returns An `HttpResponsePromise` instance. + */ + static fromFunction(fn, ...args) { + return new _HttpResponsePromise(fn(...args)); + } + /** + * Creates a function that returns an `HttpResponsePromise` from a function that returns a promise. + * + * @param fn - A function that returns a promise resolving to a `WithRawResponse` object. + * @returns A function that returns an `HttpResponsePromise` instance. + */ + static interceptFunction(fn) { + return (...args) => { + return _HttpResponsePromise.fromPromise(fn(...args)); + }; + } + /** + * Creates an `HttpResponsePromise` from an existing promise. + * + * @param promise - A promise resolving to a `WithRawResponse` object. + * @returns An `HttpResponsePromise` instance. + */ + static fromPromise(promise) { + return new _HttpResponsePromise(promise); + } + /** + * Creates an `HttpResponsePromise` from an executor function. + * + * @param executor - A function that takes resolve and reject callbacks to create a promise. + * @returns An `HttpResponsePromise` instance. + */ + static fromExecutor(executor) { + return new _HttpResponsePromise(new Promise(executor)); + } + /** + * Creates an `HttpResponsePromise` from a resolved result. + * + * @param result - A `WithRawResponse` object to resolve immediately. + * @returns An `HttpResponsePromise` instance. + */ + static fromResult(result) { + return new _HttpResponsePromise(Promise.resolve(result)); + } + unwrap() { + if (!this.unwrappedPromise) this.unwrappedPromise = this.innerPromise.then(({ data }) => data); + return this.unwrappedPromise; + } + /** @inheritdoc */ + then(onfulfilled, onrejected) { + return this.unwrap().then(onfulfilled, onrejected); + } + /** @inheritdoc */ + catch(onrejected) { + return this.unwrap().catch(onrejected); + } + /** @inheritdoc */ + finally(onfinally) { + return this.unwrap().finally(onfinally); + } + /** + * Retrieves the data and raw response. + * + * @returns A promise resolving to a `WithRawResponse` object. + */ + async withRawResponse() { + return await this.innerPromise; + } +}; +var url_exports = {}; +__export(url_exports, { + join: () => join, + toQueryString: () => toQueryString +}); +function join(base, ...segments) { + if (!base) return ""; + if (segments.length === 0) return base; + if (base.includes("://")) { + let url; + try { + url = new URL(base); + } catch { + return joinPath(base, ...segments); + } + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/"); + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) url.pathname = joinPathSegments(url.pathname, cleanSegment); + } + if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) url.pathname += "/"; + return url.toString(); + } + return joinPath(base, ...segments); +} +function joinPath(base, ...segments) { + if (segments.length === 0) return base; + let result = base; + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/"); + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) result = joinPathSegments(result, cleanSegment); + } + if (shouldPreserveTrailingSlash && !result.endsWith("/")) result += "/"; + return result; +} +function joinPathSegments(left, right) { + if (left.endsWith("/")) return left + right; + return left + "/" + right; +} +function trimSlashes(str) { + if (!str) return str; + let start = 0; + let end = str.length; + if (str.startsWith("/")) start = 1; + if (str.endsWith("/")) end = str.length - 1; + return start === 0 && end === str.length ? str : str.slice(start, end); +} +function base64ToBytes2(base64$1) { + const binString = atob(base64$1); + return Uint8Array.from(binString, (m) => m.codePointAt(0)); +} +function bytesToBase642(bytes) { + const binString = String.fromCodePoint(...bytes); + return btoa(binString); +} +function base64Encode2(input) { + if (typeof Buffer !== "undefined") return Buffer.from(input, "utf8").toString("base64"); + return bytesToBase642(new TextEncoder().encode(input)); +} +function base64Decode2(input) { + if (typeof Buffer !== "undefined") return Buffer.from(input, "base64").toString("utf8"); + const bytes = base64ToBytes2(input); + return new TextDecoder().decode(bytes); +} +var BASIC_AUTH_HEADER_PREFIX = /^Basic /i; +var BasicAuth = { + toAuthorizationHeader: (basicAuth) => { + if (basicAuth == null) return; + return `Basic ${base64Encode2(`${basicAuth.username}:${basicAuth.password}`)}`; + }, + fromAuthorizationHeader: (header) => { + const [username, password] = base64Decode2(header.replace(BASIC_AUTH_HEADER_PREFIX, "")).split(":", 2); + if (username == null || password == null) throw new Error("Invalid basic auth"); + return { + username, + password + }; + } +}; +var AnnotationQueues = class { + constructor(_options) { + this._options = _options; + } + /** + * Get all annotation queues + * + * @param {LangfuseAPI.GetAnnotationQueuesRequest} request + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.listQueues() + */ + listQueues(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__listQueues(request, requestOptions)); + } + async __listQueues(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/annotation-queues"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create an annotation queue + * + * @param {LangfuseAPI.CreateAnnotationQueueRequest} request + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.createQueue({ + * name: "name", + * description: undefined, + * scoreConfigIds: ["scoreConfigIds", "scoreConfigIds"] + * }) + */ + createQueue(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createQueue(request, requestOptions)); + } + async __createQueue(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/annotation-queues"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get an annotation queue by ID + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.getQueue("queueId") + */ + getQueue(queueId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getQueue(queueId, requestOptions)); + } + async __getQueue(queueId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get items for a specific annotation queue + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {LangfuseAPI.GetAnnotationQueueItemsRequest} request + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.listQueueItems("queueId") + */ + listQueueItems(queueId, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__listQueueItems(queueId, request, requestOptions)); + } + async __listQueueItems(queueId, request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { status, page, limit } = request; + const _queryParams = {}; + if (status != null) _queryParams["status"] = status; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items`), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}/items."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a specific item from an annotation queue + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {string} itemId - The unique identifier of the annotation queue item + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.getQueueItem("queueId", "itemId") + */ + getQueueItem(queueId, itemId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getQueueItem(queueId, itemId, requestOptions)); + } + async __getQueueItem(queueId, itemId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}/items/{itemId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Add an item to an annotation queue + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {LangfuseAPI.CreateAnnotationQueueItemRequest} request + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.createQueueItem("queueId", { + * objectId: "objectId", + * objectType: "TRACE", + * status: undefined + * }) + */ + createQueueItem(queueId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createQueueItem(queueId, request, requestOptions)); + } + async __createQueueItem(queueId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items`), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues/{queueId}/items."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Update an annotation queue item + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {string} itemId - The unique identifier of the annotation queue item + * @param {LangfuseAPI.UpdateAnnotationQueueItemRequest} request + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.updateQueueItem("queueId", "itemId", { + * status: undefined + * }) + */ + updateQueueItem(queueId, itemId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__updateQueueItem(queueId, itemId, request, requestOptions)); + } + async __updateQueueItem(queueId, itemId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/annotation-queues/{queueId}/items/{itemId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Remove an item from an annotation queue + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {string} itemId - The unique identifier of the annotation queue item + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.deleteQueueItem("queueId", "itemId") + */ + deleteQueueItem(queueId, itemId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteQueueItem(queueId, itemId, requestOptions)); + } + async __deleteQueueItem(queueId, itemId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/annotation-queues/{queueId}/items/{itemId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create an assignment for a user to an annotation queue + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {LangfuseAPI.AnnotationQueueAssignmentRequest} request + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.createQueueAssignment("queueId", { + * userId: "userId" + * }) + */ + createQueueAssignment(queueId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createQueueAssignment(queueId, request, requestOptions)); + } + async __createQueueAssignment(queueId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/assignments`), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues/{queueId}/assignments."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete an assignment for a user to an annotation queue + * + * @param {string} queueId - The unique identifier of the annotation queue + * @param {LangfuseAPI.AnnotationQueueAssignmentRequest} request + * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.annotationQueues.deleteQueueAssignment("queueId", { + * userId: "userId" + * }) + */ + deleteQueueAssignment(queueId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteQueueAssignment(queueId, request, requestOptions)); + } + async __deleteQueueAssignment(queueId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/assignments`), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/annotation-queues/{queueId}/assignments."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var BlobStorageIntegrations = class { + constructor(_options) { + this._options = _options; + } + /** + * Get all blob storage integrations for the organization (requires organization-scoped API key) + * + * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.blobStorageIntegrations.getBlobStorageIntegrations() + */ + getBlobStorageIntegrations(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getBlobStorageIntegrations(requestOptions)); + } + async __getBlobStorageIntegrations(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/integrations/blob-storage"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/integrations/blob-storage."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create or update a blob storage integration for a specific project (requires organization-scoped API key). The configuration is validated by performing a test upload to the bucket. + * + * @param {LangfuseAPI.CreateBlobStorageIntegrationRequest} request + * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.blobStorageIntegrations.upsertBlobStorageIntegration({ + * projectId: "projectId", + * type: "S3", + * bucketName: "bucketName", + * endpoint: undefined, + * region: "region", + * accessKeyId: undefined, + * secretAccessKey: undefined, + * prefix: undefined, + * exportFrequency: "every_20_minutes", + * enabled: true, + * forcePathStyle: true, + * fileType: "JSON", + * exportMode: "FULL_HISTORY", + * exportStartDate: undefined, + * compressed: undefined, + * exportSource: undefined, + * exportFieldGroups: undefined + * }) + */ + upsertBlobStorageIntegration(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__upsertBlobStorageIntegration(request, requestOptions)); + } + async __upsertBlobStorageIntegration(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/integrations/blob-storage"), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/integrations/blob-storage."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key) + * + * @param {string} id + * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.blobStorageIntegrations.getBlobStorageIntegrationStatus("id") + */ + getBlobStorageIntegrationStatus(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getBlobStorageIntegrationStatus(id, requestOptions)); + } + async __getBlobStorageIntegrationStatus(id, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/integrations/blob-storage/${encodeURIComponent(id)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/integrations/blob-storage/{id}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a blob storage integration by ID (requires organization-scoped API key) + * + * @param {string} id + * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.blobStorageIntegrations.deleteBlobStorageIntegration("id") + */ + deleteBlobStorageIntegration(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteBlobStorageIntegration(id, requestOptions)); + } + async __deleteBlobStorageIntegration(id, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/integrations/blob-storage/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/integrations/blob-storage/{id}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Comments = class { + constructor(_options) { + this._options = _options; + } + /** + * Create a comment. Comments may be attached to different object types (trace, observation, session, prompt). + * + * @param {LangfuseAPI.CreateCommentRequest} request + * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.comments.create({ + * projectId: "projectId", + * objectType: "objectType", + * objectId: "objectId", + * content: "content", + * authorUserId: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/comments"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/comments."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get all comments + * + * @param {LangfuseAPI.GetCommentsRequest} request + * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.comments.get() + */ + get(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); + } + async __get(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit, objectType, objectId, authorUserId } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + if (objectType != null) _queryParams["objectType"] = objectType; + if (objectId != null) _queryParams["objectId"] = objectId; + if (authorUserId != null) _queryParams["authorUserId"] = authorUserId; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/comments"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/comments."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a comment by id + * + * @param {string} commentId - The unique langfuse identifier of a comment + * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.comments.getById("commentId") + */ + getById(commentId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getById(commentId, requestOptions)); + } + async __getById(commentId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/comments/${encodeURIComponent(commentId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/comments/{commentId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var DatasetItems = class { + constructor(_options) { + this._options = _options; + } + /** + * Create a dataset item + * + * @param {LangfuseAPI.CreateDatasetItemRequest} request + * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasetItems.create({ + * datasetName: "datasetName", + * input: undefined, + * expectedOutput: undefined, + * metadata: undefined, + * sourceTraceId: undefined, + * sourceObservationId: undefined, + * id: undefined, + * status: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-items"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/dataset-items."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a dataset item + * + * @param {string} id + * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasetItems.get("id") + */ + get(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); + } + async __get(id, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/dataset-items/${encodeURIComponent(id)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-items/{id}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get dataset items. Optionally specify a version to get the items as they existed at that point in time. + * Note: If version parameter is provided, datasetName must also be provided. + * + * @param {LangfuseAPI.GetDatasetItemsRequest} request + * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasetItems.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { datasetName, sourceTraceId, sourceObservationId, version: version$1, page, limit } = request; + const _queryParams = {}; + if (datasetName != null) _queryParams["datasetName"] = datasetName; + if (sourceTraceId != null) _queryParams["sourceTraceId"] = sourceTraceId; + if (sourceObservationId != null) _queryParams["sourceObservationId"] = sourceObservationId; + if (version$1 != null) _queryParams["version"] = version$1; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-items"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-items."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a dataset item and all its run items. This action is irreversible. + * + * @param {string} id + * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasetItems.delete("id") + */ + delete(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + } + async __delete(id, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/dataset-items/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/dataset-items/{id}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var DatasetRunItems = class { + constructor(_options) { + this._options = _options; + } + /** + * Create a dataset run item + * + * @param {LangfuseAPI.CreateDatasetRunItemRequest} request + * @param {DatasetRunItems.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasetRunItems.create({ + * runName: "runName", + * runDescription: undefined, + * metadata: undefined, + * datasetItemId: "datasetItemId", + * observationId: undefined, + * traceId: undefined, + * datasetVersion: undefined, + * createdAt: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-run-items"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/dataset-run-items."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * List dataset run items + * + * @param {LangfuseAPI.ListDatasetRunItemsRequest} request + * @param {DatasetRunItems.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasetRunItems.list({ + * datasetId: "datasetId", + * runName: "runName" + * }) + */ + list(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { datasetId, runName, page, limit } = request; + const _queryParams = {}; + _queryParams["datasetId"] = datasetId; + _queryParams["runName"] = runName; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-run-items"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-run-items."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Datasets = class { + constructor(_options) { + this._options = _options; + } + /** + * Get all datasets + * + * @param {LangfuseAPI.GetDatasetsRequest} request + * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasets.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/datasets"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/datasets."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a dataset + * + * @param {string} datasetName + * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasets.get("datasetName") + */ + get(datasetName, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(datasetName, requestOptions)); + } + async __get(datasetName, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/datasets/${encodeURIComponent(datasetName)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/datasets/{datasetName}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create a dataset + * + * @param {LangfuseAPI.CreateDatasetRequest} request + * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasets.create({ + * name: "name", + * description: undefined, + * metadata: undefined, + * inputSchema: undefined, + * expectedOutputSchema: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/datasets"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/v2/datasets."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a dataset run and its items + * + * @param {string} datasetName + * @param {string} runName + * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasets.getRun("datasetName", "runName") + */ + getRun(datasetName, runName, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getRun(datasetName, runName, requestOptions)); + } + async __getRun(datasetName, runName, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/datasets/{datasetName}/runs/{runName}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a dataset run and all its run items. This action is irreversible. + * + * @param {string} datasetName + * @param {string} runName + * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasets.deleteRun("datasetName", "runName") + */ + deleteRun(datasetName, runName, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteRun(datasetName, runName, requestOptions)); + } + async __deleteRun(datasetName, runName, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/datasets/{datasetName}/runs/{runName}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get dataset runs + * + * @param {string} datasetName + * @param {LangfuseAPI.GetDatasetRunsRequest} request + * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.datasets.getRuns("datasetName") + */ + getRuns(datasetName, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getRuns(datasetName, request, requestOptions)); + } + async __getRuns(datasetName, request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs`), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/datasets/{datasetName}/runs."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Health = class { + constructor(_options) { + this._options = _options; + } + /** + * Check health of API and database + * + * @param {Health.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.ServiceUnavailableError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.health.health() + */ + health(requestOptions) { + return HttpResponsePromise.fromPromise(this.__health(requestOptions)); + } + async __health(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/health"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 503: throw new ServiceUnavailableError(_response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/health."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Ingestion = class { + constructor(_options) { + this._options = _options; + } + /** + * **Legacy endpoint for batch ingestion for Langfuse Observability.** + * + * -> Please use the OpenTelemetry endpoint (`/api/public/otel/v1/traces`). Learn more: https://langfuse.com/integrations/native/opentelemetry + * + * Within each batch, there can be multiple events. + * Each event has a type, an id, a timestamp, metadata and a body. + * Internally, we refer to this as the "event envelope" as it tells us something about the event but not the trace. + * We use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request. + * The event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App. + * I.e. if you want to update a trace, you'd use the same body id, but separate event IDs. + * + * Notes: + * - Introduction to data model: https://langfuse.com/docs/observability/data-model + * - Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly. + * - The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors. + * + * @param {LangfuseAPI.IngestionRequest} request + * @param {Ingestion.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.ingestion.batch({ + * batch: [{ + * type: "trace-create", + * id: "abcdef-1234-5678-90ab", + * timestamp: "2022-01-01T00:00:00.000Z", + * body: { + * id: "abcdef-1234-5678-90ab", + * timestamp: "2022-01-01T00:00:00.000Z", + * environment: "production", + * name: "My Trace", + * userId: "1234-5678-90ab-cdef", + * input: "My input", + * output: "My output", + * sessionId: "1234-5678-90ab-cdef", + * release: "1.0.0", + * version: "1.0.0", + * metadata: "My metadata", + * tags: ["tag1", "tag2"], + * "public": true + * } + * }] + * }) + * + * @example + * await client.ingestion.batch({ + * batch: [{ + * type: "span-create", + * id: "abcdef-1234-5678-90ab", + * timestamp: "2022-01-01T00:00:00.000Z", + * body: { + * id: "abcdef-1234-5678-90ab", + * traceId: "1234-5678-90ab-cdef", + * startTime: "2022-01-01T00:00:00.000Z", + * environment: "test" + * } + * }] + * }) + * + * @example + * await client.ingestion.batch({ + * batch: [{ + * type: "score-create", + * id: "abcdef-1234-5678-90ab", + * timestamp: "2022-01-01T00:00:00.000Z", + * body: { + * id: "abcdef-1234-5678-90ab", + * traceId: "1234-5678-90ab-cdef", + * name: "My Score", + * value: 0.9, + * environment: "default" + * } + * }] + * }) + */ + batch(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__batch(request, requestOptions)); + } + async __batch(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/ingestion"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/ingestion."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var MetricsV1 = class { + constructor(_options) { + this._options = _options; + } + /** + * Get metrics from the Langfuse project using a query object. + * + * Consider using the [v2 metrics endpoint](/api-reference#tag/metricsv2/GET/api/public/v2/metrics) for better performance. + * + * For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api). + * + * @param {LangfuseAPI.legacy.GetMetricsRequest} request + * @param {MetricsV1.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.legacy.metricsV1.metrics({ + * query: "query" + * }) + */ + metrics(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__metrics(request, requestOptions)); + } + async __metrics(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { query } = request; + const _queryParams = {}; + _queryParams["query"] = query; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/metrics"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/metrics."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var ObservationsV1 = class { + constructor(_options) { + this._options = _options; + } + /** + * Get a observation + * + * @param {string} observationId - The unique langfuse identifier of an observation, can be an event, span or generation + * @param {ObservationsV1.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.legacy.observationsV1.get("observationId") + */ + get(observationId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(observationId, requestOptions)); + } + async __get(observationId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/observations/${encodeURIComponent(observationId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/observations/{observationId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a list of observations. + * + * Consider using the [v2 observations endpoint](/api-reference#tag/observationsv2/GET/api/public/v2/observations) for cursor-based pagination and field selection. + * + * @param {LangfuseAPI.legacy.GetObservationsRequest} request + * @param {ObservationsV1.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.legacy.observationsV1.getMany() + */ + getMany(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); + } + async __getMany(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version: version$1, filter } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + if (name != null) _queryParams["name"] = name; + if (userId != null) _queryParams["userId"] = userId; + if (type_ != null) _queryParams["type"] = type_; + if (traceId != null) _queryParams["traceId"] = traceId; + if (level != null) _queryParams["level"] = level; + if (parentObservationId != null) _queryParams["parentObservationId"] = parentObservationId; + if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + if (fromStartTime != null) _queryParams["fromStartTime"] = fromStartTime; + if (toStartTime != null) _queryParams["toStartTime"] = toStartTime; + if (version$1 != null) _queryParams["version"] = version$1; + if (filter != null) _queryParams["filter"] = filter; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/observations"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/observations."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var ScoreV1 = class { + constructor(_options) { + this._options = _options; + } + /** + * Create a score (supports both trace and session scores) + * + * @param {LangfuseAPI.legacy.CreateScoreRequest} request + * @param {ScoreV1.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.legacy.scoreV1.create({ + * id: undefined, + * traceId: undefined, + * sessionId: undefined, + * observationId: undefined, + * datasetRunId: undefined, + * name: "name", + * value: 1.1, + * comment: undefined, + * metadata: undefined, + * environment: undefined, + * queueId: undefined, + * dataType: undefined, + * configId: undefined, + * source: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scores"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/scores."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a score (supports both trace and session scores) + * + * @param {string} scoreId - The unique langfuse identifier of a score + * @param {ScoreV1.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.legacy.scoreV1.delete("scoreId") + */ + delete(scoreId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(scoreId, requestOptions)); + } + async __delete(scoreId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scores/${encodeURIComponent(scoreId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: void 0, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/scores/{scoreId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Legacy = class { + constructor(_options) { + this._options = _options; + } + get metricsV1() { + var _a2; + return (_a2 = this._metricsV1) != null ? _a2 : this._metricsV1 = new MetricsV1(this._options); + } + get observationsV1() { + var _a2; + return (_a2 = this._observationsV1) != null ? _a2 : this._observationsV1 = new ObservationsV1(this._options); + } + get scoreV1() { + var _a2; + return (_a2 = this._scoreV1) != null ? _a2 : this._scoreV1 = new ScoreV1(this._options); + } +}; +var LlmConnections = class { + constructor(_options) { + this._options = _options; + } + /** + * Get all LLM connections in a project + * + * @param {LangfuseAPI.GetLlmConnectionsRequest} request + * @param {LlmConnections.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.llmConnections.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/llm-connections"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/llm-connections."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create or update an LLM connection. The connection is upserted on provider. + * + * @param {LangfuseAPI.UpsertLlmConnectionRequest} request + * @param {LlmConnections.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.llmConnections.upsert({ + * provider: "provider", + * adapter: "anthropic", + * secretKey: "secretKey", + * baseURL: undefined, + * customModels: undefined, + * withDefaultModels: undefined, + * extraHeaders: undefined, + * config: undefined + * }) + */ + upsert(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); + } + async __upsert(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/llm-connections"), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/llm-connections."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete an LLM connection by id. Evaluators that depend on the deleted connection are automatically paused. + * + * @param {string} id + * @param {LlmConnections.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.llmConnections.delete("id") + */ + delete(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + } + async __delete(id, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/llm-connections/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/llm-connections/{id}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Media = class { + constructor(_options) { + this._options = _options; + } + /** + * Get a media record + * + * @param {string} mediaId - The unique langfuse identifier of a media record + * @param {Media.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.media.get("mediaId") + */ + get(mediaId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(mediaId, requestOptions)); + } + async __get(mediaId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/media/${encodeURIComponent(mediaId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/media/{mediaId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Patch a media record + * + * @param {string} mediaId - The unique langfuse identifier of a media record + * @param {LangfuseAPI.PatchMediaBody} request + * @param {Media.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.media.patch("mediaId", { + * uploadedAt: "2024-01-15T09:30:00Z", + * uploadHttpStatus: 1, + * uploadHttpError: undefined, + * uploadTimeMs: undefined + * }) + */ + patch(mediaId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__patch(mediaId, request, requestOptions)); + } + async __patch(mediaId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/media/${encodeURIComponent(mediaId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: void 0, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/media/{mediaId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a presigned upload URL for a media record + * + * @param {LangfuseAPI.GetMediaUploadUrlRequest} request + * @param {Media.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.media.getUploadUrl({ + * traceId: "traceId", + * observationId: undefined, + * contentType: "image/png", + * contentLength: 1, + * sha256Hash: "sha256Hash", + * field: "field" + * }) + */ + getUploadUrl(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getUploadUrl(request, requestOptions)); + } + async __getUploadUrl(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/media"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/media."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Metrics = class { + constructor(_options) { + this._options = _options; + } + /** + * Get metrics from the Langfuse project using a query object. V2 endpoint with optimized performance. + * + * ## V2 Differences + * - Supports `observations`, `scores-numeric`, and `scores-categorical` views only (traces view not supported) + * - Direct access to tags and release fields on observations + * - Backwards-compatible: traceName, traceRelease, traceVersion dimensions are still available on observations view + * - High cardinality dimensions are not supported and will return a 400 error (see below) + * + * For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api). + * + * ## Available Views + * + * ### observations + * Query observation-level data (spans, generations, events). + * + * **Dimensions:** + * - `environment` - Deployment environment (e.g., production, staging) + * - `type` - Type of observation (SPAN, GENERATION, EVENT) + * - `name` - Name of the observation + * - `level` - Logging level of the observation + * - `version` - Version of the observation + * - `tags` - User-defined tags + * - `release` - Release version + * - `traceName` - Name of the parent trace (backwards-compatible) + * - `traceRelease` - Release version of the parent trace (backwards-compatible, maps to release) + * - `traceVersion` - Version of the parent trace (backwards-compatible, maps to version) + * - `providedModelName` - Name of the model used + * - `promptName` - Name of the prompt used + * - `promptVersion` - Version of the prompt used + * - `startTimeMonth` - Month of start_time in YYYY-MM format + * + * **Measures:** + * - `count` - Total number of observations + * - `latency` - Observation latency (milliseconds) + * - `streamingLatency` - Generation latency from completion start to end (milliseconds) + * - `inputTokens` - Sum of input tokens consumed + * - `outputTokens` - Sum of output tokens produced + * - `totalTokens` - Sum of all tokens consumed + * - `outputTokensPerSecond` - Output tokens per second + * - `tokensPerSecond` - Total tokens per second + * - `inputCost` - Input cost (USD) + * - `outputCost` - Output cost (USD) + * - `totalCost` - Total cost (USD) + * - `timeToFirstToken` - Time to first token (milliseconds) + * - `countScores` - Number of scores attached to the observation + * + * ### scores-numeric + * Query numeric and boolean score data. + * + * **Dimensions:** + * - `environment` - Deployment environment + * - `name` - Name of the score (e.g., accuracy, toxicity) + * - `source` - Origin of the score (API, ANNOTATION, EVAL) + * - `dataType` - Data type (NUMERIC, BOOLEAN) + * - `configId` - Identifier of the score config + * - `timestampMonth` - Month in YYYY-MM format + * - `timestampDay` - Day in YYYY-MM-DD format + * - `value` - Numeric value of the score + * - `traceName` - Name of the parent trace + * - `tags` - Tags + * - `traceRelease` - Release version + * - `traceVersion` - Version + * - `observationName` - Name of the associated observation + * - `observationModelName` - Model name of the associated observation + * - `observationPromptName` - Prompt name of the associated observation + * - `observationPromptVersion` - Prompt version of the associated observation + * + * **Measures:** + * - `count` - Total number of scores + * - `value` - Score value (for aggregations) + * + * ### scores-categorical + * Query categorical score data. Same dimensions as scores-numeric except uses `stringValue` instead of `value`. + * + * **Measures:** + * - `count` - Total number of scores + * + * ## High Cardinality Dimensions + * The following dimensions cannot be used as grouping dimensions in v2 metrics API as they can cause performance issues. + * Use them in filters instead. + * + * **observations view:** + * - `id` - Use traceId filter to narrow down results + * - `traceId` - Use traceId filter instead + * - `userId` - Use userId filter instead + * - `sessionId` - Use sessionId filter instead + * - `parentObservationId` - Use parentObservationId filter instead + * + * **scores-numeric / scores-categorical views:** + * - `id` - Use specific filters to narrow down results + * - `traceId` - Use traceId filter instead + * - `userId` - Use userId filter instead + * - `sessionId` - Use sessionId filter instead + * - `observationId` - Use observationId filter instead + * + * ## Aggregations + * Available aggregation functions: `sum`, `avg`, `count`, `max`, `min`, `p50`, `p75`, `p90`, `p95`, `p99`, `histogram` + * + * ## Time Granularities + * Available granularities for timeDimension: `auto`, `minute`, `hour`, `day`, `week`, `month` + * - `auto` bins the data into approximately 50 buckets based on the time range + * + * @param {LangfuseAPI.GetMetricsV2Request} request + * @param {Metrics.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.metrics.metrics({ + * query: "query" + * }) + */ + metrics(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__metrics(request, requestOptions)); + } + async __metrics(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { query } = request; + const _queryParams = {}; + _queryParams["query"] = query; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/metrics"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/metrics."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Models = class { + constructor(_options) { + this._options = _options; + } + /** + * Create a model + * + * @param {LangfuseAPI.CreateModelRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.models.create({ + * modelName: "modelName", + * matchPattern: "matchPattern", + * startDate: undefined, + * unit: undefined, + * inputPrice: undefined, + * outputPrice: undefined, + * totalPrice: undefined, + * pricingTiers: undefined, + * tokenizerId: undefined, + * tokenizerConfig: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/models"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/models."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get all models + * + * @param {LangfuseAPI.GetModelsRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.models.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/models"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/models."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a model + * + * @param {string} id + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.models.get("id") + */ + get(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); + } + async __get(id, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/models/${encodeURIComponent(id)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/models/{id}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a model. Cannot delete models managed by Langfuse. You can create your own definition with the same modelName to override the definition though. + * + * @param {string} id + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.models.delete("id") + */ + delete(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + } + async __delete(id, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/models/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: void 0, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/models/{id}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Observations = class { + constructor(_options) { + this._options = _options; + } + /** + * Get a list of observations with cursor-based pagination and flexible field selection. + * + * ## Cursor-based Pagination + * This endpoint uses cursor-based pagination for efficient traversal of large datasets. + * The cursor is returned in the response metadata and should be passed in subsequent requests + * to retrieve the next page of results. + * + * ## Field Selection + * Use the `fields` parameter to control which observation fields are returned: + * - `core` - Always included: id, traceId, startTime, endTime, projectId, parentObservationId, type + * - `basic` - name, level, statusMessage, version, environment, bookmarked, public, userId, sessionId + * - `time` - completionStartTime, createdAt, updatedAt + * - `io` - input, output + * - `metadata` - metadata (truncated to 200 chars by default, use `expandMetadata` to get full values) + * - `model` - providedModelName, internalModelId, modelParameters + * - `usage` - usageDetails, costDetails, totalCost, usagePricingTierName + * - `prompt` - promptId, promptName, promptVersion + * - `metrics` - latency, timeToFirstToken + * - `trace_context` - tags, release, traceName + * + * If not specified, `core` and `basic` field groups are returned. + * + * ## Filters + * Multiple filtering options are available via query parameters or the structured `filter` parameter. + * When using the `filter` parameter, it takes precedence over individual query parameter filters. + * + * @param {LangfuseAPI.GetObservationsV2Request} request + * @param {Observations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.observations.getMany() + */ + getMany(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); + } + async __getMany(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { fields, expandMetadata, limit, cursor, parseIoAsJson, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version: version$1, filter } = request; + const _queryParams = {}; + if (fields != null) _queryParams["fields"] = fields; + if (expandMetadata != null) _queryParams["expandMetadata"] = expandMetadata; + if (limit != null) _queryParams["limit"] = limit.toString(); + if (cursor != null) _queryParams["cursor"] = cursor; + if (parseIoAsJson != null) _queryParams["parseIoAsJson"] = parseIoAsJson.toString(); + if (name != null) _queryParams["name"] = name; + if (userId != null) _queryParams["userId"] = userId; + if (type_ != null) _queryParams["type"] = type_; + if (traceId != null) _queryParams["traceId"] = traceId; + if (level != null) _queryParams["level"] = level; + if (parentObservationId != null) _queryParams["parentObservationId"] = parentObservationId; + if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + if (fromStartTime != null) _queryParams["fromStartTime"] = fromStartTime; + if (toStartTime != null) _queryParams["toStartTime"] = toStartTime; + if (version$1 != null) _queryParams["version"] = version$1; + if (filter != null) _queryParams["filter"] = filter; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/observations"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/observations."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Opentelemetry = class { + constructor(_options) { + this._options = _options; + } + /** + * **OpenTelemetry Traces Ingestion Endpoint** + * + * This endpoint implements the OTLP/HTTP specification for trace ingestion, providing native OpenTelemetry integration for Langfuse Observability. + * + * **Supported Formats:** + * - Binary Protobuf: `Content-Type: application/x-protobuf` + * - JSON Protobuf: `Content-Type: application/json` + * - Supports gzip compression via `Content-Encoding: gzip` header + * + * **Specification Compliance:** + * - Conforms to [OTLP/HTTP Trace Export](https://opentelemetry.io/docs/specs/otlp/#otlphttp) + * - Implements `ExportTraceServiceRequest` message format + * + * **Documentation:** + * - Integration guide: https://langfuse.com/integrations/native/opentelemetry + * - Data model: https://langfuse.com/docs/observability/data-model + * + * @param {LangfuseAPI.OtelTraceRequest} request + * @param {Opentelemetry.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.opentelemetry.exportTraces({ + * resourceSpans: [{ + * resource: { + * attributes: [{ + * key: "service.name", + * value: { + * stringValue: "my-service" + * } + * }, { + * key: "service.version", + * value: { + * stringValue: "1.0.0" + * } + * }] + * }, + * scopeSpans: [{ + * scope: { + * name: "langfuse-sdk", + * version: "2.60.3" + * }, + * spans: [{ + * traceId: "0123456789abcdef0123456789abcdef", + * spanId: "0123456789abcdef", + * name: "my-operation", + * kind: 1, + * startTimeUnixNano: "1747872000000000000", + * endTimeUnixNano: "1747872001000000000", + * attributes: [{ + * key: "langfuse.observation.type", + * value: { + * stringValue: "generation" + * } + * }], + * status: {} + * }] + * }] + * }] + * }) + */ + exportTraces(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__exportTraces(request, requestOptions)); + } + async __exportTraces(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/otel/v1/traces"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/otel/v1/traces."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Organizations = class { + constructor(_options) { + this._options = _options; + } + /** + * Get all memberships for the organization associated with the API key (requires organization-scoped API key) + * + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.getOrganizationMemberships() + */ + getOrganizationMemberships(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getOrganizationMemberships(requestOptions)); + } + async __getOrganizationMemberships(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/memberships."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create or update a membership for the organization associated with the API key (requires organization-scoped API key) + * + * @param {LangfuseAPI.MembershipRequest} request + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.updateOrganizationMembership({ + * userId: "userId", + * role: "OWNER" + * }) + */ + updateOrganizationMembership(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__updateOrganizationMembership(request, requestOptions)); + } + async __updateOrganizationMembership(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/organizations/memberships."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a membership from the organization associated with the API key (requires organization-scoped API key) + * + * @param {LangfuseAPI.DeleteMembershipRequest} request + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.deleteOrganizationMembership({ + * userId: "userId" + * }) + */ + deleteOrganizationMembership(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteOrganizationMembership(request, requestOptions)); + } + async __deleteOrganizationMembership(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/organizations/memberships."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get all memberships for a specific project (requires organization-scoped API key) + * + * @param {string} projectId + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.getProjectMemberships("projectId") + */ + getProjectMemberships(projectId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getProjectMemberships(projectId, requestOptions)); + } + async __getProjectMemberships(projectId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects/{projectId}/memberships."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create or update a membership for a specific project (requires organization-scoped API key). The user must already be a member of the organization. + * + * @param {string} projectId + * @param {LangfuseAPI.MembershipRequest} request + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.updateProjectMembership("projectId", { + * userId: "userId", + * role: "OWNER" + * }) + */ + updateProjectMembership(projectId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__updateProjectMembership(projectId, request, requestOptions)); + } + async __updateProjectMembership(projectId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/projects/{projectId}/memberships."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a membership from a specific project (requires organization-scoped API key). The user must be a member of the organization. + * + * @param {string} projectId + * @param {LangfuseAPI.DeleteMembershipRequest} request + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.deleteProjectMembership("projectId", { + * userId: "userId" + * }) + */ + deleteProjectMembership(projectId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteProjectMembership(projectId, request, requestOptions)); + } + async __deleteProjectMembership(projectId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}/memberships."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get all projects for the organization associated with the API key (requires organization-scoped API key) + * + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.getOrganizationProjects() + */ + getOrganizationProjects(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getOrganizationProjects(requestOptions)); + } + async __getOrganizationProjects(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/projects"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/projects."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get all API keys for the organization associated with the API key (requires organization-scoped API key) + * + * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.organizations.getOrganizationApiKeys() + */ + getOrganizationApiKeys(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getOrganizationApiKeys(requestOptions)); + } + async __getOrganizationApiKeys(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/apiKeys"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/apiKeys."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Projects = class { + constructor(_options) { + this._options = _options; + } + /** + * Get Project associated with API key (requires project-scoped API key). You can use GET /api/public/organizations/projects to get all projects with an organization-scoped key. + * + * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.projects.get() + */ + get(requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(requestOptions)); + } + async __get(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/projects"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create a new project (requires organization-scoped API key) + * + * @param {LangfuseAPI.CreateProjectRequest} request + * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.projects.create({ + * name: "name", + * metadata: undefined, + * retention: 1 + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/projects"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/projects."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Update a project by ID (requires organization-scoped API key). + * + * @param {string} projectId + * @param {LangfuseAPI.UpdateProjectRequest} request + * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.projects.update("projectId", { + * name: "name", + * metadata: undefined, + * retention: undefined + * }) + */ + update(projectId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(projectId, request, requestOptions)); + } + async __update(projectId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}`), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/projects/{projectId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a project by ID (requires organization-scoped API key). Project deletion is processed asynchronously. + * + * @param {string} projectId + * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.projects.delete("projectId") + */ + delete(projectId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(projectId, requestOptions)); + } + async __delete(projectId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get all API keys for a project (requires organization-scoped API key) + * + * @param {string} projectId + * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.projects.getApiKeys("projectId") + */ + getApiKeys(projectId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getApiKeys(projectId, requestOptions)); + } + async __getApiKeys(projectId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects/{projectId}/apiKeys."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create a new API key for a project (requires organization-scoped API key) + * + * @param {string} projectId + * @param {LangfuseAPI.CreateApiKeyRequest} request + * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.projects.createApiKey("projectId", { + * note: undefined, + * publicKey: undefined, + * secretKey: undefined + * }) + */ + createApiKey(projectId, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createApiKey(projectId, request, requestOptions)); + } + async __createApiKey(projectId, request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys`), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/projects/{projectId}/apiKeys."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete an API key for a project (requires organization-scoped API key) + * + * @param {string} projectId + * @param {string} apiKeyId + * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.projects.deleteApiKey("projectId", "apiKeyId") + */ + deleteApiKey(projectId, apiKeyId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteApiKey(projectId, apiKeyId, requestOptions)); + } + async __deleteApiKey(projectId, apiKeyId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys/${encodeURIComponent(apiKeyId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}/apiKeys/{apiKeyId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var PromptVersion = class { + constructor(_options) { + this._options = _options; + } + /** + * Update labels for a specific prompt version + * + * @param {string} name - The name of the prompt. If the prompt is in a folder (e.g., "folder/subfolder/prompt-name"), + * the folder path must be URL encoded. + * @param {number} version - Version of the prompt to update + * @param {LangfuseAPI.UpdatePromptRequest} request + * @param {PromptVersion.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.promptVersion.update("name", 1, { + * newLabels: ["newLabels", "newLabels"] + * }) + */ + update(name, version$1, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(name, version$1, request, requestOptions)); + } + async __update(name, version$1, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(name)}/versions/${encodeURIComponent(version$1)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/v2/prompts/{name}/versions/{version}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Prompts = class { + constructor(_options) { + this._options = _options; + } + /** + * Get a prompt + * + * @param {string} promptName - The name of the prompt. If the prompt is in a folder (e.g., "folder/subfolder/prompt-name"), + * the folder path must be URL encoded. + * @param {LangfuseAPI.GetPromptRequest} request + * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.prompts.get("promptName") + */ + get(promptName, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(promptName, request, requestOptions)); + } + async __get(promptName, request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { version: version$1, label, resolve } = request; + const _queryParams = {}; + if (version$1 != null) _queryParams["version"] = version$1.toString(); + if (label != null) _queryParams["label"] = label; + if (resolve != null) _queryParams["resolve"] = resolve.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(promptName)}`), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/prompts/{promptName}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a list of prompt names with versions and labels + * + * @param {LangfuseAPI.ListPromptsMetaRequest} request + * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.prompts.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { name, label, tag, page, limit, fromUpdatedAt, toUpdatedAt } = request; + const _queryParams = {}; + if (name != null) _queryParams["name"] = name; + if (label != null) _queryParams["label"] = label; + if (tag != null) _queryParams["tag"] = tag; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + if (fromUpdatedAt != null) _queryParams["fromUpdatedAt"] = fromUpdatedAt; + if (toUpdatedAt != null) _queryParams["toUpdatedAt"] = toUpdatedAt; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/prompts"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/prompts."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create a new version for the prompt with the given `name` + * + * @param {LangfuseAPI.CreatePromptRequest} request + * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.prompts.create({ + * name: "name", + * prompt: [{ + * role: "role", + * content: "content", + * type: undefined + * }, { + * role: "role", + * content: "content", + * type: undefined + * }], + * config: undefined, + * type: "chat", + * labels: undefined, + * tags: undefined, + * commitMessage: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/prompts"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/v2/prompts."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted. + * + * @param {string} promptName - The name of the prompt + * @param {LangfuseAPI.DeletePromptRequest} request + * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.prompts.delete("promptName") + */ + delete(promptName, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(promptName, request, requestOptions)); + } + async __delete(promptName, request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { label, version: version$1 } = request; + const _queryParams = {}; + if (label != null) _queryParams["label"] = label; + if (version$1 != null) _queryParams["version"] = version$1.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(promptName)}`), + method: "DELETE", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: void 0, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/v2/prompts/{promptName}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Scim = class { + constructor(_options) { + this._options = _options; + } + /** + * Get SCIM Service Provider Configuration (requires organization-scoped API key) + * + * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scim.getServiceProviderConfig() + */ + getServiceProviderConfig(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getServiceProviderConfig(requestOptions)); + } + async __getServiceProviderConfig(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/ServiceProviderConfig"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/ServiceProviderConfig."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get SCIM Resource Types (requires organization-scoped API key) + * + * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scim.getResourceTypes() + */ + getResourceTypes(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getResourceTypes(requestOptions)); + } + async __getResourceTypes(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/ResourceTypes"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/ResourceTypes."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get SCIM Schemas (requires organization-scoped API key) + * + * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scim.getSchemas() + */ + getSchemas(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getSchemas(requestOptions)); + } + async __getSchemas(requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Schemas"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Schemas."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * List users in the organization (requires organization-scoped API key) + * + * @param {LangfuseAPI.ListUsersRequest} request + * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scim.listUsers() + */ + listUsers(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__listUsers(request, requestOptions)); + } + async __listUsers(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { filter, startIndex, count } = request; + const _queryParams = {}; + if (filter != null) _queryParams["filter"] = filter; + if (startIndex != null) _queryParams["startIndex"] = startIndex.toString(); + if (count != null) _queryParams["count"] = count.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Users"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Users."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Create a new user in the organization (requires organization-scoped API key) + * + * @param {LangfuseAPI.CreateUserRequest} request + * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scim.createUser({ + * userName: "userName", + * name: { + * formatted: undefined + * }, + * emails: undefined, + * active: undefined, + * password: undefined + * }) + */ + createUser(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions)); + } + async __createUser(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Users"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/scim/Users."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a specific user by ID (requires organization-scoped API key) + * + * @param {string} userId + * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scim.getUser("userId") + */ + getUser(userId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getUser(userId, requestOptions)); + } + async __getUser(userId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scim/Users/${encodeURIComponent(userId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Users/{userId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Remove a user from the organization (requires organization-scoped API key). Note that this only removes the user from the organization but does not delete the user entity itself. + * + * @param {string} userId + * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scim.deleteUser("userId") + */ + deleteUser(userId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteUser(userId, requestOptions)); + } + async __deleteUser(userId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scim/Users/${encodeURIComponent(userId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/scim/Users/{userId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var ScoreConfigs = class { + constructor(_options) { + this._options = _options; + } + /** + * Create a score configuration (config). Score configs are used to define the structure of scores + * + * @param {LangfuseAPI.CreateScoreConfigRequest} request + * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scoreConfigs.create({ + * name: "name", + * dataType: "NUMERIC", + * categories: undefined, + * minValue: undefined, + * maxValue: undefined, + * description: undefined + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/score-configs"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/score-configs."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get all score configs + * + * @param {LangfuseAPI.GetScoreConfigsRequest} request + * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scoreConfigs.get() + */ + get(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); + } + async __get(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/score-configs"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/score-configs."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a score config + * + * @param {string} configId - The unique langfuse identifier of a score config + * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scoreConfigs.getById("configId") + */ + getById(configId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getById(configId, requestOptions)); + } + async __getById(configId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/score-configs/${encodeURIComponent(configId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/score-configs/{configId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Update a score config + * + * @param {string} configId - The unique langfuse identifier of a score config + * @param {LangfuseAPI.UpdateScoreConfigRequest} request + * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scoreConfigs.update("configId", { + * isArchived: undefined, + * name: undefined, + * categories: undefined, + * minValue: undefined, + * maxValue: undefined, + * description: undefined + * }) + */ + update(configId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(configId, request, requestOptions)); + } + async __update(configId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/score-configs/${encodeURIComponent(configId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/score-configs/{configId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Scores = class { + constructor(_options) { + this._options = _options; + } + /** + * Get a list of scores (supports both trace and session scores) + * + * @param {LangfuseAPI.GetScoresRequest} request + * @param {Scores.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scores.getMany() + */ + getMany(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); + } + async __getMany(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit, userId, name, fromTimestamp, toTimestamp, environment, source, operator, value, scoreIds, configId, sessionId, datasetRunId, traceId, observationId, queueId, dataType, traceTags, fields, filter } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + if (userId != null) _queryParams["userId"] = userId; + if (name != null) _queryParams["name"] = name; + if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; + if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; + if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + if (source != null) _queryParams["source"] = source; + if (operator != null) _queryParams["operator"] = operator; + if (value != null) _queryParams["value"] = value.toString(); + if (scoreIds != null) _queryParams["scoreIds"] = scoreIds; + if (configId != null) _queryParams["configId"] = configId; + if (sessionId != null) _queryParams["sessionId"] = sessionId; + if (datasetRunId != null) _queryParams["datasetRunId"] = datasetRunId; + if (traceId != null) _queryParams["traceId"] = traceId; + if (observationId != null) _queryParams["observationId"] = observationId; + if (queueId != null) _queryParams["queueId"] = queueId; + if (dataType != null) _queryParams["dataType"] = dataType; + if (traceTags != null) if (Array.isArray(traceTags)) _queryParams["traceTags"] = traceTags.map((item) => item); + else _queryParams["traceTags"] = traceTags; + if (fields != null) _queryParams["fields"] = fields; + if (filter != null) _queryParams["filter"] = filter; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/scores"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/scores."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a score (supports both trace and session scores) + * + * @param {string} scoreId - The unique langfuse identifier of a score + * @param {Scores.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.scores.getById("scoreId") + */ + getById(scoreId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getById(scoreId, requestOptions)); + } + async __getById(scoreId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/scores/${encodeURIComponent(scoreId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/scores/{scoreId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Sessions = class { + constructor(_options) { + this._options = _options; + } + /** + * Get sessions + * + * @param {LangfuseAPI.GetSessionsRequest} request + * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.sessions.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit, fromTimestamp, toTimestamp, environment } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; + if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; + if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/sessions"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/sessions."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=` + * + * @param {string} sessionId - The unique id of a session + * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.sessions.get("sessionId") + */ + get(sessionId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(sessionId, requestOptions)); + } + async __get(sessionId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/sessions/${encodeURIComponent(sessionId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/sessions/{sessionId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Trace = class { + constructor(_options) { + this._options = _options; + } + /** + * Get a specific trace + * + * @param {string} traceId - The unique langfuse identifier of a trace + * @param {LangfuseAPI.GetTraceRequest} request + * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.trace.get("traceId") + */ + get(traceId, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(traceId, request, requestOptions)); + } + async __get(traceId, request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { fields } = request; + const _queryParams = {}; + if (fields != null) _queryParams["fields"] = fields; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/traces/${encodeURIComponent(traceId)}`), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/traces/{traceId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete a specific trace + * + * @param {string} traceId - The unique langfuse identifier of the trace to delete + * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.trace.delete("traceId") + */ + delete(traceId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(traceId, requestOptions)); + } + async __delete(traceId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/traces/${encodeURIComponent(traceId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/traces/{traceId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get list of traces + * + * @param {LangfuseAPI.GetTracesRequest} request + * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.trace.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit, userId, name, sessionId, fromTimestamp, toTimestamp, orderBy, tags, version: version$1, release, environment, fields, filter } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + if (userId != null) _queryParams["userId"] = userId; + if (name != null) _queryParams["name"] = name; + if (sessionId != null) _queryParams["sessionId"] = sessionId; + if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; + if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; + if (orderBy != null) _queryParams["orderBy"] = orderBy; + if (tags != null) if (Array.isArray(tags)) _queryParams["tags"] = tags.map((item) => item); + else _queryParams["tags"] = tags; + if (version$1 != null) _queryParams["version"] = version$1; + if (release != null) _queryParams["release"] = release; + if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + if (fields != null) _queryParams["fields"] = fields; + if (filter != null) _queryParams["filter"] = filter; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/traces"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/traces."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete multiple traces + * + * @param {LangfuseAPI.DeleteTracesRequest} request + * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.trace.deleteMultiple({ + * traceIds: ["traceIds", "traceIds"] + * }) + */ + deleteMultiple(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteMultiple(request, requestOptions)); + } + async __deleteMultiple(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/traces"), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/traces."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var EvaluationRules = class { + constructor(_options) { + this._options = _options; + } + /** + * Create an evaluation rule. + * + * An evaluation rule defines **what** incoming data should be evaluated and **how prompt variables should be populated** from that data. + * + * Use this resource after choosing an evaluator from the evaluator endpoints. + * + * Key rules: + * - `name` must be unique within the project for public evaluation rules + * - `target` must be `observation` or `experiment` + * - `evaluator.name` + `evaluator.scope` must identify an existing evaluator family returned by the evaluator endpoints + * - Langfuse resolves that family to its latest version before saving the evaluation rule + * - for `target=experiment`, use dataset `id` values from `GET /api/public/v2/datasets` when filtering by `datasetId` + * - every evaluator prompt variable must be mapped exactly once + * - `expected_output` and `experiment_item_metadata` mappings are only valid for `target=experiment` + * - if `enabled=true`, Langfuse validates that the referenced evaluator can currently run + * - at most 50 evaluation rules can be effectively active in one project at the same time + * + * If an evaluation rule with the same `name` already exists in the project, the API returns `409`. + * In that case, update the existing resource with `PATCH /api/public/unstable/evaluation-rules/{evaluationRuleId}` instead of creating a second one. + * + * If enabling this resource would exceed the 50-active limit, the API also returns `409`. + * In that case, disable or pause another active evaluation rule before enabling a new one. + * + * Current scope: + * - evaluation rules are live-ingestion rules only + * - they do not trigger historical backfills + * + * Recovery guidance: + * - `400 invalid_filter_value`: fix the filter `column` or `value` using `details.column`, `details.invalidValues`, and `details.allowedValues` + * - `400 invalid_filter_value` with `details.column=datasetId`: call `GET /api/public/v2/datasets`, then retry with dataset `id` values from that response + * - `400 missing_variable_mapping`: fetch the evaluator again and make sure every variable in `variables` appears exactly once in `mapping` + * - `400 duplicate_variable_mapping`: remove repeated mappings for the same variable + * - `400 invalid_variable_mapping`: switch to a valid `source` for the selected `target`, or fix the variable name + * - `400 invalid_json_path`: remove or correct the `jsonPath` + * - `422 evaluator_preflight_failed`: the selected evaluator cannot run with the resolved model configuration. Fix the evaluator/default model setup, then retry the create request. + * + * @param {LangfuseAPI.unstable.CreateEvaluationRuleRequest} request + * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.NotFoundError} + * @throws {@link LangfuseAPI.unstable.ConflictError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.UnprocessableContentError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluationRules.create({ + * name: "answer-correctness-live", + * evaluator: { + * name: "answer-correctness", + * scope: "project" + * }, + * target: "observation", + * enabled: true, + * sampling: 1, + * filter: [{ + * type: "stringOptions", + * column: "type", + * operator: "any of", + * value: ["GENERATION"] + * }], + * mapping: [{ + * variable: "input", + * source: "input" + * }, { + * variable: "output", + * source: "output" + * }] + * }) + * + * @example + * await client.unstable.evaluationRules.create({ + * name: "experiment-expected-output-match", + * evaluator: { + * name: "expected-output-match", + * scope: "project" + * }, + * target: "experiment", + * enabled: true, + * sampling: 0.5, + * filter: [{ + * type: "stringOptions", + * column: "datasetId", + * operator: "any of", + * value: ["550e8400-e29b-41d4-a716-446655440000"] + * }], + * mapping: [{ + * variable: "output", + * source: "output" + * }, { + * variable: "expected_output", + * source: "expected_output" + * }] + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluation-rules"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 409: throw new unstable_exports.ConflictError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 422: throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/unstable/evaluation-rules."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * List evaluation rules in the authenticated project. + * + * Each item describes one live evaluation rule and its effective runtime status. + * + * @param {LangfuseAPI.unstable.ListEvaluationRulesRequest} request + * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluationRules.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluation-rules"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluation-rules."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get one evaluation rule by its identifier. + * + * Use this endpoint to inspect the current evaluator, target, mapping, filters, and effective runtime status. + * + * @param {string} evaluationRuleId - Evaluation rule identifier returned by the evaluation rule endpoints. + * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.NotFoundError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluationRules.get("evaluationRuleId") + */ + get(evaluationRuleId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(evaluationRuleId, requestOptions)); + } + async __get(evaluationRuleId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluation-rules/{evaluationRuleId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Update an evaluation rule. + * + * Typical uses: + * - enable or disable live execution + * - switch to another evaluator + * - adjust sampling + * - change filters + * - update variable mappings + * + * Important behavior: + * - provide only the fields you want to change + * - if you provide `evaluator`, Langfuse resolves that evaluator family to its latest version before saving + * - changing `target`, `filter`, or `mapping` must still produce a valid target-specific configuration + * - if you change `target`, also send a compatible `filter` and `mapping` in the same request unless the existing ones are still valid for the new target + * - if the resulting config is enabled, Langfuse re-validates that the selected evaluator can run + * - if the update would move a non-active evaluation rule into the active state and the project already has 50 active evaluation rules, the API returns `409` + * + * Recovery guidance: + * - if the update fails with `missing_variable_mapping` or `invalid_variable_mapping` after changing `evaluator` or `target`, resend the request with a complete new `mapping` + * - if the update fails with `invalid_filter_value` after changing `target`, resend the request with a target-compatible `filter` + * + * @param {string} evaluationRuleId - Evaluation rule identifier. + * @param {LangfuseAPI.unstable.UpdateEvaluationRuleRequest} request + * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.NotFoundError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.UnprocessableContentError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluationRules.update("evaluationRuleId", { + * name: undefined, + * evaluator: undefined, + * target: undefined, + * enabled: undefined, + * sampling: undefined, + * filter: undefined, + * mapping: undefined + * }) + */ + update(evaluationRuleId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(evaluationRuleId, request, requestOptions)); + } + async __update(evaluationRuleId, request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 422: throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/unstable/evaluation-rules/{evaluationRuleId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Delete an evaluation rule. + * + * This removes the live-ingestion rule only. It does not delete the referenced evaluator. + * + * @param {string} evaluationRuleId - Evaluation rule identifier. + * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.NotFoundError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluationRules.delete("evaluationRuleId") + */ + delete(evaluationRuleId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(evaluationRuleId, requestOptions)); + } + async __delete(evaluationRuleId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/unstable/evaluation-rules/{evaluationRuleId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Evaluators = class { + constructor(_options) { + this._options = _options; + } + /** + * Create an evaluator in the authenticated project. + * + * Use evaluators to define **how** Langfuse should score data: the prompt, the expected structured output, and the optional model configuration. + * + * Naming behavior: + * - If this is a new evaluator name in your project, Langfuse creates version `1`. + * - If the name already exists in your project, Langfuse creates the next version and returns it. + * - When a new project version is created, existing evaluation rules in that project automatically move to the newest version for that evaluator name. + * + * Recommended workflow: + * 1. Create the evaluator. + * 2. Read the returned `variables` array. + * 3. Read the returned `outputDefinition.dataType` so the client knows whether future scores will be numeric, boolean, or categorical. + * 4. Create one or more evaluation rules that reference the returned evaluator family using `name` and `scope`. + * + * Recovery guidance: + * - `422` with `code=evaluator_preflight_failed`: the evaluator cannot run with the resolved model configuration. Add a valid explicit `modelConfig`, or configure the project's default evaluation model, then retry the same request. + * - `400` with `code=invalid_body`: the request shape is malformed. Use the structured `details.issues` array to fix the specific fields and retry. + * - `400` with `code=invalid_body` on `outputDefinition`: send `dataType`, `reasoning.description`, and `score.description`. Do not send `version`; it is not part of the public request shape. + * + * Unstable API note: + * - This surface may evolve while the underlying evaluation data model is being redesigned. + * + * @param {LangfuseAPI.unstable.CreateEvaluatorRequest} request + * @param {Evaluators.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.ConflictError} + * @throws {@link LangfuseAPI.unstable.UnprocessableContentError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluators.create({ + * name: "answer-correctness", + * prompt: "You are grading an answer.\n\nInput:\n{{input}}\n\nOutput:\n{{output}}\n\nReturn a score between 0 and 1.\n", + * outputDefinition: { + * dataType: "NUMERIC", + * dataType: "NUMERIC", + * reasoning: { + * description: "Explain why the score was assigned." + * }, + * score: { + * description: "Correctness score between 0 and 1." + * } + * }, + * modelConfig: { + * provider: "openai", + * model: "gpt-4.1-mini" + * } + * }) + */ + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluators"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 409: throw new unstable_exports.ConflictError(_response.error.body, _response.rawResponse); + case 422: throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/unstable/evaluators."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * List the evaluators available to the authenticated project. + * + * Important behavior: + * - This endpoint returns the latest version of each available evaluator. + * - Results can include evaluators from your project and Langfuse-managed evaluators. + * - If the same evaluator name exists in both places, both are returned as separate items with different `scope` values. + * + * @param {LangfuseAPI.unstable.ListEvaluatorsRequest} request + * @param {Evaluators.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluators.list() + */ + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) _queryParams["page"] = page.toString(); + if (limit != null) _queryParams["limit"] = limit.toString(); + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluators"), + method: "GET", + headers: _headers, + queryParameters: { + ..._queryParams, + ...requestOptions == null ? void 0 : requestOptions.queryParams + }, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluators."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + /** + * Get one evaluator by `id`. + * + * Use this endpoint when you want the prompt, output definition, model configuration, and derived variables for the evaluator you plan to use in an evaluation rule. + * + * @param {string} evaluatorId - Evaluator identifier returned by the evaluator endpoints. + * @param {Evaluators.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link LangfuseAPI.unstable.BadRequestError} + * @throws {@link LangfuseAPI.unstable.UnauthorizedError} + * @throws {@link LangfuseAPI.unstable.AccessDeniedError} + * @throws {@link LangfuseAPI.unstable.NotFoundError} + * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} + * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} + * @throws {@link LangfuseAPI.unstable.InternalServerError} + * @throws {@link LangfuseAPI.Error} + * @throws {@link LangfuseAPI.UnauthorizedError} + * @throws {@link LangfuseAPI.AccessDeniedError} + * @throws {@link LangfuseAPI.MethodNotAllowedError} + * @throws {@link LangfuseAPI.NotFoundError} + * + * @example + * await client.unstable.evaluators.get("evaluatorId") + */ + get(evaluatorId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(evaluatorId, requestOptions)); + } + async __get(evaluatorId, requestOptions) { + var _a2, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey + }), requestOptions == null ? void 0 : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluators/${encodeURIComponent(evaluatorId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, + maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, + abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal + }); + if (_response.ok) return { + data: _response.body, + rawResponse: _response.rawResponse + }; + if (_response.error.reason === "status-code") switch (_response.error.statusCode) { + case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: throw new Error2(_response.error.body, _response.rawResponse); + case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); + default: throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + switch (_response.error.reason) { + case "non-json": throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluators/{evaluatorId}."); + case "unknown": throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } +}; +var Unstable = class { + constructor(_options) { + this._options = _options; + } + get evaluationRules() { + var _a2; + return (_a2 = this._evaluationRules) != null ? _a2 : this._evaluationRules = new EvaluationRules(this._options); + } + get evaluators() { + var _a2; + return (_a2 = this._evaluators) != null ? _a2 : this._evaluators = new Evaluators(this._options); + } +}; +var LangfuseAPIClient = class { + constructor(_options) { + this._options = { + ..._options, + headers: mergeHeaders$1({ + "X-Langfuse-Sdk-Name": _options == null ? void 0 : _options.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": _options == null ? void 0 : _options.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": _options == null ? void 0 : _options.xLangfusePublicKey + }, _options == null ? void 0 : _options.headers) + }; + } + get annotationQueues() { + var _a2; + return (_a2 = this._annotationQueues) != null ? _a2 : this._annotationQueues = new AnnotationQueues(this._options); + } + get blobStorageIntegrations() { + var _a2; + return (_a2 = this._blobStorageIntegrations) != null ? _a2 : this._blobStorageIntegrations = new BlobStorageIntegrations(this._options); + } + get comments() { + var _a2; + return (_a2 = this._comments) != null ? _a2 : this._comments = new Comments(this._options); + } + get datasetItems() { + var _a2; + return (_a2 = this._datasetItems) != null ? _a2 : this._datasetItems = new DatasetItems(this._options); + } + get datasetRunItems() { + var _a2; + return (_a2 = this._datasetRunItems) != null ? _a2 : this._datasetRunItems = new DatasetRunItems(this._options); + } + get datasets() { + var _a2; + return (_a2 = this._datasets) != null ? _a2 : this._datasets = new Datasets(this._options); + } + get health() { + var _a2; + return (_a2 = this._health) != null ? _a2 : this._health = new Health(this._options); + } + get ingestion() { + var _a2; + return (_a2 = this._ingestion) != null ? _a2 : this._ingestion = new Ingestion(this._options); + } + get legacy() { + var _a2; + return (_a2 = this._legacy) != null ? _a2 : this._legacy = new Legacy(this._options); + } + get llmConnections() { + var _a2; + return (_a2 = this._llmConnections) != null ? _a2 : this._llmConnections = new LlmConnections(this._options); + } + get media() { + var _a2; + return (_a2 = this._media) != null ? _a2 : this._media = new Media(this._options); + } + get metrics() { + var _a2; + return (_a2 = this._metrics) != null ? _a2 : this._metrics = new Metrics(this._options); + } + get models() { + var _a2; + return (_a2 = this._models) != null ? _a2 : this._models = new Models(this._options); + } + get observations() { + var _a2; + return (_a2 = this._observations) != null ? _a2 : this._observations = new Observations(this._options); + } + get opentelemetry() { + var _a2; + return (_a2 = this._opentelemetry) != null ? _a2 : this._opentelemetry = new Opentelemetry(this._options); + } + get organizations() { + var _a2; + return (_a2 = this._organizations) != null ? _a2 : this._organizations = new Organizations(this._options); + } + get projects() { + var _a2; + return (_a2 = this._projects) != null ? _a2 : this._projects = new Projects(this._options); + } + get promptVersion() { + var _a2; + return (_a2 = this._promptVersion) != null ? _a2 : this._promptVersion = new PromptVersion(this._options); + } + get prompts() { + var _a2; + return (_a2 = this._prompts) != null ? _a2 : this._prompts = new Prompts(this._options); + } + get scim() { + var _a2; + return (_a2 = this._scim) != null ? _a2 : this._scim = new Scim(this._options); + } + get scoreConfigs() { + var _a2; + return (_a2 = this._scoreConfigs) != null ? _a2 : this._scoreConfigs = new ScoreConfigs(this._options); + } + get scores() { + var _a2; + return (_a2 = this._scores) != null ? _a2 : this._scores = new Scores(this._options); + } + get sessions() { + var _a2; + return (_a2 = this._sessions) != null ? _a2 : this._sessions = new Sessions(this._options); + } + get trace() { + var _a2; + return (_a2 = this._trace) != null ? _a2 : this._trace = new Trace(this._options); + } + get unstable() { + var _a2; + return (_a2 = this._unstable) != null ? _a2 : this._unstable = new Unstable(this._options); + } +}; +var LangfuseMedia = class { + /** + * Creates a new LangfuseMedia instance. + * + * @param params - Media parameters specifying the source and content + * + * @example + * ```typescript + * // Create from base64 data URI + * const media = new LangfuseMedia({ + * source: "base64_data_uri", + * base64DataUri: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..." + * }); + * ``` + */ + constructor(params) { + const { source } = params; + this._source = source; + if (source === "base64_data_uri") { + const [contentBytesParsed, contentTypeParsed] = this.parseBase64DataUri(params.base64DataUri); + this._contentBytes = contentBytesParsed; + this._contentType = contentTypeParsed; + } else { + this._contentBytes = params.contentBytes; + this._contentType = params.contentType; + } + } + /** + * Parses a base64 data URI to extract content bytes and type. + * + * @param data - The base64 data URI string + * @returns Tuple of [contentBytes, contentType] or [undefined, undefined] on error + * @private + */ + parseBase64DataUri(data) { + try { + if (!data || typeof data !== "string") throw new Error("Data URI is not a string"); + if (!data.startsWith("data:")) throw new Error("Data URI does not start with 'data:'"); + const [header, actualData] = data.slice(5).split(",", 2); + if (!header || !actualData) throw new Error("Invalid URI"); + const headerParts = header.split(";"); + if (!headerParts.includes("base64")) throw new Error("Data is not base64 encoded"); + const contentType = headerParts[0]; + if (!contentType) throw new Error("Content type is empty"); + return [base64ToBytes(actualData), contentType]; + } catch (error) { + getGlobalLogger().error("Error parsing base64 data URI", error); + return [void 0, void 0]; + } + } + /** + * Gets a unique identifier for this media based on its content hash. + * + * The ID is derived from the first 22 characters of the URL-safe base64-encoded + * SHA-256 hash of the content. + * + * @returns The unique media ID, or null if hash generation failed + * + * @example + * ```typescript + * const media = new LangfuseMedia({...}); + * console.log(media.id); // "A1B2C3D4E5F6G7H8I9J0K1" + * ``` + */ + async getId() { + const contentSha256Hash = await this.getSha256Hash(); + if (!contentSha256Hash) return null; + return contentSha256Hash.replaceAll("+", "-").replaceAll("/", "_").slice(0, 22); + } + /** + * Gets the length of the media content in bytes. + * + * @returns The content length in bytes, or undefined if no content is available + */ + get contentLength() { + var _a2; + return (_a2 = this._contentBytes) == null ? void 0 : _a2.length; + } + /** + * Gets the SHA-256 hash of the media content. + * + * The hash is used for content integrity verification and generating unique media IDs. + * Returns undefined if crypto is not available or hash generation fails. + * + * @returns The base64-encoded SHA-256 hash, or undefined if unavailable + */ + async getSha256Hash() { + if (!this._contentBytes) return; + try { + const hash = await crypto.subtle.digest("SHA-256", this._contentBytes); + return bytesToBase64(new Uint8Array(hash)); + } catch (error) { + getGlobalLogger().warn("[Langfuse] Failed to generate SHA-256 hash for media content:", error); + return; + } + } + /** + * Gets the media reference tag for embedding in trace data. + * + * The tag format is: `@@@langfuseMedia:type=|id=|source=@@@` + * This tag can be embedded in trace attributes and will be replaced with actual + * media content when the trace is viewed in Langfuse. + * + * @returns The media reference tag, or null if required data is missing + * + * @example + * ```typescript + * const media = new LangfuseMedia({...}); + * console.log(media.tag); + * // "@@@langfuseMedia:type=image/png|id=A1B2C3D4E5F6G7H8I9J0K1|source=base64_data_uri@@@" + * ``` + */ + async getTag() { + const id = await this.getId(); + if (!this._contentType || !this._source || !id) return null; + return `@@@langfuseMedia:type=${this._contentType}|id=${id}|source=${this._source}@@@`; + } + /** + * Gets the media content as a base64 data URI. + * + * @returns The complete data URI string, or null if no content is available + * + * @example + * ```typescript + * const media = new LangfuseMedia({...}); + * console.log(media.base64DataUri); + * // "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..." + * ``` + */ + get base64DataUri() { + if (!this._contentBytes) return null; + return `data:${this._contentType};base64,${bytesToBase64(this._contentBytes)}`; + } + /** + * Serializes the media to JSON (returns the base64 data URI). + * + * @returns The base64 data URI, or null if no content is available + */ + toJSON() { + return this.base64DataUri; + } +}; +var experimentKeys = [ + "experimentId", + "experimentName", + "experimentMetadata", + "experimentDatasetId", + "experimentItemId", + "experimentItemMetadata", + "experimentItemRootObservationId" +]; +var LangfuseOtelContextKeys = { + userId: createContextKey("langfuse_user_id"), + sessionId: createContextKey("langfuse_session_id"), + metadata: createContextKey("langfuse_metadata"), + version: createContextKey("langfuse_version"), + tags: createContextKey("langfuse_tags"), + traceName: createContextKey("langfuse_trace_name"), + experimentId: createContextKey("langfuse_experiment_id"), + experimentName: createContextKey("langfuse_experiment_name"), + experimentMetadata: createContextKey("langfuse_experiment_metadata"), + experimentDatasetId: createContextKey("langfuse_experiment_dataset_id"), + experimentItemId: createContextKey("langfuse_experiment_item_id"), + experimentItemMetadata: createContextKey("langfuse_experiment_item_metadata"), + experimentItemRootObservationId: createContextKey("langfuse_experiment_item_root_observation_id") +}; +var LANGFUSE_BAGGAGE_PREFIX = "langfuse_"; +var LANGFUSE_BAGGAGE_TAGS_SEPARATOR = ","; +var LANGFUSE_TRACE_ID_BAGGAGE_KEY = "langfuse_trace_id"; +function getLangfuseTraceIdFromBaggage(context$1) { + const baggage = propagation.getBaggage(context$1); + const entry = baggage == null ? void 0 : baggage.getEntry(LANGFUSE_TRACE_ID_BAGGAGE_KEY); + if (!(entry == null ? void 0 : entry.value)) return void 0; + return entry.value.toLowerCase(); +} +function propagateAttributes(params, fn) { + var _a2; + let context$1 = context.active(); + const span = trace.getActiveSpan(); + const asBaggage = (_a2 = params.asBaggage) != null ? _a2 : false; + const { userId, sessionId, metadata, version: version$1, tags, traceName, _internalExperiment } = params; + if (userId) { + if (isValidPropagatedString({ + value: userId, + attributeName: "userId" + })) context$1 = setPropagatedAttribute({ + key: "userId", + value: userId, + context: context$1, + span, + asBaggage + }); + } + if (sessionId) { + if (isValidPropagatedString({ + value: sessionId, + attributeName: "sessionId" + })) context$1 = setPropagatedAttribute({ + key: "sessionId", + value: sessionId, + context: context$1, + span, + asBaggage + }); + } + if (version$1) { + if (isValidPropagatedString({ + value: version$1, + attributeName: "version" + })) context$1 = setPropagatedAttribute({ + key: "version", + value: version$1, + context: context$1, + span, + asBaggage + }); + } + if (traceName) { + if (isValidPropagatedString({ + value: traceName, + attributeName: "traceName" + })) context$1 = setPropagatedAttribute({ + key: "traceName", + value: traceName, + context: context$1, + span, + asBaggage + }); + } + if (tags && tags.length > 0) { + const validTags = tags.filter((tag) => isValidPropagatedString({ + value: tag, + attributeName: "tag" + })); + if (validTags.length > 0) context$1 = setPropagatedAttribute({ + key: "tags", + value: validTags, + context: context$1, + span, + asBaggage + }); + } + if (metadata) { + const validatedMetadata = {}; + for (const [key, value] of Object.entries(metadata)) if (isValidPropagatedString({ + value, + attributeName: `metadata.${key}` + })) validatedMetadata[key] = value; + if (Object.keys(validatedMetadata).length > 0) context$1 = setPropagatedAttribute({ + key: "metadata", + value: validatedMetadata, + context: context$1, + span, + asBaggage + }); + } + if (_internalExperiment) { + for (const [key, value] of Object.entries(_internalExperiment)) if (value !== void 0) context$1 = setPropagatedAttribute({ + key, + value, + context: context$1, + span, + asBaggage + }); + } + return context.with(context$1, fn); +} +function getPropagatedAttributesFromContext(context$1) { + const propagatedAttributes = {}; + const baggage = propagation.getBaggage(context$1); + if (baggage) baggage.getAllEntries().forEach(([baggageKey, baggageEntry]) => { + if (baggageKey === LANGFUSE_TRACE_ID_BAGGAGE_KEY) return; + if (baggageKey.startsWith(LANGFUSE_BAGGAGE_PREFIX)) { + const spanKey = getSpanKeyFromBaggageKey(baggageKey); + if (spanKey) propagatedAttributes[spanKey] = baggageKey == getBaggageKeyForPropagatedKey("tags") ? baggageEntry.value.split(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) : baggageEntry.value; + } + }); + const userId = context$1.getValue(LangfuseOtelContextKeys["userId"]); + if (userId && typeof userId === "string") { + const spanKey = getSpanKeyForPropagatedKey("userId"); + propagatedAttributes[spanKey] = userId; + } + const sessionId = context$1.getValue(LangfuseOtelContextKeys["sessionId"]); + if (sessionId && typeof sessionId === "string") { + const spanKey = getSpanKeyForPropagatedKey("sessionId"); + propagatedAttributes[spanKey] = sessionId; + } + const version$1 = context$1.getValue(LangfuseOtelContextKeys["version"]); + if (version$1 && typeof version$1 === "string") { + const spanKey = getSpanKeyForPropagatedKey("version"); + propagatedAttributes[spanKey] = version$1; + } + const traceName = context$1.getValue(LangfuseOtelContextKeys["traceName"]); + if (traceName && typeof traceName === "string") { + const spanKey = getSpanKeyForPropagatedKey("traceName"); + propagatedAttributes[spanKey] = traceName; + } + const tags = context$1.getValue(LangfuseOtelContextKeys["tags"]); + if (tags && Array.isArray(tags)) { + const spanKey = getSpanKeyForPropagatedKey("tags"); + propagatedAttributes[spanKey] = tags; + } + const metadata = context$1.getValue(LangfuseOtelContextKeys["metadata"]); + if (metadata && typeof metadata === "object" && metadata !== null) for (const [k, v] of Object.entries(metadata)) { + const spanKey = `langfuse.trace.metadata.${k}`; + propagatedAttributes[spanKey] = String(v); + } + for (const key of experimentKeys) { + const contextKey = LangfuseOtelContextKeys[key]; + const value = context$1.getValue(contextKey); + if (value && typeof value === "string") { + const spanKey = getSpanKeyForPropagatedKey(key); + propagatedAttributes[spanKey] = value; + } + } + if (propagatedAttributes[getSpanKeyForPropagatedKey("experimentItemRootObservationId")]) propagatedAttributes["langfuse.environment"] = LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT; + return propagatedAttributes; +} +function setPropagatedAttribute(params) { + const { key, value, span, asBaggage } = params; + let context$1 = params.context; + let mergedMetadata = key === "metadata" ? getContextMergedMetadata(context$1, value) : {}; + let mergedTags = key === "tags" ? getContextMergedTags(context$1, value) : []; + const contextKey = getContextKeyForPropagatedKey(key); + if (key === "metadata") context$1 = context$1.setValue(contextKey, mergedMetadata); + else if (key === "tags") context$1 = context$1.setValue(contextKey, mergedTags); + else context$1 = context$1.setValue(contextKey, value); + if (span && span.isRecording()) if (key === "metadata") for (const [k, v] of Object.entries(mergedMetadata)) span.setAttribute(`langfuse.trace.metadata.${k}`, v); + else if (key === "tags") { + const spanKey = getSpanKeyForPropagatedKey(key); + span.setAttribute(spanKey, mergedTags); + } else { + const spanKey = getSpanKeyForPropagatedKey(key); + span.setAttribute(spanKey, value); + } + if (asBaggage) { + const baggageKey = getBaggageKeyForPropagatedKey(key); + let baggage = propagation.getBaggage(context$1) || propagation.createBaggage(); + if (key === "metadata") for (const [k, v] of Object.entries(mergedMetadata)) baggage = baggage.setEntry(`${baggageKey}_${k}`, { value: v }); + else if (key === "tags") baggage = baggage.setEntry(baggageKey, { value: mergedTags.join(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) }); + else baggage = baggage.setEntry(baggageKey, { value }); + context$1 = propagation.setBaggage(context$1, baggage); + } + return context$1; +} +function getContextMergedTags(context$1, newTags) { + const existingTags = context$1.getValue(LangfuseOtelContextKeys["tags"]); + if (existingTags && Array.isArray(existingTags)) return [.../* @__PURE__ */ new Set([...existingTags, ...newTags])]; + else return newTags; +} +function getContextMergedMetadata(context$1, newMetadata) { + const existingMetadata = context$1.getValue(LangfuseOtelContextKeys["metadata"]); + if (existingMetadata && typeof existingMetadata === "object" && existingMetadata !== null && !Array.isArray(existingMetadata)) return { + ...existingMetadata, + ...newMetadata + }; + else return newMetadata; +} +function isValidPropagatedString(params) { + const logger = getGlobalLogger(); + const { value, attributeName } = params; + if (typeof value !== "string") { + logger.warn(`Propagated attribute '${attributeName}' must be a string. Dropping value.`); + return false; + } + if (value.length > 200) { + logger.warn(`Propagated attribute '${attributeName}' value is over 200 characters (${value.length} chars). Dropping value.`); + return false; + } + return true; +} +function getContextKeyForPropagatedKey(key) { + return LangfuseOtelContextKeys[key]; +} +function getSpanKeyForPropagatedKey(key) { + switch (key) { + case "userId": return "user.id"; + case "sessionId": return "session.id"; + case "version": return "langfuse.version"; + case "traceName": return "langfuse.trace.name"; + case "metadata": return "langfuse.trace.metadata"; + case "tags": return "langfuse.trace.tags"; + case "experimentId": return "langfuse.experiment.id"; + case "experimentName": return "langfuse.experiment.name"; + case "experimentMetadata": return "langfuse.experiment.metadata"; + case "experimentDatasetId": return "langfuse.experiment.dataset.id"; + case "experimentItemId": return "langfuse.experiment.item.id"; + case "experimentItemMetadata": return "langfuse.experiment.item.metadata"; + case "experimentItemRootObservationId": return "langfuse.experiment.item.root_observation_id"; + default: { + const fallback = key; + throw Error("Unhandled propagated key", fallback); + } + } +} +function getBaggageKeyForPropagatedKey(key) { + switch (key) { + case "userId": return `${LANGFUSE_BAGGAGE_PREFIX}user_id`; + case "sessionId": return `${LANGFUSE_BAGGAGE_PREFIX}session_id`; + case "version": return `${LANGFUSE_BAGGAGE_PREFIX}version`; + case "traceName": return `${LANGFUSE_BAGGAGE_PREFIX}trace_name`; + case "metadata": return `${LANGFUSE_BAGGAGE_PREFIX}metadata`; + case "tags": return `${LANGFUSE_BAGGAGE_PREFIX}tags`; + case "experimentId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_id`; + case "experimentName": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_name`; + case "experimentMetadata": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_metadata`; + case "experimentDatasetId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_dataset_id`; + case "experimentItemId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_id`; + case "experimentItemMetadata": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_metadata`; + case "experimentItemRootObservationId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_root_observation_id`; + default: { + const fallback = key; + throw Error("Unhandled propagated key", fallback); + } + } +} +function getSpanKeyFromBaggageKey(baggageKey) { + if (!baggageKey.startsWith(LANGFUSE_BAGGAGE_PREFIX)) return; + const suffix = baggageKey.slice(LANGFUSE_BAGGAGE_PREFIX.length); + if (suffix.startsWith("metadata_")) return `langfuse.trace.metadata.${suffix.slice(9)}`; + switch (suffix) { + case "user_id": return getSpanKeyForPropagatedKey("userId"); + case "session_id": return getSpanKeyForPropagatedKey("sessionId"); + case "version": return getSpanKeyForPropagatedKey("version"); + case "trace_name": return getSpanKeyForPropagatedKey("traceName"); + case "tags": return getSpanKeyForPropagatedKey("tags"); + case "experiment_id": return getSpanKeyForPropagatedKey("experimentId"); + case "experiment_name": return getSpanKeyForPropagatedKey("experimentName"); + case "experiment_metadata": return getSpanKeyForPropagatedKey("experimentMetadata"); + case "experiment_dataset_id": return getSpanKeyForPropagatedKey("experimentDatasetId"); + case "experiment_item_id": return getSpanKeyForPropagatedKey("experimentItemId"); + case "experiment_item_metadata": return getSpanKeyForPropagatedKey("experimentItemMetadata"); + case "experiment_item_root_observation_id": return getSpanKeyForPropagatedKey("experimentItemRootObservationId"); + } +} + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; + const SUPPRESS_TRACING_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context$1) { + return context$1.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context$1) { + return context$1.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context$1) { + return context$1.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils$7 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const constants_1 = require_constants$1(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== void 0) entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + if (!entry) return; + const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex); + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) return; + const rawKey = keyPairPart.substring(0, separatorIndex).trim(); + const rawValue = keyPairPart.substring(separatorIndex + 1).trim(); + if (!rawKey || !rawValue) return; + let key; + let value; + try { + key = decodeURIComponent(rawKey); + value = decodeURIComponent(rawValue); + } catch { + return; + } + let metadata; + if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) { + const metadataString = entry.substring(metadataSeparatorIndex + 1); + metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString); + } + return { + key, + value, + metadata + }; + } + exports.parsePairKeyValue = parsePairKeyValue; + /** + * Parse a string serialized in the baggage HTTP Format (without metadata): + * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + */ + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== void 0 && keyPair.value.length > 0) result[keyPair.key] = keyPair.value; + }); + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const suppress_tracing_1 = require_suppress_tracing$1(); + const constants_1 = require_constants$1(); + const utils_1 = require_utils$7(); + /** + * Propagates {@link Baggage} through Context format propagation. + * + * Based on the Baggage specification: + * https://w3c.github.io/baggage/ + */ + var W3CBaggagePropagator = class { + inject(context$1, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context$1); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context$1)) return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + extract(context$1, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) return context$1; + const baggage = {}; + if (baggageString.length === 0) return context$1; + baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) baggageEntry.metadata = keyPair.metadata; + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) return context$1; + return api_1.propagation.setBaggage(context$1, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + }; + exports.W3CBaggagePropagator = W3CBaggagePropagator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = void 0; + /** + * A utility for returning wall times anchored to a given point in time. Wall time measurements will + * not be taken from the system, but instead are computed by adding a monotonic clock time + * to the anchor point. + * + * This is needed because the system time can change and result in unexpected situations like + * spans ending before they are started. Creating an anchored clock for each local root span + * ensures that span timings and durations are accurate while preventing span times from drifting + * too far from the system clock. + * + * Only creating an anchored clock once per local trace ensures span times are correct relative + * to each other. For example, a child span will never have a start time before its parent even + * if the system clock is corrected during the local trace. + * + * Heavily inspired by the OTel Java anchored clock + * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java + */ + var AnchoredClock = class { + _monotonicClock; + _epochMillis; + _performanceMillis; + /** + * Create a new AnchoredClock anchored to the current time returned by systemClock. + * + * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date + * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance + */ + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + /** + * Returns the current time by adding the number of milliseconds since the + * AnchoredClock was created to the creation epoch time + */ + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + }; + exports.AnchoredClock = AnchoredClock; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) return out; + for (const key in attributes) { + if (!Object.prototype.hasOwnProperty.call(attributes, key)) continue; + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + const val = attributes[key]; + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) out[key] = val.slice(); + else out[key] = val; + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key !== ""; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) return true; + if (Array.isArray(val)) return isHomogeneousAttributeValueArray(val); + return isValidPrimitiveAttributeValueType(typeof val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) continue; + const elementType = typeof element; + if (elementType === type) continue; + if (!type) { + if (isValidPrimitiveAttributeValueType(elementType)) { + type = elementType; + continue; + } + return false; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValueType(valType) { + switch (valType) { + case "number": + case "boolean": + case "string": return true; + } + return false; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + /** + * Returns a function that logs an error using the provided logger, or a + * console logger if one was not provided. + */ + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + /** + * Converts an exception into a string representation + * @param {Exception} ex + */ + function stringifyException(ex) { + if (typeof ex === "string") return ex; + else return JSON.stringify(flattenException(ex)); + } + /** + * Flattens an exception into key-value pairs by traversing the prototype chain + * and coercing values to strings. Duplicate properties will not be overwritten; + * the first insert wins. + */ + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) return; + const value = current[propertyName]; + if (value) result[propertyName] = String(value); + }); + current = Object.getPrototypeOf(current); + } + return result; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; + /** The global error handler delegate */ + let delegateHandler = (0, require_logging_error_handler$1().loggingErrorHandler)(); + /** + * Set the global error handler + * @param {ErrorHandler} handler + */ + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + /** + * Return the global error handler + * @param {Exception} ex + */ + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const util_1$1 = __require("util"); + /** + * Retrieves a number from an environment variable. + * - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number. + * - Returns a number in all other cases. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {number | undefined} - The number value or `undefined`. + */ + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") return; + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1$1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + /** + * Retrieves a string from an environment variable. + * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {string | undefined} - The string value or `undefined`. + */ + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") return; + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + /** + * Retrieves a boolean value from an environment variable. + * - Trims leading and trailing whitespace and ignores casing. + * - Returns `false` if the environment variable is empty, unset, or contains only whitespace. + * - Returns `false` for strings that cannot be mapped to a boolean. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace. + */ + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") return false; + if (raw === "true") return true; + else if (raw === "false") return false; + else { + api_1.diag.warn(`Unknown value ${(0, util_1$1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + /** + * Retrieves a list of strings from an environment variable. + * - Uses ',' as the delimiter. + * - Trims leading and trailing whitespace from each entry. + * - Excludes empty entries. + * - Returns `undefined` if the environment variable is empty or contains only whitespace. + * - Returns an empty array if all entries are empty or whitespace. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {string[] | undefined} - The list of strings or `undefined`. + */ + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/globalThis.js +var require_globalThis$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = void 0; + /** + * @deprecated Use globalThis directly instead. + */ + exports._globalThis = globalThis; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js +var require_version$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.7.1"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js +/** +* Creates a const map from the given values +* @param values - An array of values to be used as keys and values in the map. +* @returns A populated version of the map with the values and keys derived from the values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function createConstMap(values) { + let res = {}; + const len = values.length; + for (let lp = 0; lp < len; lp++) { + const val = values[lp]; + if (val) res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; + } + return res; +} +var init_utils = __esmMin((() => {})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js +var TMP_AWS_LAMBDA_INVOKED_ARN, TMP_DB_SYSTEM, TMP_DB_CONNECTION_STRING, TMP_DB_USER, TMP_DB_JDBC_DRIVER_CLASSNAME, TMP_DB_NAME, TMP_DB_STATEMENT, TMP_DB_OPERATION, TMP_DB_MSSQL_INSTANCE_NAME, TMP_DB_CASSANDRA_KEYSPACE, TMP_DB_CASSANDRA_PAGE_SIZE, TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, TMP_DB_CASSANDRA_TABLE, TMP_DB_CASSANDRA_IDEMPOTENCE, TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, TMP_DB_CASSANDRA_COORDINATOR_ID, TMP_DB_CASSANDRA_COORDINATOR_DC, TMP_DB_HBASE_NAMESPACE, TMP_DB_REDIS_DATABASE_INDEX, TMP_DB_MONGODB_COLLECTION, TMP_DB_SQL_TABLE, TMP_EXCEPTION_TYPE, TMP_EXCEPTION_MESSAGE, TMP_EXCEPTION_STACKTRACE, TMP_EXCEPTION_ESCAPED, TMP_FAAS_TRIGGER, TMP_FAAS_EXECUTION, TMP_FAAS_DOCUMENT_COLLECTION, TMP_FAAS_DOCUMENT_OPERATION, TMP_FAAS_DOCUMENT_TIME, TMP_FAAS_DOCUMENT_NAME, TMP_FAAS_TIME, TMP_FAAS_CRON, TMP_FAAS_COLDSTART, TMP_FAAS_INVOKED_NAME, TMP_FAAS_INVOKED_PROVIDER, TMP_FAAS_INVOKED_REGION, TMP_NET_TRANSPORT, TMP_NET_PEER_IP, TMP_NET_PEER_PORT, TMP_NET_PEER_NAME, TMP_NET_HOST_IP, TMP_NET_HOST_PORT, TMP_NET_HOST_NAME, TMP_NET_HOST_CONNECTION_TYPE, TMP_NET_HOST_CONNECTION_SUBTYPE, TMP_NET_HOST_CARRIER_NAME, TMP_NET_HOST_CARRIER_MCC, TMP_NET_HOST_CARRIER_MNC, TMP_NET_HOST_CARRIER_ICC, TMP_PEER_SERVICE, TMP_ENDUSER_ID, TMP_ENDUSER_ROLE, TMP_ENDUSER_SCOPE, TMP_THREAD_ID, TMP_THREAD_NAME, TMP_CODE_FUNCTION, TMP_CODE_NAMESPACE, TMP_CODE_FILEPATH, TMP_CODE_LINENO, TMP_HTTP_METHOD, TMP_HTTP_URL, TMP_HTTP_TARGET, TMP_HTTP_HOST, TMP_HTTP_SCHEME, TMP_HTTP_STATUS_CODE, TMP_HTTP_FLAVOR, TMP_HTTP_USER_AGENT, TMP_HTTP_REQUEST_CONTENT_LENGTH, TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, TMP_HTTP_RESPONSE_CONTENT_LENGTH, TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, TMP_HTTP_SERVER_NAME, TMP_HTTP_ROUTE, TMP_HTTP_CLIENT_IP, TMP_AWS_DYNAMODB_TABLE_NAMES, TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, TMP_AWS_DYNAMODB_CONSISTENT_READ, TMP_AWS_DYNAMODB_PROJECTION, TMP_AWS_DYNAMODB_LIMIT, TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, TMP_AWS_DYNAMODB_INDEX_NAME, TMP_AWS_DYNAMODB_SELECT, TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, TMP_AWS_DYNAMODB_TABLE_COUNT, TMP_AWS_DYNAMODB_SCAN_FORWARD, TMP_AWS_DYNAMODB_SEGMENT, TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, TMP_AWS_DYNAMODB_COUNT, TMP_AWS_DYNAMODB_SCANNED_COUNT, TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, TMP_MESSAGING_SYSTEM, TMP_MESSAGING_DESTINATION, TMP_MESSAGING_DESTINATION_KIND, TMP_MESSAGING_TEMP_DESTINATION, TMP_MESSAGING_PROTOCOL, TMP_MESSAGING_PROTOCOL_VERSION, TMP_MESSAGING_URL, TMP_MESSAGING_MESSAGE_ID, TMP_MESSAGING_CONVERSATION_ID, TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, TMP_MESSAGING_OPERATION, TMP_MESSAGING_CONSUMER_ID, TMP_MESSAGING_RABBITMQ_ROUTING_KEY, TMP_MESSAGING_KAFKA_MESSAGE_KEY, TMP_MESSAGING_KAFKA_CONSUMER_GROUP, TMP_MESSAGING_KAFKA_CLIENT_ID, TMP_MESSAGING_KAFKA_PARTITION, TMP_MESSAGING_KAFKA_TOMBSTONE, TMP_RPC_SYSTEM, TMP_RPC_SERVICE, TMP_RPC_METHOD, TMP_RPC_GRPC_STATUS_CODE, TMP_RPC_JSONRPC_VERSION, TMP_RPC_JSONRPC_REQUEST_ID, TMP_RPC_JSONRPC_ERROR_CODE, TMP_RPC_JSONRPC_ERROR_MESSAGE, TMP_MESSAGE_TYPE, TMP_MESSAGE_ID, TMP_MESSAGE_COMPRESSED_SIZE, TMP_MESSAGE_UNCOMPRESSED_SIZE, SEMATTRS_AWS_LAMBDA_INVOKED_ARN, SEMATTRS_DB_SYSTEM, SEMATTRS_DB_CONNECTION_STRING, SEMATTRS_DB_USER, SEMATTRS_DB_JDBC_DRIVER_CLASSNAME, SEMATTRS_DB_NAME, SEMATTRS_DB_STATEMENT, SEMATTRS_DB_OPERATION, SEMATTRS_DB_MSSQL_INSTANCE_NAME, SEMATTRS_DB_CASSANDRA_KEYSPACE, SEMATTRS_DB_CASSANDRA_PAGE_SIZE, SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL, SEMATTRS_DB_CASSANDRA_TABLE, SEMATTRS_DB_CASSANDRA_IDEMPOTENCE, SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, SEMATTRS_DB_CASSANDRA_COORDINATOR_ID, SEMATTRS_DB_CASSANDRA_COORDINATOR_DC, SEMATTRS_DB_HBASE_NAMESPACE, SEMATTRS_DB_REDIS_DATABASE_INDEX, SEMATTRS_DB_MONGODB_COLLECTION, SEMATTRS_DB_SQL_TABLE, SEMATTRS_EXCEPTION_TYPE, SEMATTRS_EXCEPTION_MESSAGE, SEMATTRS_EXCEPTION_STACKTRACE, SEMATTRS_EXCEPTION_ESCAPED, SEMATTRS_FAAS_TRIGGER, SEMATTRS_FAAS_EXECUTION, SEMATTRS_FAAS_DOCUMENT_COLLECTION, SEMATTRS_FAAS_DOCUMENT_OPERATION, SEMATTRS_FAAS_DOCUMENT_TIME, SEMATTRS_FAAS_DOCUMENT_NAME, SEMATTRS_FAAS_TIME, SEMATTRS_FAAS_CRON, SEMATTRS_FAAS_COLDSTART, SEMATTRS_FAAS_INVOKED_NAME, SEMATTRS_FAAS_INVOKED_PROVIDER, SEMATTRS_FAAS_INVOKED_REGION, SEMATTRS_NET_TRANSPORT, SEMATTRS_NET_PEER_IP, SEMATTRS_NET_PEER_PORT, SEMATTRS_NET_PEER_NAME, SEMATTRS_NET_HOST_IP, SEMATTRS_NET_HOST_PORT, SEMATTRS_NET_HOST_NAME, SEMATTRS_NET_HOST_CONNECTION_TYPE, SEMATTRS_NET_HOST_CONNECTION_SUBTYPE, SEMATTRS_NET_HOST_CARRIER_NAME, SEMATTRS_NET_HOST_CARRIER_MCC, SEMATTRS_NET_HOST_CARRIER_MNC, SEMATTRS_NET_HOST_CARRIER_ICC, SEMATTRS_PEER_SERVICE, SEMATTRS_ENDUSER_ID, SEMATTRS_ENDUSER_ROLE, SEMATTRS_ENDUSER_SCOPE, SEMATTRS_THREAD_ID, SEMATTRS_THREAD_NAME, SEMATTRS_CODE_FUNCTION, SEMATTRS_CODE_NAMESPACE, SEMATTRS_CODE_FILEPATH, SEMATTRS_CODE_LINENO, SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_URL, SEMATTRS_HTTP_TARGET, SEMATTRS_HTTP_HOST, SEMATTRS_HTTP_SCHEME, SEMATTRS_HTTP_STATUS_CODE, SEMATTRS_HTTP_FLAVOR, SEMATTRS_HTTP_USER_AGENT, SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH, SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, SEMATTRS_HTTP_SERVER_NAME, SEMATTRS_HTTP_ROUTE, SEMATTRS_HTTP_CLIENT_IP, SEMATTRS_AWS_DYNAMODB_TABLE_NAMES, SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY, SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ, SEMATTRS_AWS_DYNAMODB_PROJECTION, SEMATTRS_AWS_DYNAMODB_LIMIT, SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET, SEMATTRS_AWS_DYNAMODB_INDEX_NAME, SEMATTRS_AWS_DYNAMODB_SELECT, SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, SEMATTRS_AWS_DYNAMODB_TABLE_COUNT, SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD, SEMATTRS_AWS_DYNAMODB_SEGMENT, SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS, SEMATTRS_AWS_DYNAMODB_COUNT, SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT, SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, SEMATTRS_MESSAGING_SYSTEM, SEMATTRS_MESSAGING_DESTINATION, SEMATTRS_MESSAGING_DESTINATION_KIND, SEMATTRS_MESSAGING_TEMP_DESTINATION, SEMATTRS_MESSAGING_PROTOCOL, SEMATTRS_MESSAGING_PROTOCOL_VERSION, SEMATTRS_MESSAGING_URL, SEMATTRS_MESSAGING_MESSAGE_ID, SEMATTRS_MESSAGING_CONVERSATION_ID, SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, SEMATTRS_MESSAGING_OPERATION, SEMATTRS_MESSAGING_CONSUMER_ID, SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY, SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY, SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP, SEMATTRS_MESSAGING_KAFKA_CLIENT_ID, SEMATTRS_MESSAGING_KAFKA_PARTITION, SEMATTRS_MESSAGING_KAFKA_TOMBSTONE, SEMATTRS_RPC_SYSTEM, SEMATTRS_RPC_SERVICE, SEMATTRS_RPC_METHOD, SEMATTRS_RPC_GRPC_STATUS_CODE, SEMATTRS_RPC_JSONRPC_VERSION, SEMATTRS_RPC_JSONRPC_REQUEST_ID, SEMATTRS_RPC_JSONRPC_ERROR_CODE, SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE, SEMATTRS_MESSAGE_TYPE, SEMATTRS_MESSAGE_ID, SEMATTRS_MESSAGE_COMPRESSED_SIZE, SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE, SemanticAttributes, TMP_DBSYSTEMVALUES_OTHER_SQL, TMP_DBSYSTEMVALUES_MSSQL, TMP_DBSYSTEMVALUES_MYSQL, TMP_DBSYSTEMVALUES_ORACLE, TMP_DBSYSTEMVALUES_DB2, TMP_DBSYSTEMVALUES_POSTGRESQL, TMP_DBSYSTEMVALUES_REDSHIFT, TMP_DBSYSTEMVALUES_HIVE, TMP_DBSYSTEMVALUES_CLOUDSCAPE, TMP_DBSYSTEMVALUES_HSQLDB, TMP_DBSYSTEMVALUES_PROGRESS, TMP_DBSYSTEMVALUES_MAXDB, TMP_DBSYSTEMVALUES_HANADB, TMP_DBSYSTEMVALUES_INGRES, TMP_DBSYSTEMVALUES_FIRSTSQL, TMP_DBSYSTEMVALUES_EDB, TMP_DBSYSTEMVALUES_CACHE, TMP_DBSYSTEMVALUES_ADABAS, TMP_DBSYSTEMVALUES_FIREBIRD, TMP_DBSYSTEMVALUES_DERBY, TMP_DBSYSTEMVALUES_FILEMAKER, TMP_DBSYSTEMVALUES_INFORMIX, TMP_DBSYSTEMVALUES_INSTANTDB, TMP_DBSYSTEMVALUES_INTERBASE, TMP_DBSYSTEMVALUES_MARIADB, TMP_DBSYSTEMVALUES_NETEZZA, TMP_DBSYSTEMVALUES_PERVASIVE, TMP_DBSYSTEMVALUES_POINTBASE, TMP_DBSYSTEMVALUES_SQLITE, TMP_DBSYSTEMVALUES_SYBASE, TMP_DBSYSTEMVALUES_TERADATA, TMP_DBSYSTEMVALUES_VERTICA, TMP_DBSYSTEMVALUES_H2, TMP_DBSYSTEMVALUES_COLDFUSION, TMP_DBSYSTEMVALUES_CASSANDRA, TMP_DBSYSTEMVALUES_HBASE, TMP_DBSYSTEMVALUES_MONGODB, TMP_DBSYSTEMVALUES_REDIS, TMP_DBSYSTEMVALUES_COUCHBASE, TMP_DBSYSTEMVALUES_COUCHDB, TMP_DBSYSTEMVALUES_COSMOSDB, TMP_DBSYSTEMVALUES_DYNAMODB, TMP_DBSYSTEMVALUES_NEO4J, TMP_DBSYSTEMVALUES_GEODE, TMP_DBSYSTEMVALUES_ELASTICSEARCH, TMP_DBSYSTEMVALUES_MEMCACHED, TMP_DBSYSTEMVALUES_COCKROACHDB, DBSYSTEMVALUES_OTHER_SQL, DBSYSTEMVALUES_MSSQL, DBSYSTEMVALUES_MYSQL, DBSYSTEMVALUES_ORACLE, DBSYSTEMVALUES_DB2, DBSYSTEMVALUES_POSTGRESQL, DBSYSTEMVALUES_REDSHIFT, DBSYSTEMVALUES_HIVE, DBSYSTEMVALUES_CLOUDSCAPE, DBSYSTEMVALUES_HSQLDB, DBSYSTEMVALUES_PROGRESS, DBSYSTEMVALUES_MAXDB, DBSYSTEMVALUES_HANADB, DBSYSTEMVALUES_INGRES, DBSYSTEMVALUES_FIRSTSQL, DBSYSTEMVALUES_EDB, DBSYSTEMVALUES_CACHE, DBSYSTEMVALUES_ADABAS, DBSYSTEMVALUES_FIREBIRD, DBSYSTEMVALUES_DERBY, DBSYSTEMVALUES_FILEMAKER, DBSYSTEMVALUES_INFORMIX, DBSYSTEMVALUES_INSTANTDB, DBSYSTEMVALUES_INTERBASE, DBSYSTEMVALUES_MARIADB, DBSYSTEMVALUES_NETEZZA, DBSYSTEMVALUES_PERVASIVE, DBSYSTEMVALUES_POINTBASE, DBSYSTEMVALUES_SQLITE, DBSYSTEMVALUES_SYBASE, DBSYSTEMVALUES_TERADATA, DBSYSTEMVALUES_VERTICA, DBSYSTEMVALUES_H2, DBSYSTEMVALUES_COLDFUSION, DBSYSTEMVALUES_CASSANDRA, DBSYSTEMVALUES_HBASE, DBSYSTEMVALUES_MONGODB, DBSYSTEMVALUES_REDIS, DBSYSTEMVALUES_COUCHBASE, DBSYSTEMVALUES_COUCHDB, DBSYSTEMVALUES_COSMOSDB, DBSYSTEMVALUES_DYNAMODB, DBSYSTEMVALUES_NEO4J, DBSYSTEMVALUES_GEODE, DBSYSTEMVALUES_ELASTICSEARCH, DBSYSTEMVALUES_MEMCACHED, DBSYSTEMVALUES_COCKROACHDB, DbSystemValues, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, DBCASSANDRACONSISTENCYLEVELVALUES_ALL, DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_ONE, DBCASSANDRACONSISTENCYLEVELVALUES_TWO, DBCASSANDRACONSISTENCYLEVELVALUES_THREE, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, DBCASSANDRACONSISTENCYLEVELVALUES_ANY, DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, DbCassandraConsistencyLevelValues, TMP_FAASTRIGGERVALUES_DATASOURCE, TMP_FAASTRIGGERVALUES_HTTP, TMP_FAASTRIGGERVALUES_PUBSUB, TMP_FAASTRIGGERVALUES_TIMER, TMP_FAASTRIGGERVALUES_OTHER, FAASTRIGGERVALUES_DATASOURCE, FAASTRIGGERVALUES_HTTP, FAASTRIGGERVALUES_PUBSUB, FAASTRIGGERVALUES_TIMER, FAASTRIGGERVALUES_OTHER, FaasTriggerValues, TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, TMP_FAASDOCUMENTOPERATIONVALUES_DELETE, FAASDOCUMENTOPERATIONVALUES_INSERT, FAASDOCUMENTOPERATIONVALUES_EDIT, FAASDOCUMENTOPERATIONVALUES_DELETE, FaasDocumentOperationValues, TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, TMP_FAASINVOKEDPROVIDERVALUES_AWS, TMP_FAASINVOKEDPROVIDERVALUES_AZURE, TMP_FAASINVOKEDPROVIDERVALUES_GCP, FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, FAASINVOKEDPROVIDERVALUES_AWS, FAASINVOKEDPROVIDERVALUES_AZURE, FAASINVOKEDPROVIDERVALUES_GCP, FaasInvokedProviderValues, TMP_NETTRANSPORTVALUES_IP_TCP, TMP_NETTRANSPORTVALUES_IP_UDP, TMP_NETTRANSPORTVALUES_IP, TMP_NETTRANSPORTVALUES_UNIX, TMP_NETTRANSPORTVALUES_PIPE, TMP_NETTRANSPORTVALUES_INPROC, TMP_NETTRANSPORTVALUES_OTHER, NETTRANSPORTVALUES_IP_TCP, NETTRANSPORTVALUES_IP_UDP, NETTRANSPORTVALUES_IP, NETTRANSPORTVALUES_UNIX, NETTRANSPORTVALUES_PIPE, NETTRANSPORTVALUES_INPROC, NETTRANSPORTVALUES_OTHER, NetTransportValues, TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, NETHOSTCONNECTIONTYPEVALUES_WIFI, NETHOSTCONNECTIONTYPEVALUES_WIRED, NETHOSTCONNECTIONTYPEVALUES_CELL, NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, NetHostConnectionTypeValues, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, NETHOSTCONNECTIONSUBTYPEVALUES_LTE, NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, NETHOSTCONNECTIONSUBTYPEVALUES_GSM, NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, NETHOSTCONNECTIONSUBTYPEVALUES_NR, NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, NetHostConnectionSubtypeValues, TMP_HTTPFLAVORVALUES_HTTP_1_0, TMP_HTTPFLAVORVALUES_HTTP_1_1, TMP_HTTPFLAVORVALUES_HTTP_2_0, TMP_HTTPFLAVORVALUES_SPDY, TMP_HTTPFLAVORVALUES_QUIC, HTTPFLAVORVALUES_HTTP_1_0, HTTPFLAVORVALUES_HTTP_1_1, HTTPFLAVORVALUES_HTTP_2_0, HTTPFLAVORVALUES_SPDY, HTTPFLAVORVALUES_QUIC, HttpFlavorValues, TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC, MESSAGINGDESTINATIONKINDVALUES_QUEUE, MESSAGINGDESTINATIONKINDVALUES_TOPIC, MessagingDestinationKindValues, TMP_MESSAGINGOPERATIONVALUES_RECEIVE, TMP_MESSAGINGOPERATIONVALUES_PROCESS, MESSAGINGOPERATIONVALUES_RECEIVE, MESSAGINGOPERATIONVALUES_PROCESS, MessagingOperationValues, TMP_RPCGRPCSTATUSCODEVALUES_OK, TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, RPCGRPCSTATUSCODEVALUES_OK, RPCGRPCSTATUSCODEVALUES_CANCELLED, RPCGRPCSTATUSCODEVALUES_UNKNOWN, RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, RPCGRPCSTATUSCODEVALUES_NOT_FOUND, RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, RPCGRPCSTATUSCODEVALUES_ABORTED, RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, RPCGRPCSTATUSCODEVALUES_INTERNAL, RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, RPCGRPCSTATUSCODEVALUES_DATA_LOSS, RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, RpcGrpcStatusCodeValues, TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED, MESSAGETYPEVALUES_SENT, MESSAGETYPEVALUES_RECEIVED, MessageTypeValues; +var init_SemanticAttributes = __esmMin((() => { + init_utils(); + TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; + TMP_DB_SYSTEM = "db.system"; + TMP_DB_CONNECTION_STRING = "db.connection_string"; + TMP_DB_USER = "db.user"; + TMP_DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname"; + TMP_DB_NAME = "db.name"; + TMP_DB_STATEMENT = "db.statement"; + TMP_DB_OPERATION = "db.operation"; + TMP_DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name"; + TMP_DB_CASSANDRA_KEYSPACE = "db.cassandra.keyspace"; + TMP_DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size"; + TMP_DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level"; + TMP_DB_CASSANDRA_TABLE = "db.cassandra.table"; + TMP_DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence"; + TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count"; + TMP_DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id"; + TMP_DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc"; + TMP_DB_HBASE_NAMESPACE = "db.hbase.namespace"; + TMP_DB_REDIS_DATABASE_INDEX = "db.redis.database_index"; + TMP_DB_MONGODB_COLLECTION = "db.mongodb.collection"; + TMP_DB_SQL_TABLE = "db.sql.table"; + TMP_EXCEPTION_TYPE = "exception.type"; + TMP_EXCEPTION_MESSAGE = "exception.message"; + TMP_EXCEPTION_STACKTRACE = "exception.stacktrace"; + TMP_EXCEPTION_ESCAPED = "exception.escaped"; + TMP_FAAS_TRIGGER = "faas.trigger"; + TMP_FAAS_EXECUTION = "faas.execution"; + TMP_FAAS_DOCUMENT_COLLECTION = "faas.document.collection"; + TMP_FAAS_DOCUMENT_OPERATION = "faas.document.operation"; + TMP_FAAS_DOCUMENT_TIME = "faas.document.time"; + TMP_FAAS_DOCUMENT_NAME = "faas.document.name"; + TMP_FAAS_TIME = "faas.time"; + TMP_FAAS_CRON = "faas.cron"; + TMP_FAAS_COLDSTART = "faas.coldstart"; + TMP_FAAS_INVOKED_NAME = "faas.invoked_name"; + TMP_FAAS_INVOKED_PROVIDER = "faas.invoked_provider"; + TMP_FAAS_INVOKED_REGION = "faas.invoked_region"; + TMP_NET_TRANSPORT = "net.transport"; + TMP_NET_PEER_IP = "net.peer.ip"; + TMP_NET_PEER_PORT = "net.peer.port"; + TMP_NET_PEER_NAME = "net.peer.name"; + TMP_NET_HOST_IP = "net.host.ip"; + TMP_NET_HOST_PORT = "net.host.port"; + TMP_NET_HOST_NAME = "net.host.name"; + TMP_NET_HOST_CONNECTION_TYPE = "net.host.connection.type"; + TMP_NET_HOST_CONNECTION_SUBTYPE = "net.host.connection.subtype"; + TMP_NET_HOST_CARRIER_NAME = "net.host.carrier.name"; + TMP_NET_HOST_CARRIER_MCC = "net.host.carrier.mcc"; + TMP_NET_HOST_CARRIER_MNC = "net.host.carrier.mnc"; + TMP_NET_HOST_CARRIER_ICC = "net.host.carrier.icc"; + TMP_PEER_SERVICE = "peer.service"; + TMP_ENDUSER_ID = "enduser.id"; + TMP_ENDUSER_ROLE = "enduser.role"; + TMP_ENDUSER_SCOPE = "enduser.scope"; + TMP_THREAD_ID = "thread.id"; + TMP_THREAD_NAME = "thread.name"; + TMP_CODE_FUNCTION = "code.function"; + TMP_CODE_NAMESPACE = "code.namespace"; + TMP_CODE_FILEPATH = "code.filepath"; + TMP_CODE_LINENO = "code.lineno"; + TMP_HTTP_METHOD = "http.method"; + TMP_HTTP_URL = "http.url"; + TMP_HTTP_TARGET = "http.target"; + TMP_HTTP_HOST = "http.host"; + TMP_HTTP_SCHEME = "http.scheme"; + TMP_HTTP_STATUS_CODE = "http.status_code"; + TMP_HTTP_FLAVOR = "http.flavor"; + TMP_HTTP_USER_AGENT = "http.user_agent"; + TMP_HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length"; + TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = "http.request_content_length_uncompressed"; + TMP_HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length"; + TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = "http.response_content_length_uncompressed"; + TMP_HTTP_SERVER_NAME = "http.server_name"; + TMP_HTTP_ROUTE = "http.route"; + TMP_HTTP_CLIENT_IP = "http.client_ip"; + TMP_AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names"; + TMP_AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity"; + TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics"; + TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity"; + TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity"; + TMP_AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read"; + TMP_AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection"; + TMP_AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit"; + TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get"; + TMP_AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name"; + TMP_AWS_DYNAMODB_SELECT = "aws.dynamodb.select"; + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes"; + TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes"; + TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table"; + TMP_AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count"; + TMP_AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward"; + TMP_AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment"; + TMP_AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments"; + TMP_AWS_DYNAMODB_COUNT = "aws.dynamodb.count"; + TMP_AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count"; + TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions"; + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates"; + TMP_MESSAGING_SYSTEM = "messaging.system"; + TMP_MESSAGING_DESTINATION = "messaging.destination"; + TMP_MESSAGING_DESTINATION_KIND = "messaging.destination_kind"; + TMP_MESSAGING_TEMP_DESTINATION = "messaging.temp_destination"; + TMP_MESSAGING_PROTOCOL = "messaging.protocol"; + TMP_MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version"; + TMP_MESSAGING_URL = "messaging.url"; + TMP_MESSAGING_MESSAGE_ID = "messaging.message_id"; + TMP_MESSAGING_CONVERSATION_ID = "messaging.conversation_id"; + TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message_payload_size_bytes"; + TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = "messaging.message_payload_compressed_size_bytes"; + TMP_MESSAGING_OPERATION = "messaging.operation"; + TMP_MESSAGING_CONSUMER_ID = "messaging.consumer_id"; + TMP_MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key"; + TMP_MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message_key"; + TMP_MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer_group"; + TMP_MESSAGING_KAFKA_CLIENT_ID = "messaging.kafka.client_id"; + TMP_MESSAGING_KAFKA_PARTITION = "messaging.kafka.partition"; + TMP_MESSAGING_KAFKA_TOMBSTONE = "messaging.kafka.tombstone"; + TMP_RPC_SYSTEM = "rpc.system"; + TMP_RPC_SERVICE = "rpc.service"; + TMP_RPC_METHOD = "rpc.method"; + TMP_RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code"; + TMP_RPC_JSONRPC_VERSION = "rpc.jsonrpc.version"; + TMP_RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id"; + TMP_RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code"; + TMP_RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message"; + TMP_MESSAGE_TYPE = "message.type"; + TMP_MESSAGE_ID = "message.id"; + TMP_MESSAGE_COMPRESSED_SIZE = "message.compressed_size"; + TMP_MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size"; + SEMATTRS_AWS_LAMBDA_INVOKED_ARN = TMP_AWS_LAMBDA_INVOKED_ARN; + SEMATTRS_DB_SYSTEM = TMP_DB_SYSTEM; + SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; + SEMATTRS_DB_USER = TMP_DB_USER; + SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = TMP_DB_JDBC_DRIVER_CLASSNAME; + SEMATTRS_DB_NAME = TMP_DB_NAME; + SEMATTRS_DB_STATEMENT = TMP_DB_STATEMENT; + SEMATTRS_DB_OPERATION = TMP_DB_OPERATION; + SEMATTRS_DB_MSSQL_INSTANCE_NAME = TMP_DB_MSSQL_INSTANCE_NAME; + SEMATTRS_DB_CASSANDRA_KEYSPACE = TMP_DB_CASSANDRA_KEYSPACE; + SEMATTRS_DB_CASSANDRA_PAGE_SIZE = TMP_DB_CASSANDRA_PAGE_SIZE; + SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = TMP_DB_CASSANDRA_CONSISTENCY_LEVEL; + SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; + SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = TMP_DB_CASSANDRA_IDEMPOTENCE; + SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT; + SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = TMP_DB_CASSANDRA_COORDINATOR_ID; + SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = TMP_DB_CASSANDRA_COORDINATOR_DC; + SEMATTRS_DB_HBASE_NAMESPACE = TMP_DB_HBASE_NAMESPACE; + SEMATTRS_DB_REDIS_DATABASE_INDEX = TMP_DB_REDIS_DATABASE_INDEX; + SEMATTRS_DB_MONGODB_COLLECTION = TMP_DB_MONGODB_COLLECTION; + SEMATTRS_DB_SQL_TABLE = TMP_DB_SQL_TABLE; + SEMATTRS_EXCEPTION_TYPE = TMP_EXCEPTION_TYPE; + SEMATTRS_EXCEPTION_MESSAGE = TMP_EXCEPTION_MESSAGE; + SEMATTRS_EXCEPTION_STACKTRACE = TMP_EXCEPTION_STACKTRACE; + SEMATTRS_EXCEPTION_ESCAPED = TMP_EXCEPTION_ESCAPED; + SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; + SEMATTRS_FAAS_EXECUTION = TMP_FAAS_EXECUTION; + SEMATTRS_FAAS_DOCUMENT_COLLECTION = TMP_FAAS_DOCUMENT_COLLECTION; + SEMATTRS_FAAS_DOCUMENT_OPERATION = TMP_FAAS_DOCUMENT_OPERATION; + SEMATTRS_FAAS_DOCUMENT_TIME = TMP_FAAS_DOCUMENT_TIME; + SEMATTRS_FAAS_DOCUMENT_NAME = TMP_FAAS_DOCUMENT_NAME; + SEMATTRS_FAAS_TIME = TMP_FAAS_TIME; + SEMATTRS_FAAS_CRON = TMP_FAAS_CRON; + SEMATTRS_FAAS_COLDSTART = TMP_FAAS_COLDSTART; + SEMATTRS_FAAS_INVOKED_NAME = TMP_FAAS_INVOKED_NAME; + SEMATTRS_FAAS_INVOKED_PROVIDER = TMP_FAAS_INVOKED_PROVIDER; + SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; + SEMATTRS_NET_TRANSPORT = TMP_NET_TRANSPORT; + SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; + SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; + SEMATTRS_NET_PEER_NAME = TMP_NET_PEER_NAME; + SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; + SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; + SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; + SEMATTRS_NET_HOST_CONNECTION_TYPE = TMP_NET_HOST_CONNECTION_TYPE; + SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; + SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; + SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; + SEMATTRS_NET_HOST_CARRIER_MNC = TMP_NET_HOST_CARRIER_MNC; + SEMATTRS_NET_HOST_CARRIER_ICC = TMP_NET_HOST_CARRIER_ICC; + SEMATTRS_PEER_SERVICE = TMP_PEER_SERVICE; + SEMATTRS_ENDUSER_ID = TMP_ENDUSER_ID; + SEMATTRS_ENDUSER_ROLE = TMP_ENDUSER_ROLE; + SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; + SEMATTRS_THREAD_ID = TMP_THREAD_ID; + SEMATTRS_THREAD_NAME = TMP_THREAD_NAME; + SEMATTRS_CODE_FUNCTION = TMP_CODE_FUNCTION; + SEMATTRS_CODE_NAMESPACE = TMP_CODE_NAMESPACE; + SEMATTRS_CODE_FILEPATH = TMP_CODE_FILEPATH; + SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; + SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD; + SEMATTRS_HTTP_URL = TMP_HTTP_URL; + SEMATTRS_HTTP_TARGET = TMP_HTTP_TARGET; + SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; + SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME; + SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE; + SEMATTRS_HTTP_FLAVOR = TMP_HTTP_FLAVOR; + SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT; + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = TMP_HTTP_REQUEST_CONTENT_LENGTH; + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED; + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH; + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED; + SEMATTRS_HTTP_SERVER_NAME = TMP_HTTP_SERVER_NAME; + SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE; + SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; + SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = TMP_AWS_DYNAMODB_TABLE_NAMES; + SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = TMP_AWS_DYNAMODB_CONSUMED_CAPACITY; + SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS; + SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY; + SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY; + SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; + SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; + SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; + SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET; + SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; + SEMATTRS_AWS_DYNAMODB_SELECT = TMP_AWS_DYNAMODB_SELECT; + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES; + SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES; + SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE; + SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = TMP_AWS_DYNAMODB_TABLE_COUNT; + SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; + SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; + SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; + SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; + SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = TMP_AWS_DYNAMODB_SCANNED_COUNT; + SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS; + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES; + SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM; + SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; + SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; + SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; + SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; + SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; + SEMATTRS_MESSAGING_URL = TMP_MESSAGING_URL; + SEMATTRS_MESSAGING_MESSAGE_ID = TMP_MESSAGING_MESSAGE_ID; + SEMATTRS_MESSAGING_CONVERSATION_ID = TMP_MESSAGING_CONVERSATION_ID; + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES; + SEMATTRS_MESSAGING_OPERATION = TMP_MESSAGING_OPERATION; + SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; + SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = TMP_MESSAGING_RABBITMQ_ROUTING_KEY; + SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = TMP_MESSAGING_KAFKA_MESSAGE_KEY; + SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = TMP_MESSAGING_KAFKA_CONSUMER_GROUP; + SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; + SEMATTRS_MESSAGING_KAFKA_PARTITION = TMP_MESSAGING_KAFKA_PARTITION; + SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; + SEMATTRS_RPC_SYSTEM = TMP_RPC_SYSTEM; + SEMATTRS_RPC_SERVICE = TMP_RPC_SERVICE; + SEMATTRS_RPC_METHOD = TMP_RPC_METHOD; + SEMATTRS_RPC_GRPC_STATUS_CODE = TMP_RPC_GRPC_STATUS_CODE; + SEMATTRS_RPC_JSONRPC_VERSION = TMP_RPC_JSONRPC_VERSION; + SEMATTRS_RPC_JSONRPC_REQUEST_ID = TMP_RPC_JSONRPC_REQUEST_ID; + SEMATTRS_RPC_JSONRPC_ERROR_CODE = TMP_RPC_JSONRPC_ERROR_CODE; + SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; + SEMATTRS_MESSAGE_TYPE = TMP_MESSAGE_TYPE; + SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; + SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; + SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = TMP_MESSAGE_UNCOMPRESSED_SIZE; + SemanticAttributes = /* @__PURE__ */ createConstMap([ + TMP_AWS_LAMBDA_INVOKED_ARN, + TMP_DB_SYSTEM, + TMP_DB_CONNECTION_STRING, + TMP_DB_USER, + TMP_DB_JDBC_DRIVER_CLASSNAME, + TMP_DB_NAME, + TMP_DB_STATEMENT, + TMP_DB_OPERATION, + TMP_DB_MSSQL_INSTANCE_NAME, + TMP_DB_CASSANDRA_KEYSPACE, + TMP_DB_CASSANDRA_PAGE_SIZE, + TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, + TMP_DB_CASSANDRA_TABLE, + TMP_DB_CASSANDRA_IDEMPOTENCE, + TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, + TMP_DB_CASSANDRA_COORDINATOR_ID, + TMP_DB_CASSANDRA_COORDINATOR_DC, + TMP_DB_HBASE_NAMESPACE, + TMP_DB_REDIS_DATABASE_INDEX, + TMP_DB_MONGODB_COLLECTION, + TMP_DB_SQL_TABLE, + TMP_EXCEPTION_TYPE, + TMP_EXCEPTION_MESSAGE, + TMP_EXCEPTION_STACKTRACE, + TMP_EXCEPTION_ESCAPED, + TMP_FAAS_TRIGGER, + TMP_FAAS_EXECUTION, + TMP_FAAS_DOCUMENT_COLLECTION, + TMP_FAAS_DOCUMENT_OPERATION, + TMP_FAAS_DOCUMENT_TIME, + TMP_FAAS_DOCUMENT_NAME, + TMP_FAAS_TIME, + TMP_FAAS_CRON, + TMP_FAAS_COLDSTART, + TMP_FAAS_INVOKED_NAME, + TMP_FAAS_INVOKED_PROVIDER, + TMP_FAAS_INVOKED_REGION, + TMP_NET_TRANSPORT, + TMP_NET_PEER_IP, + TMP_NET_PEER_PORT, + TMP_NET_PEER_NAME, + TMP_NET_HOST_IP, + TMP_NET_HOST_PORT, + TMP_NET_HOST_NAME, + TMP_NET_HOST_CONNECTION_TYPE, + TMP_NET_HOST_CONNECTION_SUBTYPE, + TMP_NET_HOST_CARRIER_NAME, + TMP_NET_HOST_CARRIER_MCC, + TMP_NET_HOST_CARRIER_MNC, + TMP_NET_HOST_CARRIER_ICC, + TMP_PEER_SERVICE, + TMP_ENDUSER_ID, + TMP_ENDUSER_ROLE, + TMP_ENDUSER_SCOPE, + TMP_THREAD_ID, + TMP_THREAD_NAME, + TMP_CODE_FUNCTION, + TMP_CODE_NAMESPACE, + TMP_CODE_FILEPATH, + TMP_CODE_LINENO, + TMP_HTTP_METHOD, + TMP_HTTP_URL, + TMP_HTTP_TARGET, + TMP_HTTP_HOST, + TMP_HTTP_SCHEME, + TMP_HTTP_STATUS_CODE, + TMP_HTTP_FLAVOR, + TMP_HTTP_USER_AGENT, + TMP_HTTP_REQUEST_CONTENT_LENGTH, + TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_RESPONSE_CONTENT_LENGTH, + TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_SERVER_NAME, + TMP_HTTP_ROUTE, + TMP_HTTP_CLIENT_IP, + TMP_AWS_DYNAMODB_TABLE_NAMES, + TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, + TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, + TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, + TMP_AWS_DYNAMODB_CONSISTENT_READ, + TMP_AWS_DYNAMODB_PROJECTION, + TMP_AWS_DYNAMODB_LIMIT, + TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, + TMP_AWS_DYNAMODB_INDEX_NAME, + TMP_AWS_DYNAMODB_SELECT, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, + TMP_AWS_DYNAMODB_TABLE_COUNT, + TMP_AWS_DYNAMODB_SCAN_FORWARD, + TMP_AWS_DYNAMODB_SEGMENT, + TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, + TMP_AWS_DYNAMODB_COUNT, + TMP_AWS_DYNAMODB_SCANNED_COUNT, + TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, + TMP_MESSAGING_SYSTEM, + TMP_MESSAGING_DESTINATION, + TMP_MESSAGING_DESTINATION_KIND, + TMP_MESSAGING_TEMP_DESTINATION, + TMP_MESSAGING_PROTOCOL, + TMP_MESSAGING_PROTOCOL_VERSION, + TMP_MESSAGING_URL, + TMP_MESSAGING_MESSAGE_ID, + TMP_MESSAGING_CONVERSATION_ID, + TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, + TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, + TMP_MESSAGING_OPERATION, + TMP_MESSAGING_CONSUMER_ID, + TMP_MESSAGING_RABBITMQ_ROUTING_KEY, + TMP_MESSAGING_KAFKA_MESSAGE_KEY, + TMP_MESSAGING_KAFKA_CONSUMER_GROUP, + TMP_MESSAGING_KAFKA_CLIENT_ID, + TMP_MESSAGING_KAFKA_PARTITION, + TMP_MESSAGING_KAFKA_TOMBSTONE, + TMP_RPC_SYSTEM, + TMP_RPC_SERVICE, + TMP_RPC_METHOD, + TMP_RPC_GRPC_STATUS_CODE, + TMP_RPC_JSONRPC_VERSION, + TMP_RPC_JSONRPC_REQUEST_ID, + TMP_RPC_JSONRPC_ERROR_CODE, + TMP_RPC_JSONRPC_ERROR_MESSAGE, + TMP_MESSAGE_TYPE, + TMP_MESSAGE_ID, + TMP_MESSAGE_COMPRESSED_SIZE, + TMP_MESSAGE_UNCOMPRESSED_SIZE + ]); + TMP_DBSYSTEMVALUES_OTHER_SQL = "other_sql"; + TMP_DBSYSTEMVALUES_MSSQL = "mssql"; + TMP_DBSYSTEMVALUES_MYSQL = "mysql"; + TMP_DBSYSTEMVALUES_ORACLE = "oracle"; + TMP_DBSYSTEMVALUES_DB2 = "db2"; + TMP_DBSYSTEMVALUES_POSTGRESQL = "postgresql"; + TMP_DBSYSTEMVALUES_REDSHIFT = "redshift"; + TMP_DBSYSTEMVALUES_HIVE = "hive"; + TMP_DBSYSTEMVALUES_CLOUDSCAPE = "cloudscape"; + TMP_DBSYSTEMVALUES_HSQLDB = "hsqldb"; + TMP_DBSYSTEMVALUES_PROGRESS = "progress"; + TMP_DBSYSTEMVALUES_MAXDB = "maxdb"; + TMP_DBSYSTEMVALUES_HANADB = "hanadb"; + TMP_DBSYSTEMVALUES_INGRES = "ingres"; + TMP_DBSYSTEMVALUES_FIRSTSQL = "firstsql"; + TMP_DBSYSTEMVALUES_EDB = "edb"; + TMP_DBSYSTEMVALUES_CACHE = "cache"; + TMP_DBSYSTEMVALUES_ADABAS = "adabas"; + TMP_DBSYSTEMVALUES_FIREBIRD = "firebird"; + TMP_DBSYSTEMVALUES_DERBY = "derby"; + TMP_DBSYSTEMVALUES_FILEMAKER = "filemaker"; + TMP_DBSYSTEMVALUES_INFORMIX = "informix"; + TMP_DBSYSTEMVALUES_INSTANTDB = "instantdb"; + TMP_DBSYSTEMVALUES_INTERBASE = "interbase"; + TMP_DBSYSTEMVALUES_MARIADB = "mariadb"; + TMP_DBSYSTEMVALUES_NETEZZA = "netezza"; + TMP_DBSYSTEMVALUES_PERVASIVE = "pervasive"; + TMP_DBSYSTEMVALUES_POINTBASE = "pointbase"; + TMP_DBSYSTEMVALUES_SQLITE = "sqlite"; + TMP_DBSYSTEMVALUES_SYBASE = "sybase"; + TMP_DBSYSTEMVALUES_TERADATA = "teradata"; + TMP_DBSYSTEMVALUES_VERTICA = "vertica"; + TMP_DBSYSTEMVALUES_H2 = "h2"; + TMP_DBSYSTEMVALUES_COLDFUSION = "coldfusion"; + TMP_DBSYSTEMVALUES_CASSANDRA = "cassandra"; + TMP_DBSYSTEMVALUES_HBASE = "hbase"; + TMP_DBSYSTEMVALUES_MONGODB = "mongodb"; + TMP_DBSYSTEMVALUES_REDIS = "redis"; + TMP_DBSYSTEMVALUES_COUCHBASE = "couchbase"; + TMP_DBSYSTEMVALUES_COUCHDB = "couchdb"; + TMP_DBSYSTEMVALUES_COSMOSDB = "cosmosdb"; + TMP_DBSYSTEMVALUES_DYNAMODB = "dynamodb"; + TMP_DBSYSTEMVALUES_NEO4J = "neo4j"; + TMP_DBSYSTEMVALUES_GEODE = "geode"; + TMP_DBSYSTEMVALUES_ELASTICSEARCH = "elasticsearch"; + TMP_DBSYSTEMVALUES_MEMCACHED = "memcached"; + TMP_DBSYSTEMVALUES_COCKROACHDB = "cockroachdb"; + DBSYSTEMVALUES_OTHER_SQL = TMP_DBSYSTEMVALUES_OTHER_SQL; + DBSYSTEMVALUES_MSSQL = TMP_DBSYSTEMVALUES_MSSQL; + DBSYSTEMVALUES_MYSQL = TMP_DBSYSTEMVALUES_MYSQL; + DBSYSTEMVALUES_ORACLE = TMP_DBSYSTEMVALUES_ORACLE; + DBSYSTEMVALUES_DB2 = TMP_DBSYSTEMVALUES_DB2; + DBSYSTEMVALUES_POSTGRESQL = TMP_DBSYSTEMVALUES_POSTGRESQL; + DBSYSTEMVALUES_REDSHIFT = TMP_DBSYSTEMVALUES_REDSHIFT; + DBSYSTEMVALUES_HIVE = TMP_DBSYSTEMVALUES_HIVE; + DBSYSTEMVALUES_CLOUDSCAPE = TMP_DBSYSTEMVALUES_CLOUDSCAPE; + DBSYSTEMVALUES_HSQLDB = TMP_DBSYSTEMVALUES_HSQLDB; + DBSYSTEMVALUES_PROGRESS = TMP_DBSYSTEMVALUES_PROGRESS; + DBSYSTEMVALUES_MAXDB = TMP_DBSYSTEMVALUES_MAXDB; + DBSYSTEMVALUES_HANADB = TMP_DBSYSTEMVALUES_HANADB; + DBSYSTEMVALUES_INGRES = TMP_DBSYSTEMVALUES_INGRES; + DBSYSTEMVALUES_FIRSTSQL = TMP_DBSYSTEMVALUES_FIRSTSQL; + DBSYSTEMVALUES_EDB = TMP_DBSYSTEMVALUES_EDB; + DBSYSTEMVALUES_CACHE = TMP_DBSYSTEMVALUES_CACHE; + DBSYSTEMVALUES_ADABAS = TMP_DBSYSTEMVALUES_ADABAS; + DBSYSTEMVALUES_FIREBIRD = TMP_DBSYSTEMVALUES_FIREBIRD; + DBSYSTEMVALUES_DERBY = TMP_DBSYSTEMVALUES_DERBY; + DBSYSTEMVALUES_FILEMAKER = TMP_DBSYSTEMVALUES_FILEMAKER; + DBSYSTEMVALUES_INFORMIX = TMP_DBSYSTEMVALUES_INFORMIX; + DBSYSTEMVALUES_INSTANTDB = TMP_DBSYSTEMVALUES_INSTANTDB; + DBSYSTEMVALUES_INTERBASE = TMP_DBSYSTEMVALUES_INTERBASE; + DBSYSTEMVALUES_MARIADB = TMP_DBSYSTEMVALUES_MARIADB; + DBSYSTEMVALUES_NETEZZA = TMP_DBSYSTEMVALUES_NETEZZA; + DBSYSTEMVALUES_PERVASIVE = TMP_DBSYSTEMVALUES_PERVASIVE; + DBSYSTEMVALUES_POINTBASE = TMP_DBSYSTEMVALUES_POINTBASE; + DBSYSTEMVALUES_SQLITE = TMP_DBSYSTEMVALUES_SQLITE; + DBSYSTEMVALUES_SYBASE = TMP_DBSYSTEMVALUES_SYBASE; + DBSYSTEMVALUES_TERADATA = TMP_DBSYSTEMVALUES_TERADATA; + DBSYSTEMVALUES_VERTICA = TMP_DBSYSTEMVALUES_VERTICA; + DBSYSTEMVALUES_H2 = TMP_DBSYSTEMVALUES_H2; + DBSYSTEMVALUES_COLDFUSION = TMP_DBSYSTEMVALUES_COLDFUSION; + DBSYSTEMVALUES_CASSANDRA = TMP_DBSYSTEMVALUES_CASSANDRA; + DBSYSTEMVALUES_HBASE = TMP_DBSYSTEMVALUES_HBASE; + DBSYSTEMVALUES_MONGODB = TMP_DBSYSTEMVALUES_MONGODB; + DBSYSTEMVALUES_REDIS = TMP_DBSYSTEMVALUES_REDIS; + DBSYSTEMVALUES_COUCHBASE = TMP_DBSYSTEMVALUES_COUCHBASE; + DBSYSTEMVALUES_COUCHDB = TMP_DBSYSTEMVALUES_COUCHDB; + DBSYSTEMVALUES_COSMOSDB = TMP_DBSYSTEMVALUES_COSMOSDB; + DBSYSTEMVALUES_DYNAMODB = TMP_DBSYSTEMVALUES_DYNAMODB; + DBSYSTEMVALUES_NEO4J = TMP_DBSYSTEMVALUES_NEO4J; + DBSYSTEMVALUES_GEODE = TMP_DBSYSTEMVALUES_GEODE; + DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; + DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; + DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; + DbSystemValues = /* @__PURE__ */ createConstMap([ + TMP_DBSYSTEMVALUES_OTHER_SQL, + TMP_DBSYSTEMVALUES_MSSQL, + TMP_DBSYSTEMVALUES_MYSQL, + TMP_DBSYSTEMVALUES_ORACLE, + TMP_DBSYSTEMVALUES_DB2, + TMP_DBSYSTEMVALUES_POSTGRESQL, + TMP_DBSYSTEMVALUES_REDSHIFT, + TMP_DBSYSTEMVALUES_HIVE, + TMP_DBSYSTEMVALUES_CLOUDSCAPE, + TMP_DBSYSTEMVALUES_HSQLDB, + TMP_DBSYSTEMVALUES_PROGRESS, + TMP_DBSYSTEMVALUES_MAXDB, + TMP_DBSYSTEMVALUES_HANADB, + TMP_DBSYSTEMVALUES_INGRES, + TMP_DBSYSTEMVALUES_FIRSTSQL, + TMP_DBSYSTEMVALUES_EDB, + TMP_DBSYSTEMVALUES_CACHE, + TMP_DBSYSTEMVALUES_ADABAS, + TMP_DBSYSTEMVALUES_FIREBIRD, + TMP_DBSYSTEMVALUES_DERBY, + TMP_DBSYSTEMVALUES_FILEMAKER, + TMP_DBSYSTEMVALUES_INFORMIX, + TMP_DBSYSTEMVALUES_INSTANTDB, + TMP_DBSYSTEMVALUES_INTERBASE, + TMP_DBSYSTEMVALUES_MARIADB, + TMP_DBSYSTEMVALUES_NETEZZA, + TMP_DBSYSTEMVALUES_PERVASIVE, + TMP_DBSYSTEMVALUES_POINTBASE, + TMP_DBSYSTEMVALUES_SQLITE, + TMP_DBSYSTEMVALUES_SYBASE, + TMP_DBSYSTEMVALUES_TERADATA, + TMP_DBSYSTEMVALUES_VERTICA, + TMP_DBSYSTEMVALUES_H2, + TMP_DBSYSTEMVALUES_COLDFUSION, + TMP_DBSYSTEMVALUES_CASSANDRA, + TMP_DBSYSTEMVALUES_HBASE, + TMP_DBSYSTEMVALUES_MONGODB, + TMP_DBSYSTEMVALUES_REDIS, + TMP_DBSYSTEMVALUES_COUCHBASE, + TMP_DBSYSTEMVALUES_COUCHDB, + TMP_DBSYSTEMVALUES_COSMOSDB, + TMP_DBSYSTEMVALUES_DYNAMODB, + TMP_DBSYSTEMVALUES_NEO4J, + TMP_DBSYSTEMVALUES_GEODE, + TMP_DBSYSTEMVALUES_ELASTICSEARCH, + TMP_DBSYSTEMVALUES_MEMCACHED, + TMP_DBSYSTEMVALUES_COCKROACHDB + ]); + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL = "all"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = "each_quorum"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = "quorum"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = "local_quorum"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE = "one"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO = "two"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE = "three"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = "local_one"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY = "any"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = "serial"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = "local_serial"; + DBCASSANDRACONSISTENCYLEVELVALUES_ALL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL; + DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM; + DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM; + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM; + DBCASSANDRACONSISTENCYLEVELVALUES_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE; + DBCASSANDRACONSISTENCYLEVELVALUES_TWO = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO; + DBCASSANDRACONSISTENCYLEVELVALUES_THREE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE; + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE; + DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; + DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; + DbCassandraConsistencyLevelValues = /* @__PURE__ */ createConstMap([ + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL + ]); + TMP_FAASTRIGGERVALUES_DATASOURCE = "datasource"; + TMP_FAASTRIGGERVALUES_HTTP = "http"; + TMP_FAASTRIGGERVALUES_PUBSUB = "pubsub"; + TMP_FAASTRIGGERVALUES_TIMER = "timer"; + TMP_FAASTRIGGERVALUES_OTHER = "other"; + FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; + FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; + FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; + FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; + FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; + FaasTriggerValues = /* @__PURE__ */ createConstMap([ + TMP_FAASTRIGGERVALUES_DATASOURCE, + TMP_FAASTRIGGERVALUES_HTTP, + TMP_FAASTRIGGERVALUES_PUBSUB, + TMP_FAASTRIGGERVALUES_TIMER, + TMP_FAASTRIGGERVALUES_OTHER + ]); + TMP_FAASDOCUMENTOPERATIONVALUES_INSERT = "insert"; + TMP_FAASDOCUMENTOPERATIONVALUES_EDIT = "edit"; + TMP_FAASDOCUMENTOPERATIONVALUES_DELETE = "delete"; + FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; + FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; + FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; + FaasDocumentOperationValues = /* @__PURE__ */ createConstMap([ + TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, + TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, + TMP_FAASDOCUMENTOPERATIONVALUES_DELETE + ]); + TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; + TMP_FAASINVOKEDPROVIDERVALUES_AWS = "aws"; + TMP_FAASINVOKEDPROVIDERVALUES_AZURE = "azure"; + TMP_FAASINVOKEDPROVIDERVALUES_GCP = "gcp"; + FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD; + FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; + FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; + FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; + FaasInvokedProviderValues = /* @__PURE__ */ createConstMap([ + TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_FAASINVOKEDPROVIDERVALUES_AWS, + TMP_FAASINVOKEDPROVIDERVALUES_AZURE, + TMP_FAASINVOKEDPROVIDERVALUES_GCP + ]); + TMP_NETTRANSPORTVALUES_IP_TCP = "ip_tcp"; + TMP_NETTRANSPORTVALUES_IP_UDP = "ip_udp"; + TMP_NETTRANSPORTVALUES_IP = "ip"; + TMP_NETTRANSPORTVALUES_UNIX = "unix"; + TMP_NETTRANSPORTVALUES_PIPE = "pipe"; + TMP_NETTRANSPORTVALUES_INPROC = "inproc"; + TMP_NETTRANSPORTVALUES_OTHER = "other"; + NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; + NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; + NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; + NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; + NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; + NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; + NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; + NetTransportValues = /* @__PURE__ */ createConstMap([ + TMP_NETTRANSPORTVALUES_IP_TCP, + TMP_NETTRANSPORTVALUES_IP_UDP, + TMP_NETTRANSPORTVALUES_IP, + TMP_NETTRANSPORTVALUES_UNIX, + TMP_NETTRANSPORTVALUES_PIPE, + TMP_NETTRANSPORTVALUES_INPROC, + TMP_NETTRANSPORTVALUES_OTHER + ]); + TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI = "wifi"; + TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED = "wired"; + TMP_NETHOSTCONNECTIONTYPEVALUES_CELL = "cell"; + TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = "unavailable"; + TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = "unknown"; + NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; + NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; + NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; + NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; + NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; + NetHostConnectionTypeValues = /* @__PURE__ */ createConstMap([ + TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, + TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, + TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN + ]); + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = "gprs"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = "edge"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = "umts"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = "cdma"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = "evdo_0"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = "evdo_a"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = "cdma2000_1xrtt"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = "hsdpa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = "hsupa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = "hspa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = "iden"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = "evdo_b"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE = "lte"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = "ehrpd"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = "hspap"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM = "gsm"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = "td_scdma"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = "iwlan"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR = "nr"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = "nrnsa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = "lte_ca"; + NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS; + NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE; + NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS; + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA; + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0; + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A; + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT; + NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA; + NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA; + NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA; + NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN; + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B; + NETHOSTCONNECTIONSUBTYPEVALUES_LTE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE; + NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD; + NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP; + NETHOSTCONNECTIONSUBTYPEVALUES_GSM = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM; + NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA; + NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN; + NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; + NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; + NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; + NetHostConnectionSubtypeValues = /* @__PURE__ */ createConstMap([ + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA + ]); + TMP_HTTPFLAVORVALUES_HTTP_1_0 = "1.0"; + TMP_HTTPFLAVORVALUES_HTTP_1_1 = "1.1"; + TMP_HTTPFLAVORVALUES_HTTP_2_0 = "2.0"; + TMP_HTTPFLAVORVALUES_SPDY = "SPDY"; + TMP_HTTPFLAVORVALUES_QUIC = "QUIC"; + HTTPFLAVORVALUES_HTTP_1_0 = TMP_HTTPFLAVORVALUES_HTTP_1_0; + HTTPFLAVORVALUES_HTTP_1_1 = TMP_HTTPFLAVORVALUES_HTTP_1_1; + HTTPFLAVORVALUES_HTTP_2_0 = TMP_HTTPFLAVORVALUES_HTTP_2_0; + HTTPFLAVORVALUES_SPDY = TMP_HTTPFLAVORVALUES_SPDY; + HTTPFLAVORVALUES_QUIC = TMP_HTTPFLAVORVALUES_QUIC; + HttpFlavorValues = { + HTTP_1_0: TMP_HTTPFLAVORVALUES_HTTP_1_0, + HTTP_1_1: TMP_HTTPFLAVORVALUES_HTTP_1_1, + HTTP_2_0: TMP_HTTPFLAVORVALUES_HTTP_2_0, + SPDY: TMP_HTTPFLAVORVALUES_SPDY, + QUIC: TMP_HTTPFLAVORVALUES_QUIC + }; + TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE = "queue"; + TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = "topic"; + MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; + MESSAGINGDESTINATIONKINDVALUES_TOPIC = TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC; + MessagingDestinationKindValues = /* @__PURE__ */ createConstMap([TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC]); + TMP_MESSAGINGOPERATIONVALUES_RECEIVE = "receive"; + TMP_MESSAGINGOPERATIONVALUES_PROCESS = "process"; + MESSAGINGOPERATIONVALUES_RECEIVE = TMP_MESSAGINGOPERATIONVALUES_RECEIVE; + MESSAGINGOPERATIONVALUES_PROCESS = TMP_MESSAGINGOPERATIONVALUES_PROCESS; + MessagingOperationValues = /* @__PURE__ */ createConstMap([TMP_MESSAGINGOPERATIONVALUES_RECEIVE, TMP_MESSAGINGOPERATIONVALUES_PROCESS]); + TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; + TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; + TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; + TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = 3; + TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = 4; + TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND = 5; + TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = 6; + TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = 7; + TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = 8; + TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = 9; + TMP_RPCGRPCSTATUSCODEVALUES_ABORTED = 10; + TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = 11; + TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = 12; + TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL = 13; + TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = 14; + TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS = 15; + TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = 16; + RPCGRPCSTATUSCODEVALUES_OK = TMP_RPCGRPCSTATUSCODEVALUES_OK; + RPCGRPCSTATUSCODEVALUES_CANCELLED = TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED; + RPCGRPCSTATUSCODEVALUES_UNKNOWN = TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN; + RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT; + RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED; + RPCGRPCSTATUSCODEVALUES_NOT_FOUND = TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND; + RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS; + RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED; + RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED; + RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION; + RPCGRPCSTATUSCODEVALUES_ABORTED = TMP_RPCGRPCSTATUSCODEVALUES_ABORTED; + RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE; + RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED; + RPCGRPCSTATUSCODEVALUES_INTERNAL = TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL; + RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE; + RPCGRPCSTATUSCODEVALUES_DATA_LOSS = TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS; + RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED; + RpcGrpcStatusCodeValues = { + OK: TMP_RPCGRPCSTATUSCODEVALUES_OK, + CANCELLED: TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, + UNKNOWN: TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, + INVALID_ARGUMENT: TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, + DEADLINE_EXCEEDED: TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, + NOT_FOUND: TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, + ALREADY_EXISTS: TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, + PERMISSION_DENIED: TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, + RESOURCE_EXHAUSTED: TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, + FAILED_PRECONDITION: TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, + ABORTED: TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, + OUT_OF_RANGE: TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, + UNIMPLEMENTED: TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, + INTERNAL: TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, + UNAVAILABLE: TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, + DATA_LOSS: TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, + UNAUTHENTICATED: TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED + }; + TMP_MESSAGETYPEVALUES_SENT = "SENT"; + TMP_MESSAGETYPEVALUES_RECEIVED = "RECEIVED"; + MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; + MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; + MessageTypeValues = /* @__PURE__ */ createConstMap([TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED]); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js +var init_trace = __esmMin((() => { + init_SemanticAttributes(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js +var TMP_CLOUD_PROVIDER, TMP_CLOUD_ACCOUNT_ID, TMP_CLOUD_REGION, TMP_CLOUD_AVAILABILITY_ZONE, TMP_CLOUD_PLATFORM, TMP_AWS_ECS_CONTAINER_ARN, TMP_AWS_ECS_CLUSTER_ARN, TMP_AWS_ECS_LAUNCHTYPE, TMP_AWS_ECS_TASK_ARN, TMP_AWS_ECS_TASK_FAMILY, TMP_AWS_ECS_TASK_REVISION, TMP_AWS_EKS_CLUSTER_ARN, TMP_AWS_LOG_GROUP_NAMES, TMP_AWS_LOG_GROUP_ARNS, TMP_AWS_LOG_STREAM_NAMES, TMP_AWS_LOG_STREAM_ARNS, TMP_CONTAINER_NAME, TMP_CONTAINER_ID, TMP_CONTAINER_RUNTIME, TMP_CONTAINER_IMAGE_NAME, TMP_CONTAINER_IMAGE_TAG, TMP_DEPLOYMENT_ENVIRONMENT, TMP_DEVICE_ID, TMP_DEVICE_MODEL_IDENTIFIER, TMP_DEVICE_MODEL_NAME, TMP_FAAS_NAME, TMP_FAAS_ID, TMP_FAAS_VERSION, TMP_FAAS_INSTANCE, TMP_FAAS_MAX_MEMORY, TMP_HOST_ID, TMP_HOST_NAME, TMP_HOST_TYPE, TMP_HOST_ARCH, TMP_HOST_IMAGE_NAME, TMP_HOST_IMAGE_ID, TMP_HOST_IMAGE_VERSION, TMP_K8S_CLUSTER_NAME, TMP_K8S_NODE_NAME, TMP_K8S_NODE_UID, TMP_K8S_NAMESPACE_NAME, TMP_K8S_POD_UID, TMP_K8S_POD_NAME, TMP_K8S_CONTAINER_NAME, TMP_K8S_REPLICASET_UID, TMP_K8S_REPLICASET_NAME, TMP_K8S_DEPLOYMENT_UID, TMP_K8S_DEPLOYMENT_NAME, TMP_K8S_STATEFULSET_UID, TMP_K8S_STATEFULSET_NAME, TMP_K8S_DAEMONSET_UID, TMP_K8S_DAEMONSET_NAME, TMP_K8S_JOB_UID, TMP_K8S_JOB_NAME, TMP_K8S_CRONJOB_UID, TMP_K8S_CRONJOB_NAME, TMP_OS_TYPE, TMP_OS_DESCRIPTION, TMP_OS_NAME, TMP_OS_VERSION, TMP_PROCESS_PID, TMP_PROCESS_EXECUTABLE_NAME, TMP_PROCESS_EXECUTABLE_PATH, TMP_PROCESS_COMMAND, TMP_PROCESS_COMMAND_LINE, TMP_PROCESS_COMMAND_ARGS, TMP_PROCESS_OWNER, TMP_PROCESS_RUNTIME_NAME, TMP_PROCESS_RUNTIME_VERSION, TMP_PROCESS_RUNTIME_DESCRIPTION, TMP_SERVICE_NAME, TMP_SERVICE_NAMESPACE, TMP_SERVICE_INSTANCE_ID, TMP_SERVICE_VERSION, TMP_TELEMETRY_SDK_NAME, TMP_TELEMETRY_SDK_LANGUAGE, TMP_TELEMETRY_SDK_VERSION, TMP_TELEMETRY_AUTO_VERSION, TMP_WEBENGINE_NAME, TMP_WEBENGINE_VERSION, TMP_WEBENGINE_DESCRIPTION, SEMRESATTRS_CLOUD_PROVIDER, SEMRESATTRS_CLOUD_ACCOUNT_ID, SEMRESATTRS_CLOUD_REGION, SEMRESATTRS_CLOUD_AVAILABILITY_ZONE, SEMRESATTRS_CLOUD_PLATFORM, SEMRESATTRS_AWS_ECS_CONTAINER_ARN, SEMRESATTRS_AWS_ECS_CLUSTER_ARN, SEMRESATTRS_AWS_ECS_LAUNCHTYPE, SEMRESATTRS_AWS_ECS_TASK_ARN, SEMRESATTRS_AWS_ECS_TASK_FAMILY, SEMRESATTRS_AWS_ECS_TASK_REVISION, SEMRESATTRS_AWS_EKS_CLUSTER_ARN, SEMRESATTRS_AWS_LOG_GROUP_NAMES, SEMRESATTRS_AWS_LOG_GROUP_ARNS, SEMRESATTRS_AWS_LOG_STREAM_NAMES, SEMRESATTRS_AWS_LOG_STREAM_ARNS, SEMRESATTRS_CONTAINER_NAME, SEMRESATTRS_CONTAINER_ID, SEMRESATTRS_CONTAINER_RUNTIME, SEMRESATTRS_CONTAINER_IMAGE_NAME, SEMRESATTRS_CONTAINER_IMAGE_TAG, SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, SEMRESATTRS_DEVICE_ID, SEMRESATTRS_DEVICE_MODEL_IDENTIFIER, SEMRESATTRS_DEVICE_MODEL_NAME, SEMRESATTRS_FAAS_NAME, SEMRESATTRS_FAAS_ID, SEMRESATTRS_FAAS_VERSION, SEMRESATTRS_FAAS_INSTANCE, SEMRESATTRS_FAAS_MAX_MEMORY, SEMRESATTRS_HOST_ID, SEMRESATTRS_HOST_NAME, SEMRESATTRS_HOST_TYPE, SEMRESATTRS_HOST_ARCH, SEMRESATTRS_HOST_IMAGE_NAME, SEMRESATTRS_HOST_IMAGE_ID, SEMRESATTRS_HOST_IMAGE_VERSION, SEMRESATTRS_K8S_CLUSTER_NAME, SEMRESATTRS_K8S_NODE_NAME, SEMRESATTRS_K8S_NODE_UID, SEMRESATTRS_K8S_NAMESPACE_NAME, SEMRESATTRS_K8S_POD_UID, SEMRESATTRS_K8S_POD_NAME, SEMRESATTRS_K8S_CONTAINER_NAME, SEMRESATTRS_K8S_REPLICASET_UID, SEMRESATTRS_K8S_REPLICASET_NAME, SEMRESATTRS_K8S_DEPLOYMENT_UID, SEMRESATTRS_K8S_DEPLOYMENT_NAME, SEMRESATTRS_K8S_STATEFULSET_UID, SEMRESATTRS_K8S_STATEFULSET_NAME, SEMRESATTRS_K8S_DAEMONSET_UID, SEMRESATTRS_K8S_DAEMONSET_NAME, SEMRESATTRS_K8S_JOB_UID, SEMRESATTRS_K8S_JOB_NAME, SEMRESATTRS_K8S_CRONJOB_UID, SEMRESATTRS_K8S_CRONJOB_NAME, SEMRESATTRS_OS_TYPE, SEMRESATTRS_OS_DESCRIPTION, SEMRESATTRS_OS_NAME, SEMRESATTRS_OS_VERSION, SEMRESATTRS_PROCESS_PID, SEMRESATTRS_PROCESS_EXECUTABLE_NAME, SEMRESATTRS_PROCESS_EXECUTABLE_PATH, SEMRESATTRS_PROCESS_COMMAND, SEMRESATTRS_PROCESS_COMMAND_LINE, SEMRESATTRS_PROCESS_COMMAND_ARGS, SEMRESATTRS_PROCESS_OWNER, SEMRESATTRS_PROCESS_RUNTIME_NAME, SEMRESATTRS_PROCESS_RUNTIME_VERSION, SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_NAMESPACE, SEMRESATTRS_SERVICE_INSTANCE_ID, SEMRESATTRS_SERVICE_VERSION, SEMRESATTRS_TELEMETRY_SDK_NAME, SEMRESATTRS_TELEMETRY_SDK_LANGUAGE, SEMRESATTRS_TELEMETRY_SDK_VERSION, SEMRESATTRS_TELEMETRY_AUTO_VERSION, SEMRESATTRS_WEBENGINE_NAME, SEMRESATTRS_WEBENGINE_VERSION, SEMRESATTRS_WEBENGINE_DESCRIPTION, SemanticResourceAttributes, TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, TMP_CLOUDPROVIDERVALUES_AWS, TMP_CLOUDPROVIDERVALUES_AZURE, TMP_CLOUDPROVIDERVALUES_GCP, CLOUDPROVIDERVALUES_ALIBABA_CLOUD, CLOUDPROVIDERVALUES_AWS, CLOUDPROVIDERVALUES_AZURE, CLOUDPROVIDERVALUES_GCP, CloudProviderValues, TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, TMP_CLOUDPLATFORMVALUES_AWS_EC2, TMP_CLOUDPLATFORMVALUES_AWS_ECS, TMP_CLOUDPLATFORMVALUES_AWS_EKS, TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, TMP_CLOUDPLATFORMVALUES_AZURE_VM, TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, TMP_CLOUDPLATFORMVALUES_AZURE_AKS, TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE, CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, CLOUDPLATFORMVALUES_AWS_EC2, CLOUDPLATFORMVALUES_AWS_ECS, CLOUDPLATFORMVALUES_AWS_EKS, CLOUDPLATFORMVALUES_AWS_LAMBDA, CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, CLOUDPLATFORMVALUES_AZURE_VM, CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, CLOUDPLATFORMVALUES_AZURE_AKS, CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, CLOUDPLATFORMVALUES_GCP_APP_ENGINE, CloudPlatformValues, TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE, AWSECSLAUNCHTYPEVALUES_EC2, AWSECSLAUNCHTYPEVALUES_FARGATE, AwsEcsLaunchtypeValues, TMP_HOSTARCHVALUES_AMD64, TMP_HOSTARCHVALUES_ARM32, TMP_HOSTARCHVALUES_ARM64, TMP_HOSTARCHVALUES_IA64, TMP_HOSTARCHVALUES_PPC32, TMP_HOSTARCHVALUES_PPC64, TMP_HOSTARCHVALUES_X86, HOSTARCHVALUES_AMD64, HOSTARCHVALUES_ARM32, HOSTARCHVALUES_ARM64, HOSTARCHVALUES_IA64, HOSTARCHVALUES_PPC32, HOSTARCHVALUES_PPC64, HOSTARCHVALUES_X86, HostArchValues, TMP_OSTYPEVALUES_WINDOWS, TMP_OSTYPEVALUES_LINUX, TMP_OSTYPEVALUES_DARWIN, TMP_OSTYPEVALUES_FREEBSD, TMP_OSTYPEVALUES_NETBSD, TMP_OSTYPEVALUES_OPENBSD, TMP_OSTYPEVALUES_DRAGONFLYBSD, TMP_OSTYPEVALUES_HPUX, TMP_OSTYPEVALUES_AIX, TMP_OSTYPEVALUES_SOLARIS, TMP_OSTYPEVALUES_Z_OS, OSTYPEVALUES_WINDOWS, OSTYPEVALUES_LINUX, OSTYPEVALUES_DARWIN, OSTYPEVALUES_FREEBSD, OSTYPEVALUES_NETBSD, OSTYPEVALUES_OPENBSD, OSTYPEVALUES_DRAGONFLYBSD, OSTYPEVALUES_HPUX, OSTYPEVALUES_AIX, OSTYPEVALUES_SOLARIS, OSTYPEVALUES_Z_OS, OsTypeValues, TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, TMP_TELEMETRYSDKLANGUAGEVALUES_GO, TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS, TELEMETRYSDKLANGUAGEVALUES_CPP, TELEMETRYSDKLANGUAGEVALUES_DOTNET, TELEMETRYSDKLANGUAGEVALUES_ERLANG, TELEMETRYSDKLANGUAGEVALUES_GO, TELEMETRYSDKLANGUAGEVALUES_JAVA, TELEMETRYSDKLANGUAGEVALUES_NODEJS, TELEMETRYSDKLANGUAGEVALUES_PHP, TELEMETRYSDKLANGUAGEVALUES_PYTHON, TELEMETRYSDKLANGUAGEVALUES_RUBY, TELEMETRYSDKLANGUAGEVALUES_WEBJS, TelemetrySdkLanguageValues; +var init_SemanticResourceAttributes = __esmMin((() => { + init_utils(); + TMP_CLOUD_PROVIDER = "cloud.provider"; + TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; + TMP_CLOUD_REGION = "cloud.region"; + TMP_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + TMP_CLOUD_PLATFORM = "cloud.platform"; + TMP_AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn"; + TMP_AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn"; + TMP_AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype"; + TMP_AWS_ECS_TASK_ARN = "aws.ecs.task.arn"; + TMP_AWS_ECS_TASK_FAMILY = "aws.ecs.task.family"; + TMP_AWS_ECS_TASK_REVISION = "aws.ecs.task.revision"; + TMP_AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn"; + TMP_AWS_LOG_GROUP_NAMES = "aws.log.group.names"; + TMP_AWS_LOG_GROUP_ARNS = "aws.log.group.arns"; + TMP_AWS_LOG_STREAM_NAMES = "aws.log.stream.names"; + TMP_AWS_LOG_STREAM_ARNS = "aws.log.stream.arns"; + TMP_CONTAINER_NAME = "container.name"; + TMP_CONTAINER_ID = "container.id"; + TMP_CONTAINER_RUNTIME = "container.runtime"; + TMP_CONTAINER_IMAGE_NAME = "container.image.name"; + TMP_CONTAINER_IMAGE_TAG = "container.image.tag"; + TMP_DEPLOYMENT_ENVIRONMENT = "deployment.environment"; + TMP_DEVICE_ID = "device.id"; + TMP_DEVICE_MODEL_IDENTIFIER = "device.model.identifier"; + TMP_DEVICE_MODEL_NAME = "device.model.name"; + TMP_FAAS_NAME = "faas.name"; + TMP_FAAS_ID = "faas.id"; + TMP_FAAS_VERSION = "faas.version"; + TMP_FAAS_INSTANCE = "faas.instance"; + TMP_FAAS_MAX_MEMORY = "faas.max_memory"; + TMP_HOST_ID = "host.id"; + TMP_HOST_NAME = "host.name"; + TMP_HOST_TYPE = "host.type"; + TMP_HOST_ARCH = "host.arch"; + TMP_HOST_IMAGE_NAME = "host.image.name"; + TMP_HOST_IMAGE_ID = "host.image.id"; + TMP_HOST_IMAGE_VERSION = "host.image.version"; + TMP_K8S_CLUSTER_NAME = "k8s.cluster.name"; + TMP_K8S_NODE_NAME = "k8s.node.name"; + TMP_K8S_NODE_UID = "k8s.node.uid"; + TMP_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + TMP_K8S_POD_UID = "k8s.pod.uid"; + TMP_K8S_POD_NAME = "k8s.pod.name"; + TMP_K8S_CONTAINER_NAME = "k8s.container.name"; + TMP_K8S_REPLICASET_UID = "k8s.replicaset.uid"; + TMP_K8S_REPLICASET_NAME = "k8s.replicaset.name"; + TMP_K8S_DEPLOYMENT_UID = "k8s.deployment.uid"; + TMP_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + TMP_K8S_STATEFULSET_UID = "k8s.statefulset.uid"; + TMP_K8S_STATEFULSET_NAME = "k8s.statefulset.name"; + TMP_K8S_DAEMONSET_UID = "k8s.daemonset.uid"; + TMP_K8S_DAEMONSET_NAME = "k8s.daemonset.name"; + TMP_K8S_JOB_UID = "k8s.job.uid"; + TMP_K8S_JOB_NAME = "k8s.job.name"; + TMP_K8S_CRONJOB_UID = "k8s.cronjob.uid"; + TMP_K8S_CRONJOB_NAME = "k8s.cronjob.name"; + TMP_OS_TYPE = "os.type"; + TMP_OS_DESCRIPTION = "os.description"; + TMP_OS_NAME = "os.name"; + TMP_OS_VERSION = "os.version"; + TMP_PROCESS_PID = "process.pid"; + TMP_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + TMP_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + TMP_PROCESS_COMMAND = "process.command"; + TMP_PROCESS_COMMAND_LINE = "process.command_line"; + TMP_PROCESS_COMMAND_ARGS = "process.command_args"; + TMP_PROCESS_OWNER = "process.owner"; + TMP_PROCESS_RUNTIME_NAME = "process.runtime.name"; + TMP_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + TMP_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + TMP_SERVICE_NAME = "service.name"; + TMP_SERVICE_NAMESPACE = "service.namespace"; + TMP_SERVICE_INSTANCE_ID = "service.instance.id"; + TMP_SERVICE_VERSION = "service.version"; + TMP_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; + TMP_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; + TMP_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; + TMP_TELEMETRY_AUTO_VERSION = "telemetry.auto.version"; + TMP_WEBENGINE_NAME = "webengine.name"; + TMP_WEBENGINE_VERSION = "webengine.version"; + TMP_WEBENGINE_DESCRIPTION = "webengine.description"; + SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; + SEMRESATTRS_CLOUD_ACCOUNT_ID = TMP_CLOUD_ACCOUNT_ID; + SEMRESATTRS_CLOUD_REGION = TMP_CLOUD_REGION; + SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = TMP_CLOUD_AVAILABILITY_ZONE; + SEMRESATTRS_CLOUD_PLATFORM = TMP_CLOUD_PLATFORM; + SEMRESATTRS_AWS_ECS_CONTAINER_ARN = TMP_AWS_ECS_CONTAINER_ARN; + SEMRESATTRS_AWS_ECS_CLUSTER_ARN = TMP_AWS_ECS_CLUSTER_ARN; + SEMRESATTRS_AWS_ECS_LAUNCHTYPE = TMP_AWS_ECS_LAUNCHTYPE; + SEMRESATTRS_AWS_ECS_TASK_ARN = TMP_AWS_ECS_TASK_ARN; + SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; + SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; + SEMRESATTRS_AWS_EKS_CLUSTER_ARN = TMP_AWS_EKS_CLUSTER_ARN; + SEMRESATTRS_AWS_LOG_GROUP_NAMES = TMP_AWS_LOG_GROUP_NAMES; + SEMRESATTRS_AWS_LOG_GROUP_ARNS = TMP_AWS_LOG_GROUP_ARNS; + SEMRESATTRS_AWS_LOG_STREAM_NAMES = TMP_AWS_LOG_STREAM_NAMES; + SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; + SEMRESATTRS_CONTAINER_NAME = TMP_CONTAINER_NAME; + SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; + SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; + SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; + SEMRESATTRS_CONTAINER_IMAGE_TAG = TMP_CONTAINER_IMAGE_TAG; + SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = TMP_DEPLOYMENT_ENVIRONMENT; + SEMRESATTRS_DEVICE_ID = TMP_DEVICE_ID; + SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = TMP_DEVICE_MODEL_IDENTIFIER; + SEMRESATTRS_DEVICE_MODEL_NAME = TMP_DEVICE_MODEL_NAME; + SEMRESATTRS_FAAS_NAME = TMP_FAAS_NAME; + SEMRESATTRS_FAAS_ID = TMP_FAAS_ID; + SEMRESATTRS_FAAS_VERSION = TMP_FAAS_VERSION; + SEMRESATTRS_FAAS_INSTANCE = TMP_FAAS_INSTANCE; + SEMRESATTRS_FAAS_MAX_MEMORY = TMP_FAAS_MAX_MEMORY; + SEMRESATTRS_HOST_ID = TMP_HOST_ID; + SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; + SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; + SEMRESATTRS_HOST_ARCH = TMP_HOST_ARCH; + SEMRESATTRS_HOST_IMAGE_NAME = TMP_HOST_IMAGE_NAME; + SEMRESATTRS_HOST_IMAGE_ID = TMP_HOST_IMAGE_ID; + SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; + SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; + SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; + SEMRESATTRS_K8S_NODE_UID = TMP_K8S_NODE_UID; + SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; + SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; + SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; + SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; + SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; + SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; + SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; + SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; + SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; + SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; + SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; + SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; + SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; + SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; + SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; + SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; + SEMRESATTRS_OS_TYPE = TMP_OS_TYPE; + SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; + SEMRESATTRS_OS_NAME = TMP_OS_NAME; + SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; + SEMRESATTRS_PROCESS_PID = TMP_PROCESS_PID; + SEMRESATTRS_PROCESS_EXECUTABLE_NAME = TMP_PROCESS_EXECUTABLE_NAME; + SEMRESATTRS_PROCESS_EXECUTABLE_PATH = TMP_PROCESS_EXECUTABLE_PATH; + SEMRESATTRS_PROCESS_COMMAND = TMP_PROCESS_COMMAND; + SEMRESATTRS_PROCESS_COMMAND_LINE = TMP_PROCESS_COMMAND_LINE; + SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; + SEMRESATTRS_PROCESS_OWNER = TMP_PROCESS_OWNER; + SEMRESATTRS_PROCESS_RUNTIME_NAME = TMP_PROCESS_RUNTIME_NAME; + SEMRESATTRS_PROCESS_RUNTIME_VERSION = TMP_PROCESS_RUNTIME_VERSION; + SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = TMP_PROCESS_RUNTIME_DESCRIPTION; + SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME; + SEMRESATTRS_SERVICE_NAMESPACE = TMP_SERVICE_NAMESPACE; + SEMRESATTRS_SERVICE_INSTANCE_ID = TMP_SERVICE_INSTANCE_ID; + SEMRESATTRS_SERVICE_VERSION = TMP_SERVICE_VERSION; + SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME; + SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE; + SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION; + SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; + SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; + SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; + SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; + SemanticResourceAttributes = /* @__PURE__ */ createConstMap([ + TMP_CLOUD_PROVIDER, + TMP_CLOUD_ACCOUNT_ID, + TMP_CLOUD_REGION, + TMP_CLOUD_AVAILABILITY_ZONE, + TMP_CLOUD_PLATFORM, + TMP_AWS_ECS_CONTAINER_ARN, + TMP_AWS_ECS_CLUSTER_ARN, + TMP_AWS_ECS_LAUNCHTYPE, + TMP_AWS_ECS_TASK_ARN, + TMP_AWS_ECS_TASK_FAMILY, + TMP_AWS_ECS_TASK_REVISION, + TMP_AWS_EKS_CLUSTER_ARN, + TMP_AWS_LOG_GROUP_NAMES, + TMP_AWS_LOG_GROUP_ARNS, + TMP_AWS_LOG_STREAM_NAMES, + TMP_AWS_LOG_STREAM_ARNS, + TMP_CONTAINER_NAME, + TMP_CONTAINER_ID, + TMP_CONTAINER_RUNTIME, + TMP_CONTAINER_IMAGE_NAME, + TMP_CONTAINER_IMAGE_TAG, + TMP_DEPLOYMENT_ENVIRONMENT, + TMP_DEVICE_ID, + TMP_DEVICE_MODEL_IDENTIFIER, + TMP_DEVICE_MODEL_NAME, + TMP_FAAS_NAME, + TMP_FAAS_ID, + TMP_FAAS_VERSION, + TMP_FAAS_INSTANCE, + TMP_FAAS_MAX_MEMORY, + TMP_HOST_ID, + TMP_HOST_NAME, + TMP_HOST_TYPE, + TMP_HOST_ARCH, + TMP_HOST_IMAGE_NAME, + TMP_HOST_IMAGE_ID, + TMP_HOST_IMAGE_VERSION, + TMP_K8S_CLUSTER_NAME, + TMP_K8S_NODE_NAME, + TMP_K8S_NODE_UID, + TMP_K8S_NAMESPACE_NAME, + TMP_K8S_POD_UID, + TMP_K8S_POD_NAME, + TMP_K8S_CONTAINER_NAME, + TMP_K8S_REPLICASET_UID, + TMP_K8S_REPLICASET_NAME, + TMP_K8S_DEPLOYMENT_UID, + TMP_K8S_DEPLOYMENT_NAME, + TMP_K8S_STATEFULSET_UID, + TMP_K8S_STATEFULSET_NAME, + TMP_K8S_DAEMONSET_UID, + TMP_K8S_DAEMONSET_NAME, + TMP_K8S_JOB_UID, + TMP_K8S_JOB_NAME, + TMP_K8S_CRONJOB_UID, + TMP_K8S_CRONJOB_NAME, + TMP_OS_TYPE, + TMP_OS_DESCRIPTION, + TMP_OS_NAME, + TMP_OS_VERSION, + TMP_PROCESS_PID, + TMP_PROCESS_EXECUTABLE_NAME, + TMP_PROCESS_EXECUTABLE_PATH, + TMP_PROCESS_COMMAND, + TMP_PROCESS_COMMAND_LINE, + TMP_PROCESS_COMMAND_ARGS, + TMP_PROCESS_OWNER, + TMP_PROCESS_RUNTIME_NAME, + TMP_PROCESS_RUNTIME_VERSION, + TMP_PROCESS_RUNTIME_DESCRIPTION, + TMP_SERVICE_NAME, + TMP_SERVICE_NAMESPACE, + TMP_SERVICE_INSTANCE_ID, + TMP_SERVICE_VERSION, + TMP_TELEMETRY_SDK_NAME, + TMP_TELEMETRY_SDK_LANGUAGE, + TMP_TELEMETRY_SDK_VERSION, + TMP_TELEMETRY_AUTO_VERSION, + TMP_WEBENGINE_NAME, + TMP_WEBENGINE_VERSION, + TMP_WEBENGINE_DESCRIPTION + ]); + TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; + TMP_CLOUDPROVIDERVALUES_AWS = "aws"; + TMP_CLOUDPROVIDERVALUES_AZURE = "azure"; + TMP_CLOUDPROVIDERVALUES_GCP = "gcp"; + CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; + CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; + CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; + CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; + CloudProviderValues = /* @__PURE__ */ createConstMap([ + TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_CLOUDPROVIDERVALUES_AWS, + TMP_CLOUDPROVIDERVALUES_AZURE, + TMP_CLOUDPROVIDERVALUES_GCP + ]); + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"; + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = "alibaba_cloud_fc"; + TMP_CLOUDPLATFORMVALUES_AWS_EC2 = "aws_ec2"; + TMP_CLOUDPLATFORMVALUES_AWS_ECS = "aws_ecs"; + TMP_CLOUDPLATFORMVALUES_AWS_EKS = "aws_eks"; + TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA = "aws_lambda"; + TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"; + TMP_CLOUDPLATFORMVALUES_AZURE_VM = "azure_vm"; + TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = "azure_container_instances"; + TMP_CLOUDPLATFORMVALUES_AZURE_AKS = "azure_aks"; + TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = "azure_functions"; + TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = "azure_app_service"; + TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = "gcp_compute_engine"; + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = "gcp_cloud_run"; + TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine"; + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions"; + TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE = "gcp_app_engine"; + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS; + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC; + CLOUDPLATFORMVALUES_AWS_EC2 = TMP_CLOUDPLATFORMVALUES_AWS_EC2; + CLOUDPLATFORMVALUES_AWS_ECS = TMP_CLOUDPLATFORMVALUES_AWS_ECS; + CLOUDPLATFORMVALUES_AWS_EKS = TMP_CLOUDPLATFORMVALUES_AWS_EKS; + CLOUDPLATFORMVALUES_AWS_LAMBDA = TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA; + CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK; + CLOUDPLATFORMVALUES_AZURE_VM = TMP_CLOUDPLATFORMVALUES_AZURE_VM; + CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES; + CLOUDPLATFORMVALUES_AZURE_AKS = TMP_CLOUDPLATFORMVALUES_AZURE_AKS; + CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS; + CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE; + CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE; + CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN; + CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE; + CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS; + CLOUDPLATFORMVALUES_GCP_APP_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE; + CloudPlatformValues = /* @__PURE__ */ createConstMap([ + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, + TMP_CLOUDPLATFORMVALUES_AWS_EC2, + TMP_CLOUDPLATFORMVALUES_AWS_ECS, + TMP_CLOUDPLATFORMVALUES_AWS_EKS, + TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, + TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, + TMP_CLOUDPLATFORMVALUES_AZURE_VM, + TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, + TMP_CLOUDPLATFORMVALUES_AZURE_AKS, + TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, + TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, + TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE + ]); + TMP_AWSECSLAUNCHTYPEVALUES_EC2 = "ec2"; + TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = "fargate"; + AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; + AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; + AwsEcsLaunchtypeValues = /* @__PURE__ */ createConstMap([TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE]); + TMP_HOSTARCHVALUES_AMD64 = "amd64"; + TMP_HOSTARCHVALUES_ARM32 = "arm32"; + TMP_HOSTARCHVALUES_ARM64 = "arm64"; + TMP_HOSTARCHVALUES_IA64 = "ia64"; + TMP_HOSTARCHVALUES_PPC32 = "ppc32"; + TMP_HOSTARCHVALUES_PPC64 = "ppc64"; + TMP_HOSTARCHVALUES_X86 = "x86"; + HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; + HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; + HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; + HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; + HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; + HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; + HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; + HostArchValues = /* @__PURE__ */ createConstMap([ + TMP_HOSTARCHVALUES_AMD64, + TMP_HOSTARCHVALUES_ARM32, + TMP_HOSTARCHVALUES_ARM64, + TMP_HOSTARCHVALUES_IA64, + TMP_HOSTARCHVALUES_PPC32, + TMP_HOSTARCHVALUES_PPC64, + TMP_HOSTARCHVALUES_X86 + ]); + TMP_OSTYPEVALUES_WINDOWS = "windows"; + TMP_OSTYPEVALUES_LINUX = "linux"; + TMP_OSTYPEVALUES_DARWIN = "darwin"; + TMP_OSTYPEVALUES_FREEBSD = "freebsd"; + TMP_OSTYPEVALUES_NETBSD = "netbsd"; + TMP_OSTYPEVALUES_OPENBSD = "openbsd"; + TMP_OSTYPEVALUES_DRAGONFLYBSD = "dragonflybsd"; + TMP_OSTYPEVALUES_HPUX = "hpux"; + TMP_OSTYPEVALUES_AIX = "aix"; + TMP_OSTYPEVALUES_SOLARIS = "solaris"; + TMP_OSTYPEVALUES_Z_OS = "z_os"; + OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; + OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; + OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; + OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; + OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; + OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; + OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; + OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; + OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; + OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; + OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; + OsTypeValues = /* @__PURE__ */ createConstMap([ + TMP_OSTYPEVALUES_WINDOWS, + TMP_OSTYPEVALUES_LINUX, + TMP_OSTYPEVALUES_DARWIN, + TMP_OSTYPEVALUES_FREEBSD, + TMP_OSTYPEVALUES_NETBSD, + TMP_OSTYPEVALUES_OPENBSD, + TMP_OSTYPEVALUES_DRAGONFLYBSD, + TMP_OSTYPEVALUES_HPUX, + TMP_OSTYPEVALUES_AIX, + TMP_OSTYPEVALUES_SOLARIS, + TMP_OSTYPEVALUES_Z_OS + ]); + TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = "cpp"; + TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = "dotnet"; + TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = "erlang"; + TMP_TELEMETRYSDKLANGUAGEVALUES_GO = "go"; + TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = "java"; + TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = "nodejs"; + TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = "php"; + TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = "python"; + TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = "ruby"; + TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = "webjs"; + TELEMETRYSDKLANGUAGEVALUES_CPP = TMP_TELEMETRYSDKLANGUAGEVALUES_CPP; + TELEMETRYSDKLANGUAGEVALUES_DOTNET = TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET; + TELEMETRYSDKLANGUAGEVALUES_ERLANG = TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG; + TELEMETRYSDKLANGUAGEVALUES_GO = TMP_TELEMETRYSDKLANGUAGEVALUES_GO; + TELEMETRYSDKLANGUAGEVALUES_JAVA = TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA; + TELEMETRYSDKLANGUAGEVALUES_NODEJS = TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS; + TELEMETRYSDKLANGUAGEVALUES_PHP = TMP_TELEMETRYSDKLANGUAGEVALUES_PHP; + TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; + TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; + TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; + TelemetrySdkLanguageValues = /* @__PURE__ */ createConstMap([ + TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, + TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, + TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, + TMP_TELEMETRYSDKLANGUAGEVALUES_GO, + TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, + TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, + TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, + TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, + TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, + TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS + ]); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js +var init_resource = __esmMin((() => { + init_SemanticResourceAttributes(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +var ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED, ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE, ATTR_ASPNETCORE_RATE_LIMITING_POLICY, ATTR_ASPNETCORE_RATE_LIMITING_RESULT, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED, ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED, ATTR_ASPNETCORE_ROUTING_IS_FALLBACK, ATTR_ASPNETCORE_ROUTING_MATCH_STATUS, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS, ATTR_ASPNETCORE_USER_IS_AUTHENTICATED, ATTR_CLIENT_ADDRESS, ATTR_CLIENT_PORT, ATTR_CODE_COLUMN_NUMBER, ATTR_CODE_FILE_PATH, ATTR_CODE_FUNCTION_NAME, ATTR_CODE_LINE_NUMBER, ATTR_CODE_STACKTRACE, ATTR_DB_COLLECTION_NAME, ATTR_DB_NAMESPACE, ATTR_DB_OPERATION_BATCH_SIZE, ATTR_DB_OPERATION_NAME, ATTR_DB_QUERY_SUMMARY, ATTR_DB_QUERY_TEXT, ATTR_DB_RESPONSE_STATUS_CODE, ATTR_DB_STORED_PROCEDURE_NAME, ATTR_DB_SYSTEM_NAME, DB_SYSTEM_NAME_VALUE_MARIADB, DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER, DB_SYSTEM_NAME_VALUE_MYSQL, DB_SYSTEM_NAME_VALUE_POSTGRESQL, ATTR_DEPLOYMENT_ENVIRONMENT_NAME, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST, ATTR_DOTNET_GC_HEAP_GENERATION, DOTNET_GC_HEAP_GENERATION_VALUE_GEN0, DOTNET_GC_HEAP_GENERATION_VALUE_GEN1, DOTNET_GC_HEAP_GENERATION_VALUE_GEN2, DOTNET_GC_HEAP_GENERATION_VALUE_LOH, DOTNET_GC_HEAP_GENERATION_VALUE_POH, ATTR_ERROR_TYPE, ERROR_TYPE_VALUE_OTHER, ATTR_EXCEPTION_ESCAPED, ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, HTTP_REQUEST_METHOD_VALUE_OTHER, HTTP_REQUEST_METHOD_VALUE_CONNECT, HTTP_REQUEST_METHOD_VALUE_DELETE, HTTP_REQUEST_METHOD_VALUE_GET, HTTP_REQUEST_METHOD_VALUE_HEAD, HTTP_REQUEST_METHOD_VALUE_OPTIONS, HTTP_REQUEST_METHOD_VALUE_PATCH, HTTP_REQUEST_METHOD_VALUE_POST, HTTP_REQUEST_METHOD_VALUE_PUT, HTTP_REQUEST_METHOD_VALUE_TRACE, ATTR_HTTP_REQUEST_METHOD_ORIGINAL, ATTR_HTTP_REQUEST_RESEND_COUNT, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_JVM_GC_ACTION, ATTR_JVM_GC_NAME, ATTR_JVM_MEMORY_POOL_NAME, ATTR_JVM_MEMORY_TYPE, JVM_MEMORY_TYPE_VALUE_HEAP, JVM_MEMORY_TYPE_VALUE_NON_HEAP, ATTR_JVM_THREAD_DAEMON, ATTR_JVM_THREAD_STATE, JVM_THREAD_STATE_VALUE_BLOCKED, JVM_THREAD_STATE_VALUE_NEW, JVM_THREAD_STATE_VALUE_RUNNABLE, JVM_THREAD_STATE_VALUE_TERMINATED, JVM_THREAD_STATE_VALUE_TIMED_WAITING, JVM_THREAD_STATE_VALUE_WAITING, ATTR_NETWORK_LOCAL_ADDRESS, ATTR_NETWORK_LOCAL_PORT, ATTR_NETWORK_PEER_ADDRESS, ATTR_NETWORK_PEER_PORT, ATTR_NETWORK_PROTOCOL_NAME, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_NETWORK_TRANSPORT, NETWORK_TRANSPORT_VALUE_PIPE, NETWORK_TRANSPORT_VALUE_QUIC, NETWORK_TRANSPORT_VALUE_TCP, NETWORK_TRANSPORT_VALUE_UDP, NETWORK_TRANSPORT_VALUE_UNIX, ATTR_NETWORK_TYPE, NETWORK_TYPE_VALUE_IPV4, NETWORK_TYPE_VALUE_IPV6, ATTR_OTEL_EVENT_NAME, ATTR_OTEL_SCOPE_NAME, ATTR_OTEL_SCOPE_VERSION, ATTR_OTEL_STATUS_CODE, OTEL_STATUS_CODE_VALUE_ERROR, OTEL_STATUS_CODE_VALUE_OK, ATTR_OTEL_STATUS_DESCRIPTION, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_SERVICE_INSTANCE_ID, ATTR_SERVICE_NAME, ATTR_SERVICE_NAMESPACE, ATTR_SERVICE_VERSION, ATTR_SIGNALR_CONNECTION_STATUS, SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN, SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE, SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT, ATTR_SIGNALR_TRANSPORT, SIGNALR_TRANSPORT_VALUE_LONG_POLLING, SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS, SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, ATTR_TELEMETRY_DISTRO_NAME, ATTR_TELEMETRY_DISTRO_VERSION, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_CPP, TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET, TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG, TELEMETRY_SDK_LANGUAGE_VALUE_GO, TELEMETRY_SDK_LANGUAGE_VALUE_JAVA, TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, TELEMETRY_SDK_LANGUAGE_VALUE_PHP, TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON, TELEMETRY_SDK_LANGUAGE_VALUE_RUBY, TELEMETRY_SDK_LANGUAGE_VALUE_RUST, TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, ATTR_URL_FRAGMENT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_QUERY, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL; +var init_stable_attributes = __esmMin((() => { + ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; + ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type"; + ATTR_ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy"; + ATTR_ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; + ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled"; + ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback"; + ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status"; + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; + ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = "aspnetcore.user.is_authenticated"; + ATTR_CLIENT_ADDRESS = "client.address"; + ATTR_CLIENT_PORT = "client.port"; + ATTR_CODE_COLUMN_NUMBER = "code.column.number"; + ATTR_CODE_FILE_PATH = "code.file.path"; + ATTR_CODE_FUNCTION_NAME = "code.function.name"; + ATTR_CODE_LINE_NUMBER = "code.line.number"; + ATTR_CODE_STACKTRACE = "code.stacktrace"; + ATTR_DB_COLLECTION_NAME = "db.collection.name"; + ATTR_DB_NAMESPACE = "db.namespace"; + ATTR_DB_OPERATION_BATCH_SIZE = "db.operation.batch.size"; + ATTR_DB_OPERATION_NAME = "db.operation.name"; + ATTR_DB_QUERY_SUMMARY = "db.query.summary"; + ATTR_DB_QUERY_TEXT = "db.query.text"; + ATTR_DB_RESPONSE_STATUS_CODE = "db.response.status_code"; + ATTR_DB_STORED_PROCEDURE_NAME = "db.stored_procedure.name"; + ATTR_DB_SYSTEM_NAME = "db.system.name"; + DB_SYSTEM_NAME_VALUE_MARIADB = "mariadb"; + DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = "microsoft.sql_server"; + DB_SYSTEM_NAME_VALUE_MYSQL = "mysql"; + DB_SYSTEM_NAME_VALUE_POSTGRESQL = "postgresql"; + ATTR_DEPLOYMENT_ENVIRONMENT_NAME = "deployment.environment.name"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = "development"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = "production"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = "staging"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = "test"; + ATTR_DOTNET_GC_HEAP_GENERATION = "dotnet.gc.heap.generation"; + DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = "gen0"; + DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = "gen1"; + DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = "gen2"; + DOTNET_GC_HEAP_GENERATION_VALUE_LOH = "loh"; + DOTNET_GC_HEAP_GENERATION_VALUE_POH = "poh"; + ATTR_ERROR_TYPE = "error.type"; + ERROR_TYPE_VALUE_OTHER = "_OTHER"; + ATTR_EXCEPTION_ESCAPED = "exception.escaped"; + ATTR_EXCEPTION_MESSAGE = "exception.message"; + ATTR_EXCEPTION_STACKTRACE = "exception.stacktrace"; + ATTR_EXCEPTION_TYPE = "exception.type"; + ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; + ATTR_HTTP_REQUEST_METHOD = "http.request.method"; + HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; + HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; + HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; + HTTP_REQUEST_METHOD_VALUE_GET = "GET"; + HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; + HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; + HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; + HTTP_REQUEST_METHOD_VALUE_POST = "POST"; + HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; + HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; + ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original"; + ATTR_HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count"; + ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; + ATTR_HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; + ATTR_HTTP_ROUTE = "http.route"; + ATTR_JVM_GC_ACTION = "jvm.gc.action"; + ATTR_JVM_GC_NAME = "jvm.gc.name"; + ATTR_JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name"; + ATTR_JVM_MEMORY_TYPE = "jvm.memory.type"; + JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; + JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; + ATTR_JVM_THREAD_DAEMON = "jvm.thread.daemon"; + ATTR_JVM_THREAD_STATE = "jvm.thread.state"; + JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; + JVM_THREAD_STATE_VALUE_NEW = "new"; + JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; + JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; + JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; + JVM_THREAD_STATE_VALUE_WAITING = "waiting"; + ATTR_NETWORK_LOCAL_ADDRESS = "network.local.address"; + ATTR_NETWORK_LOCAL_PORT = "network.local.port"; + ATTR_NETWORK_PEER_ADDRESS = "network.peer.address"; + ATTR_NETWORK_PEER_PORT = "network.peer.port"; + ATTR_NETWORK_PROTOCOL_NAME = "network.protocol.name"; + ATTR_NETWORK_PROTOCOL_VERSION = "network.protocol.version"; + ATTR_NETWORK_TRANSPORT = "network.transport"; + NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; + NETWORK_TRANSPORT_VALUE_QUIC = "quic"; + NETWORK_TRANSPORT_VALUE_TCP = "tcp"; + NETWORK_TRANSPORT_VALUE_UDP = "udp"; + NETWORK_TRANSPORT_VALUE_UNIX = "unix"; + ATTR_NETWORK_TYPE = "network.type"; + NETWORK_TYPE_VALUE_IPV4 = "ipv4"; + NETWORK_TYPE_VALUE_IPV6 = "ipv6"; + ATTR_OTEL_EVENT_NAME = "otel.event.name"; + ATTR_OTEL_SCOPE_NAME = "otel.scope.name"; + ATTR_OTEL_SCOPE_VERSION = "otel.scope.version"; + ATTR_OTEL_STATUS_CODE = "otel.status_code"; + OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; + OTEL_STATUS_CODE_VALUE_OK = "OK"; + ATTR_OTEL_STATUS_DESCRIPTION = "otel.status_description"; + ATTR_SERVER_ADDRESS = "server.address"; + ATTR_SERVER_PORT = "server.port"; + ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + ATTR_SERVICE_NAME = "service.name"; + ATTR_SERVICE_NAMESPACE = "service.namespace"; + ATTR_SERVICE_VERSION = "service.version"; + ATTR_SIGNALR_CONNECTION_STATUS = "signalr.connection.status"; + SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; + SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; + SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; + ATTR_SIGNALR_TRANSPORT = "signalr.transport"; + SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; + SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; + SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; + ATTR_TELEMETRY_DISTRO_NAME = "telemetry.distro.name"; + ATTR_TELEMETRY_DISTRO_VERSION = "telemetry.distro.version"; + ATTR_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; + TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; + TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; + TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; + TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; + TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; + TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; + TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; + TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; + TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; + TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; + TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; + TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; + ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; + ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; + ATTR_URL_FRAGMENT = "url.fragment"; + ATTR_URL_FULL = "url.full"; + ATTR_URL_PATH = "url.path"; + ATTR_URL_QUERY = "url.query"; + ATTR_URL_SCHEME = "url.scheme"; + ATTR_USER_AGENT_ORIGINAL = "user_agent.original"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js +var METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS, METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES, METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS, METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE, METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION, METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS, METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS, METRIC_DB_CLIENT_OPERATION_DURATION, METRIC_DOTNET_ASSEMBLY_COUNT, METRIC_DOTNET_EXCEPTIONS, METRIC_DOTNET_GC_COLLECTIONS, METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED, METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE, METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE, METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE, METRIC_DOTNET_GC_PAUSE_TIME, METRIC_DOTNET_JIT_COMPILATION_TIME, METRIC_DOTNET_JIT_COMPILED_IL_SIZE, METRIC_DOTNET_JIT_COMPILED_METHODS, METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS, METRIC_DOTNET_PROCESS_CPU_COUNT, METRIC_DOTNET_PROCESS_CPU_TIME, METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET, METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH, METRIC_DOTNET_THREAD_POOL_THREAD_COUNT, METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT, METRIC_DOTNET_TIMER_COUNT, METRIC_HTTP_CLIENT_REQUEST_DURATION, METRIC_HTTP_SERVER_REQUEST_DURATION, METRIC_JVM_CLASS_COUNT, METRIC_JVM_CLASS_LOADED, METRIC_JVM_CLASS_UNLOADED, METRIC_JVM_CPU_COUNT, METRIC_JVM_CPU_RECENT_UTILIZATION, METRIC_JVM_CPU_TIME, METRIC_JVM_GC_DURATION, METRIC_JVM_MEMORY_COMMITTED, METRIC_JVM_MEMORY_LIMIT, METRIC_JVM_MEMORY_USED, METRIC_JVM_MEMORY_USED_AFTER_LAST_GC, METRIC_JVM_THREAD_COUNT, METRIC_KESTREL_ACTIVE_CONNECTIONS, METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES, METRIC_KESTREL_CONNECTION_DURATION, METRIC_KESTREL_QUEUED_CONNECTIONS, METRIC_KESTREL_QUEUED_REQUESTS, METRIC_KESTREL_REJECTED_CONNECTIONS, METRIC_KESTREL_TLS_HANDSHAKE_DURATION, METRIC_KESTREL_UPGRADED_CONNECTIONS, METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS, METRIC_SIGNALR_SERVER_CONNECTION_DURATION; +var init_stable_metrics = __esmMin((() => { + METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = "aspnetcore.diagnostics.exceptions"; + METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = "aspnetcore.rate_limiting.active_request_leases"; + METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = "aspnetcore.rate_limiting.queued_requests"; + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = "aspnetcore.rate_limiting.request.time_in_queue"; + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = "aspnetcore.rate_limiting.request_lease.duration"; + METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = "aspnetcore.rate_limiting.requests"; + METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = "aspnetcore.routing.match_attempts"; + METRIC_DB_CLIENT_OPERATION_DURATION = "db.client.operation.duration"; + METRIC_DOTNET_ASSEMBLY_COUNT = "dotnet.assembly.count"; + METRIC_DOTNET_EXCEPTIONS = "dotnet.exceptions"; + METRIC_DOTNET_GC_COLLECTIONS = "dotnet.gc.collections"; + METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = "dotnet.gc.heap.total_allocated"; + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = "dotnet.gc.last_collection.heap.fragmentation.size"; + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = "dotnet.gc.last_collection.heap.size"; + METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = "dotnet.gc.last_collection.memory.committed_size"; + METRIC_DOTNET_GC_PAUSE_TIME = "dotnet.gc.pause.time"; + METRIC_DOTNET_JIT_COMPILATION_TIME = "dotnet.jit.compilation.time"; + METRIC_DOTNET_JIT_COMPILED_IL_SIZE = "dotnet.jit.compiled_il.size"; + METRIC_DOTNET_JIT_COMPILED_METHODS = "dotnet.jit.compiled_methods"; + METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = "dotnet.monitor.lock_contentions"; + METRIC_DOTNET_PROCESS_CPU_COUNT = "dotnet.process.cpu.count"; + METRIC_DOTNET_PROCESS_CPU_TIME = "dotnet.process.cpu.time"; + METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = "dotnet.process.memory.working_set"; + METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = "dotnet.thread_pool.queue.length"; + METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = "dotnet.thread_pool.thread.count"; + METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = "dotnet.thread_pool.work_item.count"; + METRIC_DOTNET_TIMER_COUNT = "dotnet.timer.count"; + METRIC_HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration"; + METRIC_HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration"; + METRIC_JVM_CLASS_COUNT = "jvm.class.count"; + METRIC_JVM_CLASS_LOADED = "jvm.class.loaded"; + METRIC_JVM_CLASS_UNLOADED = "jvm.class.unloaded"; + METRIC_JVM_CPU_COUNT = "jvm.cpu.count"; + METRIC_JVM_CPU_RECENT_UTILIZATION = "jvm.cpu.recent_utilization"; + METRIC_JVM_CPU_TIME = "jvm.cpu.time"; + METRIC_JVM_GC_DURATION = "jvm.gc.duration"; + METRIC_JVM_MEMORY_COMMITTED = "jvm.memory.committed"; + METRIC_JVM_MEMORY_LIMIT = "jvm.memory.limit"; + METRIC_JVM_MEMORY_USED = "jvm.memory.used"; + METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = "jvm.memory.used_after_last_gc"; + METRIC_JVM_THREAD_COUNT = "jvm.thread.count"; + METRIC_KESTREL_ACTIVE_CONNECTIONS = "kestrel.active_connections"; + METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = "kestrel.active_tls_handshakes"; + METRIC_KESTREL_CONNECTION_DURATION = "kestrel.connection.duration"; + METRIC_KESTREL_QUEUED_CONNECTIONS = "kestrel.queued_connections"; + METRIC_KESTREL_QUEUED_REQUESTS = "kestrel.queued_requests"; + METRIC_KESTREL_REJECTED_CONNECTIONS = "kestrel.rejected_connections"; + METRIC_KESTREL_TLS_HANDSHAKE_DURATION = "kestrel.tls_handshake.duration"; + METRIC_KESTREL_UPGRADED_CONNECTIONS = "kestrel.upgraded_connections"; + METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = "signalr.server.active_connections"; + METRIC_SIGNALR_SERVER_CONNECTION_DURATION = "signalr.server.connection.duration"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +var EVENT_EXCEPTION; +var init_stable_events = __esmMin((() => { + EVENT_EXCEPTION = "exception"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +var esm_exports$1 = /* @__PURE__ */ __exportAll({ + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED, + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED, + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED, + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED, + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE: () => ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE, + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS: () => ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS, + ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT: () => ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT, + ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE: () => ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE, + ATTR_ASPNETCORE_RATE_LIMITING_POLICY: () => ATTR_ASPNETCORE_RATE_LIMITING_POLICY, + ATTR_ASPNETCORE_RATE_LIMITING_RESULT: () => ATTR_ASPNETCORE_RATE_LIMITING_RESULT, + ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED: () => ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED, + ATTR_ASPNETCORE_ROUTING_IS_FALLBACK: () => ATTR_ASPNETCORE_ROUTING_IS_FALLBACK, + ATTR_ASPNETCORE_ROUTING_MATCH_STATUS: () => ATTR_ASPNETCORE_ROUTING_MATCH_STATUS, + ATTR_ASPNETCORE_USER_IS_AUTHENTICATED: () => ATTR_ASPNETCORE_USER_IS_AUTHENTICATED, + ATTR_CLIENT_ADDRESS: () => ATTR_CLIENT_ADDRESS, + ATTR_CLIENT_PORT: () => ATTR_CLIENT_PORT, + ATTR_CODE_COLUMN_NUMBER: () => ATTR_CODE_COLUMN_NUMBER, + ATTR_CODE_FILE_PATH: () => ATTR_CODE_FILE_PATH, + ATTR_CODE_FUNCTION_NAME: () => ATTR_CODE_FUNCTION_NAME, + ATTR_CODE_LINE_NUMBER: () => ATTR_CODE_LINE_NUMBER, + ATTR_CODE_STACKTRACE: () => ATTR_CODE_STACKTRACE, + ATTR_DB_COLLECTION_NAME: () => ATTR_DB_COLLECTION_NAME, + ATTR_DB_NAMESPACE: () => ATTR_DB_NAMESPACE, + ATTR_DB_OPERATION_BATCH_SIZE: () => ATTR_DB_OPERATION_BATCH_SIZE, + ATTR_DB_OPERATION_NAME: () => ATTR_DB_OPERATION_NAME, + ATTR_DB_QUERY_SUMMARY: () => ATTR_DB_QUERY_SUMMARY, + ATTR_DB_QUERY_TEXT: () => ATTR_DB_QUERY_TEXT, + ATTR_DB_RESPONSE_STATUS_CODE: () => ATTR_DB_RESPONSE_STATUS_CODE, + ATTR_DB_STORED_PROCEDURE_NAME: () => ATTR_DB_STORED_PROCEDURE_NAME, + ATTR_DB_SYSTEM_NAME: () => ATTR_DB_SYSTEM_NAME, + ATTR_DEPLOYMENT_ENVIRONMENT_NAME: () => ATTR_DEPLOYMENT_ENVIRONMENT_NAME, + ATTR_DOTNET_GC_HEAP_GENERATION: () => ATTR_DOTNET_GC_HEAP_GENERATION, + ATTR_ERROR_TYPE: () => ATTR_ERROR_TYPE, + ATTR_EXCEPTION_ESCAPED: () => ATTR_EXCEPTION_ESCAPED, + ATTR_EXCEPTION_MESSAGE: () => ATTR_EXCEPTION_MESSAGE, + ATTR_EXCEPTION_STACKTRACE: () => ATTR_EXCEPTION_STACKTRACE, + ATTR_EXCEPTION_TYPE: () => ATTR_EXCEPTION_TYPE, + ATTR_HTTP_REQUEST_HEADER: () => ATTR_HTTP_REQUEST_HEADER, + ATTR_HTTP_REQUEST_METHOD: () => ATTR_HTTP_REQUEST_METHOD, + ATTR_HTTP_REQUEST_METHOD_ORIGINAL: () => ATTR_HTTP_REQUEST_METHOD_ORIGINAL, + ATTR_HTTP_REQUEST_RESEND_COUNT: () => ATTR_HTTP_REQUEST_RESEND_COUNT, + ATTR_HTTP_RESPONSE_HEADER: () => ATTR_HTTP_RESPONSE_HEADER, + ATTR_HTTP_RESPONSE_STATUS_CODE: () => ATTR_HTTP_RESPONSE_STATUS_CODE, + ATTR_HTTP_ROUTE: () => ATTR_HTTP_ROUTE, + ATTR_JVM_GC_ACTION: () => ATTR_JVM_GC_ACTION, + ATTR_JVM_GC_NAME: () => ATTR_JVM_GC_NAME, + ATTR_JVM_MEMORY_POOL_NAME: () => ATTR_JVM_MEMORY_POOL_NAME, + ATTR_JVM_MEMORY_TYPE: () => ATTR_JVM_MEMORY_TYPE, + ATTR_JVM_THREAD_DAEMON: () => ATTR_JVM_THREAD_DAEMON, + ATTR_JVM_THREAD_STATE: () => ATTR_JVM_THREAD_STATE, + ATTR_NETWORK_LOCAL_ADDRESS: () => ATTR_NETWORK_LOCAL_ADDRESS, + ATTR_NETWORK_LOCAL_PORT: () => ATTR_NETWORK_LOCAL_PORT, + ATTR_NETWORK_PEER_ADDRESS: () => ATTR_NETWORK_PEER_ADDRESS, + ATTR_NETWORK_PEER_PORT: () => ATTR_NETWORK_PEER_PORT, + ATTR_NETWORK_PROTOCOL_NAME: () => ATTR_NETWORK_PROTOCOL_NAME, + ATTR_NETWORK_PROTOCOL_VERSION: () => ATTR_NETWORK_PROTOCOL_VERSION, + ATTR_NETWORK_TRANSPORT: () => ATTR_NETWORK_TRANSPORT, + ATTR_NETWORK_TYPE: () => ATTR_NETWORK_TYPE, + ATTR_OTEL_EVENT_NAME: () => ATTR_OTEL_EVENT_NAME, + ATTR_OTEL_SCOPE_NAME: () => ATTR_OTEL_SCOPE_NAME, + ATTR_OTEL_SCOPE_VERSION: () => ATTR_OTEL_SCOPE_VERSION, + ATTR_OTEL_STATUS_CODE: () => ATTR_OTEL_STATUS_CODE, + ATTR_OTEL_STATUS_DESCRIPTION: () => ATTR_OTEL_STATUS_DESCRIPTION, + ATTR_SERVER_ADDRESS: () => ATTR_SERVER_ADDRESS, + ATTR_SERVER_PORT: () => ATTR_SERVER_PORT, + ATTR_SERVICE_INSTANCE_ID: () => ATTR_SERVICE_INSTANCE_ID, + ATTR_SERVICE_NAME: () => ATTR_SERVICE_NAME, + ATTR_SERVICE_NAMESPACE: () => ATTR_SERVICE_NAMESPACE, + ATTR_SERVICE_VERSION: () => ATTR_SERVICE_VERSION, + ATTR_SIGNALR_CONNECTION_STATUS: () => ATTR_SIGNALR_CONNECTION_STATUS, + ATTR_SIGNALR_TRANSPORT: () => ATTR_SIGNALR_TRANSPORT, + ATTR_TELEMETRY_DISTRO_NAME: () => ATTR_TELEMETRY_DISTRO_NAME, + ATTR_TELEMETRY_DISTRO_VERSION: () => ATTR_TELEMETRY_DISTRO_VERSION, + ATTR_TELEMETRY_SDK_LANGUAGE: () => ATTR_TELEMETRY_SDK_LANGUAGE, + ATTR_TELEMETRY_SDK_NAME: () => ATTR_TELEMETRY_SDK_NAME, + ATTR_TELEMETRY_SDK_VERSION: () => ATTR_TELEMETRY_SDK_VERSION, + ATTR_URL_FRAGMENT: () => ATTR_URL_FRAGMENT, + ATTR_URL_FULL: () => ATTR_URL_FULL, + ATTR_URL_PATH: () => ATTR_URL_PATH, + ATTR_URL_QUERY: () => ATTR_URL_QUERY, + ATTR_URL_SCHEME: () => ATTR_URL_SCHEME, + ATTR_USER_AGENT_ORIGINAL: () => ATTR_USER_AGENT_ORIGINAL, + AWSECSLAUNCHTYPEVALUES_EC2: () => AWSECSLAUNCHTYPEVALUES_EC2, + AWSECSLAUNCHTYPEVALUES_FARGATE: () => AWSECSLAUNCHTYPEVALUES_FARGATE, + AwsEcsLaunchtypeValues: () => AwsEcsLaunchtypeValues, + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS: () => CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC: () => CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, + CLOUDPLATFORMVALUES_AWS_EC2: () => CLOUDPLATFORMVALUES_AWS_EC2, + CLOUDPLATFORMVALUES_AWS_ECS: () => CLOUDPLATFORMVALUES_AWS_ECS, + CLOUDPLATFORMVALUES_AWS_EKS: () => CLOUDPLATFORMVALUES_AWS_EKS, + CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK: () => CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, + CLOUDPLATFORMVALUES_AWS_LAMBDA: () => CLOUDPLATFORMVALUES_AWS_LAMBDA, + CLOUDPLATFORMVALUES_AZURE_AKS: () => CLOUDPLATFORMVALUES_AZURE_AKS, + CLOUDPLATFORMVALUES_AZURE_APP_SERVICE: () => CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, + CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES: () => CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, + CLOUDPLATFORMVALUES_AZURE_FUNCTIONS: () => CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, + CLOUDPLATFORMVALUES_AZURE_VM: () => CLOUDPLATFORMVALUES_AZURE_VM, + CLOUDPLATFORMVALUES_GCP_APP_ENGINE: () => CLOUDPLATFORMVALUES_GCP_APP_ENGINE, + CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS: () => CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, + CLOUDPLATFORMVALUES_GCP_CLOUD_RUN: () => CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, + CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE: () => CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, + CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE: () => CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, + CLOUDPROVIDERVALUES_ALIBABA_CLOUD: () => CLOUDPROVIDERVALUES_ALIBABA_CLOUD, + CLOUDPROVIDERVALUES_AWS: () => CLOUDPROVIDERVALUES_AWS, + CLOUDPROVIDERVALUES_AZURE: () => CLOUDPROVIDERVALUES_AZURE, + CLOUDPROVIDERVALUES_GCP: () => CLOUDPROVIDERVALUES_GCP, + CloudPlatformValues: () => CloudPlatformValues, + CloudProviderValues: () => CloudProviderValues, + DBCASSANDRACONSISTENCYLEVELVALUES_ALL: () => DBCASSANDRACONSISTENCYLEVELVALUES_ALL, + DBCASSANDRACONSISTENCYLEVELVALUES_ANY: () => DBCASSANDRACONSISTENCYLEVELVALUES_ANY, + DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, + DBCASSANDRACONSISTENCYLEVELVALUES_ONE: () => DBCASSANDRACONSISTENCYLEVELVALUES_ONE, + DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, + DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL: () => DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, + DBCASSANDRACONSISTENCYLEVELVALUES_THREE: () => DBCASSANDRACONSISTENCYLEVELVALUES_THREE, + DBCASSANDRACONSISTENCYLEVELVALUES_TWO: () => DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + DBSYSTEMVALUES_ADABAS: () => DBSYSTEMVALUES_ADABAS, + DBSYSTEMVALUES_CACHE: () => DBSYSTEMVALUES_CACHE, + DBSYSTEMVALUES_CASSANDRA: () => DBSYSTEMVALUES_CASSANDRA, + DBSYSTEMVALUES_CLOUDSCAPE: () => DBSYSTEMVALUES_CLOUDSCAPE, + DBSYSTEMVALUES_COCKROACHDB: () => DBSYSTEMVALUES_COCKROACHDB, + DBSYSTEMVALUES_COLDFUSION: () => DBSYSTEMVALUES_COLDFUSION, + DBSYSTEMVALUES_COSMOSDB: () => DBSYSTEMVALUES_COSMOSDB, + DBSYSTEMVALUES_COUCHBASE: () => DBSYSTEMVALUES_COUCHBASE, + DBSYSTEMVALUES_COUCHDB: () => DBSYSTEMVALUES_COUCHDB, + DBSYSTEMVALUES_DB2: () => DBSYSTEMVALUES_DB2, + DBSYSTEMVALUES_DERBY: () => DBSYSTEMVALUES_DERBY, + DBSYSTEMVALUES_DYNAMODB: () => DBSYSTEMVALUES_DYNAMODB, + DBSYSTEMVALUES_EDB: () => DBSYSTEMVALUES_EDB, + DBSYSTEMVALUES_ELASTICSEARCH: () => DBSYSTEMVALUES_ELASTICSEARCH, + DBSYSTEMVALUES_FILEMAKER: () => DBSYSTEMVALUES_FILEMAKER, + DBSYSTEMVALUES_FIREBIRD: () => DBSYSTEMVALUES_FIREBIRD, + DBSYSTEMVALUES_FIRSTSQL: () => DBSYSTEMVALUES_FIRSTSQL, + DBSYSTEMVALUES_GEODE: () => DBSYSTEMVALUES_GEODE, + DBSYSTEMVALUES_H2: () => DBSYSTEMVALUES_H2, + DBSYSTEMVALUES_HANADB: () => DBSYSTEMVALUES_HANADB, + DBSYSTEMVALUES_HBASE: () => DBSYSTEMVALUES_HBASE, + DBSYSTEMVALUES_HIVE: () => DBSYSTEMVALUES_HIVE, + DBSYSTEMVALUES_HSQLDB: () => DBSYSTEMVALUES_HSQLDB, + DBSYSTEMVALUES_INFORMIX: () => DBSYSTEMVALUES_INFORMIX, + DBSYSTEMVALUES_INGRES: () => DBSYSTEMVALUES_INGRES, + DBSYSTEMVALUES_INSTANTDB: () => DBSYSTEMVALUES_INSTANTDB, + DBSYSTEMVALUES_INTERBASE: () => DBSYSTEMVALUES_INTERBASE, + DBSYSTEMVALUES_MARIADB: () => DBSYSTEMVALUES_MARIADB, + DBSYSTEMVALUES_MAXDB: () => DBSYSTEMVALUES_MAXDB, + DBSYSTEMVALUES_MEMCACHED: () => DBSYSTEMVALUES_MEMCACHED, + DBSYSTEMVALUES_MONGODB: () => DBSYSTEMVALUES_MONGODB, + DBSYSTEMVALUES_MSSQL: () => DBSYSTEMVALUES_MSSQL, + DBSYSTEMVALUES_MYSQL: () => DBSYSTEMVALUES_MYSQL, + DBSYSTEMVALUES_NEO4J: () => DBSYSTEMVALUES_NEO4J, + DBSYSTEMVALUES_NETEZZA: () => DBSYSTEMVALUES_NETEZZA, + DBSYSTEMVALUES_ORACLE: () => DBSYSTEMVALUES_ORACLE, + DBSYSTEMVALUES_OTHER_SQL: () => DBSYSTEMVALUES_OTHER_SQL, + DBSYSTEMVALUES_PERVASIVE: () => DBSYSTEMVALUES_PERVASIVE, + DBSYSTEMVALUES_POINTBASE: () => DBSYSTEMVALUES_POINTBASE, + DBSYSTEMVALUES_POSTGRESQL: () => DBSYSTEMVALUES_POSTGRESQL, + DBSYSTEMVALUES_PROGRESS: () => DBSYSTEMVALUES_PROGRESS, + DBSYSTEMVALUES_REDIS: () => DBSYSTEMVALUES_REDIS, + DBSYSTEMVALUES_REDSHIFT: () => DBSYSTEMVALUES_REDSHIFT, + DBSYSTEMVALUES_SQLITE: () => DBSYSTEMVALUES_SQLITE, + DBSYSTEMVALUES_SYBASE: () => DBSYSTEMVALUES_SYBASE, + DBSYSTEMVALUES_TERADATA: () => DBSYSTEMVALUES_TERADATA, + DBSYSTEMVALUES_VERTICA: () => DBSYSTEMVALUES_VERTICA, + DB_SYSTEM_NAME_VALUE_MARIADB: () => DB_SYSTEM_NAME_VALUE_MARIADB, + DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER: () => DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER, + DB_SYSTEM_NAME_VALUE_MYSQL: () => DB_SYSTEM_NAME_VALUE_MYSQL, + DB_SYSTEM_NAME_VALUE_POSTGRESQL: () => DB_SYSTEM_NAME_VALUE_POSTGRESQL, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST, + DOTNET_GC_HEAP_GENERATION_VALUE_GEN0: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN0, + DOTNET_GC_HEAP_GENERATION_VALUE_GEN1: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN1, + DOTNET_GC_HEAP_GENERATION_VALUE_GEN2: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN2, + DOTNET_GC_HEAP_GENERATION_VALUE_LOH: () => DOTNET_GC_HEAP_GENERATION_VALUE_LOH, + DOTNET_GC_HEAP_GENERATION_VALUE_POH: () => DOTNET_GC_HEAP_GENERATION_VALUE_POH, + DbCassandraConsistencyLevelValues: () => DbCassandraConsistencyLevelValues, + DbSystemValues: () => DbSystemValues, + ERROR_TYPE_VALUE_OTHER: () => ERROR_TYPE_VALUE_OTHER, + EVENT_EXCEPTION: () => EVENT_EXCEPTION, + FAASDOCUMENTOPERATIONVALUES_DELETE: () => FAASDOCUMENTOPERATIONVALUES_DELETE, + FAASDOCUMENTOPERATIONVALUES_EDIT: () => FAASDOCUMENTOPERATIONVALUES_EDIT, + FAASDOCUMENTOPERATIONVALUES_INSERT: () => FAASDOCUMENTOPERATIONVALUES_INSERT, + FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD: () => FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, + FAASINVOKEDPROVIDERVALUES_AWS: () => FAASINVOKEDPROVIDERVALUES_AWS, + FAASINVOKEDPROVIDERVALUES_AZURE: () => FAASINVOKEDPROVIDERVALUES_AZURE, + FAASINVOKEDPROVIDERVALUES_GCP: () => FAASINVOKEDPROVIDERVALUES_GCP, + FAASTRIGGERVALUES_DATASOURCE: () => FAASTRIGGERVALUES_DATASOURCE, + FAASTRIGGERVALUES_HTTP: () => FAASTRIGGERVALUES_HTTP, + FAASTRIGGERVALUES_OTHER: () => FAASTRIGGERVALUES_OTHER, + FAASTRIGGERVALUES_PUBSUB: () => FAASTRIGGERVALUES_PUBSUB, + FAASTRIGGERVALUES_TIMER: () => FAASTRIGGERVALUES_TIMER, + FaasDocumentOperationValues: () => FaasDocumentOperationValues, + FaasInvokedProviderValues: () => FaasInvokedProviderValues, + FaasTriggerValues: () => FaasTriggerValues, + HOSTARCHVALUES_AMD64: () => HOSTARCHVALUES_AMD64, + HOSTARCHVALUES_ARM32: () => HOSTARCHVALUES_ARM32, + HOSTARCHVALUES_ARM64: () => HOSTARCHVALUES_ARM64, + HOSTARCHVALUES_IA64: () => HOSTARCHVALUES_IA64, + HOSTARCHVALUES_PPC32: () => HOSTARCHVALUES_PPC32, + HOSTARCHVALUES_PPC64: () => HOSTARCHVALUES_PPC64, + HOSTARCHVALUES_X86: () => HOSTARCHVALUES_X86, + HTTPFLAVORVALUES_HTTP_1_0: () => HTTPFLAVORVALUES_HTTP_1_0, + HTTPFLAVORVALUES_HTTP_1_1: () => HTTPFLAVORVALUES_HTTP_1_1, + HTTPFLAVORVALUES_HTTP_2_0: () => HTTPFLAVORVALUES_HTTP_2_0, + HTTPFLAVORVALUES_QUIC: () => HTTPFLAVORVALUES_QUIC, + HTTPFLAVORVALUES_SPDY: () => HTTPFLAVORVALUES_SPDY, + HTTP_REQUEST_METHOD_VALUE_CONNECT: () => HTTP_REQUEST_METHOD_VALUE_CONNECT, + HTTP_REQUEST_METHOD_VALUE_DELETE: () => HTTP_REQUEST_METHOD_VALUE_DELETE, + HTTP_REQUEST_METHOD_VALUE_GET: () => HTTP_REQUEST_METHOD_VALUE_GET, + HTTP_REQUEST_METHOD_VALUE_HEAD: () => HTTP_REQUEST_METHOD_VALUE_HEAD, + HTTP_REQUEST_METHOD_VALUE_OPTIONS: () => HTTP_REQUEST_METHOD_VALUE_OPTIONS, + HTTP_REQUEST_METHOD_VALUE_OTHER: () => HTTP_REQUEST_METHOD_VALUE_OTHER, + HTTP_REQUEST_METHOD_VALUE_PATCH: () => HTTP_REQUEST_METHOD_VALUE_PATCH, + HTTP_REQUEST_METHOD_VALUE_POST: () => HTTP_REQUEST_METHOD_VALUE_POST, + HTTP_REQUEST_METHOD_VALUE_PUT: () => HTTP_REQUEST_METHOD_VALUE_PUT, + HTTP_REQUEST_METHOD_VALUE_TRACE: () => HTTP_REQUEST_METHOD_VALUE_TRACE, + HostArchValues: () => HostArchValues, + HttpFlavorValues: () => HttpFlavorValues, + JVM_MEMORY_TYPE_VALUE_HEAP: () => JVM_MEMORY_TYPE_VALUE_HEAP, + JVM_MEMORY_TYPE_VALUE_NON_HEAP: () => JVM_MEMORY_TYPE_VALUE_NON_HEAP, + JVM_THREAD_STATE_VALUE_BLOCKED: () => JVM_THREAD_STATE_VALUE_BLOCKED, + JVM_THREAD_STATE_VALUE_NEW: () => JVM_THREAD_STATE_VALUE_NEW, + JVM_THREAD_STATE_VALUE_RUNNABLE: () => JVM_THREAD_STATE_VALUE_RUNNABLE, + JVM_THREAD_STATE_VALUE_TERMINATED: () => JVM_THREAD_STATE_VALUE_TERMINATED, + JVM_THREAD_STATE_VALUE_TIMED_WAITING: () => JVM_THREAD_STATE_VALUE_TIMED_WAITING, + JVM_THREAD_STATE_VALUE_WAITING: () => JVM_THREAD_STATE_VALUE_WAITING, + MESSAGETYPEVALUES_RECEIVED: () => MESSAGETYPEVALUES_RECEIVED, + MESSAGETYPEVALUES_SENT: () => MESSAGETYPEVALUES_SENT, + MESSAGINGDESTINATIONKINDVALUES_QUEUE: () => MESSAGINGDESTINATIONKINDVALUES_QUEUE, + MESSAGINGDESTINATIONKINDVALUES_TOPIC: () => MESSAGINGDESTINATIONKINDVALUES_TOPIC, + MESSAGINGOPERATIONVALUES_PROCESS: () => MESSAGINGOPERATIONVALUES_PROCESS, + MESSAGINGOPERATIONVALUES_RECEIVE: () => MESSAGINGOPERATIONVALUES_RECEIVE, + METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS: () => METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS, + METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES: () => METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES, + METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS: () => METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS, + METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS, + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION, + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE, + METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS: () => METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS, + METRIC_DB_CLIENT_OPERATION_DURATION: () => METRIC_DB_CLIENT_OPERATION_DURATION, + METRIC_DOTNET_ASSEMBLY_COUNT: () => METRIC_DOTNET_ASSEMBLY_COUNT, + METRIC_DOTNET_EXCEPTIONS: () => METRIC_DOTNET_EXCEPTIONS, + METRIC_DOTNET_GC_COLLECTIONS: () => METRIC_DOTNET_GC_COLLECTIONS, + METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED: () => METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED, + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE, + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE, + METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE, + METRIC_DOTNET_GC_PAUSE_TIME: () => METRIC_DOTNET_GC_PAUSE_TIME, + METRIC_DOTNET_JIT_COMPILATION_TIME: () => METRIC_DOTNET_JIT_COMPILATION_TIME, + METRIC_DOTNET_JIT_COMPILED_IL_SIZE: () => METRIC_DOTNET_JIT_COMPILED_IL_SIZE, + METRIC_DOTNET_JIT_COMPILED_METHODS: () => METRIC_DOTNET_JIT_COMPILED_METHODS, + METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS: () => METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS, + METRIC_DOTNET_PROCESS_CPU_COUNT: () => METRIC_DOTNET_PROCESS_CPU_COUNT, + METRIC_DOTNET_PROCESS_CPU_TIME: () => METRIC_DOTNET_PROCESS_CPU_TIME, + METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET: () => METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET, + METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH: () => METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH, + METRIC_DOTNET_THREAD_POOL_THREAD_COUNT: () => METRIC_DOTNET_THREAD_POOL_THREAD_COUNT, + METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT: () => METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT, + METRIC_DOTNET_TIMER_COUNT: () => METRIC_DOTNET_TIMER_COUNT, + METRIC_HTTP_CLIENT_REQUEST_DURATION: () => METRIC_HTTP_CLIENT_REQUEST_DURATION, + METRIC_HTTP_SERVER_REQUEST_DURATION: () => METRIC_HTTP_SERVER_REQUEST_DURATION, + METRIC_JVM_CLASS_COUNT: () => METRIC_JVM_CLASS_COUNT, + METRIC_JVM_CLASS_LOADED: () => METRIC_JVM_CLASS_LOADED, + METRIC_JVM_CLASS_UNLOADED: () => METRIC_JVM_CLASS_UNLOADED, + METRIC_JVM_CPU_COUNT: () => METRIC_JVM_CPU_COUNT, + METRIC_JVM_CPU_RECENT_UTILIZATION: () => METRIC_JVM_CPU_RECENT_UTILIZATION, + METRIC_JVM_CPU_TIME: () => METRIC_JVM_CPU_TIME, + METRIC_JVM_GC_DURATION: () => METRIC_JVM_GC_DURATION, + METRIC_JVM_MEMORY_COMMITTED: () => METRIC_JVM_MEMORY_COMMITTED, + METRIC_JVM_MEMORY_LIMIT: () => METRIC_JVM_MEMORY_LIMIT, + METRIC_JVM_MEMORY_USED: () => METRIC_JVM_MEMORY_USED, + METRIC_JVM_MEMORY_USED_AFTER_LAST_GC: () => METRIC_JVM_MEMORY_USED_AFTER_LAST_GC, + METRIC_JVM_THREAD_COUNT: () => METRIC_JVM_THREAD_COUNT, + METRIC_KESTREL_ACTIVE_CONNECTIONS: () => METRIC_KESTREL_ACTIVE_CONNECTIONS, + METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES: () => METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES, + METRIC_KESTREL_CONNECTION_DURATION: () => METRIC_KESTREL_CONNECTION_DURATION, + METRIC_KESTREL_QUEUED_CONNECTIONS: () => METRIC_KESTREL_QUEUED_CONNECTIONS, + METRIC_KESTREL_QUEUED_REQUESTS: () => METRIC_KESTREL_QUEUED_REQUESTS, + METRIC_KESTREL_REJECTED_CONNECTIONS: () => METRIC_KESTREL_REJECTED_CONNECTIONS, + METRIC_KESTREL_TLS_HANDSHAKE_DURATION: () => METRIC_KESTREL_TLS_HANDSHAKE_DURATION, + METRIC_KESTREL_UPGRADED_CONNECTIONS: () => METRIC_KESTREL_UPGRADED_CONNECTIONS, + METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS: () => METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS, + METRIC_SIGNALR_SERVER_CONNECTION_DURATION: () => METRIC_SIGNALR_SERVER_CONNECTION_DURATION, + MessageTypeValues: () => MessageTypeValues, + MessagingDestinationKindValues: () => MessagingDestinationKindValues, + MessagingOperationValues: () => MessagingOperationValues, + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA: () => NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT: () => NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, + NETHOSTCONNECTIONSUBTYPEVALUES_EDGE: () => NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, + NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD: () => NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, + NETHOSTCONNECTIONSUBTYPEVALUES_GPRS: () => NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, + NETHOSTCONNECTIONSUBTYPEVALUES_GSM: () => NETHOSTCONNECTIONSUBTYPEVALUES_GSM, + NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, + NETHOSTCONNECTIONSUBTYPEVALUES_HSPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, + NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, + NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, + NETHOSTCONNECTIONSUBTYPEVALUES_IDEN: () => NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, + NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN: () => NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, + NETHOSTCONNECTIONSUBTYPEVALUES_LTE: () => NETHOSTCONNECTIONSUBTYPEVALUES_LTE, + NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA: () => NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, + NETHOSTCONNECTIONSUBTYPEVALUES_NR: () => NETHOSTCONNECTIONSUBTYPEVALUES_NR, + NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA: () => NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, + NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA: () => NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, + NETHOSTCONNECTIONSUBTYPEVALUES_UMTS: () => NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, + NETHOSTCONNECTIONTYPEVALUES_CELL: () => NETHOSTCONNECTIONTYPEVALUES_CELL, + NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE: () => NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, + NETHOSTCONNECTIONTYPEVALUES_UNKNOWN: () => NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, + NETHOSTCONNECTIONTYPEVALUES_WIFI: () => NETHOSTCONNECTIONTYPEVALUES_WIFI, + NETHOSTCONNECTIONTYPEVALUES_WIRED: () => NETHOSTCONNECTIONTYPEVALUES_WIRED, + NETTRANSPORTVALUES_INPROC: () => NETTRANSPORTVALUES_INPROC, + NETTRANSPORTVALUES_IP: () => NETTRANSPORTVALUES_IP, + NETTRANSPORTVALUES_IP_TCP: () => NETTRANSPORTVALUES_IP_TCP, + NETTRANSPORTVALUES_IP_UDP: () => NETTRANSPORTVALUES_IP_UDP, + NETTRANSPORTVALUES_OTHER: () => NETTRANSPORTVALUES_OTHER, + NETTRANSPORTVALUES_PIPE: () => NETTRANSPORTVALUES_PIPE, + NETTRANSPORTVALUES_UNIX: () => NETTRANSPORTVALUES_UNIX, + NETWORK_TRANSPORT_VALUE_PIPE: () => NETWORK_TRANSPORT_VALUE_PIPE, + NETWORK_TRANSPORT_VALUE_QUIC: () => NETWORK_TRANSPORT_VALUE_QUIC, + NETWORK_TRANSPORT_VALUE_TCP: () => NETWORK_TRANSPORT_VALUE_TCP, + NETWORK_TRANSPORT_VALUE_UDP: () => NETWORK_TRANSPORT_VALUE_UDP, + NETWORK_TRANSPORT_VALUE_UNIX: () => NETWORK_TRANSPORT_VALUE_UNIX, + NETWORK_TYPE_VALUE_IPV4: () => NETWORK_TYPE_VALUE_IPV4, + NETWORK_TYPE_VALUE_IPV6: () => NETWORK_TYPE_VALUE_IPV6, + NetHostConnectionSubtypeValues: () => NetHostConnectionSubtypeValues, + NetHostConnectionTypeValues: () => NetHostConnectionTypeValues, + NetTransportValues: () => NetTransportValues, + OSTYPEVALUES_AIX: () => OSTYPEVALUES_AIX, + OSTYPEVALUES_DARWIN: () => OSTYPEVALUES_DARWIN, + OSTYPEVALUES_DRAGONFLYBSD: () => OSTYPEVALUES_DRAGONFLYBSD, + OSTYPEVALUES_FREEBSD: () => OSTYPEVALUES_FREEBSD, + OSTYPEVALUES_HPUX: () => OSTYPEVALUES_HPUX, + OSTYPEVALUES_LINUX: () => OSTYPEVALUES_LINUX, + OSTYPEVALUES_NETBSD: () => OSTYPEVALUES_NETBSD, + OSTYPEVALUES_OPENBSD: () => OSTYPEVALUES_OPENBSD, + OSTYPEVALUES_SOLARIS: () => OSTYPEVALUES_SOLARIS, + OSTYPEVALUES_WINDOWS: () => OSTYPEVALUES_WINDOWS, + OSTYPEVALUES_Z_OS: () => OSTYPEVALUES_Z_OS, + OTEL_STATUS_CODE_VALUE_ERROR: () => OTEL_STATUS_CODE_VALUE_ERROR, + OTEL_STATUS_CODE_VALUE_OK: () => OTEL_STATUS_CODE_VALUE_OK, + OsTypeValues: () => OsTypeValues, + RPCGRPCSTATUSCODEVALUES_ABORTED: () => RPCGRPCSTATUSCODEVALUES_ABORTED, + RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS: () => RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, + RPCGRPCSTATUSCODEVALUES_CANCELLED: () => RPCGRPCSTATUSCODEVALUES_CANCELLED, + RPCGRPCSTATUSCODEVALUES_DATA_LOSS: () => RPCGRPCSTATUSCODEVALUES_DATA_LOSS, + RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED: () => RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, + RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION: () => RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, + RPCGRPCSTATUSCODEVALUES_INTERNAL: () => RPCGRPCSTATUSCODEVALUES_INTERNAL, + RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT: () => RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, + RPCGRPCSTATUSCODEVALUES_NOT_FOUND: () => RPCGRPCSTATUSCODEVALUES_NOT_FOUND, + RPCGRPCSTATUSCODEVALUES_OK: () => RPCGRPCSTATUSCODEVALUES_OK, + RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE: () => RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, + RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED: () => RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, + RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED: () => RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, + RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED: () => RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, + RPCGRPCSTATUSCODEVALUES_UNAVAILABLE: () => RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, + RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED: () => RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, + RPCGRPCSTATUSCODEVALUES_UNKNOWN: () => RPCGRPCSTATUSCODEVALUES_UNKNOWN, + RpcGrpcStatusCodeValues: () => RpcGrpcStatusCodeValues, + SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET, + SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, + SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ: () => SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ, + SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY, + SEMATTRS_AWS_DYNAMODB_COUNT: () => SEMATTRS_AWS_DYNAMODB_COUNT, + SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE: () => SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: () => SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: () => SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, + SEMATTRS_AWS_DYNAMODB_INDEX_NAME: () => SEMATTRS_AWS_DYNAMODB_INDEX_NAME, + SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS: () => SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + SEMATTRS_AWS_DYNAMODB_LIMIT: () => SEMATTRS_AWS_DYNAMODB_LIMIT, + SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: () => SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, + SEMATTRS_AWS_DYNAMODB_PROJECTION: () => SEMATTRS_AWS_DYNAMODB_PROJECTION, + SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, + SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, + SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT: () => SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT, + SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD: () => SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD, + SEMATTRS_AWS_DYNAMODB_SEGMENT: () => SEMATTRS_AWS_DYNAMODB_SEGMENT, + SEMATTRS_AWS_DYNAMODB_SELECT: () => SEMATTRS_AWS_DYNAMODB_SELECT, + SEMATTRS_AWS_DYNAMODB_TABLE_COUNT: () => SEMATTRS_AWS_DYNAMODB_TABLE_COUNT, + SEMATTRS_AWS_DYNAMODB_TABLE_NAMES: () => SEMATTRS_AWS_DYNAMODB_TABLE_NAMES, + SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS: () => SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS, + SEMATTRS_AWS_LAMBDA_INVOKED_ARN: () => SEMATTRS_AWS_LAMBDA_INVOKED_ARN, + SEMATTRS_CODE_FILEPATH: () => SEMATTRS_CODE_FILEPATH, + SEMATTRS_CODE_FUNCTION: () => SEMATTRS_CODE_FUNCTION, + SEMATTRS_CODE_LINENO: () => SEMATTRS_CODE_LINENO, + SEMATTRS_CODE_NAMESPACE: () => SEMATTRS_CODE_NAMESPACE, + SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL: () => SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL, + SEMATTRS_DB_CASSANDRA_COORDINATOR_DC: () => SEMATTRS_DB_CASSANDRA_COORDINATOR_DC, + SEMATTRS_DB_CASSANDRA_COORDINATOR_ID: () => SEMATTRS_DB_CASSANDRA_COORDINATOR_ID, + SEMATTRS_DB_CASSANDRA_IDEMPOTENCE: () => SEMATTRS_DB_CASSANDRA_IDEMPOTENCE, + SEMATTRS_DB_CASSANDRA_KEYSPACE: () => SEMATTRS_DB_CASSANDRA_KEYSPACE, + SEMATTRS_DB_CASSANDRA_PAGE_SIZE: () => SEMATTRS_DB_CASSANDRA_PAGE_SIZE, + SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: () => SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, + SEMATTRS_DB_CASSANDRA_TABLE: () => SEMATTRS_DB_CASSANDRA_TABLE, + SEMATTRS_DB_CONNECTION_STRING: () => SEMATTRS_DB_CONNECTION_STRING, + SEMATTRS_DB_HBASE_NAMESPACE: () => SEMATTRS_DB_HBASE_NAMESPACE, + SEMATTRS_DB_JDBC_DRIVER_CLASSNAME: () => SEMATTRS_DB_JDBC_DRIVER_CLASSNAME, + SEMATTRS_DB_MONGODB_COLLECTION: () => SEMATTRS_DB_MONGODB_COLLECTION, + SEMATTRS_DB_MSSQL_INSTANCE_NAME: () => SEMATTRS_DB_MSSQL_INSTANCE_NAME, + SEMATTRS_DB_NAME: () => SEMATTRS_DB_NAME, + SEMATTRS_DB_OPERATION: () => SEMATTRS_DB_OPERATION, + SEMATTRS_DB_REDIS_DATABASE_INDEX: () => SEMATTRS_DB_REDIS_DATABASE_INDEX, + SEMATTRS_DB_SQL_TABLE: () => SEMATTRS_DB_SQL_TABLE, + SEMATTRS_DB_STATEMENT: () => SEMATTRS_DB_STATEMENT, + SEMATTRS_DB_SYSTEM: () => SEMATTRS_DB_SYSTEM, + SEMATTRS_DB_USER: () => SEMATTRS_DB_USER, + SEMATTRS_ENDUSER_ID: () => SEMATTRS_ENDUSER_ID, + SEMATTRS_ENDUSER_ROLE: () => SEMATTRS_ENDUSER_ROLE, + SEMATTRS_ENDUSER_SCOPE: () => SEMATTRS_ENDUSER_SCOPE, + SEMATTRS_EXCEPTION_ESCAPED: () => SEMATTRS_EXCEPTION_ESCAPED, + SEMATTRS_EXCEPTION_MESSAGE: () => SEMATTRS_EXCEPTION_MESSAGE, + SEMATTRS_EXCEPTION_STACKTRACE: () => SEMATTRS_EXCEPTION_STACKTRACE, + SEMATTRS_EXCEPTION_TYPE: () => SEMATTRS_EXCEPTION_TYPE, + SEMATTRS_FAAS_COLDSTART: () => SEMATTRS_FAAS_COLDSTART, + SEMATTRS_FAAS_CRON: () => SEMATTRS_FAAS_CRON, + SEMATTRS_FAAS_DOCUMENT_COLLECTION: () => SEMATTRS_FAAS_DOCUMENT_COLLECTION, + SEMATTRS_FAAS_DOCUMENT_NAME: () => SEMATTRS_FAAS_DOCUMENT_NAME, + SEMATTRS_FAAS_DOCUMENT_OPERATION: () => SEMATTRS_FAAS_DOCUMENT_OPERATION, + SEMATTRS_FAAS_DOCUMENT_TIME: () => SEMATTRS_FAAS_DOCUMENT_TIME, + SEMATTRS_FAAS_EXECUTION: () => SEMATTRS_FAAS_EXECUTION, + SEMATTRS_FAAS_INVOKED_NAME: () => SEMATTRS_FAAS_INVOKED_NAME, + SEMATTRS_FAAS_INVOKED_PROVIDER: () => SEMATTRS_FAAS_INVOKED_PROVIDER, + SEMATTRS_FAAS_INVOKED_REGION: () => SEMATTRS_FAAS_INVOKED_REGION, + SEMATTRS_FAAS_TIME: () => SEMATTRS_FAAS_TIME, + SEMATTRS_FAAS_TRIGGER: () => SEMATTRS_FAAS_TRIGGER, + SEMATTRS_HTTP_CLIENT_IP: () => SEMATTRS_HTTP_CLIENT_IP, + SEMATTRS_HTTP_FLAVOR: () => SEMATTRS_HTTP_FLAVOR, + SEMATTRS_HTTP_HOST: () => SEMATTRS_HTTP_HOST, + SEMATTRS_HTTP_METHOD: () => SEMATTRS_HTTP_METHOD, + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH: () => SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH, + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: () => SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH: () => SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: () => SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, + SEMATTRS_HTTP_ROUTE: () => SEMATTRS_HTTP_ROUTE, + SEMATTRS_HTTP_SCHEME: () => SEMATTRS_HTTP_SCHEME, + SEMATTRS_HTTP_SERVER_NAME: () => SEMATTRS_HTTP_SERVER_NAME, + SEMATTRS_HTTP_STATUS_CODE: () => SEMATTRS_HTTP_STATUS_CODE, + SEMATTRS_HTTP_TARGET: () => SEMATTRS_HTTP_TARGET, + SEMATTRS_HTTP_URL: () => SEMATTRS_HTTP_URL, + SEMATTRS_HTTP_USER_AGENT: () => SEMATTRS_HTTP_USER_AGENT, + SEMATTRS_MESSAGE_COMPRESSED_SIZE: () => SEMATTRS_MESSAGE_COMPRESSED_SIZE, + SEMATTRS_MESSAGE_ID: () => SEMATTRS_MESSAGE_ID, + SEMATTRS_MESSAGE_TYPE: () => SEMATTRS_MESSAGE_TYPE, + SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE: () => SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE, + SEMATTRS_MESSAGING_CONSUMER_ID: () => SEMATTRS_MESSAGING_CONSUMER_ID, + SEMATTRS_MESSAGING_CONVERSATION_ID: () => SEMATTRS_MESSAGING_CONVERSATION_ID, + SEMATTRS_MESSAGING_DESTINATION: () => SEMATTRS_MESSAGING_DESTINATION, + SEMATTRS_MESSAGING_DESTINATION_KIND: () => SEMATTRS_MESSAGING_DESTINATION_KIND, + SEMATTRS_MESSAGING_KAFKA_CLIENT_ID: () => SEMATTRS_MESSAGING_KAFKA_CLIENT_ID, + SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP: () => SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP, + SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY: () => SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY, + SEMATTRS_MESSAGING_KAFKA_PARTITION: () => SEMATTRS_MESSAGING_KAFKA_PARTITION, + SEMATTRS_MESSAGING_KAFKA_TOMBSTONE: () => SEMATTRS_MESSAGING_KAFKA_TOMBSTONE, + SEMATTRS_MESSAGING_MESSAGE_ID: () => SEMATTRS_MESSAGING_MESSAGE_ID, + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: () => SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: () => SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, + SEMATTRS_MESSAGING_OPERATION: () => SEMATTRS_MESSAGING_OPERATION, + SEMATTRS_MESSAGING_PROTOCOL: () => SEMATTRS_MESSAGING_PROTOCOL, + SEMATTRS_MESSAGING_PROTOCOL_VERSION: () => SEMATTRS_MESSAGING_PROTOCOL_VERSION, + SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY: () => SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY, + SEMATTRS_MESSAGING_SYSTEM: () => SEMATTRS_MESSAGING_SYSTEM, + SEMATTRS_MESSAGING_TEMP_DESTINATION: () => SEMATTRS_MESSAGING_TEMP_DESTINATION, + SEMATTRS_MESSAGING_URL: () => SEMATTRS_MESSAGING_URL, + SEMATTRS_NET_HOST_CARRIER_ICC: () => SEMATTRS_NET_HOST_CARRIER_ICC, + SEMATTRS_NET_HOST_CARRIER_MCC: () => SEMATTRS_NET_HOST_CARRIER_MCC, + SEMATTRS_NET_HOST_CARRIER_MNC: () => SEMATTRS_NET_HOST_CARRIER_MNC, + SEMATTRS_NET_HOST_CARRIER_NAME: () => SEMATTRS_NET_HOST_CARRIER_NAME, + SEMATTRS_NET_HOST_CONNECTION_SUBTYPE: () => SEMATTRS_NET_HOST_CONNECTION_SUBTYPE, + SEMATTRS_NET_HOST_CONNECTION_TYPE: () => SEMATTRS_NET_HOST_CONNECTION_TYPE, + SEMATTRS_NET_HOST_IP: () => SEMATTRS_NET_HOST_IP, + SEMATTRS_NET_HOST_NAME: () => SEMATTRS_NET_HOST_NAME, + SEMATTRS_NET_HOST_PORT: () => SEMATTRS_NET_HOST_PORT, + SEMATTRS_NET_PEER_IP: () => SEMATTRS_NET_PEER_IP, + SEMATTRS_NET_PEER_NAME: () => SEMATTRS_NET_PEER_NAME, + SEMATTRS_NET_PEER_PORT: () => SEMATTRS_NET_PEER_PORT, + SEMATTRS_NET_TRANSPORT: () => SEMATTRS_NET_TRANSPORT, + SEMATTRS_PEER_SERVICE: () => SEMATTRS_PEER_SERVICE, + SEMATTRS_RPC_GRPC_STATUS_CODE: () => SEMATTRS_RPC_GRPC_STATUS_CODE, + SEMATTRS_RPC_JSONRPC_ERROR_CODE: () => SEMATTRS_RPC_JSONRPC_ERROR_CODE, + SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE: () => SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE, + SEMATTRS_RPC_JSONRPC_REQUEST_ID: () => SEMATTRS_RPC_JSONRPC_REQUEST_ID, + SEMATTRS_RPC_JSONRPC_VERSION: () => SEMATTRS_RPC_JSONRPC_VERSION, + SEMATTRS_RPC_METHOD: () => SEMATTRS_RPC_METHOD, + SEMATTRS_RPC_SERVICE: () => SEMATTRS_RPC_SERVICE, + SEMATTRS_RPC_SYSTEM: () => SEMATTRS_RPC_SYSTEM, + SEMATTRS_THREAD_ID: () => SEMATTRS_THREAD_ID, + SEMATTRS_THREAD_NAME: () => SEMATTRS_THREAD_NAME, + SEMRESATTRS_AWS_ECS_CLUSTER_ARN: () => SEMRESATTRS_AWS_ECS_CLUSTER_ARN, + SEMRESATTRS_AWS_ECS_CONTAINER_ARN: () => SEMRESATTRS_AWS_ECS_CONTAINER_ARN, + SEMRESATTRS_AWS_ECS_LAUNCHTYPE: () => SEMRESATTRS_AWS_ECS_LAUNCHTYPE, + SEMRESATTRS_AWS_ECS_TASK_ARN: () => SEMRESATTRS_AWS_ECS_TASK_ARN, + SEMRESATTRS_AWS_ECS_TASK_FAMILY: () => SEMRESATTRS_AWS_ECS_TASK_FAMILY, + SEMRESATTRS_AWS_ECS_TASK_REVISION: () => SEMRESATTRS_AWS_ECS_TASK_REVISION, + SEMRESATTRS_AWS_EKS_CLUSTER_ARN: () => SEMRESATTRS_AWS_EKS_CLUSTER_ARN, + SEMRESATTRS_AWS_LOG_GROUP_ARNS: () => SEMRESATTRS_AWS_LOG_GROUP_ARNS, + SEMRESATTRS_AWS_LOG_GROUP_NAMES: () => SEMRESATTRS_AWS_LOG_GROUP_NAMES, + SEMRESATTRS_AWS_LOG_STREAM_ARNS: () => SEMRESATTRS_AWS_LOG_STREAM_ARNS, + SEMRESATTRS_AWS_LOG_STREAM_NAMES: () => SEMRESATTRS_AWS_LOG_STREAM_NAMES, + SEMRESATTRS_CLOUD_ACCOUNT_ID: () => SEMRESATTRS_CLOUD_ACCOUNT_ID, + SEMRESATTRS_CLOUD_AVAILABILITY_ZONE: () => SEMRESATTRS_CLOUD_AVAILABILITY_ZONE, + SEMRESATTRS_CLOUD_PLATFORM: () => SEMRESATTRS_CLOUD_PLATFORM, + SEMRESATTRS_CLOUD_PROVIDER: () => SEMRESATTRS_CLOUD_PROVIDER, + SEMRESATTRS_CLOUD_REGION: () => SEMRESATTRS_CLOUD_REGION, + SEMRESATTRS_CONTAINER_ID: () => SEMRESATTRS_CONTAINER_ID, + SEMRESATTRS_CONTAINER_IMAGE_NAME: () => SEMRESATTRS_CONTAINER_IMAGE_NAME, + SEMRESATTRS_CONTAINER_IMAGE_TAG: () => SEMRESATTRS_CONTAINER_IMAGE_TAG, + SEMRESATTRS_CONTAINER_NAME: () => SEMRESATTRS_CONTAINER_NAME, + SEMRESATTRS_CONTAINER_RUNTIME: () => SEMRESATTRS_CONTAINER_RUNTIME, + SEMRESATTRS_DEPLOYMENT_ENVIRONMENT: () => SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, + SEMRESATTRS_DEVICE_ID: () => SEMRESATTRS_DEVICE_ID, + SEMRESATTRS_DEVICE_MODEL_IDENTIFIER: () => SEMRESATTRS_DEVICE_MODEL_IDENTIFIER, + SEMRESATTRS_DEVICE_MODEL_NAME: () => SEMRESATTRS_DEVICE_MODEL_NAME, + SEMRESATTRS_FAAS_ID: () => SEMRESATTRS_FAAS_ID, + SEMRESATTRS_FAAS_INSTANCE: () => SEMRESATTRS_FAAS_INSTANCE, + SEMRESATTRS_FAAS_MAX_MEMORY: () => SEMRESATTRS_FAAS_MAX_MEMORY, + SEMRESATTRS_FAAS_NAME: () => SEMRESATTRS_FAAS_NAME, + SEMRESATTRS_FAAS_VERSION: () => SEMRESATTRS_FAAS_VERSION, + SEMRESATTRS_HOST_ARCH: () => SEMRESATTRS_HOST_ARCH, + SEMRESATTRS_HOST_ID: () => SEMRESATTRS_HOST_ID, + SEMRESATTRS_HOST_IMAGE_ID: () => SEMRESATTRS_HOST_IMAGE_ID, + SEMRESATTRS_HOST_IMAGE_NAME: () => SEMRESATTRS_HOST_IMAGE_NAME, + SEMRESATTRS_HOST_IMAGE_VERSION: () => SEMRESATTRS_HOST_IMAGE_VERSION, + SEMRESATTRS_HOST_NAME: () => SEMRESATTRS_HOST_NAME, + SEMRESATTRS_HOST_TYPE: () => SEMRESATTRS_HOST_TYPE, + SEMRESATTRS_K8S_CLUSTER_NAME: () => SEMRESATTRS_K8S_CLUSTER_NAME, + SEMRESATTRS_K8S_CONTAINER_NAME: () => SEMRESATTRS_K8S_CONTAINER_NAME, + SEMRESATTRS_K8S_CRONJOB_NAME: () => SEMRESATTRS_K8S_CRONJOB_NAME, + SEMRESATTRS_K8S_CRONJOB_UID: () => SEMRESATTRS_K8S_CRONJOB_UID, + SEMRESATTRS_K8S_DAEMONSET_NAME: () => SEMRESATTRS_K8S_DAEMONSET_NAME, + SEMRESATTRS_K8S_DAEMONSET_UID: () => SEMRESATTRS_K8S_DAEMONSET_UID, + SEMRESATTRS_K8S_DEPLOYMENT_NAME: () => SEMRESATTRS_K8S_DEPLOYMENT_NAME, + SEMRESATTRS_K8S_DEPLOYMENT_UID: () => SEMRESATTRS_K8S_DEPLOYMENT_UID, + SEMRESATTRS_K8S_JOB_NAME: () => SEMRESATTRS_K8S_JOB_NAME, + SEMRESATTRS_K8S_JOB_UID: () => SEMRESATTRS_K8S_JOB_UID, + SEMRESATTRS_K8S_NAMESPACE_NAME: () => SEMRESATTRS_K8S_NAMESPACE_NAME, + SEMRESATTRS_K8S_NODE_NAME: () => SEMRESATTRS_K8S_NODE_NAME, + SEMRESATTRS_K8S_NODE_UID: () => SEMRESATTRS_K8S_NODE_UID, + SEMRESATTRS_K8S_POD_NAME: () => SEMRESATTRS_K8S_POD_NAME, + SEMRESATTRS_K8S_POD_UID: () => SEMRESATTRS_K8S_POD_UID, + SEMRESATTRS_K8S_REPLICASET_NAME: () => SEMRESATTRS_K8S_REPLICASET_NAME, + SEMRESATTRS_K8S_REPLICASET_UID: () => SEMRESATTRS_K8S_REPLICASET_UID, + SEMRESATTRS_K8S_STATEFULSET_NAME: () => SEMRESATTRS_K8S_STATEFULSET_NAME, + SEMRESATTRS_K8S_STATEFULSET_UID: () => SEMRESATTRS_K8S_STATEFULSET_UID, + SEMRESATTRS_OS_DESCRIPTION: () => SEMRESATTRS_OS_DESCRIPTION, + SEMRESATTRS_OS_NAME: () => SEMRESATTRS_OS_NAME, + SEMRESATTRS_OS_TYPE: () => SEMRESATTRS_OS_TYPE, + SEMRESATTRS_OS_VERSION: () => SEMRESATTRS_OS_VERSION, + SEMRESATTRS_PROCESS_COMMAND: () => SEMRESATTRS_PROCESS_COMMAND, + SEMRESATTRS_PROCESS_COMMAND_ARGS: () => SEMRESATTRS_PROCESS_COMMAND_ARGS, + SEMRESATTRS_PROCESS_COMMAND_LINE: () => SEMRESATTRS_PROCESS_COMMAND_LINE, + SEMRESATTRS_PROCESS_EXECUTABLE_NAME: () => SEMRESATTRS_PROCESS_EXECUTABLE_NAME, + SEMRESATTRS_PROCESS_EXECUTABLE_PATH: () => SEMRESATTRS_PROCESS_EXECUTABLE_PATH, + SEMRESATTRS_PROCESS_OWNER: () => SEMRESATTRS_PROCESS_OWNER, + SEMRESATTRS_PROCESS_PID: () => SEMRESATTRS_PROCESS_PID, + SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION: () => SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, + SEMRESATTRS_PROCESS_RUNTIME_NAME: () => SEMRESATTRS_PROCESS_RUNTIME_NAME, + SEMRESATTRS_PROCESS_RUNTIME_VERSION: () => SEMRESATTRS_PROCESS_RUNTIME_VERSION, + SEMRESATTRS_SERVICE_INSTANCE_ID: () => SEMRESATTRS_SERVICE_INSTANCE_ID, + SEMRESATTRS_SERVICE_NAME: () => SEMRESATTRS_SERVICE_NAME, + SEMRESATTRS_SERVICE_NAMESPACE: () => SEMRESATTRS_SERVICE_NAMESPACE, + SEMRESATTRS_SERVICE_VERSION: () => SEMRESATTRS_SERVICE_VERSION, + SEMRESATTRS_TELEMETRY_AUTO_VERSION: () => SEMRESATTRS_TELEMETRY_AUTO_VERSION, + SEMRESATTRS_TELEMETRY_SDK_LANGUAGE: () => SEMRESATTRS_TELEMETRY_SDK_LANGUAGE, + SEMRESATTRS_TELEMETRY_SDK_NAME: () => SEMRESATTRS_TELEMETRY_SDK_NAME, + SEMRESATTRS_TELEMETRY_SDK_VERSION: () => SEMRESATTRS_TELEMETRY_SDK_VERSION, + SEMRESATTRS_WEBENGINE_DESCRIPTION: () => SEMRESATTRS_WEBENGINE_DESCRIPTION, + SEMRESATTRS_WEBENGINE_NAME: () => SEMRESATTRS_WEBENGINE_NAME, + SEMRESATTRS_WEBENGINE_VERSION: () => SEMRESATTRS_WEBENGINE_VERSION, + SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN: () => SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN, + SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE: () => SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE, + SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT: () => SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT, + SIGNALR_TRANSPORT_VALUE_LONG_POLLING: () => SIGNALR_TRANSPORT_VALUE_LONG_POLLING, + SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS: () => SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS, + SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS: () => SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, + SemanticAttributes: () => SemanticAttributes, + SemanticResourceAttributes: () => SemanticResourceAttributes, + TELEMETRYSDKLANGUAGEVALUES_CPP: () => TELEMETRYSDKLANGUAGEVALUES_CPP, + TELEMETRYSDKLANGUAGEVALUES_DOTNET: () => TELEMETRYSDKLANGUAGEVALUES_DOTNET, + TELEMETRYSDKLANGUAGEVALUES_ERLANG: () => TELEMETRYSDKLANGUAGEVALUES_ERLANG, + TELEMETRYSDKLANGUAGEVALUES_GO: () => TELEMETRYSDKLANGUAGEVALUES_GO, + TELEMETRYSDKLANGUAGEVALUES_JAVA: () => TELEMETRYSDKLANGUAGEVALUES_JAVA, + TELEMETRYSDKLANGUAGEVALUES_NODEJS: () => TELEMETRYSDKLANGUAGEVALUES_NODEJS, + TELEMETRYSDKLANGUAGEVALUES_PHP: () => TELEMETRYSDKLANGUAGEVALUES_PHP, + TELEMETRYSDKLANGUAGEVALUES_PYTHON: () => TELEMETRYSDKLANGUAGEVALUES_PYTHON, + TELEMETRYSDKLANGUAGEVALUES_RUBY: () => TELEMETRYSDKLANGUAGEVALUES_RUBY, + TELEMETRYSDKLANGUAGEVALUES_WEBJS: () => TELEMETRYSDKLANGUAGEVALUES_WEBJS, + TELEMETRY_SDK_LANGUAGE_VALUE_CPP: () => TELEMETRY_SDK_LANGUAGE_VALUE_CPP, + TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET: () => TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET, + TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG: () => TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG, + TELEMETRY_SDK_LANGUAGE_VALUE_GO: () => TELEMETRY_SDK_LANGUAGE_VALUE_GO, + TELEMETRY_SDK_LANGUAGE_VALUE_JAVA: () => TELEMETRY_SDK_LANGUAGE_VALUE_JAVA, + TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS: () => TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + TELEMETRY_SDK_LANGUAGE_VALUE_PHP: () => TELEMETRY_SDK_LANGUAGE_VALUE_PHP, + TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON: () => TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON, + TELEMETRY_SDK_LANGUAGE_VALUE_RUBY: () => TELEMETRY_SDK_LANGUAGE_VALUE_RUBY, + TELEMETRY_SDK_LANGUAGE_VALUE_RUST: () => TELEMETRY_SDK_LANGUAGE_VALUE_RUST, + TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT: () => TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT, + TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS: () => TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, + TelemetrySdkLanguageValues: () => TelemetrySdkLanguageValues +}); +var init_esm$1 = __esmMin((() => { + init_trace(); + init_resource(); + init_stable_attributes(); + init_stable_metrics(); + init_stable_events(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = void 0; + /** + * The name of the runtime of this process. + * + * @example OpenJDK Runtime Environment + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = void 0; + const version_1 = require_version$3(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const semconv_1 = require_semconv$4(); + /** Constants describing the SDK in use */ + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node$6 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = void 0; + var environment_1 = require_environment$1(); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return environment_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return environment_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + enumerable: true, + get: function() { + return environment_1.getNumberFromEnv; + } + }); + Object.defineProperty(exports, "getStringListFromEnv", { + enumerable: true, + get: function() { + return environment_1.getStringListFromEnv; + } + }); + var globalThis_1 = require_globalThis$1(); + Object.defineProperty(exports, "_globalThis", { + enumerable: true, + get: function() { + return globalThis_1._globalThis; + } + }); + var sdk_info_1 = require_sdk_info$1(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return sdk_info_1.SDK_INFO; + } + }); + /** + * @deprecated Use performance directly. + */ + exports.otperformance = performance; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform$6 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; + var node_1 = require_node$6(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return node_1.SDK_INFO; + } + }); + Object.defineProperty(exports, "_globalThis", { + enumerable: true, + get: function() { + return node_1._globalThis; + } + }); + Object.defineProperty(exports, "otperformance", { + enumerable: true, + get: function() { + return node_1.otperformance; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return node_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return node_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + enumerable: true, + get: function() { + return node_1.getNumberFromEnv; + } + }); + Object.defineProperty(exports, "getStringListFromEnv", { + enumerable: true, + get: function() { + return node_1.getStringListFromEnv; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; + const platform_1 = require_platform$6(); + const NANOSECOND_DIGITS = 9; + const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); + const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + /** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1e3; + return [Math.trunc(epochSeconds), Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS)]; + } + exports.millisToHrTime = millisToHrTime; + /** + * @deprecated Use `performance.timeOrigin` directly. + */ + function getTimeOrigin() { + return platform_1.otperformance.timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + /** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ + function hrTime(performanceNow) { + return addHrTimes(millisToHrTime(platform_1.otperformance.timeOrigin), millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now())); + } + exports.hrTime = hrTime; + /** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ + function timeInputToHrTime(time$2) { + if (isTimeInputHrTime(time$2)) return time$2; + else if (typeof time$2 === "number") if (time$2 < platform_1.otperformance.timeOrigin) return hrTime(time$2); + else return millisToHrTime(time$2); + else if (time$2 instanceof Date) return millisToHrTime(time$2.getTime()); + else throw TypeError("Invalid input type"); + } + exports.timeInputToHrTime = timeInputToHrTime; + /** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + /** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ + function hrTimeToTimeStamp(time$2) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time$2[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + return (/* @__PURE__ */ new Date(time$2[0] * 1e3)).toISOString().replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + /** + * Convert hrTime to nanoseconds. + * @param time + */ + function hrTimeToNanoseconds(time$2) { + return time$2[0] * SECOND_TO_NANOSECONDS + time$2[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + /** + * Convert hrTime to milliseconds. + * @param time + */ + function hrTimeToMilliseconds(time$2) { + return time$2[0] * 1e3 + time$2[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + /** + * Convert hrTime to microseconds. + * @param time + */ + function hrTimeToMicroseconds(time$2) { + return time$2[0] * 1e6 + time$2[1] / 1e3; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + /** + * check if time is HrTime + * @param value + */ + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + /** + * check if input value is a correct types.TimeInput + * @param value + */ + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + /** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ + function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/timer-util.js +var require_timer_util$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = void 0; + /** + * @deprecated please copy this code to your implementation instead, this function will be removed in the next major version of this package. + * @param timer + */ + function unrefTimer(timer) { + if (typeof timer !== "number") timer.unref(); + } + exports.unrefTimer = unrefTimer; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = void 0; + (function(ExportResultCode$1) { + ExportResultCode$1[ExportResultCode$1["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode$1[ExportResultCode$1["FAILED"] = 1] = "FAILED"; + })(exports.ExportResultCode || (exports.ExportResultCode = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + /** Combines multiple propagators into a single propagator. */ + var CompositePropagator = class { + _propagators; + _fields; + /** + * Construct a composite propagator from a list of propagators. + * + * @param [config] Configuration object for composite propagator + */ + constructor(config$1 = {}) { + this._propagators = config$1.propagators ?? []; + const fields = /* @__PURE__ */ new Set(); + for (const propagator of this._propagators) { + const propagatorFields = typeof propagator.fields === "function" ? propagator.fields() : []; + for (const field of propagatorFields) fields.add(field); + } + this._fields = Array.from(fields); + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same carrier key, the propagator later in the list + * will "win". + * + * @param context Context to inject + * @param carrier Carrier into which context will be injected + */ + inject(context$1, carrier, setter) { + for (const propagator of this._propagators) try { + propagator.inject(context$1, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same context key, the propagator later in the list + * will "win". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + extract(context$1, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context$1); + } + fields() { + return this._fields.slice(); + } + }; + exports.CompositePropagator = CompositePropagator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = void 0; + const VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + const VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + /** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + /** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = void 0; + const validators_1 = require_validators$1(); + const MAX_TRACE_STATE_ITEMS = 32; + const MAX_TRACE_STATE_LEN = 512; + const LIST_MEMBERS_SEPARATOR = ","; + const LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + /** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ + var TraceState = class TraceState { + _length; + _rawTraceState; + _internalState; + constructor(rawTraceState) { + this._rawTraceState = typeof rawTraceState === "string" ? rawTraceState : ""; + this._length = this._rawTraceState.length; + } + set(key, value) { + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) return this; + const currState = this._getState(); + const currValue = currState.get(key); + let newLength = this._length; + if (typeof currValue === "string") newLength += value.length - currValue.length; + else newLength += key.length + value.length + (currState.size > 0 ? 2 : 1); + if (newLength > MAX_TRACE_STATE_LEN) return this; + const newState = new Map(currState); + newState.delete(key); + newState.set(key, value); + return this._fromState(newState, newLength); + } + unset(key) { + const currState = this._getState(); + const currValue = currState.get(key); + if (typeof currValue !== "string") return this; + let newLength = this._length - (key.length + currValue.length + 1); + if (currState.size > 1) newLength = newLength - 1; + const newState = new Map(currState); + newState.delete(key); + return this._fromState(newState, newLength); + } + get(key) { + return this._getState().get(key); + } + serialize() { + let serialized = ""; + let index = 0; + for (const entry of this._getState()) { + if (index > 0) serialized = LIST_MEMBERS_SEPARATOR + serialized; + serialized = `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; + index++; + } + return serialized; + } + _getState() { + if (this._internalState) return this._internalState; + const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR); + const vendorEntries = /* @__PURE__ */ new Map(); + let currentLength = 0; + for (const member of vendorMembers) { + const m = member.trim(); + const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (idx === -1) continue; + const key = m.slice(0, idx); + const value = m.slice(idx + 1); + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) continue; + const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0); + if (futureLength > MAX_TRACE_STATE_LEN) continue; + vendorEntries.set(key, value); + currentLength = futureLength; + if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) break; + } + this._length = currentLength; + this._internalState = new Map(Array.from(vendorEntries.entries()).reverse()); + return this._internalState; + } + _fromState(state, length) { + const traceState = Object.create(TraceState.prototype); + traceState._internalState = state; + traceState._length = length; + return traceState; + } + }; + exports.TraceState = TraceState; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const suppress_tracing_1 = require_suppress_tracing$1(); + const TraceState_1 = require_TraceState$1(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + const VERSION = "00"; + const TRACE_PARENT_REGEX = /* @__PURE__ */ new RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`); + /** + * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} + * @param traceParent - A meta property that comes from server. + * It should be dynamically generated server side to have the server's request trace Id, + * a parent span Id that was set on the server's request span, + * and the trace flags to indicate the server's sampling decision + * (01 = sampled, 00 = not sampled). + * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' + * For more information see {@link https://www.w3.org/TR/trace-context/} + */ + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) return null; + if (match[1] === "00" && match[5]) return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + /** + * Propagates {@link SpanContext} through Trace Context format propagation. + * + * Based on the Trace Context specification: + * https://www.w3.org/TR/trace-context/ + */ + var W3CTraceContextPropagator = class { + inject(context$1, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context$1); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context$1) || !(0, api_1.isSpanContextValid)(spanContext)) return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + extract(context$1, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) return context$1; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") return context$1; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) return context$1; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : void 0); + } + return api_1.trace.setSpanContext(context$1, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + }; + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; + const RPC_METADATA_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + (function(RPCType) { + RPCType["HTTP"] = "http"; + })(exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context$1, meta$2) { + return context$1.setValue(RPC_METADATA_KEY, meta$2); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context$1) { + return context$1.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context$1) { + return context$1.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = void 0; + /** + * based on lodash in order to support esm builds without esModuleInterop. + * lodash is using MIT License. + **/ + const objectTag = "[object Object]"; + const nullTag = "[object Null]"; + const undefinedTag = "[object Undefined]"; + const funcToString = Function.prototype.toString; + const objectCtorString = funcToString.call(Object); + const getPrototypeOf = Object.getPrototypeOf; + const objectProto = Object.prototype; + const hasOwnProperty = objectProto.hasOwnProperty; + const symToStringTag = Symbol ? Symbol.toStringTag : void 0; + const nativeObjectToString = objectProto.toString; + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) return false; + const proto = getPrototypeOf(value); + if (proto === null) return true; + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject; + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) return value === void 0 ? undefinedTag : nullTag; + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = void 0; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) if (isOwn) value[symToStringTag] = tag; + else delete value[symToStringTag]; + return result; + } + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = void 0; + const lodash_merge_1 = require_lodash_merge$1(); + const MAX_LEVEL = 20; + /** + * Merges objects together + * @param args - objects / values to be merged + */ + function merge(...args) { + let result = args.shift(); + const objects = /* @__PURE__ */ new WeakMap(); + while (args.length > 0) result = mergeTwoObjects(result, args.shift(), 0, objects); + return result; + } + exports.merge = merge; + function takeValue(value) { + if (isArray(value)) return value.slice(); + return value; + } + /** + * Merges two objects + * @param one - first object + * @param two - second object + * @param level - current deep level + * @param objects - objects holder that has been already referenced - to prevent + * cyclic dependency + */ + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) return; + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) result = takeValue(two); + else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) for (let i = 0, j = two.length; i < j; i++) result.push(takeValue(two[i])); + else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + if (key === "__proto__" || key === "constructor" || key === "prototype") continue; + result[key] = takeValue(two[key]); + } + } + } else if (isObject(one)) if (isObject(two)) { + if (!shouldMerge(one, two)) return two; + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + if (key === "__proto__" || key === "constructor" || key === "prototype") continue; + const twoValue = two[key]; + if (isPrimitive(twoValue)) if (typeof twoValue === "undefined") delete result[key]; + else result[key] = twoValue; + else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) delete result[key]; + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ + obj: one, + key + }); + arr2.push({ + obj: two, + key + }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else result = two; + return result; + } + /** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length; i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) return true; + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) return false; + return true; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = void 0; + /** + * Error that is thrown on timeouts. + */ + var TimeoutError = class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + }; + exports.TimeoutError = TimeoutError; + /** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ + function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = void 0; + function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === "string") return url === urlToMatch; + else return !!url.match(urlToMatch); + } + exports.urlMatches = urlMatches; + /** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ + function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) return false; + for (const ignoreUrl of ignoredUrls) if (urlMatches(url, ignoreUrl)) return true; + return false; + } + exports.isUrlIgnored = isUrlIgnored; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = void 0; + var Deferred = class { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + }; + exports.Deferred = Deferred; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = void 0; + const promise_1 = require_promise$1(); + /** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ + var BindOnceFuture = class { + _isCalled = false; + _deferred = new promise_1.Deferred(); + _callback; + _that; + constructor(callback, that) { + this._callback = callback; + this._that = that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + }; + exports.BindOnceFuture = BindOnceFuture; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + /** + * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined. + * @param value + */ + function diagLogLevelFromString(value) { + if (value == null) return; + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const suppress_tracing_1 = require_suppress_tracing$1(); + /** + * @internal + * Shared functionality used by Exporters while exporting data, including suppression of Traces. + */ + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, resolve); + }); + }); + } + exports._export = _export; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js +var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator$1(); + Object.defineProperty(exports, "W3CBaggagePropagator", { + enumerable: true, + get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } + }); + var anchored_clock_1 = require_anchored_clock$1(); + Object.defineProperty(exports, "AnchoredClock", { + enumerable: true, + get: function() { + return anchored_clock_1.AnchoredClock; + } + }); + var attributes_1 = require_attributes$1(); + Object.defineProperty(exports, "isAttributeValue", { + enumerable: true, + get: function() { + return attributes_1.isAttributeValue; + } + }); + Object.defineProperty(exports, "sanitizeAttributes", { + enumerable: true, + get: function() { + return attributes_1.sanitizeAttributes; + } + }); + var global_error_handler_1 = require_global_error_handler$1(); + Object.defineProperty(exports, "globalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.globalErrorHandler; + } + }); + Object.defineProperty(exports, "setGlobalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } + }); + var logging_error_handler_1 = require_logging_error_handler$1(); + Object.defineProperty(exports, "loggingErrorHandler", { + enumerable: true, + get: function() { + return logging_error_handler_1.loggingErrorHandler; + } + }); + var time_1 = require_time$1(); + Object.defineProperty(exports, "addHrTimes", { + enumerable: true, + get: function() { + return time_1.addHrTimes; + } + }); + Object.defineProperty(exports, "getTimeOrigin", { + enumerable: true, + get: function() { + return time_1.getTimeOrigin; + } + }); + Object.defineProperty(exports, "hrTime", { + enumerable: true, + get: function() { + return time_1.hrTime; + } + }); + Object.defineProperty(exports, "hrTimeDuration", { + enumerable: true, + get: function() { + return time_1.hrTimeDuration; + } + }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMicroseconds; + } + }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMilliseconds; + } + }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToNanoseconds; + } + }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { + enumerable: true, + get: function() { + return time_1.hrTimeToTimeStamp; + } + }); + Object.defineProperty(exports, "isTimeInput", { + enumerable: true, + get: function() { + return time_1.isTimeInput; + } + }); + Object.defineProperty(exports, "isTimeInputHrTime", { + enumerable: true, + get: function() { + return time_1.isTimeInputHrTime; + } + }); + Object.defineProperty(exports, "millisToHrTime", { + enumerable: true, + get: function() { + return time_1.millisToHrTime; + } + }); + Object.defineProperty(exports, "timeInputToHrTime", { + enumerable: true, + get: function() { + return time_1.timeInputToHrTime; + } + }); + var timer_util_1 = require_timer_util$1(); + Object.defineProperty(exports, "unrefTimer", { + enumerable: true, + get: function() { + return timer_util_1.unrefTimer; + } + }); + var ExportResult_1 = require_ExportResult$1(); + Object.defineProperty(exports, "ExportResultCode", { + enumerable: true, + get: function() { + return ExportResult_1.ExportResultCode; + } + }); + var utils_1 = require_utils$7(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { + enumerable: true, + get: function() { + return utils_1.parseKeyPairsIntoRecord; + } + }); + var platform_1 = require_platform$6(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return platform_1.SDK_INFO; + } + }); + Object.defineProperty(exports, "_globalThis", { + enumerable: true, + get: function() { + return platform_1._globalThis; + } + }); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return platform_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return platform_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + enumerable: true, + get: function() { + return platform_1.getNumberFromEnv; + } + }); + Object.defineProperty(exports, "getStringListFromEnv", { + enumerable: true, + get: function() { + return platform_1.getStringListFromEnv; + } + }); + Object.defineProperty(exports, "otperformance", { + enumerable: true, + get: function() { + return platform_1.otperformance; + } + }); + var composite_1 = require_composite$1(); + Object.defineProperty(exports, "CompositePropagator", { + enumerable: true, + get: function() { + return composite_1.CompositePropagator; + } + }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator$1(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } + }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } + }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } + }); + Object.defineProperty(exports, "parseTraceParent", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } + }); + var rpc_metadata_1 = require_rpc_metadata$1(); + Object.defineProperty(exports, "RPCType", { + enumerable: true, + get: function() { + return rpc_metadata_1.RPCType; + } + }); + Object.defineProperty(exports, "deleteRPCMetadata", { + enumerable: true, + get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } + }); + Object.defineProperty(exports, "getRPCMetadata", { + enumerable: true, + get: function() { + return rpc_metadata_1.getRPCMetadata; + } + }); + Object.defineProperty(exports, "setRPCMetadata", { + enumerable: true, + get: function() { + return rpc_metadata_1.setRPCMetadata; + } + }); + var suppress_tracing_1 = require_suppress_tracing$1(); + Object.defineProperty(exports, "isTracingSuppressed", { + enumerable: true, + get: function() { + return suppress_tracing_1.isTracingSuppressed; + } + }); + Object.defineProperty(exports, "suppressTracing", { + enumerable: true, + get: function() { + return suppress_tracing_1.suppressTracing; + } + }); + Object.defineProperty(exports, "unsuppressTracing", { + enumerable: true, + get: function() { + return suppress_tracing_1.unsuppressTracing; + } + }); + var TraceState_1 = require_TraceState$1(); + Object.defineProperty(exports, "TraceState", { + enumerable: true, + get: function() { + return TraceState_1.TraceState; + } + }); + var merge_1 = require_merge$1(); + Object.defineProperty(exports, "merge", { + enumerable: true, + get: function() { + return merge_1.merge; + } + }); + var timeout_1 = require_timeout$1(); + Object.defineProperty(exports, "TimeoutError", { + enumerable: true, + get: function() { + return timeout_1.TimeoutError; + } + }); + Object.defineProperty(exports, "callWithTimeout", { + enumerable: true, + get: function() { + return timeout_1.callWithTimeout; + } + }); + var url_1 = require_url$1(); + Object.defineProperty(exports, "isUrlIgnored", { + enumerable: true, + get: function() { + return url_1.isUrlIgnored; + } + }); + Object.defineProperty(exports, "urlMatches", { + enumerable: true, + get: function() { + return url_1.urlMatches; + } + }); + var callback_1 = require_callback$1(); + Object.defineProperty(exports, "BindOnceFuture", { + enumerable: true, + get: function() { + return callback_1.BindOnceFuture; + } + }); + var configuration_1 = require_configuration$1(); + Object.defineProperty(exports, "diagLogLevelFromString", { + enumerable: true, + get: function() { + return configuration_1.diagLogLevelFromString; + } + }); + const exporter_1 = require_exporter$1(); + exports.internal = { _export: exporter_1._export }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js +var OTLPExporterBase; +var init_OTLPExporterBase = __esmMin((() => { + OTLPExporterBase = class { + _delegate; + constructor(_delegate) { + this._delegate = _delegate; + } + /** + * Export items. + * @param items + * @param resultCallback + */ + export(items, resultCallback) { + this._delegate.export(items, resultCallback); + } + forceFlush() { + return this._delegate.forceFlush(); + } + shutdown() { + return this._delegate.shutdown(); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js +var OTLPExporterError; +var init_types = __esmMin((() => { + OTLPExporterError = class extends Error { + code; + name = "OTLPExporterError"; + data; + constructor(message, code, data) { + super(message); + this.data = data; + this.code = code; + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js +function validateTimeoutMillis(timeoutMillis) { + if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) return timeoutMillis; + throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`); +} +function wrapStaticHeadersInFunction(headers) { + if (headers == null) return; + return () => headers; +} +/** +* @param userProvidedConfiguration Configuration options provided by the user in code. +* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. +* @param defaultConfiguration The defaults as defined by the exporter specification +*/ +function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ?? fallbackConfiguration.timeoutMillis ?? defaultConfiguration.timeoutMillis), + concurrencyLimit: userProvidedConfiguration.concurrencyLimit ?? fallbackConfiguration.concurrencyLimit ?? defaultConfiguration.concurrencyLimit, + compression: userProvidedConfiguration.compression ?? fallbackConfiguration.compression ?? defaultConfiguration.compression + }; +} +function getSharedConfigurationDefaults() { + return { + timeoutMillis: 1e4, + concurrencyLimit: 30, + compression: "none" + }; +} +var init_shared_configuration = __esmMin((() => {})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/legacy-node-configuration.js +var CompressionAlgorithm; +var init_legacy_node_configuration = __esmMin((() => { + ; + (function(CompressionAlgorithm$1) { + CompressionAlgorithm$1["NONE"] = "none"; + CompressionAlgorithm$1["GZIP"] = "gzip"; + })(CompressionAlgorithm || (CompressionAlgorithm = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js +/** +* Promise queue for keeping track of export promises. Finished promises will be auto-dequeued. +* Allows for awaiting all promises in the queue. +*/ +function createBoundedQueueExportPromiseHandler(options) { + return new BoundedQueueExportPromiseHandler(options.concurrencyLimit); +} +var BoundedQueueExportPromiseHandler; +var init_bounded_queue_export_promise_handler = __esmMin((() => { + BoundedQueueExportPromiseHandler = class { + _concurrencyLimit; + _sendingPromises = []; + /** + * @param concurrencyLimit maximum promises allowed in a queue at the same time. + */ + constructor(concurrencyLimit) { + this._concurrencyLimit = concurrencyLimit; + } + pushPromise(promise) { + if (this.hasReachedLimit()) throw new Error("Concurrency Limit reached"); + this._sendingPromises.push(promise); + const popPromise = () => { + const index = this._sendingPromises.indexOf(promise); + this._sendingPromises.splice(index, 1); + }; + promise.then(popPromise, popPromise); + } + hasReachedLimit() { + return this._sendingPromises.length >= this._concurrencyLimit; + } + async awaitAll() { + await Promise.all(this._sendingPromises); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; + const SUPPRESS_TRACING_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context$1) { + return context$1.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context$1) { + return context$1.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context$1) { + return context$1.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils$6 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const constants_1 = require_constants(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== void 0) entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + return { + key, + value, + metadata + }; + } + exports.parsePairKeyValue = parsePairKeyValue; + /** + * Parse a string serialized in the baggage HTTP Format (without metadata): + * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + */ + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== void 0 && keyPair.value.length > 0) result[keyPair.key] = keyPair.value; + }); + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const suppress_tracing_1 = require_suppress_tracing(); + const constants_1 = require_constants(); + const utils_1 = require_utils$6(); + /** + * Propagates {@link Baggage} through Context format propagation. + * + * Based on the Baggage specification: + * https://w3c.github.io/baggage/ + */ + var W3CBaggagePropagator = class { + inject(context$1, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context$1); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context$1)) return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + extract(context$1, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) return context$1; + const baggage = {}; + if (baggageString.length === 0) return context$1; + baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) baggageEntry.metadata = keyPair.metadata; + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) return context$1; + return api_1.propagation.setBaggage(context$1, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + }; + exports.W3CBaggagePropagator = W3CBaggagePropagator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = void 0; + /** + * A utility for returning wall times anchored to a given point in time. Wall time measurements will + * not be taken from the system, but instead are computed by adding a monotonic clock time + * to the anchor point. + * + * This is needed because the system time can change and result in unexpected situations like + * spans ending before they are started. Creating an anchored clock for each local root span + * ensures that span timings and durations are accurate while preventing span times from drifting + * too far from the system clock. + * + * Only creating an anchored clock once per local trace ensures span times are correct relative + * to each other. For example, a child span will never have a start time before its parent even + * if the system clock is corrected during the local trace. + * + * Heavily inspired by the OTel Java anchored clock + * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java + */ + var AnchoredClock = class { + _monotonicClock; + _epochMillis; + _performanceMillis; + /** + * Create a new AnchoredClock anchored to the current time returned by systemClock. + * + * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date + * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance + */ + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + /** + * Returns the current time by adding the number of milliseconds since the + * AnchoredClock was created to the creation epoch time + */ + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + }; + exports.AnchoredClock = AnchoredClock; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) return out; + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) out[key] = val.slice(); + else out[key] = val; + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key.length > 0; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) return true; + if (Array.isArray(val)) return isHomogeneousAttributeValueArray(val); + return isValidPrimitiveAttributeValue(val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + return false; + } + if (typeof element === type) continue; + return false; + } + return true; + } + function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case "number": + case "boolean": + case "string": return true; + } + return false; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + /** + * Returns a function that logs an error using the provided logger, or a + * console logger if one was not provided. + */ + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + /** + * Converts an exception into a string representation + * @param {Exception} ex + */ + function stringifyException(ex) { + if (typeof ex === "string") return ex; + else return JSON.stringify(flattenException(ex)); + } + /** + * Flattens an exception into key-value pairs by traversing the prototype chain + * and coercing values to strings. Duplicate properties will not be overwritten; + * the first insert wins. + */ + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) return; + const value = current[propertyName]; + if (value) result[propertyName] = String(value); + }); + current = Object.getPrototypeOf(current); + } + return result; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; + /** The global error handler delegate */ + let delegateHandler = (0, require_logging_error_handler().loggingErrorHandler)(); + /** + * Set the global error handler + * @param {ErrorHandler} handler + */ + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + /** + * Return the global error handler + * @param {Exception} ex + */ + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const util_1 = __require("util"); + /** + * Retrieves a number from an environment variable. + * - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number. + * - Returns a number in all other cases. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {number | undefined} - The number value or `undefined`. + */ + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") return; + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + /** + * Retrieves a string from an environment variable. + * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {string | undefined} - The string value or `undefined`. + */ + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") return; + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + /** + * Retrieves a boolean value from an environment variable. + * - Trims leading and trailing whitespace and ignores casing. + * - Returns `false` if the environment variable is empty, unset, or contains only whitespace. + * - Returns `false` for strings that cannot be mapped to a boolean. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace. + */ + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") return false; + if (raw === "true") return true; + else if (raw === "false") return false; + else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + /** + * Retrieves a list of strings from an environment variable. + * - Uses ',' as the delimiter. + * - Trims leading and trailing whitespace from each entry. + * - Excludes empty entries. + * - Returns `undefined` if the environment variable is empty or contains only whitespace. + * - Returns an empty array if all entries are empty or whitespace. + * + * @param {string} key - The name of the environment variable to retrieve. + * @returns {string[] | undefined} - The list of strings or `undefined`. + */ + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js +var require_globalThis = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = void 0; + /** only globals that common to node and browsers are allowed */ + exports._globalThis = typeof globalThis === "object" ? globalThis : global; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/performance.js +var require_performance = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = void 0; + const perf_hooks_1 = __require("perf_hooks"); + exports.otperformance = perf_hooks_1.performance; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js +var require_version$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.1.0"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = void 0; + /** + * The name of the runtime of this process. + * + * @example OpenJDK Runtime Environment + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = void 0; + const version_1 = require_version$2(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const semconv_1 = require_semconv$3(); + /** Constants describing the SDK in use */ + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js +var require_timer_util = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = void 0; + function unrefTimer(timer) { + timer.unref(); + } + exports.unrefTimer = unrefTimer; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = void 0; + var environment_1 = require_environment(); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return environment_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return environment_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + enumerable: true, + get: function() { + return environment_1.getNumberFromEnv; + } + }); + Object.defineProperty(exports, "getStringListFromEnv", { + enumerable: true, + get: function() { + return environment_1.getStringListFromEnv; + } + }); + var globalThis_1 = require_globalThis(); + Object.defineProperty(exports, "_globalThis", { + enumerable: true, + get: function() { + return globalThis_1._globalThis; + } + }); + var performance_1 = require_performance(); + Object.defineProperty(exports, "otperformance", { + enumerable: true, + get: function() { + return performance_1.otperformance; + } + }); + var sdk_info_1 = require_sdk_info(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return sdk_info_1.SDK_INFO; + } + }); + var timer_util_1 = require_timer_util(); + Object.defineProperty(exports, "unrefTimer", { + enumerable: true, + get: function() { + return timer_util_1.unrefTimer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; + var node_1 = require_node$5(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return node_1.SDK_INFO; + } + }); + Object.defineProperty(exports, "_globalThis", { + enumerable: true, + get: function() { + return node_1._globalThis; + } + }); + Object.defineProperty(exports, "otperformance", { + enumerable: true, + get: function() { + return node_1.otperformance; + } + }); + Object.defineProperty(exports, "unrefTimer", { + enumerable: true, + get: function() { + return node_1.unrefTimer; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return node_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return node_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + enumerable: true, + get: function() { + return node_1.getNumberFromEnv; + } + }); + Object.defineProperty(exports, "getStringListFromEnv", { + enumerable: true, + get: function() { + return node_1.getStringListFromEnv; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; + const platform_1 = require_platform$5(); + const NANOSECOND_DIGITS = 9; + const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); + const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + /** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1e3; + return [Math.trunc(epochSeconds), Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS)]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== "number") { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + /** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ + function hrTime(performanceNow) { + return addHrTimes(millisToHrTime(getTimeOrigin()), millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now())); + } + exports.hrTime = hrTime; + /** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ + function timeInputToHrTime(time$2) { + if (isTimeInputHrTime(time$2)) return time$2; + else if (typeof time$2 === "number") if (time$2 < getTimeOrigin()) return hrTime(time$2); + else return millisToHrTime(time$2); + else if (time$2 instanceof Date) return millisToHrTime(time$2.getTime()); + else throw TypeError("Invalid input type"); + } + exports.timeInputToHrTime = timeInputToHrTime; + /** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + /** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ + function hrTimeToTimeStamp(time$2) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time$2[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + return (/* @__PURE__ */ new Date(time$2[0] * 1e3)).toISOString().replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + /** + * Convert hrTime to nanoseconds. + * @param time + */ + function hrTimeToNanoseconds(time$2) { + return time$2[0] * SECOND_TO_NANOSECONDS + time$2[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + /** + * Convert hrTime to milliseconds. + * @param time + */ + function hrTimeToMilliseconds(time$2) { + return time$2[0] * 1e3 + time$2[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + /** + * Convert hrTime to microseconds. + * @param time + */ + function hrTimeToMicroseconds(time$2) { + return time$2[0] * 1e6 + time$2[1] / 1e3; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + /** + * check if time is HrTime + * @param value + */ + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + /** + * check if input value is a correct types.TimeInput + * @param value + */ + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + /** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ + function addHrTimes(time1, time2) { + const out = [time1[0] + time2[0], time1[1] + time2[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = void 0; + (function(ExportResultCode$1) { + ExportResultCode$1[ExportResultCode$1["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode$1[ExportResultCode$1["FAILED"] = 1] = "FAILED"; + })(exports.ExportResultCode || (exports.ExportResultCode = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + /** Combines multiple propagators into a single propagator. */ + var CompositePropagator = class { + _propagators; + _fields; + /** + * Construct a composite propagator from a list of propagators. + * + * @param [config] Configuration object for composite propagator + */ + constructor(config$1 = {}) { + this._propagators = config$1.propagators ?? []; + this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same carrier key, the propagator later in the list + * will "win". + * + * @param context Context to inject + * @param carrier Carrier into which context will be injected + */ + inject(context$1, carrier, setter) { + for (const propagator of this._propagators) try { + propagator.inject(context$1, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + /** + * Run each of the configured propagators with the given context and carrier. + * Propagators are run in the order they are configured, so if multiple + * propagators write the same context key, the propagator later in the list + * will "win". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + extract(context$1, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context$1); + } + fields() { + return this._fields.slice(); + } + }; + exports.CompositePropagator = CompositePropagator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = void 0; + const VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + const VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + /** + * Key is opaque string up to 256 characters printable. It MUST begin with a + * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, + * underscores _, dashes -, asterisks *, and forward slashes /. + * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the + * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. + * see https://www.w3.org/TR/trace-context/#key + */ + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + /** + * Value is opaque string up to 256 characters printable ASCII RFC0020 + * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + */ + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = void 0; + const validators_1 = require_validators(); + const MAX_TRACE_STATE_ITEMS = 32; + const MAX_TRACE_STATE_LEN = 512; + const LIST_MEMBERS_SEPARATOR = ","; + const LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + /** + * TraceState must be a class and not a simple object type because of the spec + * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * + * Here is the list of allowed mutations: + * - New key-value pair should be added into the beginning of the list + * - The value of any key can be updated. Modified keys MUST be moved to the + * beginning of the list. + */ + var TraceState = class TraceState { + _internalState = /* @__PURE__ */ new Map(); + constructor(rawTraceState) { + if (rawTraceState) this._parse(rawTraceState); + } + set(key, value) { + const traceState = this._clone(); + if (traceState._internalState.has(key)) traceState._internalState.delete(key); + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys().reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => { + const listMember = part.trim(); + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) agg.set(key, value); + } + return agg; + }, /* @__PURE__ */ new Map()); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState(); + traceState._internalState = new Map(this._internalState); + return traceState; + } + }; + exports.TraceState = TraceState; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const suppress_tracing_1 = require_suppress_tracing(); + const TraceState_1 = require_TraceState(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + const VERSION = "00"; + const TRACE_PARENT_REGEX = /* @__PURE__ */ new RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`); + /** + * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} + * @param traceParent - A meta property that comes from server. + * It should be dynamically generated server side to have the server's request trace Id, + * a parent span Id that was set on the server's request span, + * and the trace flags to indicate the server's sampling decision + * (01 = sampled, 00 = not sampled). + * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' + * For more information see {@link https://www.w3.org/TR/trace-context/} + */ + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) return null; + if (match[1] === "00" && match[5]) return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + /** + * Propagates {@link SpanContext} through Trace Context format propagation. + * + * Based on the Trace Context specification: + * https://www.w3.org/TR/trace-context/ + */ + var W3CTraceContextPropagator = class { + inject(context$1, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context$1); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context$1) || !(0, api_1.isSpanContextValid)(spanContext)) return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + extract(context$1, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) return context$1; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") return context$1; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) return context$1; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : void 0); + } + return api_1.trace.setSpanContext(context$1, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + }; + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; + const RPC_METADATA_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + (function(RPCType) { + RPCType["HTTP"] = "http"; + })(exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context$1, meta$2) { + return context$1.setValue(RPC_METADATA_KEY, meta$2); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context$1) { + return context$1.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context$1) { + return context$1.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = void 0; + /** + * based on lodash in order to support esm builds without esModuleInterop. + * lodash is using MIT License. + **/ + const objectTag = "[object Object]"; + const nullTag = "[object Null]"; + const undefinedTag = "[object Undefined]"; + const funcToString = Function.prototype.toString; + const objectCtorString = funcToString.call(Object); + const getPrototypeOf = Object.getPrototypeOf; + const objectProto = Object.prototype; + const hasOwnProperty = objectProto.hasOwnProperty; + const symToStringTag = Symbol ? Symbol.toStringTag : void 0; + const nativeObjectToString = objectProto.toString; + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) return false; + const proto = getPrototypeOf(value); + if (proto === null) return true; + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject; + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) return value === void 0 ? undefinedTag : nullTag; + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = void 0; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) if (isOwn) value[symToStringTag] = tag; + else delete value[symToStringTag]; + return result; + } + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = void 0; + const lodash_merge_1 = require_lodash_merge(); + const MAX_LEVEL = 20; + /** + * Merges objects together + * @param args - objects / values to be merged + */ + function merge(...args) { + let result = args.shift(); + const objects = /* @__PURE__ */ new WeakMap(); + while (args.length > 0) result = mergeTwoObjects(result, args.shift(), 0, objects); + return result; + } + exports.merge = merge; + function takeValue(value) { + if (isArray(value)) return value.slice(); + return value; + } + /** + * Merges two objects + * @param one - first object + * @param two - second object + * @param level - current deep level + * @param objects - objects holder that has been already referenced - to prevent + * cyclic dependency + */ + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) return; + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) result = takeValue(two); + else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) for (let i = 0, j = two.length; i < j; i++) result.push(takeValue(two[i])); + else if (isObject(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } else if (isObject(one)) if (isObject(two)) { + if (!shouldMerge(one, two)) return two; + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) if (typeof twoValue === "undefined") delete result[key]; + else result[key] = twoValue; + else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) delete result[key]; + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ + obj: one, + key + }); + arr2.push({ + obj: two, + key + }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else result = two; + return result; + } + /** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length; i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) return true; + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) return false; + return true; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = void 0; + /** + * Error that is thrown on timeouts. + */ + var TimeoutError = class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + }; + exports.TimeoutError = TimeoutError; + /** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ + function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = void 0; + function urlMatches(url, urlToMatch) { + if (typeof urlToMatch === "string") return url === urlToMatch; + else return !!url.match(urlToMatch); + } + exports.urlMatches = urlMatches; + /** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ + function isUrlIgnored(url, ignoredUrls) { + if (!ignoredUrls) return false; + for (const ignoreUrl of ignoredUrls) if (urlMatches(url, ignoreUrl)) return true; + return false; + } + exports.isUrlIgnored = isUrlIgnored; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = void 0; + var Deferred = class { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + }; + exports.Deferred = Deferred; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = void 0; + const promise_1 = require_promise(); + /** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ + var BindOnceFuture = class { + _callback; + _that; + _isCalled = false; + _deferred = new promise_1.Deferred(); + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + }; + exports.BindOnceFuture = BindOnceFuture; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + /** + * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined. + * @param value + */ + function diagLogLevelFromString(value) { + if (value == null) return; + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const suppress_tracing_1 = require_suppress_tracing(); + /** + * @internal + * Shared functionality used by Exporters while exporting data, including suppression of Traces. + */ + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); + } + exports._export = _export; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js +var require_src$8 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator(); + Object.defineProperty(exports, "W3CBaggagePropagator", { + enumerable: true, + get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } + }); + var anchored_clock_1 = require_anchored_clock(); + Object.defineProperty(exports, "AnchoredClock", { + enumerable: true, + get: function() { + return anchored_clock_1.AnchoredClock; + } + }); + var attributes_1 = require_attributes(); + Object.defineProperty(exports, "isAttributeValue", { + enumerable: true, + get: function() { + return attributes_1.isAttributeValue; + } + }); + Object.defineProperty(exports, "sanitizeAttributes", { + enumerable: true, + get: function() { + return attributes_1.sanitizeAttributes; + } + }); + var global_error_handler_1 = require_global_error_handler(); + Object.defineProperty(exports, "globalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.globalErrorHandler; + } + }); + Object.defineProperty(exports, "setGlobalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } + }); + var logging_error_handler_1 = require_logging_error_handler(); + Object.defineProperty(exports, "loggingErrorHandler", { + enumerable: true, + get: function() { + return logging_error_handler_1.loggingErrorHandler; + } + }); + var time_1 = require_time(); + Object.defineProperty(exports, "addHrTimes", { + enumerable: true, + get: function() { + return time_1.addHrTimes; + } + }); + Object.defineProperty(exports, "getTimeOrigin", { + enumerable: true, + get: function() { + return time_1.getTimeOrigin; + } + }); + Object.defineProperty(exports, "hrTime", { + enumerable: true, + get: function() { + return time_1.hrTime; + } + }); + Object.defineProperty(exports, "hrTimeDuration", { + enumerable: true, + get: function() { + return time_1.hrTimeDuration; + } + }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMicroseconds; + } + }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMilliseconds; + } + }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToNanoseconds; + } + }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { + enumerable: true, + get: function() { + return time_1.hrTimeToTimeStamp; + } + }); + Object.defineProperty(exports, "isTimeInput", { + enumerable: true, + get: function() { + return time_1.isTimeInput; + } + }); + Object.defineProperty(exports, "isTimeInputHrTime", { + enumerable: true, + get: function() { + return time_1.isTimeInputHrTime; + } + }); + Object.defineProperty(exports, "millisToHrTime", { + enumerable: true, + get: function() { + return time_1.millisToHrTime; + } + }); + Object.defineProperty(exports, "timeInputToHrTime", { + enumerable: true, + get: function() { + return time_1.timeInputToHrTime; + } + }); + var ExportResult_1 = require_ExportResult(); + Object.defineProperty(exports, "ExportResultCode", { + enumerable: true, + get: function() { + return ExportResult_1.ExportResultCode; + } + }); + var utils_1 = require_utils$6(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { + enumerable: true, + get: function() { + return utils_1.parseKeyPairsIntoRecord; + } + }); + var platform_1 = require_platform$5(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return platform_1.SDK_INFO; + } + }); + Object.defineProperty(exports, "_globalThis", { + enumerable: true, + get: function() { + return platform_1._globalThis; + } + }); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return platform_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return platform_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + enumerable: true, + get: function() { + return platform_1.getNumberFromEnv; + } + }); + Object.defineProperty(exports, "getStringListFromEnv", { + enumerable: true, + get: function() { + return platform_1.getStringListFromEnv; + } + }); + Object.defineProperty(exports, "otperformance", { + enumerable: true, + get: function() { + return platform_1.otperformance; + } + }); + Object.defineProperty(exports, "unrefTimer", { + enumerable: true, + get: function() { + return platform_1.unrefTimer; + } + }); + var composite_1 = require_composite(); + Object.defineProperty(exports, "CompositePropagator", { + enumerable: true, + get: function() { + return composite_1.CompositePropagator; + } + }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } + }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } + }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } + }); + Object.defineProperty(exports, "parseTraceParent", { + enumerable: true, + get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } + }); + var rpc_metadata_1 = require_rpc_metadata(); + Object.defineProperty(exports, "RPCType", { + enumerable: true, + get: function() { + return rpc_metadata_1.RPCType; + } + }); + Object.defineProperty(exports, "deleteRPCMetadata", { + enumerable: true, + get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } + }); + Object.defineProperty(exports, "getRPCMetadata", { + enumerable: true, + get: function() { + return rpc_metadata_1.getRPCMetadata; + } + }); + Object.defineProperty(exports, "setRPCMetadata", { + enumerable: true, + get: function() { + return rpc_metadata_1.setRPCMetadata; + } + }); + var suppress_tracing_1 = require_suppress_tracing(); + Object.defineProperty(exports, "isTracingSuppressed", { + enumerable: true, + get: function() { + return suppress_tracing_1.isTracingSuppressed; + } + }); + Object.defineProperty(exports, "suppressTracing", { + enumerable: true, + get: function() { + return suppress_tracing_1.suppressTracing; + } + }); + Object.defineProperty(exports, "unsuppressTracing", { + enumerable: true, + get: function() { + return suppress_tracing_1.unsuppressTracing; + } + }); + var TraceState_1 = require_TraceState(); + Object.defineProperty(exports, "TraceState", { + enumerable: true, + get: function() { + return TraceState_1.TraceState; + } + }); + var merge_1 = require_merge(); + Object.defineProperty(exports, "merge", { + enumerable: true, + get: function() { + return merge_1.merge; + } + }); + var timeout_1 = require_timeout(); + Object.defineProperty(exports, "TimeoutError", { + enumerable: true, + get: function() { + return timeout_1.TimeoutError; + } + }); + Object.defineProperty(exports, "callWithTimeout", { + enumerable: true, + get: function() { + return timeout_1.callWithTimeout; + } + }); + var url_1 = require_url(); + Object.defineProperty(exports, "isUrlIgnored", { + enumerable: true, + get: function() { + return url_1.isUrlIgnored; + } + }); + Object.defineProperty(exports, "urlMatches", { + enumerable: true, + get: function() { + return url_1.urlMatches; + } + }); + var callback_1 = require_callback(); + Object.defineProperty(exports, "BindOnceFuture", { + enumerable: true, + get: function() { + return callback_1.BindOnceFuture; + } + }); + var configuration_1 = require_configuration(); + Object.defineProperty(exports, "diagLogLevelFromString", { + enumerable: true, + get: function() { + return configuration_1.diagLogLevelFromString; + } + }); + const exporter_1 = require_exporter(); + exports.internal = { _export: exporter_1._export }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js +function isPartialSuccessResponse(response) { + return Object.prototype.hasOwnProperty.call(response, "partialSuccess"); +} +/** +* Default response handler that logs a partial success to the console. +*/ +function createLoggingPartialSuccessResponseHandler() { + return { handleResponse(response) { + if (response == null || !isPartialSuccessResponse(response) || response.partialSuccess == null || Object.keys(response.partialSuccess).length === 0) return; + diag.warn("Received Partial Success response:", JSON.stringify(response.partialSuccess)); + } }; +} +var init_logging_response_handler = __esmMin((() => { + init_esm$2(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js +/** +* Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all +* signals. +*/ +function createOtlpExportDelegate(components, settings) { + return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout); +} +var import_src$5, OTLPExportDelegate; +var init_otlp_export_delegate = __esmMin((() => { + import_src$5 = require_src$8(); + init_types(); + init_logging_response_handler(); + init_esm$2(); + OTLPExportDelegate = class { + _transport; + _serializer; + _responseHandler; + _promiseQueue; + _timeout; + _diagLogger; + constructor(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) { + this._transport = _transport; + this._serializer = _serializer; + this._responseHandler = _responseHandler; + this._promiseQueue = _promiseQueue; + this._timeout = _timeout; + this._diagLogger = diag.createComponentLogger({ namespace: "OTLPExportDelegate" }); + } + export(internalRepresentation, resultCallback) { + this._diagLogger.debug("items to be sent", internalRepresentation); + if (this._promiseQueue.hasReachedLimit()) { + resultCallback({ + code: import_src$5.ExportResultCode.FAILED, + error: /* @__PURE__ */ new Error("Concurrent export limit reached") + }); + return; + } + const serializedRequest = this._serializer.serializeRequest(internalRepresentation); + if (serializedRequest == null) { + resultCallback({ + code: import_src$5.ExportResultCode.FAILED, + error: /* @__PURE__ */ new Error("Nothing to send") + }); + return; + } + this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => { + if (response.status === "success") { + if (response.data != null) try { + this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data)); + } catch (e) { + this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e, response.data); + } + resultCallback({ code: import_src$5.ExportResultCode.SUCCESS }); + return; + } else if (response.status === "failure" && response.error) { + resultCallback({ + code: import_src$5.ExportResultCode.FAILED, + error: response.error + }); + return; + } else if (response.status === "retryable") resultCallback({ + code: import_src$5.ExportResultCode.FAILED, + error: new OTLPExporterError("Export failed with retryable status") + }); + else resultCallback({ + code: import_src$5.ExportResultCode.FAILED, + error: new OTLPExporterError("Export failed with unknown error") + }); + }, (reason) => resultCallback({ + code: import_src$5.ExportResultCode.FAILED, + error: reason + }))); + } + forceFlush() { + return this._promiseQueue.awaitAll(); + } + async shutdown() { + this._diagLogger.debug("shutdown started"); + await this.forceFlush(); + this._transport.shutdown(); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js +function createOtlpNetworkExportDelegate(options, serializer, transport) { + return createOtlpExportDelegate({ + transport, + serializer, + promiseHandler: createBoundedQueueExportPromiseHandler(options) + }, { timeout: options.timeoutMillis }); +} +var init_otlp_network_export_delegate = __esmMin((() => { + init_bounded_queue_export_promise_handler(); + init_otlp_export_delegate(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index.js +var esm_exports = /* @__PURE__ */ __exportAll({ + CompressionAlgorithm: () => CompressionAlgorithm, + OTLPExporterBase: () => OTLPExporterBase, + OTLPExporterError: () => OTLPExporterError, + createOtlpNetworkExportDelegate: () => createOtlpNetworkExportDelegate, + getSharedConfigurationDefaults: () => getSharedConfigurationDefaults, + mergeOtlpSharedConfigurationWithDefaults: () => mergeOtlpSharedConfigurationWithDefaults +}); +var init_esm = __esmMin((() => { + init_OTLPExporterBase(); + init_types(); + init_shared_configuration(); + init_legacy_node_configuration(); + init_otlp_network_export_delegate(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/version.js +var require_version$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "0.205.0"; +})); + +//#endregion +//#region node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js +var require_aspromise = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = asPromise; + /** + * Callback as used by {@link util.asPromise}. + * @typedef asPromiseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {...*} params Additional arguments + * @returns {undefined} + */ + /** + * Returns a promise from a node-style callback function. + * @memberof util + * @param {asPromiseCallback} fn Function to call + * @param {*} ctx Function context + * @param {...*} params Function arguments + * @returns {Promise<*>} Promisified function + */ + function asPromise(fn, ctx) { + var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; + while (index < arguments.length) params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err) { + if (pending) { + pending = false; + if (err) reject(err); + else { + var params$1 = new Array(arguments.length - 1), offset$1 = 0; + while (offset$1 < params$1.length) params$1[offset$1++] = arguments[offset$1]; + resolve.apply(null, params$1); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); + } +})); + +//#endregion +//#region node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js +var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ + var base64 = exports; + /** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ + base64.length = function length(string$2) { + var p = string$2.length; + if (!p) return 0; + var n = 0; + while (--p % 4 > 1 && string$2.charAt(p) === "=") ++n; + return Math.ceil(string$2.length * 3) / 4 - n; + }; + var b64 = new Array(64); + var s64 = new Array(123); + for (var i = 0; i < 64;) s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + /** + * Encodes a buffer to a base64 encoded string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} Base64 encoded string + */ + base64.encode = function encode$2(buffer, start, end) { + var parts = null, chunk = []; + var i = 0, j = 0, t; + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i++] = b64[t | b >> 6]; + chunk[i++] = b64[b & 63]; + j = 0; + break; + } + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i = 0; + } + } + if (j) { + chunk[i++] = b64[t]; + chunk[i++] = 61; + if (j === 1) chunk[i++] = 61; + } + if (parts) { + if (i) parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i)); + }; + var invalidEncoding = "invalid encoding"; + /** + * Decodes a base64 encoded string to a buffer. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Number of bytes written + * @throws {Error} If encoding is invalid + */ + base64.decode = function decode$2(string$2, buffer, offset) { + var start = offset; + var j = 0, t; + for (var i = 0; i < string$2.length;) { + var c = string$2.charCodeAt(i++); + if (c === 61 && j > 1) break; + if ((c = s64[c]) === void 0) throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) throw Error(invalidEncoding); + return offset - start; + }; + /** + * Tests if the specified string appears to be base64 encoded. + * @param {string} string String to test + * @returns {boolean} `true` if probably base64 encoded, otherwise false + */ + base64.test = function test(string$2) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string$2); + }; +})); + +//#endregion +//#region node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.js +var require_eventemitter = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = EventEmitter; + /** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ + function EventEmitter() { + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = Object.create(null); + } + /** + * Event listener as used by {@link util.EventEmitter}. + * @typedef EventEmitterListener + * @type {function} + * @param {...*} args Arguments + * @returns {undefined} + */ + /** + * Registers an event listener. + * @param {string} evt Event name + * @param {EventEmitterListener} fn Listener + * @param {*} [ctx] Listener context + * @returns {this} `this` + */ + EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn, + ctx: ctx || this + }); + return this; + }; + /** + * Removes an event listener or any matching listeners if arguments are omitted. + * @param {string} [evt] Event name. Removes all listeners if omitted. + * @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted. + * @returns {this} `this` + */ + EventEmitter.prototype.off = function off(evt, fn) { + if (evt === void 0) this._listeners = Object.create(null); + else if (fn === void 0) this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + if (!listeners) return this; + for (var i = 0; i < listeners.length;) if (listeners[i].fn === fn) listeners.splice(i, 1); + else ++i; + } + return this; + }; + /** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {this} `this` + */ + EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], i = 1; + for (; i < arguments.length;) args.push(arguments[i++]); + for (i = 0; i < listeners.length;) listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; + }; +})); + +//#endregion +//#region node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js +var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = factory(factory); + /** + * Reads / writes floats / doubles from / to buffers. + * @name util.float + * @namespace + */ + /** + * Writes a 32 bit float to a buffer using little endian byte order. + * @name util.float.writeFloatLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + /** + * Writes a 32 bit float to a buffer using big endian byte order. + * @name util.float.writeFloatBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + /** + * Reads a 32 bit float from a buffer using little endian byte order. + * @name util.float.readFloatLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + /** + * Reads a 32 bit float from a buffer using big endian byte order. + * @name util.float.readFloatBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + /** + * Writes a 64 bit double to a buffer using little endian byte order. + * @name util.float.writeDoubleLE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + /** + * Writes a 64 bit double to a buffer using big endian byte order. + * @name util.float.writeDoubleBE + * @function + * @param {number} val Value to write + * @param {Uint8Array} buf Target buffer + * @param {number} pos Target buffer offset + * @returns {undefined} + */ + /** + * Reads a 64 bit double from a buffer using little endian byte order. + * @name util.float.readDoubleLE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + /** + * Reads a 64 bit double from a buffer using big endian byte order. + * @name util.float.readDoubleBE + * @function + * @param {Uint8Array} buf Source buffer + * @param {number} pos Source buffer offset + * @returns {number} Value read + */ + function factory(exports$1) { + if (typeof Float32Array !== "undefined") (function() { + var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128; + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + /* istanbul ignore next */ + exports$1.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + /* istanbul ignore next */ + exports$1.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + /* istanbul ignore next */ + exports$1.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + /* istanbul ignore next */ + exports$1.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + })(); + else (function() { + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) val = -val; + if (val === 0) writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos); + else if (isNaN(val)) writeUint(2143289344, buf, pos); + else if (val > 34028234663852886e22) writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 11754943508222875e-54) writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + exports$1.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports$1.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; + return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + exports$1.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports$1.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + })(); + if (typeof Float64Array !== "undefined") (function() { + var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128; + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + /* istanbul ignore next */ + exports$1.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + /* istanbul ignore next */ + exports$1.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + /* istanbul ignore next */ + exports$1.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + /* istanbul ignore next */ + exports$1.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + })(); + else (function() { + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 17976931348623157e292) { + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 22250738585072014e-324) { + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + exports$1.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports$1.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + exports$1.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports$1.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + })(); + return exports$1; + } + function writeUintLE(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + function writeUintBE(val, buf, pos) { + buf[pos] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; + } + function readUintLE(buf, pos) { + return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; + } + function readUintBE(buf, pos) { + return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; + } +})); + +//#endregion +//#region node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.js +var require_inquire = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = inquire; + /** + * Requires a module only if available. + * @memberof util + * @param {string} moduleName Module to require + * @returns {?Object} Required module if available and not empty, otherwise `null` + * @deprecated Legacy optional require helper. Will be removed in a future release. + */ + function inquire(moduleName) { + try { + if (typeof __require !== "function") return null; + var mod = __require(moduleName); + if (mod && (mod.length || Object.keys(mod).length)) return mod; + return null; + } catch (err) { + return null; + } + } +})); + +//#endregion +//#region node_modules/.pnpm/@protobufjs+utf8@1.1.1/node_modules/@protobufjs/utf8/index.js +var require_utf8 = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ + var utf8 = exports, replacementChar = "�"; + /** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ + utf8.length = function utf8_length(string$2) { + var len = 0, c = 0; + for (var i = 0; i < string$2.length; ++i) { + c = string$2.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ((c & 64512) === 55296 && (string$2.charCodeAt(i + 1) & 64512) === 56320) { + ++i; + len += 4; + } else len += 3; + } + return len; + }; + /** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ + utf8.read = function utf8_read(buffer, start, end) { + if (end - start < 1) return ""; + var str = ""; + for (var i = start; i < end;) { + var t = buffer[i++]; + if (t <= 127) str += String.fromCharCode(t); + else if (t >= 192 && t < 224) { + var c2 = (t & 31) << 6 | buffer[i++] & 63; + str += c2 >= 128 ? String.fromCharCode(c2) : replacementChar; + } else if (t >= 224 && t < 240) { + var c3 = (t & 15) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; + str += c3 >= 2048 ? String.fromCharCode(c3) : replacementChar; + } else if (t >= 240) { + var t2 = (t & 7) << 18 | (buffer[i++] & 63) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; + if (t2 < 65536 || t2 > 1114111) str += replacementChar; + else { + t2 -= 65536; + str += String.fromCharCode(55296 + (t2 >> 10)); + str += String.fromCharCode(56320 + (t2 & 1023)); + } + } + } + return str; + }; + /** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ + utf8.write = function utf8_write(string$2, buffer, offset) { + var start = offset, c1, c2; + for (var i = 0; i < string$2.length; ++i) { + c1 = string$2.charCodeAt(i); + if (c1 < 128) buffer[offset++] = c1; + else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 64512) === 55296 && ((c2 = string$2.charCodeAt(i + 1)) & 64512) === 56320) { + c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; + }; +})); + +//#endregion +//#region node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js +var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = pool; + /** + * An allocator as used by {@link util.pool}. + * @typedef PoolAllocator + * @type {function} + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + /** + * A slicer as used by {@link util.pool}. + * @typedef PoolSlicer + * @type {function} + * @param {number} start Start offset + * @param {number} end End offset + * @returns {Uint8Array} Buffer slice + * @this {Uint8Array} + */ + /** + * A general purpose buffer pool. + * @memberof util + * @function + * @param {PoolAllocator} alloc Allocator + * @param {PoolSlicer} slice Slicer + * @param {number} [size=8192] Slab size + * @returns {PoolAllocator} Pooled allocator + */ + function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size$1) { + if (size$1 < 1 || size$1 > MAX) return alloc(size$1); + if (offset + size$1 > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size$1); + if (offset & 7) offset = (offset | 7) + 1; + return buf; + }; + } +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/util/longbits.js +var require_longbits = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = LongBits; + var util = require_minimal$1(); + /** + * Constructs new long bits. + * @classdesc Helper class for working with the low and high bits of a 64 bit value. + * @memberof util + * @constructor + * @param {number} lo Low 32 bits, unsigned + * @param {number} hi High 32 bits, unsigned + */ + function LongBits(lo, hi) { + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + /** + * High bits. + * @type {number} + */ + this.hi = hi >>> 0; + } + /** + * Zero bits. + * @memberof util.LongBits + * @type {util.LongBits} + */ + var zero = LongBits.zero = new LongBits(0, 0); + zero.toNumber = function() { + return 0; + }; + zero.zzEncode = zero.zzDecode = function() { + return this; + }; + zero.length = function() { + return 1; + }; + /** + * Zero hash. + * @memberof util.LongBits + * @type {string} + */ + var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + /** + * Constructs new long bits from the specified number. + * @param {number} value Value + * @returns {util.LongBits} Instance + */ + LongBits.fromNumber = function fromNumber(value) { + if (value === 0) return zero; + var sign = value < 0; + if (sign) value = -value; + var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) hi = 0; + } + } + return new LongBits(lo, hi); + }; + /** + * Constructs new long bits from a number, long or string. + * @param {Long|number|string} value Value + * @returns {util.LongBits} Instance + */ + LongBits.from = function from(value) { + if (typeof value === "number") return LongBits.fromNumber(value); + if (util.isString(value)) + /* istanbul ignore else */ + if (util.Long) value = util.Long.fromString(value); + else return LongBits.fromNumber(parseInt(value, 10)); + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; + }; + /** + * Converts this long bits to a possibly unsafe JavaScript number. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {number} Possibly unsafe number + */ + LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; + if (!lo) hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; + }; + /** + * Converts this long bits to a long. + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long} Long + */ + LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { + low: this.lo | 0, + high: this.hi | 0, + unsigned: Boolean(unsigned) + }; + }; + var charCodeAt = String.prototype.charCodeAt; + /** + * Constructs new long bits from the specified 8 characters long hash. + * @param {string} hash Hash + * @returns {util.LongBits} Bits + */ + LongBits.fromHash = function fromHash(hash) { + if (hash === zeroHash) return zero; + return new LongBits((charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0, (charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0); + }; + /** + * Converts this long bits to a 8 characters long hash. + * @returns {string} Hash + */ + LongBits.prototype.toHash = function toHash() { + return String.fromCharCode(this.lo & 255, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, this.hi & 255, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24); + }; + /** + * Zig-zag encodes this long bits. + * @returns {util.LongBits} `this` + */ + LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = (this.lo << 1 ^ mask) >>> 0; + return this; + }; + /** + * Zig-zag decodes this long bits. + * @returns {util.LongBits} `this` + */ + LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = (this.hi >>> 1 ^ mask) >>> 0; + return this; + }; + /** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ + LongBits.prototype.length = function length() { + var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; + return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; + }; +})); + +//#endregion +//#region node_modules/.pnpm/long@5.3.2/node_modules/long/umd/index.js +var require_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => { + (function(global$1, factory) { + function preferDefault(exports$1) { + return exports$1.default || exports$1; + } + if (typeof define === "function" && define.amd) define([], function() { + var exports$1 = {}; + factory(exports$1); + return preferDefault(exports$1); + }); + else if (typeof exports === "object") { + factory(exports); + if (typeof module === "object") module.exports = preferDefault(exports); + } else (function() { + var exports$1 = {}; + factory(exports$1); + global$1.Long = preferDefault(exports$1); + })(); + })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : exports, function(_exports) { + "use strict"; + Object.defineProperty(_exports, "__esModule", { value: true }); + _exports.default = void 0; + /** + * @license + * Copyright 2009 The Closure Library Authors + * Copyright 2020 Daniel Wirtz / The long.js Authors. + * + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + */ + var wasm = null; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ + 0, + 97, + 115, + 109, + 1, + 0, + 0, + 0, + 1, + 13, + 2, + 96, + 0, + 1, + 127, + 96, + 4, + 127, + 127, + 127, + 127, + 1, + 127, + 3, + 7, + 6, + 0, + 1, + 1, + 1, + 1, + 1, + 6, + 6, + 1, + 127, + 1, + 65, + 0, + 11, + 7, + 50, + 6, + 3, + 109, + 117, + 108, + 0, + 1, + 5, + 100, + 105, + 118, + 95, + 115, + 0, + 2, + 5, + 100, + 105, + 118, + 95, + 117, + 0, + 3, + 5, + 114, + 101, + 109, + 95, + 115, + 0, + 4, + 5, + 114, + 101, + 109, + 95, + 117, + 0, + 5, + 8, + 103, + 101, + 116, + 95, + 104, + 105, + 103, + 104, + 0, + 0, + 10, + 191, + 1, + 6, + 4, + 0, + 35, + 0, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 126, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 127, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 128, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 129, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 130, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11 + ])), {}).exports; + } catch {} + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @constructor + */ + function Long(low, high, unsigned) { + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; + } + /** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ + Long.prototype.__isLong__; + Object.defineProperty(Long.prototype, "__isLong__", { value: true }); + /** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + /** + * @function + * @param {*} value number + * @returns {number} + * @inner + */ + function ctz32(value) { + var c = Math.clz32(value & -value); + return value ? 31 - c : c; + } + /** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ + Long.isLong = isLong; + /** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ + var INT_CACHE = {}; + /** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ + var UINT_CACHE = {}; + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = 0 <= value && value < 256) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, 0, true); + if (cache) UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = -128 <= value && value < 128) { + cachedObj = INT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } + } + /** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromInt = fromInt; + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromNumber(value, unsigned) { + if (isNaN(value)) return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) return UZERO; + if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; + } + if (value < 0) return fromNumber(-value, unsigned).neg(); + return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); + } + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromNumber = fromNumber; + /** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBits = fromBits; + /** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ + var pow_dbl = Math.pow; + /** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ + function fromString(str, unsigned, radix) { + if (str.length === 0) throw Error("empty string"); + if (typeof unsigned === "number") { + radix = unsigned; + unsigned = false; + } else unsigned = !!unsigned; + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return unsigned ? UZERO : ZERO; + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + var p; + if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen"); + else if (p === 0) return fromString(str.substring(1), unsigned, radix).neg(); + var radixToPower = fromNumber(pow_dbl(radix, 8)); + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + /** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ + Long.fromString = fromString; + /** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); + return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); + } + /** + * Converts the specified value to a Long using the appropriate from* function for its type. + * @function + * @param {!Long|number|bigint|string|!{low: number, high: number, unsigned: boolean}} val Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} + */ + Long.fromValue = fromValue; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_16_DBL = 65536; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_24_DBL = 1 << 24; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + /** + * @type {!Long} + * @const + * @inner + */ + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + /** + * @type {!Long} + * @inner + */ + var ZERO = fromInt(0); + /** + * Signed zero. + * @type {!Long} + */ + Long.ZERO = ZERO; + /** + * @type {!Long} + * @inner + */ + var UZERO = fromInt(0, true); + /** + * Unsigned zero. + * @type {!Long} + */ + Long.UZERO = UZERO; + /** + * @type {!Long} + * @inner + */ + var ONE = fromInt(1); + /** + * Signed one. + * @type {!Long} + */ + Long.ONE = ONE; + /** + * @type {!Long} + * @inner + */ + var UONE = fromInt(1, true); + /** + * Unsigned one. + * @type {!Long} + */ + Long.UONE = UONE; + /** + * @type {!Long} + * @inner + */ + var NEG_ONE = fromInt(-1); + /** + * Signed negative one. + * @type {!Long} + */ + Long.NEG_ONE = NEG_ONE; + /** + * @type {!Long} + * @inner + */ + var MAX_VALUE = fromBits(-1, 2147483647, false); + /** + * Maximum signed value. + * @type {!Long} + */ + Long.MAX_VALUE = MAX_VALUE; + /** + * @type {!Long} + * @inner + */ + var MAX_UNSIGNED_VALUE = fromBits(-1, -1, true); + /** + * Maximum unsigned value. + * @type {!Long} + */ + Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + /** + * @type {!Long} + * @inner + */ + var MIN_VALUE = fromBits(0, -2147483648, false); + /** + * Minimum signed value. + * @type {!Long} + */ + Long.MIN_VALUE = MIN_VALUE; + /** + * @alias Long.prototype + * @inner + */ + var LongPrototype = Long.prototype; + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @this {!Long} + * @returns {number} + */ + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @this {!Long} + * @returns {number} + */ + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** + * Converts the Long to a string written in the specified radix. + * @this {!Long} + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + if (this.isZero()) return "0"; + if (this.isNegative()) if (this.eq(MIN_VALUE)) { + var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else return "-" + this.neg().toString(radix); + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; + var result = ""; + while (true) { + var remDiv = rem.div(radixToPower), digits = (rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0).toString(radix); + rem = remDiv; + if (rem.isZero()) return digits + result; + else { + while (digits.length < 6) digits = "0" + digits; + result = "" + digits + result; + } + } + }; + /** + * Gets the high 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed high bits + */ + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + /** + * Gets the high 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned high bits + */ + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + /** + * Gets the low 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed low bits + */ + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + /** + * Gets the low 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned low bits + */ + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + /** + * Gets the number of bits needed to represent the absolute value of this Long. + * @this {!Long} + * @returns {number} + */ + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + /** + * Tests if this Long can be safely represented as a JavaScript number. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isSafeInteger = function isSafeInteger() { + var top11Bits = this.high >> 21; + if (!top11Bits) return true; + if (this.unsigned) return false; + return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); + }; + /** + * Tests if this Long's value equals zero. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + /** + * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. + * @returns {boolean} + */ + LongPrototype.eqz = LongPrototype.isZero; + /** + * Tests if this Long's value is negative. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + /** + * Tests if this Long's value is positive or zero. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + /** + * Tests if this Long's value is odd. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + /** + * Tests if this Long's value is even. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; + }; + /** + * Tests if this Long's value equals the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.equals = function equals(other) { + if (!isLong(other)) other = fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false; + return this.high === other.high && this.low === other.low; + }; + /** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.eq = LongPrototype.equals; + /** + * Tests if this Long's value differs from the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.notEquals = function notEquals(other) { + return !this.eq(other); + }; + /** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.neq = LongPrototype.notEquals; + /** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.ne = LongPrototype.notEquals; + /** + * Tests if this Long's value is less than the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThan = function lessThan(other) { + return this.comp(other) < 0; + }; + /** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lt = LongPrototype.lessThan; + /** + * Tests if this Long's value is less than or equal the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(other) <= 0; + }; + /** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lte = LongPrototype.lessThanOrEqual; + /** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.le = LongPrototype.lessThanOrEqual; + /** + * Tests if this Long's value is greater than the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(other) > 0; + }; + /** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.gt = LongPrototype.greaterThan; + /** + * Tests if this Long's value is greater than or equal the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(other) >= 0; + }; + /** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + /** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.ge = LongPrototype.greaterThanOrEqual; + /** + * Compares this Long's value with the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.compare = function compare(other) { + if (!isLong(other)) other = fromValue(other); + if (this.eq(other)) return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) return -1; + if (!thisNeg && otherNeg) return 1; + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; + }; + /** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.comp = LongPrototype.compare; + /** + * Negates this Long's value. + * @this {!Long} + * @returns {!Long} Negated Long + */ + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; + return this.not().add(ONE); + }; + /** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ + LongPrototype.neg = LongPrototype.negate; + /** + * Returns the sum of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} addend Addend + * @returns {!Long} Sum + */ + LongPrototype.add = function add(addend) { + if (!isLong(addend)) addend = fromValue(addend); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = addend.high >>> 16; + var b32 = addend.high & 65535; + var b16 = addend.low >>> 16; + var b00 = addend.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 + b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + /** + * Returns the difference of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|bigint|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.sub = LongPrototype.subtract; + /** + * Returns the product of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) return this; + if (!isLong(multiplier)) multiplier = fromValue(multiplier); + if (wasm) return fromBits(wasm["mul"](this.low, this.high, multiplier.low, multiplier.high), wasm["get_high"](), this.unsigned); + if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; + if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; + if (this.isNegative()) if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); + else return this.neg().mul(multiplier).neg(); + else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 65535; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 65535; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + /** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|bigint|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.mul = LongPrototype.multiply; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @this {!Long} + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + if (divisor.isZero()) throw Error("division by zero"); + if (wasm) { + if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) return this; + return fromBits((this.unsigned ? wasm["div_u"] : wasm["div_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned); + } + if (this.isZero()) return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + if (this.eq(MIN_VALUE)) if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; + else if (divisor.eq(MIN_VALUE)) return ONE; + else { + approx = this.shr(1).div(divisor).shl(1); + if (approx.eq(ZERO)) return divisor.isNegative() ? ONE : NEG_ONE; + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return UZERO; + if (divisor.gt(this.shru(1))) return UONE; + res = UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) approxRes = ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.div = LongPrototype.divide; + /** + * Returns this Long modulo the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + if (wasm) return fromBits((this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned); + return this.sub(this.div(divisor).mul(divisor)); + }; + /** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.mod = LongPrototype.modulo; + /** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.rem = LongPrototype.modulo; + /** + * Returns the bitwise NOT of this Long. + * @this {!Long} + * @returns {!Long} + */ + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + /** + * Returns count leading zeros of this Long. + * @this {!Long} + * @returns {!number} + */ + LongPrototype.countLeadingZeros = function countLeadingZeros() { + return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; + }; + /** + * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. + * @function + * @param {!Long} + * @returns {!number} + */ + LongPrototype.clz = LongPrototype.countLeadingZeros; + /** + * Returns count trailing zeros of this Long. + * @this {!Long} + * @returns {!number} + */ + LongPrototype.countTrailingZeros = function countTrailingZeros() { + return this.low ? ctz32(this.low) : ctz32(this.high) + 32; + }; + /** + * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. + * @function + * @param {!Long} + * @returns {!number} + */ + LongPrototype.ctz = LongPrototype.countTrailingZeros; + /** + * Returns the bitwise AND of this Long and the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ + LongPrototype.and = function and(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Returns the bitwise OR of this Long and the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ + LongPrototype.or = function or(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns the bitwise XOR of this Long and the given one. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ + LongPrototype.xor = function xor(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned); + else return fromBits(0, this.low << numBits - 32, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shl = LongPrototype.shiftLeft; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned); + else return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shr = LongPrototype.shiftRight; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned); + if (numBits === 32) return fromBits(this.high, 0, this.unsigned); + return fromBits(this.high >>> numBits - 32, 0, this.unsigned); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + /** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + /** + * Returns this Long with bits rotated to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotateLeft = function rotateLeft(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned); + } + numBits -= 32; + b = 32 - numBits; + return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned); + }; + /** + * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotl = LongPrototype.rotateLeft; + /** + * Returns this Long with bits rotated to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotateRight = function rotateRight(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned); + } + numBits -= 32; + b = 32 - numBits; + return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned); + }; + /** + * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotr = LongPrototype.rotateRight; + /** + * Converts this Long to signed. + * @this {!Long} + * @returns {!Long} Signed long + */ + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) return this; + return fromBits(this.low, this.high, false); + }; + /** + * Converts this Long to unsigned. + * @this {!Long} + * @returns {!Long} Unsigned long + */ + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) return this; + return fromBits(this.low, this.high, true); + }; + /** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @this {!Long} + * @returns {!Array.} Byte representation + */ + LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @this {!Long} + * @returns {!Array.} Little endian byte representation + */ + LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, lo = this.low; + return [ + lo & 255, + lo >>> 8 & 255, + lo >>> 16 & 255, + lo >>> 24, + hi & 255, + hi >>> 8 & 255, + hi >>> 16 & 255, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @this {!Long} + * @returns {!Array.} Big endian byte representation + */ + LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + hi >>> 16 & 255, + hi >>> 8 & 255, + hi & 255, + lo >>> 24, + lo >>> 16 & 255, + lo >>> 8 & 255, + lo & 255 + ]; + }; + /** + * Creates a Long from its byte representation. + * @param {!Array.} bytes Byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {Long} The corresponding Long value + */ + Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param {!Array.} bytes Little endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ + Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param {!Array.} bytes Big endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ + Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); + }; + if (typeof BigInt === "function") { + /** + * Returns a Long representing the given big integer. + * @function + * @param {number} value The big integer value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBigInt = function fromBigInt(value, unsigned) { + return fromBits(Number(BigInt.asIntN(32, value)), Number(BigInt.asIntN(32, value >> BigInt(32))), unsigned); + }; + Long.fromValue = function fromValueWithBigInt(value, unsigned) { + if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); + return fromValue(value, unsigned); + }; + /** + * Converts the Long to its big integer representation. + * @this {!Long} + * @returns {bigint} + */ + LongPrototype.toBigInt = function toBigInt() { + var lowBigInt = BigInt(this.low >>> 0); + return BigInt(this.unsigned ? this.high >>> 0 : this.high) << BigInt(32) | lowBigInt; + }; + } + _exports.default = Long; + }); +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/util/minimal.js +var require_minimal$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var util = exports; + util.asPromise = require_aspromise(); + util.base64 = require_base64(); + util.EventEmitter = require_eventemitter(); + util.float = require_float(); + util.inquire = require_inquire(); + util.utf8 = require_utf8(); + util.pool = require_pool(); + util.LongBits = require_longbits(); + /** + * Tests if the specified key can affect object prototypes. + * @memberof util + * @param {string} key Key to test + * @returns {boolean} `true` if the key is unsafe + */ + function isUnsafeProperty(key) { + return key === "__proto__" || key === "prototype" || key === "constructor"; + } + util.isUnsafeProperty = isUnsafeProperty; + /** + * Whether running within node or not. + * @memberof util + * @type {boolean} + */ + util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node); + /** + * Global object reference. + * @memberof util + * @type {Object} + */ + util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports; + /** + * An immuable empty array. + * @memberof util + * @type {Array.<*>} + * @const + */ + util.emptyArray = Object.freeze ? Object.freeze([]) : []; + /** + * An immutable empty object. + * @type {Object} + * @const + */ + util.emptyObject = Object.freeze ? Object.freeze({}) : ( /* istanbul ignore next */ {}); + /** + * Tests if the specified value is an integer. + * @function + * @param {*} value Value to test + * @returns {boolean} `true` if the value is an integer + */ + util.isInteger = Number.isInteger || function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; + }; + /** + * Tests if the specified value is a string. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a string + */ + util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; + }; + /** + * Tests if the specified value is a non-null object. + * @param {*} value Value to test + * @returns {boolean} `true` if the value is a non-null object + */ + util.isObject = function isObject$1(value) { + return value && typeof value === "object"; + }; + /** + * Checks if a property on a message is considered to be present. + * This is an alias of {@link util.isSet}. + * @function + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ + util.isset = util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; + }; + /** + * Any compatible Buffer instance. + * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. + * @interface Buffer + * @extends Uint8Array + */ + /** + * Node's Buffer class if available. + * @type {Constructor} + */ + util.Buffer = (function() { + try { + var Buffer$1 = util.global.Buffer; + return Buffer$1.prototype.utf8Write ? Buffer$1 : null; + } catch (e) { + /* istanbul ignore next */ + return null; + } + })(); + util._Buffer_from = null; + util._Buffer_allocUnsafe = null; + /** + * Creates a new buffer of whatever type supported by the environment. + * @param {number|number[]} [sizeOrArray=0] Buffer size or number array + * @returns {Uint8Array|Buffer} Buffer + */ + util.newBuffer = function newBuffer(sizeOrArray) { + /* istanbul ignore next */ + return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); + }; + /** + * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. + * @type {Constructor} + */ + util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + /** + * Any compatible Long instance. + * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. + * @interface Long + * @property {number} low Low bits + * @property {number} high High bits + * @property {boolean} unsigned Whether unsigned or not + */ + /** + * Long.js's Long class if available. + * @type {Constructor} + */ + util.Long = util.global.dcodeIO && util.global.dcodeIO.Long || util.global.Long || (function() { + try { + var Long = require_umd(); + return Long && Long.isLong ? Long : null; + } catch (e) { + /* istanbul ignore next */ + return null; + } + })(); + /** + * Regular expression used to verify 2 bit (`bool`) map keys. + * @type {RegExp} + * @const + */ + util.key2Re = /^true|false|0|1$/; + /** + * Regular expression used to verify 32 bit (`int32` etc.) map keys. + * @type {RegExp} + * @const + */ + util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + /** + * Regular expression used to verify 64 bit (`int64` etc.) map keys. + * @type {RegExp} + * @const + */ + util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + /** + * Converts a number or long to an 8 characters long hash string. + * @param {Long|number} value Value to convert + * @returns {string} Hash + */ + util.longToHash = function longToHash(value) { + return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash; + }; + /** + * Converts an 8 characters long hash string to a long or number. + * @param {string} hash Hash + * @param {boolean} [unsigned=false] Whether unsigned or not + * @returns {Long|number} Original value + */ + util.longFromHash = function longFromHash(hash, unsigned) { + var bits = util.LongBits.fromHash(hash); + if (util.Long) return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); + }; + /** + * Merges the properties of the source object into the destination object. + * @memberof util + * @param {Object.} dst Destination object + * @param {...(Object.|boolean)} src Source objects, optionally followed by an `ifNotSet` flag + * @returns {Object.} Destination object + */ + function merge(dst) { + var ifNotSet = typeof arguments[arguments.length - 1] === "boolean", limit = ifNotSet ? arguments.length - 1 : arguments.length; + ifNotSet = ifNotSet && arguments[arguments.length - 1]; + for (var a = 1; a < limit; ++a) { + var src = arguments[a]; + if (!src) continue; + for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) if (!isUnsafeProperty(keys[i]) && (dst[keys[i]] === void 0 || !ifNotSet)) dst[keys[i]] = src[keys[i]]; + } + return dst; + } + util.merge = merge; + /** + * Schema declaration nesting limit. + * @memberof util + * @type {number} + */ + util.nestingLimit = 32; + /** + * Recursion limit. + * @memberof util + * @type {number} + */ + util.recursionLimit = 100; + /** + * Makes a property safe for assignment as an own property. + * @memberof util + * @param {Object.} obj Object + * @param {string} key Property key + * @returns {undefined} + */ + util.makeProp = function makeProp(obj, key) { + Object.defineProperty(obj, key, { + enumerable: true, + configurable: true, + writable: true + }); + }; + /** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ + util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); + }; + /** + * Creates a custom error constructor. + * @memberof util + * @param {string} name Error name + * @returns {Constructor} Custom error constructor + */ + function newError(name) { + function CustomError(message, properties) { + if (!(this instanceof CustomError)) return new CustomError(message, properties); + Object.defineProperty(this, "message", { get: function() { + return message; + } }); + /* istanbul ignore next */ + if (Error.captureStackTrace) Error.captureStackTrace(this, CustomError); + else Object.defineProperty(this, "stack", { value: (/* @__PURE__ */ new Error()).stack || "" }); + if (properties) merge(this, properties); + } + CustomError.prototype = Object.create(Error.prototype, { + constructor: { + value: CustomError, + writable: true, + enumerable: false, + configurable: true + }, + name: { + get: function get() { + return name; + }, + set: void 0, + enumerable: false, + configurable: true + }, + toString: { + value: function value() { + return this.name + ": " + this.message; + }, + writable: true, + enumerable: false, + configurable: true + } + }); + return CustomError; + } + util.newError = newError; + /** + * Constructs a new protocol error. + * @classdesc Error subclass indicating a protocol specifc error. + * @memberof util + * @extends Error + * @template T extends Message + * @constructor + * @param {string} message Error message + * @param {Object.} [properties] Additional properties + * @example + * try { + * MyMessage.decode(someBuffer); // throws if required fields are missing + * } catch (e) { + * if (e instanceof ProtocolError && e.instance) + * console.log("decoded so far: " + JSON.stringify(e.instance)); + * } + */ + util.ProtocolError = newError("ProtocolError"); + /** + * So far decoded message instance. + * @name util.ProtocolError#instance + * @type {Message} + */ + /** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + /** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ + util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0; i < fieldNames.length; ++i) fieldMap[fieldNames[i]] = 1; + /** + * @returns {string|undefined} Set field name, if any + * @this Object + * @ignore + */ + return function() { + for (var keys = Object.keys(this), i$1 = keys.length - 1; i$1 > -1; --i$1) if (fieldMap[keys[i$1]] === 1 && this[keys[i$1]] !== void 0 && this[keys[i$1]] !== null) return keys[i$1]; + }; + }; + /** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + /** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ + util.oneOfSetter = function setOneOf(fieldNames) { + /** + * @param {string} name Field name + * @returns {undefined} + * @this Object + * @ignore + */ + return function(name) { + for (var i = 0; i < fieldNames.length; ++i) if (fieldNames[i] !== name) delete this[fieldNames[i]]; + }; + }; + /** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - Longs become strings + * - Enums become string keys + * - Bytes become base64 encoded strings + * - (Sub-)Messages become plain objects + * - Maps become plain objects with all string keys + * - Repeated fields become arrays + * - NaN and Infinity for float and double fields become strings + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ + util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true + }; + util._configure = function() { + var Buffer$1 = util.Buffer; + /* istanbul ignore if */ + if (!Buffer$1) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + util._Buffer_from = Buffer$1.from !== Uint8Array.from && Buffer$1.from || function Buffer_from(value, encoding) { + return new Buffer$1(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer$1.allocUnsafe || function Buffer_allocUnsafe(size) { + return new Buffer$1(size); + }; + }; +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/writer.js +var require_writer = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = Writer; + var util = require_minimal$1(); + var BufferWriter; + var LongBits = util.LongBits, base64 = util.base64, utf8 = util.utf8; + /** + * Constructs a new writer operation instance. + * @classdesc Scheduled writer operation. + * @constructor + * @param {function(*, Uint8Array, number)} fn Function to call + * @param {number} len Value byte length + * @param {*} val Value to write + * @ignore + */ + function Op(fn, len, val) { + /** + * Function to call. + * @type {function(Uint8Array, number, *)} + */ + this.fn = fn; + /** + * Value byte length. + * @type {number} + */ + this.len = len; + /** + * Next operation. + * @type {Writer.Op|undefined} + */ + this.next = void 0; + /** + * Value to write. + * @type {*} + */ + this.val = val; + } + /* istanbul ignore next */ + function noop() {} + /** + * Constructs a new writer state instance. + * @classdesc Copied writer state. + * @memberof Writer + * @constructor + * @param {Writer} writer Writer to copy state from + * @ignore + */ + function State(writer) { + /** + * Current head. + * @type {Writer.Op} + */ + this.head = writer.head; + /** + * Current tail. + * @type {Writer.Op} + */ + this.tail = writer.tail; + /** + * Current buffer length. + * @type {number} + */ + this.len = writer.len; + /** + * Next state. + * @type {State|null} + */ + this.next = writer.states; + } + /** + * Constructs a new writer instance. + * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. + * @constructor + */ + function Writer() { + /** + * Current length. + * @type {number} + */ + this.len = 0; + /** + * Operations head. + * @type {Object} + */ + this.head = new Op(noop, 0, 0); + /** + * Operations tail + * @type {Object} + */ + this.tail = this.head; + /** + * Linked forked states. + * @type {Object|null} + */ + this.states = null; + } + var create = function create() { + return util.Buffer ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } : function create_array() { + return new Writer(); + }; + }; + /** + * Creates a new writer. + * @function + * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} + */ + Writer.create = create(); + /** + * Allocates a buffer of the specified size. + * @param {number} size Buffer size + * @returns {Uint8Array} Buffer + */ + Writer.alloc = function alloc(size) { + return new util.Array(size); + }; + /* istanbul ignore else */ + if (util.Array !== Array) Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + /** + * Pushes a new operation to the queue. + * @param {function(Uint8Array, number, *)} fn Function to call + * @param {number} len Value byte length + * @param {number} val Value to write + * @returns {Writer} `this` + * @private + */ + Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + }; + function writeByte(val, buf, pos) { + buf[pos] = val & 255; + } + function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; + } + /** + * Constructs a new varint writer operation instance. + * @classdesc Scheduled varint writer operation. + * @extends Op + * @constructor + * @param {number} len Value byte length + * @param {number} val Value to write + * @ignore + */ + function VarintOp(len, val) { + this.len = len; + this.next = void 0; + this.val = val; + } + VarintOp.prototype = Object.create(Op.prototype); + VarintOp.prototype.fn = writeVarint32; + /** + * Writes an unsigned 32 bit value as a varint. + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.uint32 = function write_uint32(value) { + this.len += (this.tail = this.tail.next = new VarintOp((value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, value)).len; + return this; + }; + /** + * Writes a signed 32 bit value as a varint. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.int32 = function write_int32(value) { + return (value |= 0) < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value); + }; + /** + * Writes a 32 bit value as a varint, zig-zag encoded. + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); + }; + function writeVarint64(val, buf, pos) { + var lo = val.lo, hi = val.hi; + while (hi) { + buf[pos++] = lo & 127 | 128; + lo = (lo >>> 7 | hi << 25) >>> 0; + hi >>>= 7; + } + while (lo > 127) { + buf[pos++] = lo & 127 | 128; + lo = lo >>> 7; + } + buf[pos++] = lo; + } + /** + * Writes an unsigned 64 bit value as a varint. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); + }; + /** + * Writes a signed 64 bit value as a varint. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.int64 = Writer.prototype.uint64; + /** + * Writes a signed 64 bit value as a varint, zig-zag encoded. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); + }; + /** + * Writes a boolish value as a varint. + * @param {boolean} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); + }; + function writeFixed32(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + /** + * Writes an unsigned 32 bit value as fixed 32 bits. + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); + }; + /** + * Writes a signed 32 bit value as fixed 32 bits. + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.sfixed32 = Writer.prototype.fixed32; + /** + * Writes an unsigned 64 bit value as fixed 64 bits. + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); + }; + /** + * Writes a signed 64 bit value as fixed 64 bits. + * @function + * @param {Long|number|string} value Value to write + * @returns {Writer} `this` + * @throws {TypeError} If `value` is a string and no long library is present. + */ + Writer.prototype.sfixed64 = Writer.prototype.fixed64; + /** + * Writes a float (32 bit). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); + }; + /** + * Writes a double (64 bit float). + * @function + * @param {number} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); + }; + var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); + } : function writeBytes_for(val, buf, pos) { + for (var i = 0; i < val.length; ++i) buf[pos + i] = val[i]; + }; + /** + * Writes a sequence of bytes. + * @param {Uint8Array|string} value Buffer or base64 encoded string to write + * @returns {Writer} `this` + */ + Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base64.length(value)); + base64.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); + }; + /** + * Writes a string. + * @param {string} value Value to write + * @returns {Writer} `this` + */ + Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0); + }; + /** + * Forks this writer's state by pushing it to a stack. + * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. + * @returns {Writer} `this` + */ + Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; + }; + /** + * Resets this instance to the last state. + * @returns {Writer} `this` + */ + Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; + }; + /** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ + Writer.prototype.ldelim = function ldelim() { + var head = this.head, tail = this.tail, len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; + this.tail = tail; + this.len += len; + } + return this; + }; + /** + * Finishes the write operation. + * @returns {Uint8Array} Finished buffer + */ + Writer.prototype.finish = function finish() { + var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + return buf; + }; + Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); + }; +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/writer_buffer.js +var require_writer_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = BufferWriter; + var Writer = require_writer(); + (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + var util = require_minimal$1(); + /** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ + function BufferWriter() { + Writer.call(this); + } + BufferWriter._configure = function() { + /** + * Allocates a buffer of the specified size. + * @function + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + BufferWriter.alloc = util._Buffer_allocUnsafe; + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); + } : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) val.copy(buf, pos, 0, val.length); + else for (var i = 0; i < val.length;) buf[pos++] = val[i++]; + }; + }; + /** + * @override + */ + BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) this._push(BufferWriter.writeBytesBuffer, len, value); + return this; + }; + function writeStringBuffer(val, buf, pos) { + if (val.length < 40) util.utf8.write(val, buf, pos); + else if (buf.utf8Write) buf.utf8Write(val, pos); + else buf.write(val, pos); + } + /** + * @override + */ + BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) this._push(writeStringBuffer, len, value); + return this; + }; + /** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + BufferWriter._configure(); +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/reader.js +var require_reader = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = Reader; + var util = require_minimal$1(); + var BufferReader; + var LongBits = util.LongBits, utf8 = util.utf8; + /* istanbul ignore next */ + function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); + } + /** + * Constructs a new reader instance using the specified buffer. + * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. + * @constructor + * @param {Uint8Array} buffer Buffer to read from + */ + function Reader(buffer) { + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + /** + * Read buffer length. + * @type {number} + */ + this.len = buffer.length; + } + var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) return new Reader(buffer); + throw Error("illegal buffer"); + } : function create_array(buffer) { + if (Array.isArray(buffer)) return new Reader(buffer); + throw Error("illegal buffer"); + }; + var create = function create() { + return util.Buffer ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer$1) { + return util.Buffer.isBuffer(buffer$1) ? new BufferReader(buffer$1) : create_array(buffer$1); + })(buffer); + } : create_array; + }; + /** + * Creates a new reader using the specified buffer. + * @function + * @param {Uint8Array|Buffer} buffer Buffer to read from + * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} + * @throws {Error} If `buffer` is not a valid buffer + */ + Reader.create = create(); + Reader.prototype._slice = util.Array.prototype.subarray || util.Array.prototype.slice; + /** + * Reads a varint as an unsigned 32 bit value. + * @function + * @returns {number} Value read + */ + Reader.prototype.uint32 = (function read_uint32_setup() { + var value = 4294967295; + return function read_uint32() { + value = (this.buf[this.pos] & 127) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; + if (this.buf[this.pos++] < 128) return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; + if (this.buf[this.pos++] < 128) return value; + /* istanbul ignore if */ + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; + })(); + /** + * Reads a varint as a signed 32 bit value. + * @returns {number} Value read + */ + Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; + }; + /** + * Reads a zig-zag encoded varint as a signed 32 bit value. + * @returns {number} Value read + */ + Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; + }; + function readLongVarint() { + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { + for (; i < 4; ++i) { + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) return bits; + i = 0; + } else { + for (; i < 3; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) throw indexOutOfRange(this); + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) for (; i < 5; ++i) { + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) return bits; + } + else for (; i < 5; ++i) { + /* istanbul ignore if */ + if (this.pos >= this.len) throw indexOutOfRange(this); + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) return bits; + } + /* istanbul ignore next */ + throw Error("invalid varint encoding"); + } + /** + * Reads a varint as a signed 64 bit value. + * @name Reader#int64 + * @function + * @returns {Long} Value read + */ + /** + * Reads a varint as an unsigned 64 bit value. + * @name Reader#uint64 + * @function + * @returns {Long} Value read + */ + /** + * Reads a zig-zag encoded varint as a signed 64 bit value. + * @name Reader#sint64 + * @function + * @returns {Long} Value read + */ + /** + * Reads a varint as a boolean. + * @returns {boolean} Value read + */ + Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; + }; + function readFixed32_end(buf, end) { + return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; + } + /** + * Reads fixed 32 bits as an unsigned 32 bit integer. + * @returns {number} Value read + */ + Reader.prototype.fixed32 = function read_fixed32() { + /* istanbul ignore if */ + if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4); + }; + /** + * Reads fixed 32 bits as a signed 32 bit integer. + * @returns {number} Value read + */ + Reader.prototype.sfixed32 = function read_sfixed32() { + /* istanbul ignore if */ + if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4) | 0; + }; + function readFixed64() { + /* istanbul ignore if */ + if (this.pos + 8 > this.len) throw indexOutOfRange(this, 8); + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); + } + /** + * Reads fixed 64 bits. + * @name Reader#fixed64 + * @function + * @returns {Long} Value read + */ + /** + * Reads zig-zag encoded fixed 64 bits. + * @name Reader#sfixed64 + * @function + * @returns {Long} Value read + */ + /** + * Reads a float (32 bit) as a number. + * @function + * @returns {number} Value read + */ + Reader.prototype.float = function read_float() { + /* istanbul ignore if */ + if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; + }; + /** + * Reads a double (64 bit float) as a number. + * @function + * @returns {number} Value read + */ + Reader.prototype.double = function read_double() { + /* istanbul ignore if */ + if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4); + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; + }; + /** + * Reads a sequence of bytes preceeded by its length as a varint. + * @returns {Uint8Array} Value read + */ + Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), start = this.pos, end = this.pos + length; + /* istanbul ignore if */ + if (end > this.len) throw indexOutOfRange(this, length); + this.pos += length; + if (Array.isArray(this.buf)) return this.buf.slice(start, end); + if (start === end) { + var nativeBuffer = util.Buffer; + return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); + } + return this._slice.call(this.buf, start, end); + }; + /** + * Reads a string preceeded by its byte length as a varint. + * @returns {string} Value read + */ + Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); + }; + /** + * Skips the specified number of bytes if specified, otherwise skips a varint. + * @param {number} [length] Length if known, otherwise a varint is assumed + * @returns {Reader} `this` + */ + Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + /* istanbul ignore if */ + if (this.pos + length > this.len) throw indexOutOfRange(this, length); + this.pos += length; + } else do + /* istanbul ignore if */ + if (this.pos >= this.len) throw indexOutOfRange(this); + while (this.buf[this.pos++] & 128); + return this; + }; + /** + * Recursion limit. + * @type {number} + */ + Reader.recursionLimit = util.recursionLimit; + /** + * Skips the next element of the specified wire type. + * @param {number} wireType Wire type received + * @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted + * @returns {Reader} `this` + */ + Reader.prototype.skipType = function(wireType, depth) { + if (depth === void 0) depth = 0; + if (depth > Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) this.skipType(wireType, depth + 1); + break; + case 5: + this.skip(4); + break; + default: throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + }; + Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); + var fn = util.Long ? "toLong" : "toNumber"; + util.merge(Reader.prototype, { + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + }); + }; +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/reader_buffer.js +var require_reader_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = BufferReader; + var Reader = require_reader(); + (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + var util = require_minimal$1(); + /** + * Constructs a new buffer reader instance. + * @classdesc Wire format reader using node buffers. + * @extends Reader + * @constructor + * @param {Buffer} buffer Buffer to read from + */ + function BufferReader(buffer) { + Reader.call(this, buffer); + /** + * Read buffer. + * @name BufferReader#buf + * @type {Buffer} + */ + } + BufferReader._configure = function() { + /* istanbul ignore else */ + if (util.Buffer) BufferReader.prototype._slice = util.Buffer.prototype.slice; + }; + /** + * @override + */ + BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); + return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); + }; + /** + * Reads a sequence of bytes preceeded by its length as a varint. + * @name BufferReader#bytes + * @function + * @returns {Buffer} Value read + */ + BufferReader._configure(); +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/rpc/service.js +var require_service = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = Service; + var util = require_minimal$1(); + (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + /** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. + * @typedef rpc.ServiceMethodCallback + * @template TRes extends Message + * @type {function} + * @param {Error|null} error Error, if any + * @param {TRes} [response] Response message + * @returns {undefined} + */ + /** + * A service method part of a {@link rpc.Service} as created by {@link Service.create}. + * @typedef rpc.ServiceMethod + * @template TReq extends Message + * @template TRes extends Message + * @type {function} + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message + * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` + */ + /** + * Constructs a new RPC service instance. + * @classdesc An RPC service as returned by {@link Service#create}. + * @exports rpc.Service + * @extends util.EventEmitter + * @constructor + * @param {RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Service(rpcImpl, requestDelimited, responseDelimited) { + if (typeof rpcImpl !== "function") throw TypeError("rpcImpl must be a function"); + util.EventEmitter.call(this); + /** + * RPC implementation. Becomes `null` once the service is ended. + * @type {RPCImpl|null} + */ + this.rpcImpl = rpcImpl; + /** + * Whether requests are length-delimited. + * @type {boolean} + */ + this.requestDelimited = Boolean(requestDelimited); + /** + * Whether responses are length-delimited. + * @type {boolean} + */ + this.responseDelimited = Boolean(responseDelimited); + } + /** + * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. + * @param {Method|rpc.ServiceMethod} method Reflected or static method + * @param {Constructor} requestCtor Request constructor + * @param {Constructor} responseCtor Response constructor + * @param {TReq|Properties} request Request message or plain object + * @param {rpc.ServiceMethodCallback} callback Service callback + * @returns {undefined} + * @template TReq extends Message + * @template TRes extends Message + */ + Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + if (!request) throw TypeError("request must be specified"); + var self$1 = this; + if (!callback) return util.asPromise(rpcCall, self$1, method, requestCtor, responseCtor, request); + if (!self$1.rpcImpl) { + setTimeout(function() { + callback(Error("already ended")); + }, 0); + return; + } + try { + return self$1.rpcImpl(method, requestCtor[self$1.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err, response) { + if (err) { + self$1.emit("error", err, method); + return callback(err); + } + if (response === null) { + self$1.end(true); + return; + } + if (!(response instanceof responseCtor)) try { + response = responseCtor[self$1.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err$1) { + self$1.emit("error", err$1, method); + return callback(err$1); + } + self$1.emit("data", response, method); + return callback(null, response); + }); + } catch (err) { + self$1.emit("error", err, method); + setTimeout(function() { + callback(err); + }, 0); + return; + } + }; + /** + * Ends this service and emits the `end` event. + * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. + * @returns {rpc.Service} `this` + */ + Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; + }; +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/rpc.js +var require_rpc = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * Streaming RPC helpers. + * @namespace + */ + var rpc = exports; + /** + * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. + * @typedef RPCImpl + * @type {function} + * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called + * @param {Uint8Array} requestData Request data + * @param {RPCImplCallback} callback Callback function + * @returns {undefined} + * @example + * function rpcImpl(method, requestData, callback) { + * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code + * throw Error("no such method"); + * asynchronouslyObtainAResponse(requestData, function(err, responseData) { + * callback(err, responseData); + * }); + * } + */ + /** + * Node-style callback as used by {@link RPCImpl}. + * @typedef RPCImplCallback + * @type {function} + * @param {Error|null} error Error, if any, otherwise `null` + * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error + * @returns {undefined} + */ + rpc.Service = require_service(); +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/roots.js +var require_roots = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = Object.create(null); +})); +/** +* Named roots. +* This is where pbjs stores generated structures (the option `-r, --root` specifies a name). +* Can also be used manually to make roots available across modules. +* @name roots +* @type {Object.} +* @example +* // pbjs -r myroot -o compiled.js ... +* +* // in another module: +* require("./compiled.js"); +* +* // in any subsequent module: +* var root = protobuf.roots["myroot"]; +*/ + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/index-minimal.js +var require_index_minimal = /* @__PURE__ */ __commonJSMin(((exports) => { + var protobuf = exports; + /** + * Build type, one of `"full"`, `"light"` or `"minimal"`. + * @name build + * @type {string} + * @const + */ + protobuf.build = "minimal"; + protobuf.Writer = require_writer(); + protobuf.BufferWriter = require_writer_buffer(); + protobuf.Reader = require_reader(); + protobuf.BufferReader = require_reader_buffer(); + protobuf.util = require_minimal$1(); + protobuf.rpc = require_rpc(); + protobuf.roots = require_roots(); + protobuf.configure = configure; + /* istanbul ignore next */ + /** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ + function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); + } + configure(); +})); + +//#endregion +//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/minimal.js +var require_minimal = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = require_index_minimal(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +var require_root = /* @__PURE__ */ __commonJSMin(((exports, module) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var $protobuf = require_minimal(); + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + $root.opentelemetry = (function() { + /** + * Namespace opentelemetry. + * @exports opentelemetry + * @namespace + */ + var opentelemetry = {}; + opentelemetry.proto = (function() { + /** + * Namespace proto. + * @memberof opentelemetry + * @namespace + */ + var proto = {}; + proto.common = (function() { + /** + * Namespace common. + * @memberof opentelemetry.proto + * @namespace + */ + var common = {}; + common.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.common + * @namespace + */ + var v1 = {}; + v1.AnyValue = (function() { + /** + * Properties of an AnyValue. + * @memberof opentelemetry.proto.common.v1 + * @interface IAnyValue + * @property {string|null} [stringValue] AnyValue stringValue + * @property {boolean|null} [boolValue] AnyValue boolValue + * @property {number|Long|null} [intValue] AnyValue intValue + * @property {number|null} [doubleValue] AnyValue doubleValue + * @property {opentelemetry.proto.common.v1.IArrayValue|null} [arrayValue] AnyValue arrayValue + * @property {opentelemetry.proto.common.v1.IKeyValueList|null} [kvlistValue] AnyValue kvlistValue + * @property {Uint8Array|null} [bytesValue] AnyValue bytesValue + */ + /** + * Constructs a new AnyValue. + * @memberof opentelemetry.proto.common.v1 + * @classdesc Represents an AnyValue. + * @implements IAnyValue + * @constructor + * @param {opentelemetry.proto.common.v1.IAnyValue=} [properties] Properties to set + */ + function AnyValue(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * AnyValue stringValue. + * @member {string|null|undefined} stringValue + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + AnyValue.prototype.stringValue = null; + /** + * AnyValue boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + AnyValue.prototype.boolValue = null; + /** + * AnyValue intValue. + * @member {number|Long|null|undefined} intValue + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + AnyValue.prototype.intValue = null; + /** + * AnyValue doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + AnyValue.prototype.doubleValue = null; + /** + * AnyValue arrayValue. + * @member {opentelemetry.proto.common.v1.IArrayValue|null|undefined} arrayValue + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + AnyValue.prototype.arrayValue = null; + /** + * AnyValue kvlistValue. + * @member {opentelemetry.proto.common.v1.IKeyValueList|null|undefined} kvlistValue + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + AnyValue.prototype.kvlistValue = null; + /** + * AnyValue bytesValue. + * @member {Uint8Array|null|undefined} bytesValue + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + AnyValue.prototype.bytesValue = null; + var $oneOfFields; + /** + * AnyValue value. + * @member {"stringValue"|"boolValue"|"intValue"|"doubleValue"|"arrayValue"|"kvlistValue"|"bytesValue"|undefined} value + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + */ + Object.defineProperty(AnyValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = [ + "stringValue", + "boolValue", + "intValue", + "doubleValue", + "arrayValue", + "kvlistValue", + "bytesValue" + ]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * Creates a new AnyValue instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {opentelemetry.proto.common.v1.IAnyValue=} [properties] Properties to set + * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue instance + */ + AnyValue.create = function create(properties) { + return new AnyValue(properties); + }; + /** + * Encodes the specified AnyValue message. Does not implicitly {@link opentelemetry.proto.common.v1.AnyValue.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {opentelemetry.proto.common.v1.IAnyValue} message AnyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnyValue.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(10).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) writer.uint32(16).bool(message.boolValue); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) writer.uint32(24).int64(message.intValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(33).double(message.doubleValue); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) $root.opentelemetry.proto.common.v1.ArrayValue.encode(message.arrayValue, writer.uint32(42).fork()).ldelim(); + if (message.kvlistValue != null && Object.hasOwnProperty.call(message, "kvlistValue")) $root.opentelemetry.proto.common.v1.KeyValueList.encode(message.kvlistValue, writer.uint32(50).fork()).ldelim(); + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) writer.uint32(58).bytes(message.bytesValue); + return writer; + }; + /** + * Encodes the specified AnyValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.AnyValue.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {opentelemetry.proto.common.v1.IAnyValue} message AnyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an AnyValue message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnyValue.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.AnyValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.stringValue = reader.string(); + break; + case 2: + message.boolValue = reader.bool(); + break; + case 3: + message.intValue = reader.int64(); + break; + case 4: + message.doubleValue = reader.double(); + break; + case 5: + message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.decode(reader, reader.uint32()); + break; + case 6: + message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.decode(reader, reader.uint32()); + break; + case 7: + message.bytesValue = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an AnyValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an AnyValue message. + * @function verify + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.value = 1; + if (!$util.isString(message.stringValue)) return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + if (typeof message.boolValue !== "boolean") return "boolValue: boolean expected"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) return "intValue: integer|Long expected"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + var error = $root.opentelemetry.proto.common.v1.ArrayValue.verify(message.arrayValue); + if (error) return "arrayValue." + error; + } + if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + var error = $root.opentelemetry.proto.common.v1.KeyValueList.verify(message.kvlistValue); + if (error) return "kvlistValue." + error; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) return "bytesValue: buffer expected"; + } + return null; + }; + /** + * Creates an AnyValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue + */ + AnyValue.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.common.v1.AnyValue) return object$1; + var message = new $root.opentelemetry.proto.common.v1.AnyValue(); + if (object$1.stringValue != null) message.stringValue = String(object$1.stringValue); + if (object$1.boolValue != null) message.boolValue = Boolean(object$1.boolValue); + if (object$1.intValue != null) { + if ($util.Long) (message.intValue = $util.Long.fromValue(object$1.intValue)).unsigned = false; + else if (typeof object$1.intValue === "string") message.intValue = parseInt(object$1.intValue, 10); + else if (typeof object$1.intValue === "number") message.intValue = object$1.intValue; + else if (typeof object$1.intValue === "object") message.intValue = new $util.LongBits(object$1.intValue.low >>> 0, object$1.intValue.high >>> 0).toNumber(); + } + if (object$1.doubleValue != null) message.doubleValue = Number(object$1.doubleValue); + if (object$1.arrayValue != null) { + if (typeof object$1.arrayValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected"); + message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.fromObject(object$1.arrayValue); + } + if (object$1.kvlistValue != null) { + if (typeof object$1.kvlistValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected"); + message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.fromObject(object$1.kvlistValue); + } + if (object$1.bytesValue != null) { + if (typeof object$1.bytesValue === "string") $util.base64.decode(object$1.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object$1.bytesValue)), 0); + else if (object$1.bytesValue.length >= 0) message.bytesValue = object$1.bytesValue; + } + return message; + }; + /** + * Creates a plain object from an AnyValue message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {opentelemetry.proto.common.v1.AnyValue} message AnyValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnyValue.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object$1.stringValue = message.stringValue; + if (options.oneofs) object$1.value = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object$1.boolValue = message.boolValue; + if (options.oneofs) object$1.value = "boolValue"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") object$1.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else object$1.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) object$1.value = "intValue"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object$1.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) object$1.value = "doubleValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object$1.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) object$1.value = "arrayValue"; + } + if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { + object$1.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.toObject(message.kvlistValue, options); + if (options.oneofs) object$1.value = "kvlistValue"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object$1.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (options.oneofs) object$1.value = "bytesValue"; + } + return object$1; + }; + /** + * Converts this AnyValue to JSON. + * @function toJSON + * @memberof opentelemetry.proto.common.v1.AnyValue + * @instance + * @returns {Object.} JSON object + */ + AnyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for AnyValue + * @function getTypeUrl + * @memberof opentelemetry.proto.common.v1.AnyValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.common.v1.AnyValue"; + }; + return AnyValue; + })(); + v1.ArrayValue = (function() { + /** + * Properties of an ArrayValue. + * @memberof opentelemetry.proto.common.v1 + * @interface IArrayValue + * @property {Array.|null} [values] ArrayValue values + */ + /** + * Constructs a new ArrayValue. + * @memberof opentelemetry.proto.common.v1 + * @classdesc Represents an ArrayValue. + * @implements IArrayValue + * @constructor + * @param {opentelemetry.proto.common.v1.IArrayValue=} [properties] Properties to set + */ + function ArrayValue(properties) { + this.values = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ArrayValue values. + * @member {Array.} values + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @instance + */ + ArrayValue.prototype.values = $util.emptyArray; + /** + * Creates a new ArrayValue instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {opentelemetry.proto.common.v1.IArrayValue=} [properties] Properties to set + * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue instance + */ + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); + }; + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link opentelemetry.proto.common.v1.ArrayValue.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {opentelemetry.proto.common.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.ArrayValue.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {opentelemetry.proto.common.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.ArrayValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) message.values = []; + message.values.push($root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ArrayValue message. + * @function verify + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.values[i]); + if (error) return "values." + error; + } + } + return null; + }; + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue + */ + ArrayValue.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.common.v1.ArrayValue) return object$1; + var message = new $root.opentelemetry.proto.common.v1.ArrayValue(); + if (object$1.values) { + if (!Array.isArray(object$1.values)) throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0; i < object$1.values.length; ++i) { + if (typeof object$1.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected"); + message.values[i] = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.values[i]); + } + } + return message; + }; + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {opentelemetry.proto.common.v1.ArrayValue} message ArrayValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayValue.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.values = []; + if (message.values && message.values.length) { + object$1.values = []; + for (var j = 0; j < message.values.length; ++j) object$1.values[j] = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.values[j], options); + } + return object$1; + }; + /** + * Converts this ArrayValue to JSON. + * @function toJSON + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @instance + * @returns {Object.} JSON object + */ + ArrayValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ArrayValue + * @function getTypeUrl + * @memberof opentelemetry.proto.common.v1.ArrayValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.common.v1.ArrayValue"; + }; + return ArrayValue; + })(); + v1.KeyValueList = (function() { + /** + * Properties of a KeyValueList. + * @memberof opentelemetry.proto.common.v1 + * @interface IKeyValueList + * @property {Array.|null} [values] KeyValueList values + */ + /** + * Constructs a new KeyValueList. + * @memberof opentelemetry.proto.common.v1 + * @classdesc Represents a KeyValueList. + * @implements IKeyValueList + * @constructor + * @param {opentelemetry.proto.common.v1.IKeyValueList=} [properties] Properties to set + */ + function KeyValueList(properties) { + this.values = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * KeyValueList values. + * @member {Array.} values + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @instance + */ + KeyValueList.prototype.values = $util.emptyArray; + /** + * Creates a new KeyValueList instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {opentelemetry.proto.common.v1.IKeyValueList=} [properties] Properties to set + * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList instance + */ + KeyValueList.create = function create(properties) { + return new KeyValueList(properties); + }; + /** + * Encodes the specified KeyValueList message. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValueList.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {opentelemetry.proto.common.v1.IKeyValueList} message KeyValueList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValueList.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified KeyValueList message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValueList.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {opentelemetry.proto.common.v1.IKeyValueList} message KeyValueList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValueList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a KeyValueList message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValueList.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValueList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) message.values = []; + message.values.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a KeyValueList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValueList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a KeyValueList message. + * @function verify + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValueList.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.values[i]); + if (error) return "values." + error; + } + } + return null; + }; + /** + * Creates a KeyValueList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList + */ + KeyValueList.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.common.v1.KeyValueList) return object$1; + var message = new $root.opentelemetry.proto.common.v1.KeyValueList(); + if (object$1.values) { + if (!Array.isArray(object$1.values)) throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected"); + message.values = []; + for (var i = 0; i < object$1.values.length; ++i) { + if (typeof object$1.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected"); + message.values[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.values[i]); + } + } + return message; + }; + /** + * Creates a plain object from a KeyValueList message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {opentelemetry.proto.common.v1.KeyValueList} message KeyValueList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValueList.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.values = []; + if (message.values && message.values.length) { + object$1.values = []; + for (var j = 0; j < message.values.length; ++j) object$1.values[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.values[j], options); + } + return object$1; + }; + /** + * Converts this KeyValueList to JSON. + * @function toJSON + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @instance + * @returns {Object.} JSON object + */ + KeyValueList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for KeyValueList + * @function getTypeUrl + * @memberof opentelemetry.proto.common.v1.KeyValueList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyValueList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValueList"; + }; + return KeyValueList; + })(); + v1.KeyValue = (function() { + /** + * Properties of a KeyValue. + * @memberof opentelemetry.proto.common.v1 + * @interface IKeyValue + * @property {string|null} [key] KeyValue key + * @property {opentelemetry.proto.common.v1.IAnyValue|null} [value] KeyValue value + */ + /** + * Constructs a new KeyValue. + * @memberof opentelemetry.proto.common.v1 + * @classdesc Represents a KeyValue. + * @implements IKeyValue + * @constructor + * @param {opentelemetry.proto.common.v1.IKeyValue=} [properties] Properties to set + */ + function KeyValue(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * KeyValue key. + * @member {string|null|undefined} key + * @memberof opentelemetry.proto.common.v1.KeyValue + * @instance + */ + KeyValue.prototype.key = null; + /** + * KeyValue value. + * @member {opentelemetry.proto.common.v1.IAnyValue|null|undefined} value + * @memberof opentelemetry.proto.common.v1.KeyValue + * @instance + */ + KeyValue.prototype.value = null; + /** + * Creates a new KeyValue instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {opentelemetry.proto.common.v1.IKeyValue=} [properties] Properties to set + * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue instance + */ + KeyValue.create = function create(properties) { + return new KeyValue(properties); + }; + /** + * Encodes the specified KeyValue message. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValue.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {opentelemetry.proto.common.v1.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) writer.uint32(10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.value, writer.uint32(18).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValue.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {opentelemetry.proto.common.v1.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a KeyValue message. + * @function verify + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + if (!$util.isString(message.key)) return "key: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.value); + if (error) return "value." + error; + } + return null; + }; + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue + */ + KeyValue.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.common.v1.KeyValue) return object$1; + var message = new $root.opentelemetry.proto.common.v1.KeyValue(); + if (object$1.key != null) message.key = String(object$1.key); + if (object$1.value != null) { + if (typeof object$1.value !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected"); + message.value = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.value); + } + return message; + }; + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {opentelemetry.proto.common.v1.KeyValue} message KeyValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValue.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) { + object$1.key = ""; + object$1.value = null; + } + if (message.key != null && message.hasOwnProperty("key")) object$1.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) object$1.value = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.value, options); + return object$1; + }; + /** + * Converts this KeyValue to JSON. + * @function toJSON + * @memberof opentelemetry.proto.common.v1.KeyValue + * @instance + * @returns {Object.} JSON object + */ + KeyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for KeyValue + * @function getTypeUrl + * @memberof opentelemetry.proto.common.v1.KeyValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValue"; + }; + return KeyValue; + })(); + v1.InstrumentationScope = (function() { + /** + * Properties of an InstrumentationScope. + * @memberof opentelemetry.proto.common.v1 + * @interface IInstrumentationScope + * @property {string|null} [name] InstrumentationScope name + * @property {string|null} [version] InstrumentationScope version + * @property {Array.|null} [attributes] InstrumentationScope attributes + * @property {number|null} [droppedAttributesCount] InstrumentationScope droppedAttributesCount + */ + /** + * Constructs a new InstrumentationScope. + * @memberof opentelemetry.proto.common.v1 + * @classdesc Represents an InstrumentationScope. + * @implements IInstrumentationScope + * @constructor + * @param {opentelemetry.proto.common.v1.IInstrumentationScope=} [properties] Properties to set + */ + function InstrumentationScope(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * InstrumentationScope name. + * @member {string|null|undefined} name + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @instance + */ + InstrumentationScope.prototype.name = null; + /** + * InstrumentationScope version. + * @member {string|null|undefined} version + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @instance + */ + InstrumentationScope.prototype.version = null; + /** + * InstrumentationScope attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @instance + */ + InstrumentationScope.prototype.attributes = $util.emptyArray; + /** + * InstrumentationScope droppedAttributesCount. + * @member {number|null|undefined} droppedAttributesCount + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @instance + */ + InstrumentationScope.prototype.droppedAttributesCount = null; + /** + * Creates a new InstrumentationScope instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {opentelemetry.proto.common.v1.IInstrumentationScope=} [properties] Properties to set + * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope instance + */ + InstrumentationScope.create = function create(properties) { + return new InstrumentationScope(properties); + }; + /** + * Encodes the specified InstrumentationScope message. Does not implicitly {@link opentelemetry.proto.common.v1.InstrumentationScope.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {opentelemetry.proto.common.v1.IInstrumentationScope} message InstrumentationScope message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstrumentationScope.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(18).string(message.version); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); + return writer; + }; + /** + * Encodes the specified InstrumentationScope message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.InstrumentationScope.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {opentelemetry.proto.common.v1.IInstrumentationScope} message InstrumentationScope message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstrumentationScope.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an InstrumentationScope message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstrumentationScope.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.InstrumentationScope(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 4: + message.droppedAttributesCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an InstrumentationScope message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstrumentationScope.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an InstrumentationScope message. + * @function verify + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstrumentationScope.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) return "name: string expected"; + } + if (message.version != null && message.hasOwnProperty("version")) { + if (!$util.isString(message.version)) return "version: string expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; + } + return null; + }; + /** + * Creates an InstrumentationScope message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope + */ + InstrumentationScope.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.common.v1.InstrumentationScope) return object$1; + var message = new $root.opentelemetry.proto.common.v1.InstrumentationScope(); + if (object$1.name != null) message.name = String(object$1.name); + if (object$1.version != null) message.version = String(object$1.version); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; + return message; + }; + /** + * Creates a plain object from an InstrumentationScope message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {opentelemetry.proto.common.v1.InstrumentationScope} message InstrumentationScope + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstrumentationScope.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.attributes = []; + if (options.defaults) { + object$1.name = ""; + object$1.version = ""; + object$1.droppedAttributesCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) object$1.version = message.version; + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; + return object$1; + }; + /** + * Converts this InstrumentationScope to JSON. + * @function toJSON + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @instance + * @returns {Object.} JSON object + */ + InstrumentationScope.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for InstrumentationScope + * @function getTypeUrl + * @memberof opentelemetry.proto.common.v1.InstrumentationScope + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstrumentationScope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.common.v1.InstrumentationScope"; + }; + return InstrumentationScope; + })(); + v1.EntityRef = (function() { + /** + * Properties of an EntityRef. + * @memberof opentelemetry.proto.common.v1 + * @interface IEntityRef + * @property {string|null} [schemaUrl] EntityRef schemaUrl + * @property {string|null} [type] EntityRef type + * @property {Array.|null} [idKeys] EntityRef idKeys + * @property {Array.|null} [descriptionKeys] EntityRef descriptionKeys + */ + /** + * Constructs a new EntityRef. + * @memberof opentelemetry.proto.common.v1 + * @classdesc Represents an EntityRef. + * @implements IEntityRef + * @constructor + * @param {opentelemetry.proto.common.v1.IEntityRef=} [properties] Properties to set + */ + function EntityRef(properties) { + this.idKeys = []; + this.descriptionKeys = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * EntityRef schemaUrl. + * @member {string|null|undefined} schemaUrl + * @memberof opentelemetry.proto.common.v1.EntityRef + * @instance + */ + EntityRef.prototype.schemaUrl = null; + /** + * EntityRef type. + * @member {string|null|undefined} type + * @memberof opentelemetry.proto.common.v1.EntityRef + * @instance + */ + EntityRef.prototype.type = null; + /** + * EntityRef idKeys. + * @member {Array.} idKeys + * @memberof opentelemetry.proto.common.v1.EntityRef + * @instance + */ + EntityRef.prototype.idKeys = $util.emptyArray; + /** + * EntityRef descriptionKeys. + * @member {Array.} descriptionKeys + * @memberof opentelemetry.proto.common.v1.EntityRef + * @instance + */ + EntityRef.prototype.descriptionKeys = $util.emptyArray; + /** + * Creates a new EntityRef instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {opentelemetry.proto.common.v1.IEntityRef=} [properties] Properties to set + * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef instance + */ + EntityRef.create = function create(properties) { + return new EntityRef(properties); + }; + /** + * Encodes the specified EntityRef message. Does not implicitly {@link opentelemetry.proto.common.v1.EntityRef.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {opentelemetry.proto.common.v1.IEntityRef} message EntityRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityRef.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(10).string(message.schemaUrl); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(18).string(message.type); + if (message.idKeys != null && message.idKeys.length) for (var i = 0; i < message.idKeys.length; ++i) writer.uint32(26).string(message.idKeys[i]); + if (message.descriptionKeys != null && message.descriptionKeys.length) for (var i = 0; i < message.descriptionKeys.length; ++i) writer.uint32(34).string(message.descriptionKeys[i]); + return writer; + }; + /** + * Encodes the specified EntityRef message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.EntityRef.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {opentelemetry.proto.common.v1.IEntityRef} message EntityRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an EntityRef message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityRef.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.EntityRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.schemaUrl = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + if (!(message.idKeys && message.idKeys.length)) message.idKeys = []; + message.idKeys.push(reader.string()); + break; + case 4: + if (!(message.descriptionKeys && message.descriptionKeys.length)) message.descriptionKeys = []; + message.descriptionKeys.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an EntityRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an EntityRef message. + * @function verify + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + if (!$util.isString(message.type)) return "type: string expected"; + } + if (message.idKeys != null && message.hasOwnProperty("idKeys")) { + if (!Array.isArray(message.idKeys)) return "idKeys: array expected"; + for (var i = 0; i < message.idKeys.length; ++i) if (!$util.isString(message.idKeys[i])) return "idKeys: string[] expected"; + } + if (message.descriptionKeys != null && message.hasOwnProperty("descriptionKeys")) { + if (!Array.isArray(message.descriptionKeys)) return "descriptionKeys: array expected"; + for (var i = 0; i < message.descriptionKeys.length; ++i) if (!$util.isString(message.descriptionKeys[i])) return "descriptionKeys: string[] expected"; + } + return null; + }; + /** + * Creates an EntityRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef + */ + EntityRef.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.common.v1.EntityRef) return object$1; + var message = new $root.opentelemetry.proto.common.v1.EntityRef(); + if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); + if (object$1.type != null) message.type = String(object$1.type); + if (object$1.idKeys) { + if (!Array.isArray(object$1.idKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected"); + message.idKeys = []; + for (var i = 0; i < object$1.idKeys.length; ++i) message.idKeys[i] = String(object$1.idKeys[i]); + } + if (object$1.descriptionKeys) { + if (!Array.isArray(object$1.descriptionKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected"); + message.descriptionKeys = []; + for (var i = 0; i < object$1.descriptionKeys.length; ++i) message.descriptionKeys[i] = String(object$1.descriptionKeys[i]); + } + return message; + }; + /** + * Creates a plain object from an EntityRef message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {opentelemetry.proto.common.v1.EntityRef} message EntityRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityRef.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) { + object$1.idKeys = []; + object$1.descriptionKeys = []; + } + if (options.defaults) { + object$1.schemaUrl = ""; + object$1.type = ""; + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; + if (message.type != null && message.hasOwnProperty("type")) object$1.type = message.type; + if (message.idKeys && message.idKeys.length) { + object$1.idKeys = []; + for (var j = 0; j < message.idKeys.length; ++j) object$1.idKeys[j] = message.idKeys[j]; + } + if (message.descriptionKeys && message.descriptionKeys.length) { + object$1.descriptionKeys = []; + for (var j = 0; j < message.descriptionKeys.length; ++j) object$1.descriptionKeys[j] = message.descriptionKeys[j]; + } + return object$1; + }; + /** + * Converts this EntityRef to JSON. + * @function toJSON + * @memberof opentelemetry.proto.common.v1.EntityRef + * @instance + * @returns {Object.} JSON object + */ + EntityRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for EntityRef + * @function getTypeUrl + * @memberof opentelemetry.proto.common.v1.EntityRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.common.v1.EntityRef"; + }; + return EntityRef; + })(); + return v1; + })(); + return common; + })(); + proto.resource = (function() { + /** + * Namespace resource. + * @memberof opentelemetry.proto + * @namespace + */ + var resource = {}; + resource.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.resource + * @namespace + */ + var v1 = {}; + v1.Resource = (function() { + /** + * Properties of a Resource. + * @memberof opentelemetry.proto.resource.v1 + * @interface IResource + * @property {Array.|null} [attributes] Resource attributes + * @property {number|null} [droppedAttributesCount] Resource droppedAttributesCount + * @property {Array.|null} [entityRefs] Resource entityRefs + */ + /** + * Constructs a new Resource. + * @memberof opentelemetry.proto.resource.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {opentelemetry.proto.resource.v1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + this.attributes = []; + this.entityRefs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Resource attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.resource.v1.Resource + * @instance + */ + Resource.prototype.attributes = $util.emptyArray; + /** + * Resource droppedAttributesCount. + * @member {number|null|undefined} droppedAttributesCount + * @memberof opentelemetry.proto.resource.v1.Resource + * @instance + */ + Resource.prototype.droppedAttributesCount = null; + /** + * Resource entityRefs. + * @member {Array.} entityRefs + * @memberof opentelemetry.proto.resource.v1.Resource + * @instance + */ + Resource.prototype.entityRefs = $util.emptyArray; + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {opentelemetry.proto.resource.v1.IResource=} [properties] Properties to set + * @returns {opentelemetry.proto.resource.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + /** + * Encodes the specified Resource message. Does not implicitly {@link opentelemetry.proto.resource.v1.Resource.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {opentelemetry.proto.resource.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(16).uint32(message.droppedAttributesCount); + if (message.entityRefs != null && message.entityRefs.length) for (var i = 0; i < message.entityRefs.length; ++i) $root.opentelemetry.proto.common.v1.EntityRef.encode(message.entityRefs[i], writer.uint32(26).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link opentelemetry.proto.resource.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {opentelemetry.proto.resource.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.resource.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.resource.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 2: + message.droppedAttributesCount = reader.uint32(); + break; + case 3: + if (!(message.entityRefs && message.entityRefs.length)) message.entityRefs = []; + message.entityRefs.push($root.opentelemetry.proto.common.v1.EntityRef.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.resource.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Resource message. + * @function verify + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; + } + if (message.entityRefs != null && message.hasOwnProperty("entityRefs")) { + if (!Array.isArray(message.entityRefs)) return "entityRefs: array expected"; + for (var i = 0; i < message.entityRefs.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.EntityRef.verify(message.entityRefs[i]); + if (error) return "entityRefs." + error; + } + } + return null; + }; + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.resource.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.resource.v1.Resource) return object$1; + var message = new $root.opentelemetry.proto.resource.v1.Resource(); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; + if (object$1.entityRefs) { + if (!Array.isArray(object$1.entityRefs)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected"); + message.entityRefs = []; + for (var i = 0; i < object$1.entityRefs.length; ++i) { + if (typeof object$1.entityRefs[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected"); + message.entityRefs[i] = $root.opentelemetry.proto.common.v1.EntityRef.fromObject(object$1.entityRefs[i]); + } + } + return message; + }; + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {opentelemetry.proto.resource.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) { + object$1.attributes = []; + object$1.entityRefs = []; + } + if (options.defaults) object$1.droppedAttributesCount = 0; + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; + if (message.entityRefs && message.entityRefs.length) { + object$1.entityRefs = []; + for (var j = 0; j < message.entityRefs.length; ++j) object$1.entityRefs[j] = $root.opentelemetry.proto.common.v1.EntityRef.toObject(message.entityRefs[j], options); + } + return object$1; + }; + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof opentelemetry.proto.resource.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof opentelemetry.proto.resource.v1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.resource.v1.Resource"; + }; + return Resource; + })(); + return v1; + })(); + return resource; + })(); + proto.trace = (function() { + /** + * Namespace trace. + * @memberof opentelemetry.proto + * @namespace + */ + var trace$1 = {}; + trace$1.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.trace + * @namespace + */ + var v1 = {}; + v1.TracesData = (function() { + /** + * Properties of a TracesData. + * @memberof opentelemetry.proto.trace.v1 + * @interface ITracesData + * @property {Array.|null} [resourceSpans] TracesData resourceSpans + */ + /** + * Constructs a new TracesData. + * @memberof opentelemetry.proto.trace.v1 + * @classdesc Represents a TracesData. + * @implements ITracesData + * @constructor + * @param {opentelemetry.proto.trace.v1.ITracesData=} [properties] Properties to set + */ + function TracesData(properties) { + this.resourceSpans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * TracesData resourceSpans. + * @member {Array.} resourceSpans + * @memberof opentelemetry.proto.trace.v1.TracesData + * @instance + */ + TracesData.prototype.resourceSpans = $util.emptyArray; + /** + * Creates a new TracesData instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {opentelemetry.proto.trace.v1.ITracesData=} [properties] Properties to set + * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData instance + */ + TracesData.create = function create(properties) { + return new TracesData(properties); + }; + /** + * Encodes the specified TracesData message. Does not implicitly {@link opentelemetry.proto.trace.v1.TracesData.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {opentelemetry.proto.trace.v1.ITracesData} message TracesData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TracesData.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resourceSpans != null && message.resourceSpans.length) for (var i = 0; i < message.resourceSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified TracesData message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.TracesData.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {opentelemetry.proto.trace.v1.ITracesData} message TracesData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TracesData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a TracesData message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TracesData.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.TracesData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.resourceSpans && message.resourceSpans.length)) message.resourceSpans = []; + message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a TracesData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TracesData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a TracesData message. + * @function verify + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TracesData.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { + if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; + for (var i = 0; i < message.resourceSpans.length; ++i) { + var error = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); + if (error) return "resourceSpans." + error; + } + } + return null; + }; + /** + * Creates a TracesData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData + */ + TracesData.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.trace.v1.TracesData) return object$1; + var message = new $root.opentelemetry.proto.trace.v1.TracesData(); + if (object$1.resourceSpans) { + if (!Array.isArray(object$1.resourceSpans)) throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected"); + message.resourceSpans = []; + for (var i = 0; i < object$1.resourceSpans.length; ++i) { + if (typeof object$1.resourceSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected"); + message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object$1.resourceSpans[i]); + } + } + return message; + }; + /** + * Creates a plain object from a TracesData message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {opentelemetry.proto.trace.v1.TracesData} message TracesData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TracesData.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.resourceSpans = []; + if (message.resourceSpans && message.resourceSpans.length) { + object$1.resourceSpans = []; + for (var j = 0; j < message.resourceSpans.length; ++j) object$1.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); + } + return object$1; + }; + /** + * Converts this TracesData to JSON. + * @function toJSON + * @memberof opentelemetry.proto.trace.v1.TracesData + * @instance + * @returns {Object.} JSON object + */ + TracesData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for TracesData + * @function getTypeUrl + * @memberof opentelemetry.proto.trace.v1.TracesData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TracesData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.TracesData"; + }; + return TracesData; + })(); + v1.ResourceSpans = (function() { + /** + * Properties of a ResourceSpans. + * @memberof opentelemetry.proto.trace.v1 + * @interface IResourceSpans + * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceSpans resource + * @property {Array.|null} [scopeSpans] ResourceSpans scopeSpans + * @property {string|null} [schemaUrl] ResourceSpans schemaUrl + */ + /** + * Constructs a new ResourceSpans. + * @memberof opentelemetry.proto.trace.v1 + * @classdesc Represents a ResourceSpans. + * @implements IResourceSpans + * @constructor + * @param {opentelemetry.proto.trace.v1.IResourceSpans=} [properties] Properties to set + */ + function ResourceSpans(properties) { + this.scopeSpans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ResourceSpans resource. + * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @instance + */ + ResourceSpans.prototype.resource = null; + /** + * ResourceSpans scopeSpans. + * @member {Array.} scopeSpans + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @instance + */ + ResourceSpans.prototype.scopeSpans = $util.emptyArray; + /** + * ResourceSpans schemaUrl. + * @member {string|null|undefined} schemaUrl + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @instance + */ + ResourceSpans.prototype.schemaUrl = null; + /** + * Creates a new ResourceSpans instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {opentelemetry.proto.trace.v1.IResourceSpans=} [properties] Properties to set + * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans instance + */ + ResourceSpans.create = function create(properties) { + return new ResourceSpans(properties); + }; + /** + * Encodes the specified ResourceSpans message. Does not implicitly {@link opentelemetry.proto.trace.v1.ResourceSpans.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {opentelemetry.proto.trace.v1.IResourceSpans} message ResourceSpans message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSpans.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + if (message.scopeSpans != null && message.scopeSpans.length) for (var i = 0; i < message.scopeSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ScopeSpans.encode(message.scopeSpans[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); + return writer; + }; + /** + * Encodes the specified ResourceSpans message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.ResourceSpans.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {opentelemetry.proto.trace.v1.IResourceSpans} message ResourceSpans message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSpans.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a ResourceSpans message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSpans.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ResourceSpans(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.scopeSpans && message.scopeSpans.length)) message.scopeSpans = []; + message.scopeSpans.push($root.opentelemetry.proto.trace.v1.ScopeSpans.decode(reader, reader.uint32())); + break; + case 3: + message.schemaUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a ResourceSpans message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSpans.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a ResourceSpans message. + * @function verify + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSpans.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error) return "resource." + error; + } + if (message.scopeSpans != null && message.hasOwnProperty("scopeSpans")) { + if (!Array.isArray(message.scopeSpans)) return "scopeSpans: array expected"; + for (var i = 0; i < message.scopeSpans.length; ++i) { + var error = $root.opentelemetry.proto.trace.v1.ScopeSpans.verify(message.scopeSpans[i]); + if (error) return "scopeSpans." + error; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; + } + return null; + }; + /** + * Creates a ResourceSpans message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans + */ + ResourceSpans.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.trace.v1.ResourceSpans) return object$1; + var message = new $root.opentelemetry.proto.trace.v1.ResourceSpans(); + if (object$1.resource != null) { + if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); + } + if (object$1.scopeSpans) { + if (!Array.isArray(object$1.scopeSpans)) throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected"); + message.scopeSpans = []; + for (var i = 0; i < object$1.scopeSpans.length; ++i) { + if (typeof object$1.scopeSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected"); + message.scopeSpans[i] = $root.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(object$1.scopeSpans[i]); + } + } + if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); + return message; + }; + /** + * Creates a plain object from a ResourceSpans message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {opentelemetry.proto.trace.v1.ResourceSpans} message ResourceSpans + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSpans.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.scopeSpans = []; + if (options.defaults) { + object$1.resource = null; + object$1.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeSpans && message.scopeSpans.length) { + object$1.scopeSpans = []; + for (var j = 0; j < message.scopeSpans.length; ++j) object$1.scopeSpans[j] = $root.opentelemetry.proto.trace.v1.ScopeSpans.toObject(message.scopeSpans[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; + return object$1; + }; + /** + * Converts this ResourceSpans to JSON. + * @function toJSON + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @instance + * @returns {Object.} JSON object + */ + ResourceSpans.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ResourceSpans + * @function getTypeUrl + * @memberof opentelemetry.proto.trace.v1.ResourceSpans + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ResourceSpans"; + }; + return ResourceSpans; + })(); + v1.ScopeSpans = (function() { + /** + * Properties of a ScopeSpans. + * @memberof opentelemetry.proto.trace.v1 + * @interface IScopeSpans + * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeSpans scope + * @property {Array.|null} [spans] ScopeSpans spans + * @property {string|null} [schemaUrl] ScopeSpans schemaUrl + */ + /** + * Constructs a new ScopeSpans. + * @memberof opentelemetry.proto.trace.v1 + * @classdesc Represents a ScopeSpans. + * @implements IScopeSpans + * @constructor + * @param {opentelemetry.proto.trace.v1.IScopeSpans=} [properties] Properties to set + */ + function ScopeSpans(properties) { + this.spans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ScopeSpans scope. + * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @instance + */ + ScopeSpans.prototype.scope = null; + /** + * ScopeSpans spans. + * @member {Array.} spans + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @instance + */ + ScopeSpans.prototype.spans = $util.emptyArray; + /** + * ScopeSpans schemaUrl. + * @member {string|null|undefined} schemaUrl + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @instance + */ + ScopeSpans.prototype.schemaUrl = null; + /** + * Creates a new ScopeSpans instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {opentelemetry.proto.trace.v1.IScopeSpans=} [properties] Properties to set + * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans instance + */ + ScopeSpans.create = function create(properties) { + return new ScopeSpans(properties); + }; + /** + * Encodes the specified ScopeSpans message. Does not implicitly {@link opentelemetry.proto.trace.v1.ScopeSpans.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {opentelemetry.proto.trace.v1.IScopeSpans} message ScopeSpans message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScopeSpans.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); + if (message.spans != null && message.spans.length) for (var i = 0; i < message.spans.length; ++i) $root.opentelemetry.proto.trace.v1.Span.encode(message.spans[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); + return writer; + }; + /** + * Encodes the specified ScopeSpans message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.ScopeSpans.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {opentelemetry.proto.trace.v1.IScopeSpans} message ScopeSpans message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScopeSpans.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a ScopeSpans message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScopeSpans.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ScopeSpans(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.spans && message.spans.length)) message.spans = []; + message.spans.push($root.opentelemetry.proto.trace.v1.Span.decode(reader, reader.uint32())); + break; + case 3: + message.schemaUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a ScopeSpans message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScopeSpans.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a ScopeSpans message. + * @function verify + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScopeSpans.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) { + var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error) return "scope." + error; + } + if (message.spans != null && message.hasOwnProperty("spans")) { + if (!Array.isArray(message.spans)) return "spans: array expected"; + for (var i = 0; i < message.spans.length; ++i) { + var error = $root.opentelemetry.proto.trace.v1.Span.verify(message.spans[i]); + if (error) return "spans." + error; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; + } + return null; + }; + /** + * Creates a ScopeSpans message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans + */ + ScopeSpans.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.trace.v1.ScopeSpans) return object$1; + var message = new $root.opentelemetry.proto.trace.v1.ScopeSpans(); + if (object$1.scope != null) { + if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); + } + if (object$1.spans) { + if (!Array.isArray(object$1.spans)) throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected"); + message.spans = []; + for (var i = 0; i < object$1.spans.length; ++i) { + if (typeof object$1.spans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected"); + message.spans[i] = $root.opentelemetry.proto.trace.v1.Span.fromObject(object$1.spans[i]); + } + } + if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); + return message; + }; + /** + * Creates a plain object from a ScopeSpans message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {opentelemetry.proto.trace.v1.ScopeSpans} message ScopeSpans + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScopeSpans.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.spans = []; + if (options.defaults) { + object$1.scope = null; + object$1.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.spans && message.spans.length) { + object$1.spans = []; + for (var j = 0; j < message.spans.length; ++j) object$1.spans[j] = $root.opentelemetry.proto.trace.v1.Span.toObject(message.spans[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; + return object$1; + }; + /** + * Converts this ScopeSpans to JSON. + * @function toJSON + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @instance + * @returns {Object.} JSON object + */ + ScopeSpans.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ScopeSpans + * @function getTypeUrl + * @memberof opentelemetry.proto.trace.v1.ScopeSpans + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScopeSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ScopeSpans"; + }; + return ScopeSpans; + })(); + v1.Span = (function() { + /** + * Properties of a Span. + * @memberof opentelemetry.proto.trace.v1 + * @interface ISpan + * @property {Uint8Array|null} [traceId] Span traceId + * @property {Uint8Array|null} [spanId] Span spanId + * @property {string|null} [traceState] Span traceState + * @property {Uint8Array|null} [parentSpanId] Span parentSpanId + * @property {number|null} [flags] Span flags + * @property {string|null} [name] Span name + * @property {opentelemetry.proto.trace.v1.Span.SpanKind|null} [kind] Span kind + * @property {number|Long|null} [startTimeUnixNano] Span startTimeUnixNano + * @property {number|Long|null} [endTimeUnixNano] Span endTimeUnixNano + * @property {Array.|null} [attributes] Span attributes + * @property {number|null} [droppedAttributesCount] Span droppedAttributesCount + * @property {Array.|null} [events] Span events + * @property {number|null} [droppedEventsCount] Span droppedEventsCount + * @property {Array.|null} [links] Span links + * @property {number|null} [droppedLinksCount] Span droppedLinksCount + * @property {opentelemetry.proto.trace.v1.IStatus|null} [status] Span status + */ + /** + * Constructs a new Span. + * @memberof opentelemetry.proto.trace.v1 + * @classdesc Represents a Span. + * @implements ISpan + * @constructor + * @param {opentelemetry.proto.trace.v1.ISpan=} [properties] Properties to set + */ + function Span(properties) { + this.attributes = []; + this.events = []; + this.links = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Span traceId. + * @member {Uint8Array|null|undefined} traceId + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.traceId = null; + /** + * Span spanId. + * @member {Uint8Array|null|undefined} spanId + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.spanId = null; + /** + * Span traceState. + * @member {string|null|undefined} traceState + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.traceState = null; + /** + * Span parentSpanId. + * @member {Uint8Array|null|undefined} parentSpanId + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.parentSpanId = null; + /** + * Span flags. + * @member {number|null|undefined} flags + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.flags = null; + /** + * Span name. + * @member {string|null|undefined} name + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.name = null; + /** + * Span kind. + * @member {opentelemetry.proto.trace.v1.Span.SpanKind|null|undefined} kind + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.kind = null; + /** + * Span startTimeUnixNano. + * @member {number|Long|null|undefined} startTimeUnixNano + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.startTimeUnixNano = null; + /** + * Span endTimeUnixNano. + * @member {number|Long|null|undefined} endTimeUnixNano + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.endTimeUnixNano = null; + /** + * Span attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.attributes = $util.emptyArray; + /** + * Span droppedAttributesCount. + * @member {number|null|undefined} droppedAttributesCount + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.droppedAttributesCount = null; + /** + * Span events. + * @member {Array.} events + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.events = $util.emptyArray; + /** + * Span droppedEventsCount. + * @member {number|null|undefined} droppedEventsCount + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.droppedEventsCount = null; + /** + * Span links. + * @member {Array.} links + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.links = $util.emptyArray; + /** + * Span droppedLinksCount. + * @member {number|null|undefined} droppedLinksCount + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.droppedLinksCount = null; + /** + * Span status. + * @member {opentelemetry.proto.trace.v1.IStatus|null|undefined} status + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + */ + Span.prototype.status = null; + /** + * Creates a new Span instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {opentelemetry.proto.trace.v1.ISpan=} [properties] Properties to set + * @returns {opentelemetry.proto.trace.v1.Span} Span instance + */ + Span.create = function create(properties) { + return new Span(properties); + }; + /** + * Encodes the specified Span message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {opentelemetry.proto.trace.v1.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(10).bytes(message.traceId); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(18).bytes(message.spanId); + if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) writer.uint32(26).string(message.traceState); + if (message.parentSpanId != null && Object.hasOwnProperty.call(message, "parentSpanId")) writer.uint32(34).bytes(message.parentSpanId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(42).string(message.name); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(48).int32(message.kind); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(57).fixed64(message.startTimeUnixNano); + if (message.endTimeUnixNano != null && Object.hasOwnProperty.call(message, "endTimeUnixNano")) writer.uint32(65).fixed64(message.endTimeUnixNano); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(80).uint32(message.droppedAttributesCount); + if (message.events != null && message.events.length) for (var i = 0; i < message.events.length; ++i) $root.opentelemetry.proto.trace.v1.Span.Event.encode(message.events[i], writer.uint32(90).fork()).ldelim(); + if (message.droppedEventsCount != null && Object.hasOwnProperty.call(message, "droppedEventsCount")) writer.uint32(96).uint32(message.droppedEventsCount); + if (message.links != null && message.links.length) for (var i = 0; i < message.links.length; ++i) $root.opentelemetry.proto.trace.v1.Span.Link.encode(message.links[i], writer.uint32(106).fork()).ldelim(); + if (message.droppedLinksCount != null && Object.hasOwnProperty.call(message, "droppedLinksCount")) writer.uint32(112).uint32(message.droppedLinksCount); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) $root.opentelemetry.proto.trace.v1.Status.encode(message.status, writer.uint32(122).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(133).fixed32(message.flags); + return writer; + }; + /** + * Encodes the specified Span message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {opentelemetry.proto.trace.v1.ISpan} message Span message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Span.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Span message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.trace.v1.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.traceId = reader.bytes(); + break; + case 2: + message.spanId = reader.bytes(); + break; + case 3: + message.traceState = reader.string(); + break; + case 4: + message.parentSpanId = reader.bytes(); + break; + case 16: + message.flags = reader.fixed32(); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.kind = reader.int32(); + break; + case 7: + message.startTimeUnixNano = reader.fixed64(); + break; + case 8: + message.endTimeUnixNano = reader.fixed64(); + break; + case 9: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 10: + message.droppedAttributesCount = reader.uint32(); + break; + case 11: + if (!(message.events && message.events.length)) message.events = []; + message.events.push($root.opentelemetry.proto.trace.v1.Span.Event.decode(reader, reader.uint32())); + break; + case 12: + message.droppedEventsCount = reader.uint32(); + break; + case 13: + if (!(message.links && message.links.length)) message.links = []; + message.links.push($root.opentelemetry.proto.trace.v1.Span.Link.decode(reader, reader.uint32())); + break; + case 14: + message.droppedLinksCount = reader.uint32(); + break; + case 15: + message.status = $root.opentelemetry.proto.trace.v1.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Span message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.trace.v1.Span} Span + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Span.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Span message. + * @function verify + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Span.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; + } + if (message.traceState != null && message.hasOwnProperty("traceState")) { + if (!$util.isString(message.traceState)) return "traceState: string expected"; + } + if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) { + if (!(message.parentSpanId && typeof message.parentSpanId.length === "number" || $util.isString(message.parentSpanId))) return "parentSpanId: buffer expected"; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) return "flags: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) return "name: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) switch (message.kind) { + default: return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: break; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; + } + if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) { + if (!$util.isInteger(message.endTimeUnixNano) && !(message.endTimeUnixNano && $util.isInteger(message.endTimeUnixNano.low) && $util.isInteger(message.endTimeUnixNano.high))) return "endTimeUnixNano: integer|Long expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; + } + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) { + var error = $root.opentelemetry.proto.trace.v1.Span.Event.verify(message.events[i]); + if (error) return "events." + error; + } + } + if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) { + if (!$util.isInteger(message.droppedEventsCount)) return "droppedEventsCount: integer expected"; + } + if (message.links != null && message.hasOwnProperty("links")) { + if (!Array.isArray(message.links)) return "links: array expected"; + for (var i = 0; i < message.links.length; ++i) { + var error = $root.opentelemetry.proto.trace.v1.Span.Link.verify(message.links[i]); + if (error) return "links." + error; + } + } + if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) { + if (!$util.isInteger(message.droppedLinksCount)) return "droppedLinksCount: integer expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.opentelemetry.proto.trace.v1.Status.verify(message.status); + if (error) return "status." + error; + } + return null; + }; + /** + * Creates a Span message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.trace.v1.Span} Span + */ + Span.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span) return object$1; + var message = new $root.opentelemetry.proto.trace.v1.Span(); + if (object$1.traceId != null) { + if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); + else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; + } + if (object$1.spanId != null) { + if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); + else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; + } + if (object$1.traceState != null) message.traceState = String(object$1.traceState); + if (object$1.parentSpanId != null) { + if (typeof object$1.parentSpanId === "string") $util.base64.decode(object$1.parentSpanId, message.parentSpanId = $util.newBuffer($util.base64.length(object$1.parentSpanId)), 0); + else if (object$1.parentSpanId.length >= 0) message.parentSpanId = object$1.parentSpanId; + } + if (object$1.flags != null) message.flags = object$1.flags >>> 0; + if (object$1.name != null) message.name = String(object$1.name); + switch (object$1.kind) { + default: + if (typeof object$1.kind === "number") { + message.kind = object$1.kind; + break; + } + break; + case "SPAN_KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "SPAN_KIND_INTERNAL": + case 1: + message.kind = 1; + break; + case "SPAN_KIND_SERVER": + case 2: + message.kind = 2; + break; + case "SPAN_KIND_CLIENT": + case 3: + message.kind = 3; + break; + case "SPAN_KIND_PRODUCER": + case 4: + message.kind = 4; + break; + case "SPAN_KIND_CONSUMER": + case 5: + message.kind = 5; + break; + } + if (object$1.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; + else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); + else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; + else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object$1.endTimeUnixNano != null) { + if ($util.Long) (message.endTimeUnixNano = $util.Long.fromValue(object$1.endTimeUnixNano)).unsigned = false; + else if (typeof object$1.endTimeUnixNano === "string") message.endTimeUnixNano = parseInt(object$1.endTimeUnixNano, 10); + else if (typeof object$1.endTimeUnixNano === "number") message.endTimeUnixNano = object$1.endTimeUnixNano; + else if (typeof object$1.endTimeUnixNano === "object") message.endTimeUnixNano = new $util.LongBits(object$1.endTimeUnixNano.low >>> 0, object$1.endTimeUnixNano.high >>> 0).toNumber(); + } + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; + if (object$1.events) { + if (!Array.isArray(object$1.events)) throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected"); + message.events = []; + for (var i = 0; i < object$1.events.length; ++i) { + if (typeof object$1.events[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected"); + message.events[i] = $root.opentelemetry.proto.trace.v1.Span.Event.fromObject(object$1.events[i]); + } + } + if (object$1.droppedEventsCount != null) message.droppedEventsCount = object$1.droppedEventsCount >>> 0; + if (object$1.links) { + if (!Array.isArray(object$1.links)) throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected"); + message.links = []; + for (var i = 0; i < object$1.links.length; ++i) { + if (typeof object$1.links[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected"); + message.links[i] = $root.opentelemetry.proto.trace.v1.Span.Link.fromObject(object$1.links[i]); + } + } + if (object$1.droppedLinksCount != null) message.droppedLinksCount = object$1.droppedLinksCount >>> 0; + if (object$1.status != null) { + if (typeof object$1.status !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected"); + message.status = $root.opentelemetry.proto.trace.v1.Status.fromObject(object$1.status); + } + return message; + }; + /** + * Creates a plain object from a Span message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {opentelemetry.proto.trace.v1.Span} message Span + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Span.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) { + object$1.attributes = []; + object$1.events = []; + object$1.links = []; + } + if (options.defaults) { + if (options.bytes === String) object$1.traceId = ""; + else { + object$1.traceId = []; + if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); + } + if (options.bytes === String) object$1.spanId = ""; + else { + object$1.spanId = []; + if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); + } + object$1.traceState = ""; + if (options.bytes === String) object$1.parentSpanId = ""; + else { + object$1.parentSpanId = []; + if (options.bytes !== Array) object$1.parentSpanId = $util.newBuffer(object$1.parentSpanId); + } + object$1.name = ""; + object$1.kind = options.enums === String ? "SPAN_KIND_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.endTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.endTimeUnixNano = options.longs === String ? "0" : 0; + object$1.droppedAttributesCount = 0; + object$1.droppedEventsCount = 0; + object$1.droppedLinksCount = 0; + object$1.status = null; + object$1.flags = 0; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.traceState != null && message.hasOwnProperty("traceState")) object$1.traceState = message.traceState; + if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) object$1.parentSpanId = options.bytes === String ? $util.base64.encode(message.parentSpanId, 0, message.parentSpanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.parentSpanId) : message.parentSpanId; + if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; + if (message.kind != null && message.hasOwnProperty("kind")) object$1.kind = options.enums === String ? $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] === void 0 ? message.kind : $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] : message.kind; + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) if (typeof message.endTimeUnixNano === "number") object$1.endTimeUnixNano = options.longs === String ? String(message.endTimeUnixNano) : message.endTimeUnixNano; + else object$1.endTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.endTimeUnixNano.low >>> 0, message.endTimeUnixNano.high >>> 0).toNumber() : message.endTimeUnixNano; + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; + if (message.events && message.events.length) { + object$1.events = []; + for (var j = 0; j < message.events.length; ++j) object$1.events[j] = $root.opentelemetry.proto.trace.v1.Span.Event.toObject(message.events[j], options); + } + if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) object$1.droppedEventsCount = message.droppedEventsCount; + if (message.links && message.links.length) { + object$1.links = []; + for (var j = 0; j < message.links.length; ++j) object$1.links[j] = $root.opentelemetry.proto.trace.v1.Span.Link.toObject(message.links[j], options); + } + if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) object$1.droppedLinksCount = message.droppedLinksCount; + if (message.status != null && message.hasOwnProperty("status")) object$1.status = $root.opentelemetry.proto.trace.v1.Status.toObject(message.status, options); + if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; + return object$1; + }; + /** + * Converts this Span to JSON. + * @function toJSON + * @memberof opentelemetry.proto.trace.v1.Span + * @instance + * @returns {Object.} JSON object + */ + Span.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Span + * @function getTypeUrl + * @memberof opentelemetry.proto.trace.v1.Span + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span"; + }; + /** + * SpanKind enum. + * @name opentelemetry.proto.trace.v1.Span.SpanKind + * @enum {number} + * @property {number} SPAN_KIND_UNSPECIFIED=0 SPAN_KIND_UNSPECIFIED value + * @property {number} SPAN_KIND_INTERNAL=1 SPAN_KIND_INTERNAL value + * @property {number} SPAN_KIND_SERVER=2 SPAN_KIND_SERVER value + * @property {number} SPAN_KIND_CLIENT=3 SPAN_KIND_CLIENT value + * @property {number} SPAN_KIND_PRODUCER=4 SPAN_KIND_PRODUCER value + * @property {number} SPAN_KIND_CONSUMER=5 SPAN_KIND_CONSUMER value + */ + Span.SpanKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPAN_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPAN_KIND_INTERNAL"] = 1; + values[valuesById[2] = "SPAN_KIND_SERVER"] = 2; + values[valuesById[3] = "SPAN_KIND_CLIENT"] = 3; + values[valuesById[4] = "SPAN_KIND_PRODUCER"] = 4; + values[valuesById[5] = "SPAN_KIND_CONSUMER"] = 5; + return values; + })(); + Span.Event = (function() { + /** + * Properties of an Event. + * @memberof opentelemetry.proto.trace.v1.Span + * @interface IEvent + * @property {number|Long|null} [timeUnixNano] Event timeUnixNano + * @property {string|null} [name] Event name + * @property {Array.|null} [attributes] Event attributes + * @property {number|null} [droppedAttributesCount] Event droppedAttributesCount + */ + /** + * Constructs a new Event. + * @memberof opentelemetry.proto.trace.v1.Span + * @classdesc Represents an Event. + * @implements IEvent + * @constructor + * @param {opentelemetry.proto.trace.v1.Span.IEvent=} [properties] Properties to set + */ + function Event(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Event timeUnixNano. + * @member {number|Long|null|undefined} timeUnixNano + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @instance + */ + Event.prototype.timeUnixNano = null; + /** + * Event name. + * @member {string|null|undefined} name + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @instance + */ + Event.prototype.name = null; + /** + * Event attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @instance + */ + Event.prototype.attributes = $util.emptyArray; + /** + * Event droppedAttributesCount. + * @member {number|null|undefined} droppedAttributesCount + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @instance + */ + Event.prototype.droppedAttributesCount = null; + /** + * Creates a new Event instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {opentelemetry.proto.trace.v1.Span.IEvent=} [properties] Properties to set + * @returns {opentelemetry.proto.trace.v1.Span.Event} Event instance + */ + Event.create = function create(properties) { + return new Event(properties); + }; + /** + * Encodes the specified Event message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Event.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {opentelemetry.proto.trace.v1.Span.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(9).fixed64(message.timeUnixNano); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(18).string(message.name); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); + return writer; + }; + /** + * Encodes the specified Event message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Event.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {opentelemetry.proto.trace.v1.Span.IEvent} message Event message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an Event message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.trace.v1.Span.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Event(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.timeUnixNano = reader.fixed64(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 4: + message.droppedAttributesCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an Event message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.trace.v1.Span.Event} Event + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an Event message. + * @function verify + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) return "name: string expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; + } + return null; + }; + /** + * Creates an Event message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.trace.v1.Span.Event} Event + */ + Event.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span.Event) return object$1; + var message = new $root.opentelemetry.proto.trace.v1.Span.Event(); + if (object$1.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; + else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); + else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; + else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); + } + if (object$1.name != null) message.name = String(object$1.name); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; + return message; + }; + /** + * Creates a plain object from an Event message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {opentelemetry.proto.trace.v1.Span.Event} message Event + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Event.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.attributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.timeUnixNano = options.longs === String ? "0" : 0; + object$1.name = ""; + object$1.droppedAttributesCount = 0; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; + return object$1; + }; + /** + * Converts this Event to JSON. + * @function toJSON + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @instance + * @returns {Object.} JSON object + */ + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Event + * @function getTypeUrl + * @memberof opentelemetry.proto.trace.v1.Span.Event + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Event"; + }; + return Event; + })(); + Span.Link = (function() { + /** + * Properties of a Link. + * @memberof opentelemetry.proto.trace.v1.Span + * @interface ILink + * @property {Uint8Array|null} [traceId] Link traceId + * @property {Uint8Array|null} [spanId] Link spanId + * @property {string|null} [traceState] Link traceState + * @property {Array.|null} [attributes] Link attributes + * @property {number|null} [droppedAttributesCount] Link droppedAttributesCount + * @property {number|null} [flags] Link flags + */ + /** + * Constructs a new Link. + * @memberof opentelemetry.proto.trace.v1.Span + * @classdesc Represents a Link. + * @implements ILink + * @constructor + * @param {opentelemetry.proto.trace.v1.Span.ILink=} [properties] Properties to set + */ + function Link(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Link traceId. + * @member {Uint8Array|null|undefined} traceId + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @instance + */ + Link.prototype.traceId = null; + /** + * Link spanId. + * @member {Uint8Array|null|undefined} spanId + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @instance + */ + Link.prototype.spanId = null; + /** + * Link traceState. + * @member {string|null|undefined} traceState + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @instance + */ + Link.prototype.traceState = null; + /** + * Link attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @instance + */ + Link.prototype.attributes = $util.emptyArray; + /** + * Link droppedAttributesCount. + * @member {number|null|undefined} droppedAttributesCount + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @instance + */ + Link.prototype.droppedAttributesCount = null; + /** + * Link flags. + * @member {number|null|undefined} flags + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @instance + */ + Link.prototype.flags = null; + /** + * Creates a new Link instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {opentelemetry.proto.trace.v1.Span.ILink=} [properties] Properties to set + * @returns {opentelemetry.proto.trace.v1.Span.Link} Link instance + */ + Link.create = function create(properties) { + return new Link(properties); + }; + /** + * Encodes the specified Link message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Link.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {opentelemetry.proto.trace.v1.Span.ILink} message Link message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Link.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(10).bytes(message.traceId); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(18).bytes(message.spanId); + if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) writer.uint32(26).string(message.traceState); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(34).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(40).uint32(message.droppedAttributesCount); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(53).fixed32(message.flags); + return writer; + }; + /** + * Encodes the specified Link message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Link.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {opentelemetry.proto.trace.v1.Span.ILink} message Link message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Link.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Link message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.trace.v1.Span.Link} Link + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Link.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Link(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.traceId = reader.bytes(); + break; + case 2: + message.spanId = reader.bytes(); + break; + case 3: + message.traceState = reader.string(); + break; + case 4: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 5: + message.droppedAttributesCount = reader.uint32(); + break; + case 6: + message.flags = reader.fixed32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Link message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.trace.v1.Span.Link} Link + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Link.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Link message. + * @function verify + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Link.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; + } + if (message.traceState != null && message.hasOwnProperty("traceState")) { + if (!$util.isString(message.traceState)) return "traceState: string expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) return "flags: integer expected"; + } + return null; + }; + /** + * Creates a Link message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.trace.v1.Span.Link} Link + */ + Link.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span.Link) return object$1; + var message = new $root.opentelemetry.proto.trace.v1.Span.Link(); + if (object$1.traceId != null) { + if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); + else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; + } + if (object$1.spanId != null) { + if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); + else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; + } + if (object$1.traceState != null) message.traceState = String(object$1.traceState); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; + if (object$1.flags != null) message.flags = object$1.flags >>> 0; + return message; + }; + /** + * Creates a plain object from a Link message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {opentelemetry.proto.trace.v1.Span.Link} message Link + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Link.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.attributes = []; + if (options.defaults) { + if (options.bytes === String) object$1.traceId = ""; + else { + object$1.traceId = []; + if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); + } + if (options.bytes === String) object$1.spanId = ""; + else { + object$1.spanId = []; + if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); + } + object$1.traceState = ""; + object$1.droppedAttributesCount = 0; + object$1.flags = 0; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.traceState != null && message.hasOwnProperty("traceState")) object$1.traceState = message.traceState; + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; + if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; + return object$1; + }; + /** + * Converts this Link to JSON. + * @function toJSON + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @instance + * @returns {Object.} JSON object + */ + Link.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Link + * @function getTypeUrl + * @memberof opentelemetry.proto.trace.v1.Span.Link + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Link.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Link"; + }; + return Link; + })(); + return Span; + })(); + v1.Status = (function() { + /** + * Properties of a Status. + * @memberof opentelemetry.proto.trace.v1 + * @interface IStatus + * @property {string|null} [message] Status message + * @property {opentelemetry.proto.trace.v1.Status.StatusCode|null} [code] Status code + */ + /** + * Constructs a new Status. + * @memberof opentelemetry.proto.trace.v1 + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {opentelemetry.proto.trace.v1.IStatus=} [properties] Properties to set + */ + function Status(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Status message. + * @member {string|null|undefined} message + * @memberof opentelemetry.proto.trace.v1.Status + * @instance + */ + Status.prototype.message = null; + /** + * Status code. + * @member {opentelemetry.proto.trace.v1.Status.StatusCode|null|undefined} code + * @memberof opentelemetry.proto.trace.v1.Status + * @instance + */ + Status.prototype.code = null; + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {opentelemetry.proto.trace.v1.IStatus=} [properties] Properties to set + * @returns {opentelemetry.proto.trace.v1.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + /** + * Encodes the specified Status message. Does not implicitly {@link opentelemetry.proto.trace.v1.Status.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {opentelemetry.proto.trace.v1.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(18).string(message.message); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(24).int32(message.code); + return writer; + }; + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {opentelemetry.proto.trace.v1.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.trace.v1.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 2: + message.message = reader.string(); + break; + case 3: + message.code = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.trace.v1.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Status message. + * @function verify + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + if (!$util.isString(message.message)) return "message: string expected"; + } + if (message.code != null && message.hasOwnProperty("code")) switch (message.code) { + default: return "code: enum value expected"; + case 0: + case 1: + case 2: break; + } + return null; + }; + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.trace.v1.Status} Status + */ + Status.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Status) return object$1; + var message = new $root.opentelemetry.proto.trace.v1.Status(); + if (object$1.message != null) message.message = String(object$1.message); + switch (object$1.code) { + default: + if (typeof object$1.code === "number") { + message.code = object$1.code; + break; + } + break; + case "STATUS_CODE_UNSET": + case 0: + message.code = 0; + break; + case "STATUS_CODE_OK": + case 1: + message.code = 1; + break; + case "STATUS_CODE_ERROR": + case 2: + message.code = 2; + break; + } + return message; + }; + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {opentelemetry.proto.trace.v1.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) { + object$1.message = ""; + object$1.code = options.enums === String ? "STATUS_CODE_UNSET" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) object$1.message = message.message; + if (message.code != null && message.hasOwnProperty("code")) object$1.code = options.enums === String ? $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] === void 0 ? message.code : $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] : message.code; + return object$1; + }; + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof opentelemetry.proto.trace.v1.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof opentelemetry.proto.trace.v1.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Status"; + }; + /** + * StatusCode enum. + * @name opentelemetry.proto.trace.v1.Status.StatusCode + * @enum {number} + * @property {number} STATUS_CODE_UNSET=0 STATUS_CODE_UNSET value + * @property {number} STATUS_CODE_OK=1 STATUS_CODE_OK value + * @property {number} STATUS_CODE_ERROR=2 STATUS_CODE_ERROR value + */ + Status.StatusCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_CODE_UNSET"] = 0; + values[valuesById[1] = "STATUS_CODE_OK"] = 1; + values[valuesById[2] = "STATUS_CODE_ERROR"] = 2; + return values; + })(); + return Status; + })(); + /** + * SpanFlags enum. + * @name opentelemetry.proto.trace.v1.SpanFlags + * @enum {number} + * @property {number} SPAN_FLAGS_DO_NOT_USE=0 SPAN_FLAGS_DO_NOT_USE value + * @property {number} SPAN_FLAGS_TRACE_FLAGS_MASK=255 SPAN_FLAGS_TRACE_FLAGS_MASK value + * @property {number} SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK=256 SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK value + * @property {number} SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK=512 SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK value + */ + v1.SpanFlags = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPAN_FLAGS_DO_NOT_USE"] = 0; + values[valuesById[255] = "SPAN_FLAGS_TRACE_FLAGS_MASK"] = 255; + values[valuesById[256] = "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"] = 256; + values[valuesById[512] = "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"] = 512; + return values; + })(); + return v1; + })(); + return trace$1; + })(); + proto.collector = (function() { + /** + * Namespace collector. + * @memberof opentelemetry.proto + * @namespace + */ + var collector = {}; + collector.trace = (function() { + /** + * Namespace trace. + * @memberof opentelemetry.proto.collector + * @namespace + */ + var trace$1 = {}; + trace$1.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.collector.trace + * @namespace + */ + var v1 = {}; + v1.TraceService = (function() { + /** + * Constructs a new TraceService service. + * @memberof opentelemetry.proto.collector.trace.v1 + * @classdesc Represents a TraceService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TraceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + (TraceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TraceService; + /** + * Creates new TraceService service using the specified rpc implementation. + * @function create + * @memberof opentelemetry.proto.collector.trace.v1.TraceService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TraceService} RPC service. Useful where requests and/or responses are streamed. + */ + TraceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + /** + * Callback as used by {@link opentelemetry.proto.collector.trace.v1.TraceService#export_}. + * @memberof opentelemetry.proto.collector.trace.v1.TraceService + * @typedef ExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} [response] ExportTraceServiceResponse + */ + /** + * Calls Export. + * @function export + * @memberof opentelemetry.proto.collector.trace.v1.TraceService + * @instance + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} request ExportTraceServiceRequest message or plain object + * @param {opentelemetry.proto.collector.trace.v1.TraceService.ExportCallback} callback Node-style callback called with the error, if any, and ExportTraceServiceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TraceService.prototype["export"] = function export_(request, callback) { + return this.rpcCall(export_, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse, request, callback); + }, "name", { value: "Export" }); + /** + * Calls Export. + * @function export + * @memberof opentelemetry.proto.collector.trace.v1.TraceService + * @instance + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} request ExportTraceServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return TraceService; + })(); + v1.ExportTraceServiceRequest = (function() { + /** + * Properties of an ExportTraceServiceRequest. + * @memberof opentelemetry.proto.collector.trace.v1 + * @interface IExportTraceServiceRequest + * @property {Array.|null} [resourceSpans] ExportTraceServiceRequest resourceSpans + */ + /** + * Constructs a new ExportTraceServiceRequest. + * @memberof opentelemetry.proto.collector.trace.v1 + * @classdesc Represents an ExportTraceServiceRequest. + * @implements IExportTraceServiceRequest + * @constructor + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest=} [properties] Properties to set + */ + function ExportTraceServiceRequest(properties) { + this.resourceSpans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportTraceServiceRequest resourceSpans. + * @member {Array.} resourceSpans + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @instance + */ + ExportTraceServiceRequest.prototype.resourceSpans = $util.emptyArray; + /** + * Creates a new ExportTraceServiceRequest instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest instance + */ + ExportTraceServiceRequest.create = function create(properties) { + return new ExportTraceServiceRequest(properties); + }; + /** + * Encodes the specified ExportTraceServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} message ExportTraceServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTraceServiceRequest.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resourceSpans != null && message.resourceSpans.length) for (var i = 0; i < message.resourceSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified ExportTraceServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} message ExportTraceServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTraceServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportTraceServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTraceServiceRequest.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.resourceSpans && message.resourceSpans.length)) message.resourceSpans = []; + message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportTraceServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTraceServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportTraceServiceRequest message. + * @function verify + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTraceServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { + if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; + for (var i = 0; i < message.resourceSpans.length; ++i) { + var error = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); + if (error) return "resourceSpans." + error; + } + } + return null; + }; + /** + * Creates an ExportTraceServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest + */ + ExportTraceServiceRequest.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) return object$1; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest(); + if (object$1.resourceSpans) { + if (!Array.isArray(object$1.resourceSpans)) throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected"); + message.resourceSpans = []; + for (var i = 0; i < object$1.resourceSpans.length; ++i) { + if (typeof object$1.resourceSpans[i] !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected"); + message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object$1.resourceSpans[i]); + } + } + return message; + }; + /** + * Creates a plain object from an ExportTraceServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} message ExportTraceServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTraceServiceRequest.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.resourceSpans = []; + if (message.resourceSpans && message.resourceSpans.length) { + object$1.resourceSpans = []; + for (var j = 0; j < message.resourceSpans.length; ++j) object$1.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); + } + return object$1; + }; + /** + * Converts this ExportTraceServiceRequest to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @instance + * @returns {Object.} JSON object + */ + ExportTraceServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportTraceServiceRequest + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTraceServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"; + }; + return ExportTraceServiceRequest; + })(); + v1.ExportTraceServiceResponse = (function() { + /** + * Properties of an ExportTraceServiceResponse. + * @memberof opentelemetry.proto.collector.trace.v1 + * @interface IExportTraceServiceResponse + * @property {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess|null} [partialSuccess] ExportTraceServiceResponse partialSuccess + */ + /** + * Constructs a new ExportTraceServiceResponse. + * @memberof opentelemetry.proto.collector.trace.v1 + * @classdesc Represents an ExportTraceServiceResponse. + * @implements IExportTraceServiceResponse + * @constructor + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse=} [properties] Properties to set + */ + function ExportTraceServiceResponse(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportTraceServiceResponse partialSuccess. + * @member {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess|null|undefined} partialSuccess + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @instance + */ + ExportTraceServiceResponse.prototype.partialSuccess = null; + /** + * Creates a new ExportTraceServiceResponse instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse instance + */ + ExportTraceServiceResponse.create = function create(properties) { + return new ExportTraceServiceResponse(properties); + }; + /** + * Encodes the specified ExportTraceServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse} message ExportTraceServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTraceServiceResponse.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified ExportTraceServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse} message ExportTraceServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTraceServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportTraceServiceResponse message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTraceServiceResponse.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportTraceServiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTraceServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportTraceServiceResponse message. + * @function verify + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTraceServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { + var error = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(message.partialSuccess); + if (error) return "partialSuccess." + error; + } + return null; + }; + /** + * Creates an ExportTraceServiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse + */ + ExportTraceServiceResponse.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse) return object$1; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse(); + if (object$1.partialSuccess != null) { + if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(object$1.partialSuccess); + } + return message; + }; + /** + * Creates a plain object from an ExportTraceServiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} message ExportTraceServiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTraceServiceResponse.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) object$1.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(message.partialSuccess, options); + return object$1; + }; + /** + * Converts this ExportTraceServiceResponse to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @instance + * @returns {Object.} JSON object + */ + ExportTraceServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportTraceServiceResponse + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTraceServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"; + }; + return ExportTraceServiceResponse; + })(); + v1.ExportTracePartialSuccess = (function() { + /** + * Properties of an ExportTracePartialSuccess. + * @memberof opentelemetry.proto.collector.trace.v1 + * @interface IExportTracePartialSuccess + * @property {number|Long|null} [rejectedSpans] ExportTracePartialSuccess rejectedSpans + * @property {string|null} [errorMessage] ExportTracePartialSuccess errorMessage + */ + /** + * Constructs a new ExportTracePartialSuccess. + * @memberof opentelemetry.proto.collector.trace.v1 + * @classdesc Represents an ExportTracePartialSuccess. + * @implements IExportTracePartialSuccess + * @constructor + * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess=} [properties] Properties to set + */ + function ExportTracePartialSuccess(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportTracePartialSuccess rejectedSpans. + * @member {number|Long|null|undefined} rejectedSpans + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @instance + */ + ExportTracePartialSuccess.prototype.rejectedSpans = null; + /** + * ExportTracePartialSuccess errorMessage. + * @member {string|null|undefined} errorMessage + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @instance + */ + ExportTracePartialSuccess.prototype.errorMessage = null; + /** + * Creates a new ExportTracePartialSuccess instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess instance + */ + ExportTracePartialSuccess.create = function create(properties) { + return new ExportTracePartialSuccess(properties); + }; + /** + * Encodes the specified ExportTracePartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess} message ExportTracePartialSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTracePartialSuccess.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.rejectedSpans != null && Object.hasOwnProperty.call(message, "rejectedSpans")) writer.uint32(8).int64(message.rejectedSpans); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); + return writer; + }; + /** + * Encodes the specified ExportTracePartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess} message ExportTracePartialSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportTracePartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportTracePartialSuccess message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTracePartialSuccess.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.rejectedSpans = reader.int64(); + break; + case 2: + message.errorMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportTracePartialSuccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportTracePartialSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportTracePartialSuccess message. + * @function verify + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportTracePartialSuccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) { + if (!$util.isInteger(message.rejectedSpans) && !(message.rejectedSpans && $util.isInteger(message.rejectedSpans.low) && $util.isInteger(message.rejectedSpans.high))) return "rejectedSpans: integer|Long expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { + if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; + } + return null; + }; + /** + * Creates an ExportTracePartialSuccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess + */ + ExportTracePartialSuccess.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess) return object$1; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess(); + if (object$1.rejectedSpans != null) { + if ($util.Long) (message.rejectedSpans = $util.Long.fromValue(object$1.rejectedSpans)).unsigned = false; + else if (typeof object$1.rejectedSpans === "string") message.rejectedSpans = parseInt(object$1.rejectedSpans, 10); + else if (typeof object$1.rejectedSpans === "number") message.rejectedSpans = object$1.rejectedSpans; + else if (typeof object$1.rejectedSpans === "object") message.rejectedSpans = new $util.LongBits(object$1.rejectedSpans.low >>> 0, object$1.rejectedSpans.high >>> 0).toNumber(); + } + if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); + return message; + }; + /** + * Creates a plain object from an ExportTracePartialSuccess message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} message ExportTracePartialSuccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportTracePartialSuccess.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.rejectedSpans = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.rejectedSpans = options.longs === String ? "0" : 0; + object$1.errorMessage = ""; + } + if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) if (typeof message.rejectedSpans === "number") object$1.rejectedSpans = options.longs === String ? String(message.rejectedSpans) : message.rejectedSpans; + else object$1.rejectedSpans = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedSpans) : options.longs === Number ? new $util.LongBits(message.rejectedSpans.low >>> 0, message.rejectedSpans.high >>> 0).toNumber() : message.rejectedSpans; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; + return object$1; + }; + /** + * Converts this ExportTracePartialSuccess to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @instance + * @returns {Object.} JSON object + */ + ExportTracePartialSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportTracePartialSuccess + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportTracePartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"; + }; + return ExportTracePartialSuccess; + })(); + return v1; + })(); + return trace$1; + })(); + collector.metrics = (function() { + /** + * Namespace metrics. + * @memberof opentelemetry.proto.collector + * @namespace + */ + var metrics$1 = {}; + metrics$1.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.collector.metrics + * @namespace + */ + var v1 = {}; + v1.MetricsService = (function() { + /** + * Constructs a new MetricsService service. + * @memberof opentelemetry.proto.collector.metrics.v1 + * @classdesc Represents a MetricsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function MetricsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + (MetricsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsService; + /** + * Creates new MetricsService service using the specified rpc implementation. + * @function create + * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {MetricsService} RPC service. Useful where requests and/or responses are streamed. + */ + MetricsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + /** + * Callback as used by {@link opentelemetry.proto.collector.metrics.v1.MetricsService#export_}. + * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService + * @typedef ExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} [response] ExportMetricsServiceResponse + */ + /** + * Calls Export. + * @function export + * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService + * @instance + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} request ExportMetricsServiceRequest message or plain object + * @param {opentelemetry.proto.collector.metrics.v1.MetricsService.ExportCallback} callback Node-style callback called with the error, if any, and ExportMetricsServiceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MetricsService.prototype["export"] = function export_(request, callback) { + return this.rpcCall(export_, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse, request, callback); + }, "name", { value: "Export" }); + /** + * Calls Export. + * @function export + * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService + * @instance + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} request ExportMetricsServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return MetricsService; + })(); + v1.ExportMetricsServiceRequest = (function() { + /** + * Properties of an ExportMetricsServiceRequest. + * @memberof opentelemetry.proto.collector.metrics.v1 + * @interface IExportMetricsServiceRequest + * @property {Array.|null} [resourceMetrics] ExportMetricsServiceRequest resourceMetrics + */ + /** + * Constructs a new ExportMetricsServiceRequest. + * @memberof opentelemetry.proto.collector.metrics.v1 + * @classdesc Represents an ExportMetricsServiceRequest. + * @implements IExportMetricsServiceRequest + * @constructor + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest=} [properties] Properties to set + */ + function ExportMetricsServiceRequest(properties) { + this.resourceMetrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportMetricsServiceRequest resourceMetrics. + * @member {Array.} resourceMetrics + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @instance + */ + ExportMetricsServiceRequest.prototype.resourceMetrics = $util.emptyArray; + /** + * Creates a new ExportMetricsServiceRequest instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest instance + */ + ExportMetricsServiceRequest.create = function create(properties) { + return new ExportMetricsServiceRequest(properties); + }; + /** + * Encodes the specified ExportMetricsServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} message ExportMetricsServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportMetricsServiceRequest.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resourceMetrics != null && message.resourceMetrics.length) for (var i = 0; i < message.resourceMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified ExportMetricsServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} message ExportMetricsServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportMetricsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportMetricsServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportMetricsServiceRequest.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.resourceMetrics && message.resourceMetrics.length)) message.resourceMetrics = []; + message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportMetricsServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportMetricsServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportMetricsServiceRequest message. + * @function verify + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportMetricsServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { + if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; + for (var i = 0; i < message.resourceMetrics.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); + if (error) return "resourceMetrics." + error; + } + } + return null; + }; + /** + * Creates an ExportMetricsServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest + */ + ExportMetricsServiceRequest.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) return object$1; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest(); + if (object$1.resourceMetrics) { + if (!Array.isArray(object$1.resourceMetrics)) throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected"); + message.resourceMetrics = []; + for (var i = 0; i < object$1.resourceMetrics.length; ++i) { + if (typeof object$1.resourceMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected"); + message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object$1.resourceMetrics[i]); + } + } + return message; + }; + /** + * Creates a plain object from an ExportMetricsServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} message ExportMetricsServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportMetricsServiceRequest.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.resourceMetrics = []; + if (message.resourceMetrics && message.resourceMetrics.length) { + object$1.resourceMetrics = []; + for (var j = 0; j < message.resourceMetrics.length; ++j) object$1.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); + } + return object$1; + }; + /** + * Converts this ExportMetricsServiceRequest to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @instance + * @returns {Object.} JSON object + */ + ExportMetricsServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportMetricsServiceRequest + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportMetricsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"; + }; + return ExportMetricsServiceRequest; + })(); + v1.ExportMetricsServiceResponse = (function() { + /** + * Properties of an ExportMetricsServiceResponse. + * @memberof opentelemetry.proto.collector.metrics.v1 + * @interface IExportMetricsServiceResponse + * @property {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess|null} [partialSuccess] ExportMetricsServiceResponse partialSuccess + */ + /** + * Constructs a new ExportMetricsServiceResponse. + * @memberof opentelemetry.proto.collector.metrics.v1 + * @classdesc Represents an ExportMetricsServiceResponse. + * @implements IExportMetricsServiceResponse + * @constructor + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse=} [properties] Properties to set + */ + function ExportMetricsServiceResponse(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportMetricsServiceResponse partialSuccess. + * @member {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess|null|undefined} partialSuccess + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @instance + */ + ExportMetricsServiceResponse.prototype.partialSuccess = null; + /** + * Creates a new ExportMetricsServiceResponse instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse instance + */ + ExportMetricsServiceResponse.create = function create(properties) { + return new ExportMetricsServiceResponse(properties); + }; + /** + * Encodes the specified ExportMetricsServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse} message ExportMetricsServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportMetricsServiceResponse.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified ExportMetricsServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse} message ExportMetricsServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportMetricsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportMetricsServiceResponse message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportMetricsServiceResponse.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportMetricsServiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportMetricsServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportMetricsServiceResponse message. + * @function verify + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportMetricsServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { + var error = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(message.partialSuccess); + if (error) return "partialSuccess." + error; + } + return null; + }; + /** + * Creates an ExportMetricsServiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse + */ + ExportMetricsServiceResponse.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse) return object$1; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse(); + if (object$1.partialSuccess != null) { + if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(object$1.partialSuccess); + } + return message; + }; + /** + * Creates a plain object from an ExportMetricsServiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} message ExportMetricsServiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportMetricsServiceResponse.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) object$1.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(message.partialSuccess, options); + return object$1; + }; + /** + * Converts this ExportMetricsServiceResponse to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @instance + * @returns {Object.} JSON object + */ + ExportMetricsServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportMetricsServiceResponse + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportMetricsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"; + }; + return ExportMetricsServiceResponse; + })(); + v1.ExportMetricsPartialSuccess = (function() { + /** + * Properties of an ExportMetricsPartialSuccess. + * @memberof opentelemetry.proto.collector.metrics.v1 + * @interface IExportMetricsPartialSuccess + * @property {number|Long|null} [rejectedDataPoints] ExportMetricsPartialSuccess rejectedDataPoints + * @property {string|null} [errorMessage] ExportMetricsPartialSuccess errorMessage + */ + /** + * Constructs a new ExportMetricsPartialSuccess. + * @memberof opentelemetry.proto.collector.metrics.v1 + * @classdesc Represents an ExportMetricsPartialSuccess. + * @implements IExportMetricsPartialSuccess + * @constructor + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess=} [properties] Properties to set + */ + function ExportMetricsPartialSuccess(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportMetricsPartialSuccess rejectedDataPoints. + * @member {number|Long|null|undefined} rejectedDataPoints + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @instance + */ + ExportMetricsPartialSuccess.prototype.rejectedDataPoints = null; + /** + * ExportMetricsPartialSuccess errorMessage. + * @member {string|null|undefined} errorMessage + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @instance + */ + ExportMetricsPartialSuccess.prototype.errorMessage = null; + /** + * Creates a new ExportMetricsPartialSuccess instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess instance + */ + ExportMetricsPartialSuccess.create = function create(properties) { + return new ExportMetricsPartialSuccess(properties); + }; + /** + * Encodes the specified ExportMetricsPartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess} message ExportMetricsPartialSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportMetricsPartialSuccess.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.rejectedDataPoints != null && Object.hasOwnProperty.call(message, "rejectedDataPoints")) writer.uint32(8).int64(message.rejectedDataPoints); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); + return writer; + }; + /** + * Encodes the specified ExportMetricsPartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess} message ExportMetricsPartialSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportMetricsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportMetricsPartialSuccess message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportMetricsPartialSuccess.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.rejectedDataPoints = reader.int64(); + break; + case 2: + message.errorMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportMetricsPartialSuccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportMetricsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportMetricsPartialSuccess message. + * @function verify + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportMetricsPartialSuccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) { + if (!$util.isInteger(message.rejectedDataPoints) && !(message.rejectedDataPoints && $util.isInteger(message.rejectedDataPoints.low) && $util.isInteger(message.rejectedDataPoints.high))) return "rejectedDataPoints: integer|Long expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { + if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; + } + return null; + }; + /** + * Creates an ExportMetricsPartialSuccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess + */ + ExportMetricsPartialSuccess.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess) return object$1; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess(); + if (object$1.rejectedDataPoints != null) { + if ($util.Long) (message.rejectedDataPoints = $util.Long.fromValue(object$1.rejectedDataPoints)).unsigned = false; + else if (typeof object$1.rejectedDataPoints === "string") message.rejectedDataPoints = parseInt(object$1.rejectedDataPoints, 10); + else if (typeof object$1.rejectedDataPoints === "number") message.rejectedDataPoints = object$1.rejectedDataPoints; + else if (typeof object$1.rejectedDataPoints === "object") message.rejectedDataPoints = new $util.LongBits(object$1.rejectedDataPoints.low >>> 0, object$1.rejectedDataPoints.high >>> 0).toNumber(); + } + if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); + return message; + }; + /** + * Creates a plain object from an ExportMetricsPartialSuccess message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} message ExportMetricsPartialSuccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportMetricsPartialSuccess.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.rejectedDataPoints = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.rejectedDataPoints = options.longs === String ? "0" : 0; + object$1.errorMessage = ""; + } + if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) if (typeof message.rejectedDataPoints === "number") object$1.rejectedDataPoints = options.longs === String ? String(message.rejectedDataPoints) : message.rejectedDataPoints; + else object$1.rejectedDataPoints = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedDataPoints) : options.longs === Number ? new $util.LongBits(message.rejectedDataPoints.low >>> 0, message.rejectedDataPoints.high >>> 0).toNumber() : message.rejectedDataPoints; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; + return object$1; + }; + /** + * Converts this ExportMetricsPartialSuccess to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @instance + * @returns {Object.} JSON object + */ + ExportMetricsPartialSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportMetricsPartialSuccess + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportMetricsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"; + }; + return ExportMetricsPartialSuccess; + })(); + return v1; + })(); + return metrics$1; + })(); + collector.logs = (function() { + /** + * Namespace logs. + * @memberof opentelemetry.proto.collector + * @namespace + */ + var logs = {}; + logs.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.collector.logs + * @namespace + */ + var v1 = {}; + v1.LogsService = (function() { + /** + * Constructs a new LogsService service. + * @memberof opentelemetry.proto.collector.logs.v1 + * @classdesc Represents a LogsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function LogsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + (LogsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LogsService; + /** + * Creates new LogsService service using the specified rpc implementation. + * @function create + * @memberof opentelemetry.proto.collector.logs.v1.LogsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {LogsService} RPC service. Useful where requests and/or responses are streamed. + */ + LogsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + /** + * Callback as used by {@link opentelemetry.proto.collector.logs.v1.LogsService#export_}. + * @memberof opentelemetry.proto.collector.logs.v1.LogsService + * @typedef ExportCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} [response] ExportLogsServiceResponse + */ + /** + * Calls Export. + * @function export + * @memberof opentelemetry.proto.collector.logs.v1.LogsService + * @instance + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} request ExportLogsServiceRequest message or plain object + * @param {opentelemetry.proto.collector.logs.v1.LogsService.ExportCallback} callback Node-style callback called with the error, if any, and ExportLogsServiceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LogsService.prototype["export"] = function export_(request, callback) { + return this.rpcCall(export_, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse, request, callback); + }, "name", { value: "Export" }); + /** + * Calls Export. + * @function export + * @memberof opentelemetry.proto.collector.logs.v1.LogsService + * @instance + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} request ExportLogsServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return LogsService; + })(); + v1.ExportLogsServiceRequest = (function() { + /** + * Properties of an ExportLogsServiceRequest. + * @memberof opentelemetry.proto.collector.logs.v1 + * @interface IExportLogsServiceRequest + * @property {Array.|null} [resourceLogs] ExportLogsServiceRequest resourceLogs + */ + /** + * Constructs a new ExportLogsServiceRequest. + * @memberof opentelemetry.proto.collector.logs.v1 + * @classdesc Represents an ExportLogsServiceRequest. + * @implements IExportLogsServiceRequest + * @constructor + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest=} [properties] Properties to set + */ + function ExportLogsServiceRequest(properties) { + this.resourceLogs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportLogsServiceRequest resourceLogs. + * @member {Array.} resourceLogs + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @instance + */ + ExportLogsServiceRequest.prototype.resourceLogs = $util.emptyArray; + /** + * Creates a new ExportLogsServiceRequest instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest instance + */ + ExportLogsServiceRequest.create = function create(properties) { + return new ExportLogsServiceRequest(properties); + }; + /** + * Encodes the specified ExportLogsServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} message ExportLogsServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportLogsServiceRequest.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resourceLogs != null && message.resourceLogs.length) for (var i = 0; i < message.resourceLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified ExportLogsServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} message ExportLogsServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportLogsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportLogsServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportLogsServiceRequest.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.resourceLogs && message.resourceLogs.length)) message.resourceLogs = []; + message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportLogsServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportLogsServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportLogsServiceRequest message. + * @function verify + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportLogsServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { + if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; + for (var i = 0; i < message.resourceLogs.length; ++i) { + var error = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); + if (error) return "resourceLogs." + error; + } + } + return null; + }; + /** + * Creates an ExportLogsServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest + */ + ExportLogsServiceRequest.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) return object$1; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest(); + if (object$1.resourceLogs) { + if (!Array.isArray(object$1.resourceLogs)) throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected"); + message.resourceLogs = []; + for (var i = 0; i < object$1.resourceLogs.length; ++i) { + if (typeof object$1.resourceLogs[i] !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected"); + message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object$1.resourceLogs[i]); + } + } + return message; + }; + /** + * Creates a plain object from an ExportLogsServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} message ExportLogsServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportLogsServiceRequest.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.resourceLogs = []; + if (message.resourceLogs && message.resourceLogs.length) { + object$1.resourceLogs = []; + for (var j = 0; j < message.resourceLogs.length; ++j) object$1.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); + } + return object$1; + }; + /** + * Converts this ExportLogsServiceRequest to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @instance + * @returns {Object.} JSON object + */ + ExportLogsServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportLogsServiceRequest + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportLogsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"; + }; + return ExportLogsServiceRequest; + })(); + v1.ExportLogsServiceResponse = (function() { + /** + * Properties of an ExportLogsServiceResponse. + * @memberof opentelemetry.proto.collector.logs.v1 + * @interface IExportLogsServiceResponse + * @property {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess|null} [partialSuccess] ExportLogsServiceResponse partialSuccess + */ + /** + * Constructs a new ExportLogsServiceResponse. + * @memberof opentelemetry.proto.collector.logs.v1 + * @classdesc Represents an ExportLogsServiceResponse. + * @implements IExportLogsServiceResponse + * @constructor + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse=} [properties] Properties to set + */ + function ExportLogsServiceResponse(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportLogsServiceResponse partialSuccess. + * @member {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess|null|undefined} partialSuccess + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @instance + */ + ExportLogsServiceResponse.prototype.partialSuccess = null; + /** + * Creates a new ExportLogsServiceResponse instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse instance + */ + ExportLogsServiceResponse.create = function create(properties) { + return new ExportLogsServiceResponse(properties); + }; + /** + * Encodes the specified ExportLogsServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse} message ExportLogsServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportLogsServiceResponse.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified ExportLogsServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse} message ExportLogsServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportLogsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportLogsServiceResponse message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportLogsServiceResponse.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportLogsServiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportLogsServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportLogsServiceResponse message. + * @function verify + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportLogsServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { + var error = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(message.partialSuccess); + if (error) return "partialSuccess." + error; + } + return null; + }; + /** + * Creates an ExportLogsServiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse + */ + ExportLogsServiceResponse.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse) return object$1; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse(); + if (object$1.partialSuccess != null) { + if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(object$1.partialSuccess); + } + return message; + }; + /** + * Creates a plain object from an ExportLogsServiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} message ExportLogsServiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportLogsServiceResponse.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) object$1.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(message.partialSuccess, options); + return object$1; + }; + /** + * Converts this ExportLogsServiceResponse to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @instance + * @returns {Object.} JSON object + */ + ExportLogsServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportLogsServiceResponse + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportLogsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"; + }; + return ExportLogsServiceResponse; + })(); + v1.ExportLogsPartialSuccess = (function() { + /** + * Properties of an ExportLogsPartialSuccess. + * @memberof opentelemetry.proto.collector.logs.v1 + * @interface IExportLogsPartialSuccess + * @property {number|Long|null} [rejectedLogRecords] ExportLogsPartialSuccess rejectedLogRecords + * @property {string|null} [errorMessage] ExportLogsPartialSuccess errorMessage + */ + /** + * Constructs a new ExportLogsPartialSuccess. + * @memberof opentelemetry.proto.collector.logs.v1 + * @classdesc Represents an ExportLogsPartialSuccess. + * @implements IExportLogsPartialSuccess + * @constructor + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess=} [properties] Properties to set + */ + function ExportLogsPartialSuccess(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExportLogsPartialSuccess rejectedLogRecords. + * @member {number|Long|null|undefined} rejectedLogRecords + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @instance + */ + ExportLogsPartialSuccess.prototype.rejectedLogRecords = null; + /** + * ExportLogsPartialSuccess errorMessage. + * @member {string|null|undefined} errorMessage + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @instance + */ + ExportLogsPartialSuccess.prototype.errorMessage = null; + /** + * Creates a new ExportLogsPartialSuccess instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess=} [properties] Properties to set + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess instance + */ + ExportLogsPartialSuccess.create = function create(properties) { + return new ExportLogsPartialSuccess(properties); + }; + /** + * Encodes the specified ExportLogsPartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess} message ExportLogsPartialSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportLogsPartialSuccess.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.rejectedLogRecords != null && Object.hasOwnProperty.call(message, "rejectedLogRecords")) writer.uint32(8).int64(message.rejectedLogRecords); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); + return writer; + }; + /** + * Encodes the specified ExportLogsPartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess} message ExportLogsPartialSuccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportLogsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExportLogsPartialSuccess message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportLogsPartialSuccess.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.rejectedLogRecords = reader.int64(); + break; + case 2: + message.errorMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExportLogsPartialSuccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportLogsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExportLogsPartialSuccess message. + * @function verify + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportLogsPartialSuccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) { + if (!$util.isInteger(message.rejectedLogRecords) && !(message.rejectedLogRecords && $util.isInteger(message.rejectedLogRecords.low) && $util.isInteger(message.rejectedLogRecords.high))) return "rejectedLogRecords: integer|Long expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { + if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; + } + return null; + }; + /** + * Creates an ExportLogsPartialSuccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess + */ + ExportLogsPartialSuccess.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess) return object$1; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess(); + if (object$1.rejectedLogRecords != null) { + if ($util.Long) (message.rejectedLogRecords = $util.Long.fromValue(object$1.rejectedLogRecords)).unsigned = false; + else if (typeof object$1.rejectedLogRecords === "string") message.rejectedLogRecords = parseInt(object$1.rejectedLogRecords, 10); + else if (typeof object$1.rejectedLogRecords === "number") message.rejectedLogRecords = object$1.rejectedLogRecords; + else if (typeof object$1.rejectedLogRecords === "object") message.rejectedLogRecords = new $util.LongBits(object$1.rejectedLogRecords.low >>> 0, object$1.rejectedLogRecords.high >>> 0).toNumber(); + } + if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); + return message; + }; + /** + * Creates a plain object from an ExportLogsPartialSuccess message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} message ExportLogsPartialSuccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportLogsPartialSuccess.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.rejectedLogRecords = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.rejectedLogRecords = options.longs === String ? "0" : 0; + object$1.errorMessage = ""; + } + if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) if (typeof message.rejectedLogRecords === "number") object$1.rejectedLogRecords = options.longs === String ? String(message.rejectedLogRecords) : message.rejectedLogRecords; + else object$1.rejectedLogRecords = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedLogRecords) : options.longs === Number ? new $util.LongBits(message.rejectedLogRecords.low >>> 0, message.rejectedLogRecords.high >>> 0).toNumber() : message.rejectedLogRecords; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; + return object$1; + }; + /** + * Converts this ExportLogsPartialSuccess to JSON. + * @function toJSON + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @instance + * @returns {Object.} JSON object + */ + ExportLogsPartialSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExportLogsPartialSuccess + * @function getTypeUrl + * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportLogsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"; + }; + return ExportLogsPartialSuccess; + })(); + return v1; + })(); + return logs; + })(); + return collector; + })(); + proto.metrics = (function() { + /** + * Namespace metrics. + * @memberof opentelemetry.proto + * @namespace + */ + var metrics$1 = {}; + metrics$1.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.metrics + * @namespace + */ + var v1 = {}; + v1.MetricsData = (function() { + /** + * Properties of a MetricsData. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IMetricsData + * @property {Array.|null} [resourceMetrics] MetricsData resourceMetrics + */ + /** + * Constructs a new MetricsData. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a MetricsData. + * @implements IMetricsData + * @constructor + * @param {opentelemetry.proto.metrics.v1.IMetricsData=} [properties] Properties to set + */ + function MetricsData(properties) { + this.resourceMetrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * MetricsData resourceMetrics. + * @member {Array.} resourceMetrics + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @instance + */ + MetricsData.prototype.resourceMetrics = $util.emptyArray; + /** + * Creates a new MetricsData instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {opentelemetry.proto.metrics.v1.IMetricsData=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData instance + */ + MetricsData.create = function create(properties) { + return new MetricsData(properties); + }; + /** + * Encodes the specified MetricsData message. Does not implicitly {@link opentelemetry.proto.metrics.v1.MetricsData.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {opentelemetry.proto.metrics.v1.IMetricsData} message MetricsData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsData.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resourceMetrics != null && message.resourceMetrics.length) for (var i = 0; i < message.resourceMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified MetricsData message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.MetricsData.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {opentelemetry.proto.metrics.v1.IMetricsData} message MetricsData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricsData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a MetricsData message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsData.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.MetricsData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.resourceMetrics && message.resourceMetrics.length)) message.resourceMetrics = []; + message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a MetricsData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricsData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a MetricsData message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricsData.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { + if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; + for (var i = 0; i < message.resourceMetrics.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); + if (error) return "resourceMetrics." + error; + } + } + return null; + }; + /** + * Creates a MetricsData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData + */ + MetricsData.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.MetricsData) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.MetricsData(); + if (object$1.resourceMetrics) { + if (!Array.isArray(object$1.resourceMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected"); + message.resourceMetrics = []; + for (var i = 0; i < object$1.resourceMetrics.length; ++i) { + if (typeof object$1.resourceMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected"); + message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object$1.resourceMetrics[i]); + } + } + return message; + }; + /** + * Creates a plain object from a MetricsData message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {opentelemetry.proto.metrics.v1.MetricsData} message MetricsData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricsData.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.resourceMetrics = []; + if (message.resourceMetrics && message.resourceMetrics.length) { + object$1.resourceMetrics = []; + for (var j = 0; j < message.resourceMetrics.length; ++j) object$1.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); + } + return object$1; + }; + /** + * Converts this MetricsData to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @instance + * @returns {Object.} JSON object + */ + MetricsData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for MetricsData + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.MetricsData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.MetricsData"; + }; + return MetricsData; + })(); + v1.ResourceMetrics = (function() { + /** + * Properties of a ResourceMetrics. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IResourceMetrics + * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceMetrics resource + * @property {Array.|null} [scopeMetrics] ResourceMetrics scopeMetrics + * @property {string|null} [schemaUrl] ResourceMetrics schemaUrl + */ + /** + * Constructs a new ResourceMetrics. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a ResourceMetrics. + * @implements IResourceMetrics + * @constructor + * @param {opentelemetry.proto.metrics.v1.IResourceMetrics=} [properties] Properties to set + */ + function ResourceMetrics(properties) { + this.scopeMetrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ResourceMetrics resource. + * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @instance + */ + ResourceMetrics.prototype.resource = null; + /** + * ResourceMetrics scopeMetrics. + * @member {Array.} scopeMetrics + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @instance + */ + ResourceMetrics.prototype.scopeMetrics = $util.emptyArray; + /** + * ResourceMetrics schemaUrl. + * @member {string|null|undefined} schemaUrl + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @instance + */ + ResourceMetrics.prototype.schemaUrl = null; + /** + * Creates a new ResourceMetrics instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.IResourceMetrics=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics instance + */ + ResourceMetrics.create = function create(properties) { + return new ResourceMetrics(properties); + }; + /** + * Encodes the specified ResourceMetrics message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ResourceMetrics.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.IResourceMetrics} message ResourceMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceMetrics.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + if (message.scopeMetrics != null && message.scopeMetrics.length) for (var i = 0; i < message.scopeMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(message.scopeMetrics[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); + return writer; + }; + /** + * Encodes the specified ResourceMetrics message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ResourceMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.IResourceMetrics} message ResourceMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a ResourceMetrics message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceMetrics.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.scopeMetrics && message.scopeMetrics.length)) message.scopeMetrics = []; + message.scopeMetrics.push($root.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(reader, reader.uint32())); + break; + case 3: + message.schemaUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a ResourceMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a ResourceMetrics message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error) return "resource." + error; + } + if (message.scopeMetrics != null && message.hasOwnProperty("scopeMetrics")) { + if (!Array.isArray(message.scopeMetrics)) return "scopeMetrics: array expected"; + for (var i = 0; i < message.scopeMetrics.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(message.scopeMetrics[i]); + if (error) return "scopeMetrics." + error; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; + } + return null; + }; + /** + * Creates a ResourceMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics + */ + ResourceMetrics.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ResourceMetrics) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics(); + if (object$1.resource != null) { + if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); + } + if (object$1.scopeMetrics) { + if (!Array.isArray(object$1.scopeMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected"); + message.scopeMetrics = []; + for (var i = 0; i < object$1.scopeMetrics.length; ++i) { + if (typeof object$1.scopeMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected"); + message.scopeMetrics[i] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(object$1.scopeMetrics[i]); + } + } + if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); + return message; + }; + /** + * Creates a plain object from a ResourceMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.ResourceMetrics} message ResourceMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceMetrics.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.scopeMetrics = []; + if (options.defaults) { + object$1.resource = null; + object$1.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeMetrics && message.scopeMetrics.length) { + object$1.scopeMetrics = []; + for (var j = 0; j < message.scopeMetrics.length; ++j) object$1.scopeMetrics[j] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(message.scopeMetrics[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; + return object$1; + }; + /** + * Converts this ResourceMetrics to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @instance + * @returns {Object.} JSON object + */ + ResourceMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ResourceMetrics + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ResourceMetrics"; + }; + return ResourceMetrics; + })(); + v1.ScopeMetrics = (function() { + /** + * Properties of a ScopeMetrics. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IScopeMetrics + * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeMetrics scope + * @property {Array.|null} [metrics] ScopeMetrics metrics + * @property {string|null} [schemaUrl] ScopeMetrics schemaUrl + */ + /** + * Constructs a new ScopeMetrics. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a ScopeMetrics. + * @implements IScopeMetrics + * @constructor + * @param {opentelemetry.proto.metrics.v1.IScopeMetrics=} [properties] Properties to set + */ + function ScopeMetrics(properties) { + this.metrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ScopeMetrics scope. + * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @instance + */ + ScopeMetrics.prototype.scope = null; + /** + * ScopeMetrics metrics. + * @member {Array.} metrics + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @instance + */ + ScopeMetrics.prototype.metrics = $util.emptyArray; + /** + * ScopeMetrics schemaUrl. + * @member {string|null|undefined} schemaUrl + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @instance + */ + ScopeMetrics.prototype.schemaUrl = null; + /** + * Creates a new ScopeMetrics instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.IScopeMetrics=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics instance + */ + ScopeMetrics.create = function create(properties) { + return new ScopeMetrics(properties); + }; + /** + * Encodes the specified ScopeMetrics message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ScopeMetrics.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.IScopeMetrics} message ScopeMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScopeMetrics.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) for (var i = 0; i < message.metrics.length; ++i) $root.opentelemetry.proto.metrics.v1.Metric.encode(message.metrics[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); + return writer; + }; + /** + * Encodes the specified ScopeMetrics message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ScopeMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.IScopeMetrics} message ScopeMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScopeMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a ScopeMetrics message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScopeMetrics.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.metrics && message.metrics.length)) message.metrics = []; + message.metrics.push($root.opentelemetry.proto.metrics.v1.Metric.decode(reader, reader.uint32())); + break; + case 3: + message.schemaUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a ScopeMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScopeMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a ScopeMetrics message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScopeMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) { + var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error) return "scope." + error; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.Metric.verify(message.metrics[i]); + if (error) return "metrics." + error; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; + } + return null; + }; + /** + * Creates a ScopeMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics + */ + ScopeMetrics.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ScopeMetrics) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics(); + if (object$1.scope != null) { + if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); + } + if (object$1.metrics) { + if (!Array.isArray(object$1.metrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object$1.metrics.length; ++i) { + if (typeof object$1.metrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected"); + message.metrics[i] = $root.opentelemetry.proto.metrics.v1.Metric.fromObject(object$1.metrics[i]); + } + } + if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); + return message; + }; + /** + * Creates a plain object from a ScopeMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {opentelemetry.proto.metrics.v1.ScopeMetrics} message ScopeMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScopeMetrics.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.metrics = []; + if (options.defaults) { + object$1.scope = null; + object$1.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.metrics && message.metrics.length) { + object$1.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) object$1.metrics[j] = $root.opentelemetry.proto.metrics.v1.Metric.toObject(message.metrics[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; + return object$1; + }; + /** + * Converts this ScopeMetrics to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @instance + * @returns {Object.} JSON object + */ + ScopeMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ScopeMetrics + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScopeMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ScopeMetrics"; + }; + return ScopeMetrics; + })(); + v1.Metric = (function() { + /** + * Properties of a Metric. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IMetric + * @property {string|null} [name] Metric name + * @property {string|null} [description] Metric description + * @property {string|null} [unit] Metric unit + * @property {opentelemetry.proto.metrics.v1.IGauge|null} [gauge] Metric gauge + * @property {opentelemetry.proto.metrics.v1.ISum|null} [sum] Metric sum + * @property {opentelemetry.proto.metrics.v1.IHistogram|null} [histogram] Metric histogram + * @property {opentelemetry.proto.metrics.v1.IExponentialHistogram|null} [exponentialHistogram] Metric exponentialHistogram + * @property {opentelemetry.proto.metrics.v1.ISummary|null} [summary] Metric summary + * @property {Array.|null} [metadata] Metric metadata + */ + /** + * Constructs a new Metric. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {opentelemetry.proto.metrics.v1.IMetric=} [properties] Properties to set + */ + function Metric(properties) { + this.metadata = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Metric name. + * @member {string|null|undefined} name + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.name = null; + /** + * Metric description. + * @member {string|null|undefined} description + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.description = null; + /** + * Metric unit. + * @member {string|null|undefined} unit + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.unit = null; + /** + * Metric gauge. + * @member {opentelemetry.proto.metrics.v1.IGauge|null|undefined} gauge + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.gauge = null; + /** + * Metric sum. + * @member {opentelemetry.proto.metrics.v1.ISum|null|undefined} sum + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.sum = null; + /** + * Metric histogram. + * @member {opentelemetry.proto.metrics.v1.IHistogram|null|undefined} histogram + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.histogram = null; + /** + * Metric exponentialHistogram. + * @member {opentelemetry.proto.metrics.v1.IExponentialHistogram|null|undefined} exponentialHistogram + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.exponentialHistogram = null; + /** + * Metric summary. + * @member {opentelemetry.proto.metrics.v1.ISummary|null|undefined} summary + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.summary = null; + /** + * Metric metadata. + * @member {Array.} metadata + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Metric.prototype.metadata = $util.emptyArray; + var $oneOfFields; + /** + * Metric data. + * @member {"gauge"|"sum"|"histogram"|"exponentialHistogram"|"summary"|undefined} data + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + */ + Object.defineProperty(Metric.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = [ + "gauge", + "sum", + "histogram", + "exponentialHistogram", + "summary" + ]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {opentelemetry.proto.metrics.v1.IMetric=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + /** + * Encodes the specified Metric message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Metric.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {opentelemetry.proto.metrics.v1.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(18).string(message.description); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) writer.uint32(26).string(message.unit); + if (message.gauge != null && Object.hasOwnProperty.call(message, "gauge")) $root.opentelemetry.proto.metrics.v1.Gauge.encode(message.gauge, writer.uint32(42).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) $root.opentelemetry.proto.metrics.v1.Sum.encode(message.sum, writer.uint32(58).fork()).ldelim(); + if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) $root.opentelemetry.proto.metrics.v1.Histogram.encode(message.histogram, writer.uint32(74).fork()).ldelim(); + if (message.exponentialHistogram != null && Object.hasOwnProperty.call(message, "exponentialHistogram")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(message.exponentialHistogram, writer.uint32(82).fork()).ldelim(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) $root.opentelemetry.proto.metrics.v1.Summary.encode(message.summary, writer.uint32(90).fork()).ldelim(); + if (message.metadata != null && message.metadata.length) for (var i = 0; i < message.metadata.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.metadata[i], writer.uint32(98).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {opentelemetry.proto.metrics.v1.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Metric(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.unit = reader.string(); + break; + case 5: + message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.decode(reader, reader.uint32()); + break; + case 7: + message.sum = $root.opentelemetry.proto.metrics.v1.Sum.decode(reader, reader.uint32()); + break; + case 9: + message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.decode(reader, reader.uint32()); + break; + case 10: + message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(reader, reader.uint32()); + break; + case 11: + message.summary = $root.opentelemetry.proto.metrics.v1.Summary.decode(reader, reader.uint32()); + break; + case 12: + if (!(message.metadata && message.metadata.length)) message.metadata = []; + message.metadata.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Metric message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) return "name: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + if (!$util.isString(message.description)) return "description: string expected"; + } + if (message.unit != null && message.hasOwnProperty("unit")) { + if (!$util.isString(message.unit)) return "unit: string expected"; + } + if (message.gauge != null && message.hasOwnProperty("gauge")) { + properties.data = 1; + var error = $root.opentelemetry.proto.metrics.v1.Gauge.verify(message.gauge); + if (error) return "gauge." + error; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (properties.data === 1) return "data: multiple values"; + properties.data = 1; + var error = $root.opentelemetry.proto.metrics.v1.Sum.verify(message.sum); + if (error) return "sum." + error; + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + if (properties.data === 1) return "data: multiple values"; + properties.data = 1; + var error = $root.opentelemetry.proto.metrics.v1.Histogram.verify(message.histogram); + if (error) return "histogram." + error; + } + if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { + if (properties.data === 1) return "data: multiple values"; + properties.data = 1; + var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(message.exponentialHistogram); + if (error) return "exponentialHistogram." + error; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + if (properties.data === 1) return "data: multiple values"; + properties.data = 1; + var error = $root.opentelemetry.proto.metrics.v1.Summary.verify(message.summary); + if (error) return "summary." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!Array.isArray(message.metadata)) return "metadata: array expected"; + for (var i = 0; i < message.metadata.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.metadata[i]); + if (error) return "metadata." + error; + } + } + return null; + }; + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.Metric} Metric + */ + Metric.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Metric) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.Metric(); + if (object$1.name != null) message.name = String(object$1.name); + if (object$1.description != null) message.description = String(object$1.description); + if (object$1.unit != null) message.unit = String(object$1.unit); + if (object$1.gauge != null) { + if (typeof object$1.gauge !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected"); + message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.fromObject(object$1.gauge); + } + if (object$1.sum != null) { + if (typeof object$1.sum !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected"); + message.sum = $root.opentelemetry.proto.metrics.v1.Sum.fromObject(object$1.sum); + } + if (object$1.histogram != null) { + if (typeof object$1.histogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected"); + message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.fromObject(object$1.histogram); + } + if (object$1.exponentialHistogram != null) { + if (typeof object$1.exponentialHistogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected"); + message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(object$1.exponentialHistogram); + } + if (object$1.summary != null) { + if (typeof object$1.summary !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected"); + message.summary = $root.opentelemetry.proto.metrics.v1.Summary.fromObject(object$1.summary); + } + if (object$1.metadata) { + if (!Array.isArray(object$1.metadata)) throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected"); + message.metadata = []; + for (var i = 0; i < object$1.metadata.length; ++i) { + if (typeof object$1.metadata[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected"); + message.metadata[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.metadata[i]); + } + } + return message; + }; + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {opentelemetry.proto.metrics.v1.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.metadata = []; + if (options.defaults) { + object$1.name = ""; + object$1.description = ""; + object$1.unit = ""; + } + if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) object$1.description = message.description; + if (message.unit != null && message.hasOwnProperty("unit")) object$1.unit = message.unit; + if (message.gauge != null && message.hasOwnProperty("gauge")) { + object$1.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.toObject(message.gauge, options); + if (options.oneofs) object$1.data = "gauge"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + object$1.sum = $root.opentelemetry.proto.metrics.v1.Sum.toObject(message.sum, options); + if (options.oneofs) object$1.data = "sum"; + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + object$1.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.toObject(message.histogram, options); + if (options.oneofs) object$1.data = "histogram"; + } + if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { + object$1.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(message.exponentialHistogram, options); + if (options.oneofs) object$1.data = "exponentialHistogram"; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + object$1.summary = $root.opentelemetry.proto.metrics.v1.Summary.toObject(message.summary, options); + if (options.oneofs) object$1.data = "summary"; + } + if (message.metadata && message.metadata.length) { + object$1.metadata = []; + for (var j = 0; j < message.metadata.length; ++j) object$1.metadata[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.metadata[j], options); + } + return object$1; + }; + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Metric"; + }; + return Metric; + })(); + v1.Gauge = (function() { + /** + * Properties of a Gauge. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IGauge + * @property {Array.|null} [dataPoints] Gauge dataPoints + */ + /** + * Constructs a new Gauge. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a Gauge. + * @implements IGauge + * @constructor + * @param {opentelemetry.proto.metrics.v1.IGauge=} [properties] Properties to set + */ + function Gauge(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Gauge dataPoints. + * @member {Array.} dataPoints + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @instance + */ + Gauge.prototype.dataPoints = $util.emptyArray; + /** + * Creates a new Gauge instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {opentelemetry.proto.metrics.v1.IGauge=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge instance + */ + Gauge.create = function create(properties) { + return new Gauge(properties); + }; + /** + * Encodes the specified Gauge message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Gauge.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {opentelemetry.proto.metrics.v1.IGauge} message Gauge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gauge.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified Gauge message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Gauge.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {opentelemetry.proto.metrics.v1.IGauge} message Gauge message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gauge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Gauge message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gauge.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Gauge(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Gauge message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gauge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Gauge message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Gauge.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); + if (error) return "dataPoints." + error; + } + } + return null; + }; + /** + * Creates a Gauge message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge + */ + Gauge.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Gauge) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.Gauge(); + if (object$1.dataPoints) { + if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object$1.dataPoints.length; ++i) { + if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object$1.dataPoints[i]); + } + } + return message; + }; + /** + * Creates a plain object from a Gauge message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {opentelemetry.proto.metrics.v1.Gauge} message Gauge + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Gauge.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object$1.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); + } + return object$1; + }; + /** + * Converts this Gauge to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @instance + * @returns {Object.} JSON object + */ + Gauge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Gauge + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.Gauge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Gauge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Gauge"; + }; + return Gauge; + })(); + v1.Sum = (function() { + /** + * Properties of a Sum. + * @memberof opentelemetry.proto.metrics.v1 + * @interface ISum + * @property {Array.|null} [dataPoints] Sum dataPoints + * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] Sum aggregationTemporality + * @property {boolean|null} [isMonotonic] Sum isMonotonic + */ + /** + * Constructs a new Sum. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {opentelemetry.proto.metrics.v1.ISum=} [properties] Properties to set + */ + function Sum(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Sum dataPoints. + * @member {Array.} dataPoints + * @memberof opentelemetry.proto.metrics.v1.Sum + * @instance + */ + Sum.prototype.dataPoints = $util.emptyArray; + /** + * Sum aggregationTemporality. + * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality + * @memberof opentelemetry.proto.metrics.v1.Sum + * @instance + */ + Sum.prototype.aggregationTemporality = null; + /** + * Sum isMonotonic. + * @member {boolean|null|undefined} isMonotonic + * @memberof opentelemetry.proto.metrics.v1.Sum + * @instance + */ + Sum.prototype.isMonotonic = null; + /** + * Creates a new Sum instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {opentelemetry.proto.metrics.v1.ISum=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; + /** + * Encodes the specified Sum message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Sum.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {opentelemetry.proto.metrics.v1.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); + if (message.isMonotonic != null && Object.hasOwnProperty.call(message, "isMonotonic")) writer.uint32(24).bool(message.isMonotonic); + return writer; + }; + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {opentelemetry.proto.metrics.v1.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); + break; + case 2: + message.aggregationTemporality = reader.int32(); + break; + case 3: + message.isMonotonic = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Sum message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); + if (error) return "dataPoints." + error; + } + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { + default: return "aggregationTemporality: enum value expected"; + case 0: + case 1: + case 2: break; + } + if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) { + if (typeof message.isMonotonic !== "boolean") return "isMonotonic: boolean expected"; + } + return null; + }; + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.Sum} Sum + */ + Sum.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Sum) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.Sum(); + if (object$1.dataPoints) { + if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object$1.dataPoints.length; ++i) { + if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object$1.dataPoints[i]); + } + } + switch (object$1.aggregationTemporality) { + default: + if (typeof object$1.aggregationTemporality === "number") { + message.aggregationTemporality = object$1.aggregationTemporality; + break; + } + break; + case "AGGREGATION_TEMPORALITY_UNSPECIFIED": + case 0: + message.aggregationTemporality = 0; + break; + case "AGGREGATION_TEMPORALITY_DELTA": + case 1: + message.aggregationTemporality = 1; + break; + case "AGGREGATION_TEMPORALITY_CUMULATIVE": + case 2: + message.aggregationTemporality = 2; + break; + } + if (object$1.isMonotonic != null) message.isMonotonic = Boolean(object$1.isMonotonic); + return message; + }; + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {opentelemetry.proto.metrics.v1.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.dataPoints = []; + if (options.defaults) { + object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + object$1.isMonotonic = false; + } + if (message.dataPoints && message.dataPoints.length) { + object$1.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; + if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) object$1.isMonotonic = message.isMonotonic; + return object$1; + }; + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Sum"; + }; + return Sum; + })(); + v1.Histogram = (function() { + /** + * Properties of a Histogram. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IHistogram + * @property {Array.|null} [dataPoints] Histogram dataPoints + * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] Histogram aggregationTemporality + */ + /** + * Constructs a new Histogram. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a Histogram. + * @implements IHistogram + * @constructor + * @param {opentelemetry.proto.metrics.v1.IHistogram=} [properties] Properties to set + */ + function Histogram(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Histogram dataPoints. + * @member {Array.} dataPoints + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @instance + */ + Histogram.prototype.dataPoints = $util.emptyArray; + /** + * Histogram aggregationTemporality. + * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @instance + */ + Histogram.prototype.aggregationTemporality = null; + /** + * Creates a new Histogram instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {opentelemetry.proto.metrics.v1.IHistogram=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram instance + */ + Histogram.create = function create(properties) { + return new Histogram(properties); + }; + /** + * Encodes the specified Histogram message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Histogram.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {opentelemetry.proto.metrics.v1.IHistogram} message Histogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Histogram.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); + return writer; + }; + /** + * Encodes the specified Histogram message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Histogram.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {opentelemetry.proto.metrics.v1.IHistogram} message Histogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Histogram.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Histogram message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Histogram.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Histogram(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(reader, reader.uint32())); + break; + case 2: + message.aggregationTemporality = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Histogram message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Histogram.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Histogram message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Histogram.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(message.dataPoints[i]); + if (error) return "dataPoints." + error; + } + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { + default: return "aggregationTemporality: enum value expected"; + case 0: + case 1: + case 2: break; + } + return null; + }; + /** + * Creates a Histogram message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram + */ + Histogram.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Histogram) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.Histogram(); + if (object$1.dataPoints) { + if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object$1.dataPoints.length; ++i) { + if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(object$1.dataPoints[i]); + } + } + switch (object$1.aggregationTemporality) { + default: + if (typeof object$1.aggregationTemporality === "number") { + message.aggregationTemporality = object$1.aggregationTemporality; + break; + } + break; + case "AGGREGATION_TEMPORALITY_UNSPECIFIED": + case 0: + message.aggregationTemporality = 0; + break; + case "AGGREGATION_TEMPORALITY_DELTA": + case 1: + message.aggregationTemporality = 1; + break; + case "AGGREGATION_TEMPORALITY_CUMULATIVE": + case 2: + message.aggregationTemporality = 2; + break; + } + return message; + }; + /** + * Creates a plain object from a Histogram message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {opentelemetry.proto.metrics.v1.Histogram} message Histogram + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Histogram.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.dataPoints = []; + if (options.defaults) object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + if (message.dataPoints && message.dataPoints.length) { + object$1.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; + return object$1; + }; + /** + * Converts this Histogram to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @instance + * @returns {Object.} JSON object + */ + Histogram.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Histogram + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.Histogram + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Histogram"; + }; + return Histogram; + })(); + v1.ExponentialHistogram = (function() { + /** + * Properties of an ExponentialHistogram. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IExponentialHistogram + * @property {Array.|null} [dataPoints] ExponentialHistogram dataPoints + * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] ExponentialHistogram aggregationTemporality + */ + /** + * Constructs a new ExponentialHistogram. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents an ExponentialHistogram. + * @implements IExponentialHistogram + * @constructor + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram=} [properties] Properties to set + */ + function ExponentialHistogram(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExponentialHistogram dataPoints. + * @member {Array.} dataPoints + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @instance + */ + ExponentialHistogram.prototype.dataPoints = $util.emptyArray; + /** + * ExponentialHistogram aggregationTemporality. + * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @instance + */ + ExponentialHistogram.prototype.aggregationTemporality = null; + /** + * Creates a new ExponentialHistogram instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram instance + */ + ExponentialHistogram.create = function create(properties) { + return new ExponentialHistogram(properties); + }; + /** + * Encodes the specified ExponentialHistogram message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogram.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram} message ExponentialHistogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExponentialHistogram.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); + return writer; + }; + /** + * Encodes the specified ExponentialHistogram message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogram.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram} message ExponentialHistogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExponentialHistogram.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExponentialHistogram message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExponentialHistogram.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(reader, reader.uint32())); + break; + case 2: + message.aggregationTemporality = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExponentialHistogram message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExponentialHistogram.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExponentialHistogram message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExponentialHistogram.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(message.dataPoints[i]); + if (error) return "dataPoints." + error; + } + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { + default: return "aggregationTemporality: enum value expected"; + case 0: + case 1: + case 2: break; + } + return null; + }; + /** + * Creates an ExponentialHistogram message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram + */ + ExponentialHistogram.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogram) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram(); + if (object$1.dataPoints) { + if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object$1.dataPoints.length; ++i) { + if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(object$1.dataPoints[i]); + } + } + switch (object$1.aggregationTemporality) { + default: + if (typeof object$1.aggregationTemporality === "number") { + message.aggregationTemporality = object$1.aggregationTemporality; + break; + } + break; + case "AGGREGATION_TEMPORALITY_UNSPECIFIED": + case 0: + message.aggregationTemporality = 0; + break; + case "AGGREGATION_TEMPORALITY_DELTA": + case 1: + message.aggregationTemporality = 1; + break; + case "AGGREGATION_TEMPORALITY_CUMULATIVE": + case 2: + message.aggregationTemporality = 2; + break; + } + return message; + }; + /** + * Creates a plain object from an ExponentialHistogram message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {opentelemetry.proto.metrics.v1.ExponentialHistogram} message ExponentialHistogram + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExponentialHistogram.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.dataPoints = []; + if (options.defaults) object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + if (message.dataPoints && message.dataPoints.length) { + object$1.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; + return object$1; + }; + /** + * Converts this ExponentialHistogram to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @instance + * @returns {Object.} JSON object + */ + ExponentialHistogram.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExponentialHistogram + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExponentialHistogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogram"; + }; + return ExponentialHistogram; + })(); + v1.Summary = (function() { + /** + * Properties of a Summary. + * @memberof opentelemetry.proto.metrics.v1 + * @interface ISummary + * @property {Array.|null} [dataPoints] Summary dataPoints + */ + /** + * Constructs a new Summary. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a Summary. + * @implements ISummary + * @constructor + * @param {opentelemetry.proto.metrics.v1.ISummary=} [properties] Properties to set + */ + function Summary(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Summary dataPoints. + * @member {Array.} dataPoints + * @memberof opentelemetry.proto.metrics.v1.Summary + * @instance + */ + Summary.prototype.dataPoints = $util.emptyArray; + /** + * Creates a new Summary instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {opentelemetry.proto.metrics.v1.ISummary=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.Summary} Summary instance + */ + Summary.create = function create(properties) { + return new Summary(properties); + }; + /** + * Encodes the specified Summary message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Summary.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {opentelemetry.proto.metrics.v1.ISummary} message Summary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Summary.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified Summary message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Summary.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {opentelemetry.proto.metrics.v1.ISummary} message Summary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Summary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Summary message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.Summary} Summary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Summary.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Summary(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Summary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.Summary} Summary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Summary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Summary message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Summary.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(message.dataPoints[i]); + if (error) return "dataPoints." + error; + } + } + return null; + }; + /** + * Creates a Summary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.Summary} Summary + */ + Summary.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Summary) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.Summary(); + if (object$1.dataPoints) { + if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object$1.dataPoints.length; ++i) { + if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(object$1.dataPoints[i]); + } + } + return message; + }; + /** + * Creates a plain object from a Summary message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {opentelemetry.proto.metrics.v1.Summary} message Summary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Summary.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object$1.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(message.dataPoints[j], options); + } + return object$1; + }; + /** + * Converts this Summary to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.Summary + * @instance + * @returns {Object.} JSON object + */ + Summary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Summary + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.Summary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Summary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Summary"; + }; + return Summary; + })(); + /** + * AggregationTemporality enum. + * @name opentelemetry.proto.metrics.v1.AggregationTemporality + * @enum {number} + * @property {number} AGGREGATION_TEMPORALITY_UNSPECIFIED=0 AGGREGATION_TEMPORALITY_UNSPECIFIED value + * @property {number} AGGREGATION_TEMPORALITY_DELTA=1 AGGREGATION_TEMPORALITY_DELTA value + * @property {number} AGGREGATION_TEMPORALITY_CUMULATIVE=2 AGGREGATION_TEMPORALITY_CUMULATIVE value + */ + v1.AggregationTemporality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGGREGATION_TEMPORALITY_DELTA"] = 1; + values[valuesById[2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2; + return values; + })(); + /** + * DataPointFlags enum. + * @name opentelemetry.proto.metrics.v1.DataPointFlags + * @enum {number} + * @property {number} DATA_POINT_FLAGS_DO_NOT_USE=0 DATA_POINT_FLAGS_DO_NOT_USE value + * @property {number} DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK=1 DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK value + */ + v1.DataPointFlags = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_POINT_FLAGS_DO_NOT_USE"] = 0; + values[valuesById[1] = "DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"] = 1; + return values; + })(); + v1.NumberDataPoint = (function() { + /** + * Properties of a NumberDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @interface INumberDataPoint + * @property {Array.|null} [attributes] NumberDataPoint attributes + * @property {number|Long|null} [startTimeUnixNano] NumberDataPoint startTimeUnixNano + * @property {number|Long|null} [timeUnixNano] NumberDataPoint timeUnixNano + * @property {number|null} [asDouble] NumberDataPoint asDouble + * @property {number|Long|null} [asInt] NumberDataPoint asInt + * @property {Array.|null} [exemplars] NumberDataPoint exemplars + * @property {number|null} [flags] NumberDataPoint flags + */ + /** + * Constructs a new NumberDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a NumberDataPoint. + * @implements INumberDataPoint + * @constructor + * @param {opentelemetry.proto.metrics.v1.INumberDataPoint=} [properties] Properties to set + */ + function NumberDataPoint(properties) { + this.attributes = []; + this.exemplars = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * NumberDataPoint attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + NumberDataPoint.prototype.attributes = $util.emptyArray; + /** + * NumberDataPoint startTimeUnixNano. + * @member {number|Long|null|undefined} startTimeUnixNano + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + NumberDataPoint.prototype.startTimeUnixNano = null; + /** + * NumberDataPoint timeUnixNano. + * @member {number|Long|null|undefined} timeUnixNano + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + NumberDataPoint.prototype.timeUnixNano = null; + /** + * NumberDataPoint asDouble. + * @member {number|null|undefined} asDouble + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + NumberDataPoint.prototype.asDouble = null; + /** + * NumberDataPoint asInt. + * @member {number|Long|null|undefined} asInt + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + NumberDataPoint.prototype.asInt = null; + /** + * NumberDataPoint exemplars. + * @member {Array.} exemplars + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + NumberDataPoint.prototype.exemplars = $util.emptyArray; + /** + * NumberDataPoint flags. + * @member {number|null|undefined} flags + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + NumberDataPoint.prototype.flags = null; + var $oneOfFields; + /** + * NumberDataPoint value. + * @member {"asDouble"|"asInt"|undefined} value + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + */ + Object.defineProperty(NumberDataPoint.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * Creates a new NumberDataPoint instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.INumberDataPoint=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint instance + */ + NumberDataPoint.create = function create(properties) { + return new NumberDataPoint(properties); + }; + /** + * Encodes the specified NumberDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.NumberDataPoint.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.INumberDataPoint} message NumberDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumberDataPoint.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); + if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) writer.uint32(33).double(message.asDouble); + if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(42).fork()).ldelim(); + if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); + return writer; + }; + /** + * Encodes the specified NumberDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.NumberDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.INumberDataPoint} message NumberDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumberDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a NumberDataPoint message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumberDataPoint.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 7: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 2: + message.startTimeUnixNano = reader.fixed64(); + break; + case 3: + message.timeUnixNano = reader.fixed64(); + break; + case 4: + message.asDouble = reader.double(); + break; + case 6: + message.asInt = reader.sfixed64(); + break; + case 5: + if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; + message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); + break; + case 8: + message.flags = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a NumberDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumberDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a NumberDataPoint message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumberDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; + } + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + properties.value = 1; + if (typeof message.asDouble !== "number") return "asDouble: number expected"; + } + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) return "asInt: integer|Long expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; + for (var i = 0; i < message.exemplars.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); + if (error) return "exemplars." + error; + } + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) return "flags: integer expected"; + } + return null; + }; + /** + * Creates a NumberDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint + */ + NumberDataPoint.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.NumberDataPoint) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint(); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; + else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); + else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; + else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object$1.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; + else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); + else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; + else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); + } + if (object$1.asDouble != null) message.asDouble = Number(object$1.asDouble); + if (object$1.asInt != null) { + if ($util.Long) (message.asInt = $util.Long.fromValue(object$1.asInt)).unsigned = false; + else if (typeof object$1.asInt === "string") message.asInt = parseInt(object$1.asInt, 10); + else if (typeof object$1.asInt === "number") message.asInt = object$1.asInt; + else if (typeof object$1.asInt === "object") message.asInt = new $util.LongBits(object$1.asInt.low >>> 0, object$1.asInt.high >>> 0).toNumber(); + } + if (object$1.exemplars) { + if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object$1.exemplars.length; ++i) { + if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); + } + } + if (object$1.flags != null) message.flags = object$1.flags >>> 0; + return message; + }; + /** + * Creates a plain object from a NumberDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.NumberDataPoint} message NumberDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumberDataPoint.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) { + object$1.exemplars = []; + object$1.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.timeUnixNano = options.longs === String ? "0" : 0; + object$1.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + object$1.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; + if (options.oneofs) object$1.value = "asDouble"; + } + if (message.exemplars && message.exemplars.length) { + object$1.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (typeof message.asInt === "number") object$1.asInt = options.longs === String ? String(message.asInt) : message.asInt; + else object$1.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; + if (options.oneofs) object$1.value = "asInt"; + } + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; + return object$1; + }; + /** + * Converts this NumberDataPoint to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @instance + * @returns {Object.} JSON object + */ + NumberDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for NumberDataPoint + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NumberDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.NumberDataPoint"; + }; + return NumberDataPoint; + })(); + v1.HistogramDataPoint = (function() { + /** + * Properties of a HistogramDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IHistogramDataPoint + * @property {Array.|null} [attributes] HistogramDataPoint attributes + * @property {number|Long|null} [startTimeUnixNano] HistogramDataPoint startTimeUnixNano + * @property {number|Long|null} [timeUnixNano] HistogramDataPoint timeUnixNano + * @property {number|Long|null} [count] HistogramDataPoint count + * @property {number|null} [sum] HistogramDataPoint sum + * @property {Array.|null} [bucketCounts] HistogramDataPoint bucketCounts + * @property {Array.|null} [explicitBounds] HistogramDataPoint explicitBounds + * @property {Array.|null} [exemplars] HistogramDataPoint exemplars + * @property {number|null} [flags] HistogramDataPoint flags + * @property {number|null} [min] HistogramDataPoint min + * @property {number|null} [max] HistogramDataPoint max + */ + /** + * Constructs a new HistogramDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a HistogramDataPoint. + * @implements IHistogramDataPoint + * @constructor + * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint=} [properties] Properties to set + */ + function HistogramDataPoint(properties) { + this.attributes = []; + this.bucketCounts = []; + this.explicitBounds = []; + this.exemplars = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * HistogramDataPoint attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.attributes = $util.emptyArray; + /** + * HistogramDataPoint startTimeUnixNano. + * @member {number|Long|null|undefined} startTimeUnixNano + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.startTimeUnixNano = null; + /** + * HistogramDataPoint timeUnixNano. + * @member {number|Long|null|undefined} timeUnixNano + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.timeUnixNano = null; + /** + * HistogramDataPoint count. + * @member {number|Long|null|undefined} count + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.count = null; + /** + * HistogramDataPoint sum. + * @member {number|null|undefined} sum + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.sum = null; + /** + * HistogramDataPoint bucketCounts. + * @member {Array.} bucketCounts + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.bucketCounts = $util.emptyArray; + /** + * HistogramDataPoint explicitBounds. + * @member {Array.} explicitBounds + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.explicitBounds = $util.emptyArray; + /** + * HistogramDataPoint exemplars. + * @member {Array.} exemplars + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.exemplars = $util.emptyArray; + /** + * HistogramDataPoint flags. + * @member {number|null|undefined} flags + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.flags = null; + /** + * HistogramDataPoint min. + * @member {number|null|undefined} min + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.min = null; + /** + * HistogramDataPoint max. + * @member {number|null|undefined} max + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + HistogramDataPoint.prototype.max = null; + var $oneOfFields; + /** + * HistogramDataPoint _sum. + * @member {"sum"|undefined} _sum + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + Object.defineProperty(HistogramDataPoint.prototype, "_sum", { + get: $util.oneOfGetter($oneOfFields = ["sum"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * HistogramDataPoint _min. + * @member {"min"|undefined} _min + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + Object.defineProperty(HistogramDataPoint.prototype, "_min", { + get: $util.oneOfGetter($oneOfFields = ["min"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * HistogramDataPoint _max. + * @member {"max"|undefined} _max + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + */ + Object.defineProperty(HistogramDataPoint.prototype, "_max", { + get: $util.oneOfGetter($oneOfFields = ["max"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * Creates a new HistogramDataPoint instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint instance + */ + HistogramDataPoint.create = function create(properties) { + return new HistogramDataPoint(properties); + }; + /** + * Encodes the specified HistogramDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.HistogramDataPoint.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint} message HistogramDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramDataPoint.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); + if (message.bucketCounts != null && message.bucketCounts.length) { + writer.uint32(50).fork(); + for (var i = 0; i < message.bucketCounts.length; ++i) writer.fixed64(message.bucketCounts[i]); + writer.ldelim(); + } + if (message.explicitBounds != null && message.explicitBounds.length) { + writer.uint32(58).fork(); + for (var i = 0; i < message.explicitBounds.length; ++i) writer.double(message.explicitBounds[i]); + writer.ldelim(); + } + if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(66).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(89).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) writer.uint32(97).double(message.max); + return writer; + }; + /** + * Encodes the specified HistogramDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.HistogramDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint} message HistogramDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a HistogramDataPoint message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramDataPoint.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 9: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 2: + message.startTimeUnixNano = reader.fixed64(); + break; + case 3: + message.timeUnixNano = reader.fixed64(); + break; + case 4: + message.count = reader.fixed64(); + break; + case 5: + message.sum = reader.double(); + break; + case 6: + if (!(message.bucketCounts && message.bucketCounts.length)) message.bucketCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) message.bucketCounts.push(reader.fixed64()); + } else message.bucketCounts.push(reader.fixed64()); + break; + case 7: + if (!(message.explicitBounds && message.explicitBounds.length)) message.explicitBounds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) message.explicitBounds.push(reader.double()); + } else message.explicitBounds.push(reader.double()); + break; + case 8: + if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; + message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); + break; + case 10: + message.flags = reader.uint32(); + break; + case 11: + message.min = reader.double(); + break; + case 12: + message.max = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a HistogramDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a HistogramDataPoint message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties._sum = 1; + if (typeof message.sum !== "number") return "sum: number expected"; + } + if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { + if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; + for (var i = 0; i < message.bucketCounts.length; ++i) if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) return "bucketCounts: integer|Long[] expected"; + } + if (message.explicitBounds != null && message.hasOwnProperty("explicitBounds")) { + if (!Array.isArray(message.explicitBounds)) return "explicitBounds: array expected"; + for (var i = 0; i < message.explicitBounds.length; ++i) if (typeof message.explicitBounds[i] !== "number") return "explicitBounds: number[] expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; + for (var i = 0; i < message.exemplars.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); + if (error) return "exemplars." + error; + } + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) return "flags: integer expected"; + } + if (message.min != null && message.hasOwnProperty("min")) { + properties._min = 1; + if (typeof message.min !== "number") return "min: number expected"; + } + if (message.max != null && message.hasOwnProperty("max")) { + properties._max = 1; + if (typeof message.max !== "number") return "max: number expected"; + } + return null; + }; + /** + * Creates a HistogramDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint + */ + HistogramDataPoint.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.HistogramDataPoint) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint(); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; + else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); + else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; + else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object$1.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; + else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); + else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; + else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); + } + if (object$1.count != null) { + if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; + else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); + else if (typeof object$1.count === "number") message.count = object$1.count; + else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); + } + if (object$1.sum != null) message.sum = Number(object$1.sum); + if (object$1.bucketCounts) { + if (!Array.isArray(object$1.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0; i < object$1.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object$1.bucketCounts[i])).unsigned = false; + else if (typeof object$1.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object$1.bucketCounts[i], 10); + else if (typeof object$1.bucketCounts[i] === "number") message.bucketCounts[i] = object$1.bucketCounts[i]; + else if (typeof object$1.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object$1.bucketCounts[i].low >>> 0, object$1.bucketCounts[i].high >>> 0).toNumber(); + } + if (object$1.explicitBounds) { + if (!Array.isArray(object$1.explicitBounds)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected"); + message.explicitBounds = []; + for (var i = 0; i < object$1.explicitBounds.length; ++i) message.explicitBounds[i] = Number(object$1.explicitBounds[i]); + } + if (object$1.exemplars) { + if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object$1.exemplars.length; ++i) { + if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); + } + } + if (object$1.flags != null) message.flags = object$1.flags >>> 0; + if (object$1.min != null) message.min = Number(object$1.min); + if (object$1.max != null) message.max = Number(object$1.max); + return message; + }; + /** + * Creates a plain object from a HistogramDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.HistogramDataPoint} message HistogramDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramDataPoint.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) { + object$1.bucketCounts = []; + object$1.explicitBounds = []; + object$1.exemplars = []; + object$1.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.count = options.longs === String ? "0" : 0; + object$1.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; + else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.sum != null && message.hasOwnProperty("sum")) { + object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (options.oneofs) object$1._sum = "sum"; + } + if (message.bucketCounts && message.bucketCounts.length) { + object$1.bucketCounts = []; + for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object$1.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else object$1.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; + } + if (message.explicitBounds && message.explicitBounds.length) { + object$1.explicitBounds = []; + for (var j = 0; j < message.explicitBounds.length; ++j) object$1.explicitBounds[j] = options.json && !isFinite(message.explicitBounds[j]) ? String(message.explicitBounds[j]) : message.explicitBounds[j]; + } + if (message.exemplars && message.exemplars.length) { + object$1.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; + if (message.min != null && message.hasOwnProperty("min")) { + object$1.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (options.oneofs) object$1._min = "min"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object$1.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (options.oneofs) object$1._max = "max"; + } + return object$1; + }; + /** + * Converts this HistogramDataPoint to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @instance + * @returns {Object.} JSON object + */ + HistogramDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for HistogramDataPoint + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.HistogramDataPoint"; + }; + return HistogramDataPoint; + })(); + v1.ExponentialHistogramDataPoint = (function() { + /** + * Properties of an ExponentialHistogramDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IExponentialHistogramDataPoint + * @property {Array.|null} [attributes] ExponentialHistogramDataPoint attributes + * @property {number|Long|null} [startTimeUnixNano] ExponentialHistogramDataPoint startTimeUnixNano + * @property {number|Long|null} [timeUnixNano] ExponentialHistogramDataPoint timeUnixNano + * @property {number|Long|null} [count] ExponentialHistogramDataPoint count + * @property {number|null} [sum] ExponentialHistogramDataPoint sum + * @property {number|null} [scale] ExponentialHistogramDataPoint scale + * @property {number|Long|null} [zeroCount] ExponentialHistogramDataPoint zeroCount + * @property {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null} [positive] ExponentialHistogramDataPoint positive + * @property {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null} [negative] ExponentialHistogramDataPoint negative + * @property {number|null} [flags] ExponentialHistogramDataPoint flags + * @property {Array.|null} [exemplars] ExponentialHistogramDataPoint exemplars + * @property {number|null} [min] ExponentialHistogramDataPoint min + * @property {number|null} [max] ExponentialHistogramDataPoint max + * @property {number|null} [zeroThreshold] ExponentialHistogramDataPoint zeroThreshold + */ + /** + * Constructs a new ExponentialHistogramDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents an ExponentialHistogramDataPoint. + * @implements IExponentialHistogramDataPoint + * @constructor + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint=} [properties] Properties to set + */ + function ExponentialHistogramDataPoint(properties) { + this.attributes = []; + this.exemplars = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ExponentialHistogramDataPoint attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.attributes = $util.emptyArray; + /** + * ExponentialHistogramDataPoint startTimeUnixNano. + * @member {number|Long|null|undefined} startTimeUnixNano + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.startTimeUnixNano = null; + /** + * ExponentialHistogramDataPoint timeUnixNano. + * @member {number|Long|null|undefined} timeUnixNano + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.timeUnixNano = null; + /** + * ExponentialHistogramDataPoint count. + * @member {number|Long|null|undefined} count + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.count = null; + /** + * ExponentialHistogramDataPoint sum. + * @member {number|null|undefined} sum + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.sum = null; + /** + * ExponentialHistogramDataPoint scale. + * @member {number|null|undefined} scale + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.scale = null; + /** + * ExponentialHistogramDataPoint zeroCount. + * @member {number|Long|null|undefined} zeroCount + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.zeroCount = null; + /** + * ExponentialHistogramDataPoint positive. + * @member {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null|undefined} positive + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.positive = null; + /** + * ExponentialHistogramDataPoint negative. + * @member {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null|undefined} negative + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.negative = null; + /** + * ExponentialHistogramDataPoint flags. + * @member {number|null|undefined} flags + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.flags = null; + /** + * ExponentialHistogramDataPoint exemplars. + * @member {Array.} exemplars + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.exemplars = $util.emptyArray; + /** + * ExponentialHistogramDataPoint min. + * @member {number|null|undefined} min + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.min = null; + /** + * ExponentialHistogramDataPoint max. + * @member {number|null|undefined} max + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.max = null; + /** + * ExponentialHistogramDataPoint zeroThreshold. + * @member {number|null|undefined} zeroThreshold + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + ExponentialHistogramDataPoint.prototype.zeroThreshold = null; + var $oneOfFields; + /** + * ExponentialHistogramDataPoint _sum. + * @member {"sum"|undefined} _sum + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_sum", { + get: $util.oneOfGetter($oneOfFields = ["sum"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * ExponentialHistogramDataPoint _min. + * @member {"min"|undefined} _min + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_min", { + get: $util.oneOfGetter($oneOfFields = ["min"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * ExponentialHistogramDataPoint _max. + * @member {"max"|undefined} _max + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + */ + Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_max", { + get: $util.oneOfGetter($oneOfFields = ["max"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * Creates a new ExponentialHistogramDataPoint instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint instance + */ + ExponentialHistogramDataPoint.create = function create(properties) { + return new ExponentialHistogramDataPoint(properties); + }; + /** + * Encodes the specified ExponentialHistogramDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint} message ExponentialHistogramDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExponentialHistogramDataPoint.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) writer.uint32(48).sint32(message.scale); + if (message.zeroCount != null && Object.hasOwnProperty.call(message, "zeroCount")) writer.uint32(57).fixed64(message.zeroCount); + if (message.positive != null && Object.hasOwnProperty.call(message, "positive")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.positive, writer.uint32(66).fork()).ldelim(); + if (message.negative != null && Object.hasOwnProperty.call(message, "negative")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.negative, writer.uint32(74).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); + if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(90).fork()).ldelim(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(97).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) writer.uint32(105).double(message.max); + if (message.zeroThreshold != null && Object.hasOwnProperty.call(message, "zeroThreshold")) writer.uint32(113).double(message.zeroThreshold); + return writer; + }; + /** + * Encodes the specified ExponentialHistogramDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint} message ExponentialHistogramDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExponentialHistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an ExponentialHistogramDataPoint message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExponentialHistogramDataPoint.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 2: + message.startTimeUnixNano = reader.fixed64(); + break; + case 3: + message.timeUnixNano = reader.fixed64(); + break; + case 4: + message.count = reader.fixed64(); + break; + case 5: + message.sum = reader.double(); + break; + case 6: + message.scale = reader.sint32(); + break; + case 7: + message.zeroCount = reader.fixed64(); + break; + case 8: + message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); + break; + case 9: + message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); + break; + case 10: + message.flags = reader.uint32(); + break; + case 11: + if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; + message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); + break; + case 12: + message.min = reader.double(); + break; + case 13: + message.max = reader.double(); + break; + case 14: + message.zeroThreshold = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an ExponentialHistogramDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExponentialHistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an ExponentialHistogramDataPoint message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExponentialHistogramDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties._sum = 1; + if (typeof message.sum !== "number") return "sum: number expected"; + } + if (message.scale != null && message.hasOwnProperty("scale")) { + if (!$util.isInteger(message.scale)) return "scale: integer expected"; + } + if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) { + if (!$util.isInteger(message.zeroCount) && !(message.zeroCount && $util.isInteger(message.zeroCount.low) && $util.isInteger(message.zeroCount.high))) return "zeroCount: integer|Long expected"; + } + if (message.positive != null && message.hasOwnProperty("positive")) { + var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.positive); + if (error) return "positive." + error; + } + if (message.negative != null && message.hasOwnProperty("negative")) { + var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.negative); + if (error) return "negative." + error; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) return "flags: integer expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; + for (var i = 0; i < message.exemplars.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); + if (error) return "exemplars." + error; + } + } + if (message.min != null && message.hasOwnProperty("min")) { + properties._min = 1; + if (typeof message.min !== "number") return "min: number expected"; + } + if (message.max != null && message.hasOwnProperty("max")) { + properties._max = 1; + if (typeof message.max !== "number") return "max: number expected"; + } + if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) { + if (typeof message.zeroThreshold !== "number") return "zeroThreshold: number expected"; + } + return null; + }; + /** + * Creates an ExponentialHistogramDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint + */ + ExponentialHistogramDataPoint.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint(); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; + else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); + else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; + else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object$1.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; + else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); + else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; + else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); + } + if (object$1.count != null) { + if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; + else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); + else if (typeof object$1.count === "number") message.count = object$1.count; + else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); + } + if (object$1.sum != null) message.sum = Number(object$1.sum); + if (object$1.scale != null) message.scale = object$1.scale | 0; + if (object$1.zeroCount != null) { + if ($util.Long) (message.zeroCount = $util.Long.fromValue(object$1.zeroCount)).unsigned = false; + else if (typeof object$1.zeroCount === "string") message.zeroCount = parseInt(object$1.zeroCount, 10); + else if (typeof object$1.zeroCount === "number") message.zeroCount = object$1.zeroCount; + else if (typeof object$1.zeroCount === "object") message.zeroCount = new $util.LongBits(object$1.zeroCount.low >>> 0, object$1.zeroCount.high >>> 0).toNumber(); + } + if (object$1.positive != null) { + if (typeof object$1.positive !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected"); + message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object$1.positive); + } + if (object$1.negative != null) { + if (typeof object$1.negative !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected"); + message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object$1.negative); + } + if (object$1.flags != null) message.flags = object$1.flags >>> 0; + if (object$1.exemplars) { + if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object$1.exemplars.length; ++i) { + if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); + } + } + if (object$1.min != null) message.min = Number(object$1.min); + if (object$1.max != null) message.max = Number(object$1.max); + if (object$1.zeroThreshold != null) message.zeroThreshold = Number(object$1.zeroThreshold); + return message; + }; + /** + * Creates a plain object from an ExponentialHistogramDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} message ExponentialHistogramDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExponentialHistogramDataPoint.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) { + object$1.attributes = []; + object$1.exemplars = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.count = options.longs === String ? "0" : 0; + object$1.scale = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.zeroCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.zeroCount = options.longs === String ? "0" : 0; + object$1.positive = null; + object$1.negative = null; + object$1.flags = 0; + object$1.zeroThreshold = 0; + } + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; + else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.sum != null && message.hasOwnProperty("sum")) { + object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (options.oneofs) object$1._sum = "sum"; + } + if (message.scale != null && message.hasOwnProperty("scale")) object$1.scale = message.scale; + if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) if (typeof message.zeroCount === "number") object$1.zeroCount = options.longs === String ? String(message.zeroCount) : message.zeroCount; + else object$1.zeroCount = options.longs === String ? $util.Long.prototype.toString.call(message.zeroCount) : options.longs === Number ? new $util.LongBits(message.zeroCount.low >>> 0, message.zeroCount.high >>> 0).toNumber() : message.zeroCount; + if (message.positive != null && message.hasOwnProperty("positive")) object$1.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.positive, options); + if (message.negative != null && message.hasOwnProperty("negative")) object$1.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.negative, options); + if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; + if (message.exemplars && message.exemplars.length) { + object$1.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.min != null && message.hasOwnProperty("min")) { + object$1.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (options.oneofs) object$1._min = "min"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object$1.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (options.oneofs) object$1._max = "max"; + } + if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) object$1.zeroThreshold = options.json && !isFinite(message.zeroThreshold) ? String(message.zeroThreshold) : message.zeroThreshold; + return object$1; + }; + /** + * Converts this ExponentialHistogramDataPoint to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @instance + * @returns {Object.} JSON object + */ + ExponentialHistogramDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ExponentialHistogramDataPoint + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExponentialHistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"; + }; + ExponentialHistogramDataPoint.Buckets = (function() { + /** + * Properties of a Buckets. + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @interface IBuckets + * @property {number|null} [offset] Buckets offset + * @property {Array.|null} [bucketCounts] Buckets bucketCounts + */ + /** + * Constructs a new Buckets. + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint + * @classdesc Represents a Buckets. + * @implements IBuckets + * @constructor + * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets=} [properties] Properties to set + */ + function Buckets(properties) { + this.bucketCounts = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Buckets offset. + * @member {number|null|undefined} offset + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @instance + */ + Buckets.prototype.offset = null; + /** + * Buckets bucketCounts. + * @member {Array.} bucketCounts + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @instance + */ + Buckets.prototype.bucketCounts = $util.emptyArray; + /** + * Creates a new Buckets instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets instance + */ + Buckets.create = function create(properties) { + return new Buckets(properties); + }; + /** + * Encodes the specified Buckets message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets} message Buckets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Buckets.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) writer.uint32(8).sint32(message.offset); + if (message.bucketCounts != null && message.bucketCounts.length) { + writer.uint32(18).fork(); + for (var i = 0; i < message.bucketCounts.length; ++i) writer.uint64(message.bucketCounts[i]); + writer.ldelim(); + } + return writer; + }; + /** + * Encodes the specified Buckets message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets} message Buckets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Buckets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a Buckets message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Buckets.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.offset = reader.sint32(); + break; + case 2: + if (!(message.bucketCounts && message.bucketCounts.length)) message.bucketCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) message.bucketCounts.push(reader.uint64()); + } else message.bucketCounts.push(reader.uint64()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a Buckets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Buckets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a Buckets message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Buckets.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.offset != null && message.hasOwnProperty("offset")) { + if (!$util.isInteger(message.offset)) return "offset: integer expected"; + } + if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { + if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; + for (var i = 0; i < message.bucketCounts.length; ++i) if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) return "bucketCounts: integer|Long[] expected"; + } + return null; + }; + /** + * Creates a Buckets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets + */ + Buckets.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets(); + if (object$1.offset != null) message.offset = object$1.offset | 0; + if (object$1.bucketCounts) { + if (!Array.isArray(object$1.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0; i < object$1.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object$1.bucketCounts[i])).unsigned = true; + else if (typeof object$1.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object$1.bucketCounts[i], 10); + else if (typeof object$1.bucketCounts[i] === "number") message.bucketCounts[i] = object$1.bucketCounts[i]; + else if (typeof object$1.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object$1.bucketCounts[i].low >>> 0, object$1.bucketCounts[i].high >>> 0).toNumber(true); + } + return message; + }; + /** + * Creates a plain object from a Buckets message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} message Buckets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Buckets.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.bucketCounts = []; + if (options.defaults) object$1.offset = 0; + if (message.offset != null && message.hasOwnProperty("offset")) object$1.offset = message.offset; + if (message.bucketCounts && message.bucketCounts.length) { + object$1.bucketCounts = []; + for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object$1.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else object$1.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber(true) : message.bucketCounts[j]; + } + return object$1; + }; + /** + * Converts this Buckets to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @instance + * @returns {Object.} JSON object + */ + Buckets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Buckets + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Buckets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"; + }; + return Buckets; + })(); + return ExponentialHistogramDataPoint; + })(); + v1.SummaryDataPoint = (function() { + /** + * Properties of a SummaryDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @interface ISummaryDataPoint + * @property {Array.|null} [attributes] SummaryDataPoint attributes + * @property {number|Long|null} [startTimeUnixNano] SummaryDataPoint startTimeUnixNano + * @property {number|Long|null} [timeUnixNano] SummaryDataPoint timeUnixNano + * @property {number|Long|null} [count] SummaryDataPoint count + * @property {number|null} [sum] SummaryDataPoint sum + * @property {Array.|null} [quantileValues] SummaryDataPoint quantileValues + * @property {number|null} [flags] SummaryDataPoint flags + */ + /** + * Constructs a new SummaryDataPoint. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents a SummaryDataPoint. + * @implements ISummaryDataPoint + * @constructor + * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint=} [properties] Properties to set + */ + function SummaryDataPoint(properties) { + this.attributes = []; + this.quantileValues = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * SummaryDataPoint attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + */ + SummaryDataPoint.prototype.attributes = $util.emptyArray; + /** + * SummaryDataPoint startTimeUnixNano. + * @member {number|Long|null|undefined} startTimeUnixNano + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + */ + SummaryDataPoint.prototype.startTimeUnixNano = null; + /** + * SummaryDataPoint timeUnixNano. + * @member {number|Long|null|undefined} timeUnixNano + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + */ + SummaryDataPoint.prototype.timeUnixNano = null; + /** + * SummaryDataPoint count. + * @member {number|Long|null|undefined} count + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + */ + SummaryDataPoint.prototype.count = null; + /** + * SummaryDataPoint sum. + * @member {number|null|undefined} sum + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + */ + SummaryDataPoint.prototype.sum = null; + /** + * SummaryDataPoint quantileValues. + * @member {Array.} quantileValues + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + */ + SummaryDataPoint.prototype.quantileValues = $util.emptyArray; + /** + * SummaryDataPoint flags. + * @member {number|null|undefined} flags + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + */ + SummaryDataPoint.prototype.flags = null; + /** + * Creates a new SummaryDataPoint instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint instance + */ + SummaryDataPoint.create = function create(properties) { + return new SummaryDataPoint(properties); + }; + /** + * Encodes the specified SummaryDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint} message SummaryDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryDataPoint.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); + if (message.quantileValues != null && message.quantileValues.length) for (var i = 0; i < message.quantileValues.length; ++i) $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(message.quantileValues[i], writer.uint32(50).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); + return writer; + }; + /** + * Encodes the specified SummaryDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint} message SummaryDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a SummaryDataPoint message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryDataPoint.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 7: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 2: + message.startTimeUnixNano = reader.fixed64(); + break; + case 3: + message.timeUnixNano = reader.fixed64(); + break; + case 4: + message.count = reader.fixed64(); + break; + case 5: + message.sum = reader.double(); + break; + case 6: + if (!(message.quantileValues && message.quantileValues.length)) message.quantileValues = []; + message.quantileValues.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(reader, reader.uint32())); + break; + case 8: + message.flags = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a SummaryDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a SummaryDataPoint message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummaryDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (typeof message.sum !== "number") return "sum: number expected"; + } + if (message.quantileValues != null && message.hasOwnProperty("quantileValues")) { + if (!Array.isArray(message.quantileValues)) return "quantileValues: array expected"; + for (var i = 0; i < message.quantileValues.length; ++i) { + var error = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(message.quantileValues[i]); + if (error) return "quantileValues." + error; + } + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) return "flags: integer expected"; + } + return null; + }; + /** + * Creates a SummaryDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint + */ + SummaryDataPoint.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint(); + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; + else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); + else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; + else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object$1.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; + else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); + else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; + else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); + } + if (object$1.count != null) { + if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; + else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); + else if (typeof object$1.count === "number") message.count = object$1.count; + else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); + } + if (object$1.sum != null) message.sum = Number(object$1.sum); + if (object$1.quantileValues) { + if (!Array.isArray(object$1.quantileValues)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected"); + message.quantileValues = []; + for (var i = 0; i < object$1.quantileValues.length; ++i) { + if (typeof object$1.quantileValues[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected"); + message.quantileValues[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(object$1.quantileValues[i]); + } + } + if (object$1.flags != null) message.flags = object$1.flags >>> 0; + return message; + }; + /** + * Creates a plain object from a SummaryDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint} message SummaryDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummaryDataPoint.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) { + object$1.quantileValues = []; + object$1.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.count = options.longs === String ? "0" : 0; + object$1.sum = 0; + object$1.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; + else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.sum != null && message.hasOwnProperty("sum")) object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (message.quantileValues && message.quantileValues.length) { + object$1.quantileValues = []; + for (var j = 0; j < message.quantileValues.length; ++j) object$1.quantileValues[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(message.quantileValues[j], options); + } + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; + return object$1; + }; + /** + * Converts this SummaryDataPoint to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @instance + * @returns {Object.} JSON object + */ + SummaryDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for SummaryDataPoint + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SummaryDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint"; + }; + SummaryDataPoint.ValueAtQuantile = (function() { + /** + * Properties of a ValueAtQuantile. + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @interface IValueAtQuantile + * @property {number|null} [quantile] ValueAtQuantile quantile + * @property {number|null} [value] ValueAtQuantile value + */ + /** + * Constructs a new ValueAtQuantile. + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint + * @classdesc Represents a ValueAtQuantile. + * @implements IValueAtQuantile + * @constructor + * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile=} [properties] Properties to set + */ + function ValueAtQuantile(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ValueAtQuantile quantile. + * @member {number|null|undefined} quantile + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @instance + */ + ValueAtQuantile.prototype.quantile = null; + /** + * ValueAtQuantile value. + * @member {number|null|undefined} value + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @instance + */ + ValueAtQuantile.prototype.value = null; + /** + * Creates a new ValueAtQuantile instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile instance + */ + ValueAtQuantile.create = function create(properties) { + return new ValueAtQuantile(properties); + }; + /** + * Encodes the specified ValueAtQuantile message. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile} message ValueAtQuantile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueAtQuantile.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.quantile != null && Object.hasOwnProperty.call(message, "quantile")) writer.uint32(9).double(message.quantile); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(17).double(message.value); + return writer; + }; + /** + * Encodes the specified ValueAtQuantile message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile} message ValueAtQuantile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueAtQuantile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a ValueAtQuantile message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueAtQuantile.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.quantile = reader.double(); + break; + case 2: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a ValueAtQuantile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueAtQuantile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a ValueAtQuantile message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueAtQuantile.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.quantile != null && message.hasOwnProperty("quantile")) { + if (typeof message.quantile !== "number") return "quantile: number expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + if (typeof message.value !== "number") return "value: number expected"; + } + return null; + }; + /** + * Creates a ValueAtQuantile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile + */ + ValueAtQuantile.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile(); + if (object$1.quantile != null) message.quantile = Number(object$1.quantile); + if (object$1.value != null) message.value = Number(object$1.value); + return message; + }; + /** + * Creates a plain object from a ValueAtQuantile message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} message ValueAtQuantile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueAtQuantile.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.defaults) { + object$1.quantile = 0; + object$1.value = 0; + } + if (message.quantile != null && message.hasOwnProperty("quantile")) object$1.quantile = options.json && !isFinite(message.quantile) ? String(message.quantile) : message.quantile; + if (message.value != null && message.hasOwnProperty("value")) object$1.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object$1; + }; + /** + * Converts this ValueAtQuantile to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @instance + * @returns {Object.} JSON object + */ + ValueAtQuantile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ValueAtQuantile + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValueAtQuantile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"; + }; + return ValueAtQuantile; + })(); + return SummaryDataPoint; + })(); + v1.Exemplar = (function() { + /** + * Properties of an Exemplar. + * @memberof opentelemetry.proto.metrics.v1 + * @interface IExemplar + * @property {Array.|null} [filteredAttributes] Exemplar filteredAttributes + * @property {number|Long|null} [timeUnixNano] Exemplar timeUnixNano + * @property {number|null} [asDouble] Exemplar asDouble + * @property {number|Long|null} [asInt] Exemplar asInt + * @property {Uint8Array|null} [spanId] Exemplar spanId + * @property {Uint8Array|null} [traceId] Exemplar traceId + */ + /** + * Constructs a new Exemplar. + * @memberof opentelemetry.proto.metrics.v1 + * @classdesc Represents an Exemplar. + * @implements IExemplar + * @constructor + * @param {opentelemetry.proto.metrics.v1.IExemplar=} [properties] Properties to set + */ + function Exemplar(properties) { + this.filteredAttributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * Exemplar filteredAttributes. + * @member {Array.} filteredAttributes + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + */ + Exemplar.prototype.filteredAttributes = $util.emptyArray; + /** + * Exemplar timeUnixNano. + * @member {number|Long|null|undefined} timeUnixNano + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + */ + Exemplar.prototype.timeUnixNano = null; + /** + * Exemplar asDouble. + * @member {number|null|undefined} asDouble + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + */ + Exemplar.prototype.asDouble = null; + /** + * Exemplar asInt. + * @member {number|Long|null|undefined} asInt + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + */ + Exemplar.prototype.asInt = null; + /** + * Exemplar spanId. + * @member {Uint8Array|null|undefined} spanId + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + */ + Exemplar.prototype.spanId = null; + /** + * Exemplar traceId. + * @member {Uint8Array|null|undefined} traceId + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + */ + Exemplar.prototype.traceId = null; + var $oneOfFields; + /** + * Exemplar value. + * @member {"asDouble"|"asInt"|undefined} value + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + */ + Object.defineProperty(Exemplar.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** + * Creates a new Exemplar instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {opentelemetry.proto.metrics.v1.IExemplar=} [properties] Properties to set + * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar instance + */ + Exemplar.create = function create(properties) { + return new Exemplar(properties); + }; + /** + * Encodes the specified Exemplar message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Exemplar.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {opentelemetry.proto.metrics.v1.IExemplar} message Exemplar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exemplar.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(17).fixed64(message.timeUnixNano); + if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) writer.uint32(25).double(message.asDouble); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(34).bytes(message.spanId); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(42).bytes(message.traceId); + if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); + if (message.filteredAttributes != null && message.filteredAttributes.length) for (var i = 0; i < message.filteredAttributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.filteredAttributes[i], writer.uint32(58).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Exemplar.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {opentelemetry.proto.metrics.v1.IExemplar} message Exemplar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Exemplar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes an Exemplar message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exemplar.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Exemplar(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 7: + if (!(message.filteredAttributes && message.filteredAttributes.length)) message.filteredAttributes = []; + message.filteredAttributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 2: + message.timeUnixNano = reader.fixed64(); + break; + case 3: + message.asDouble = reader.double(); + break; + case 6: + message.asInt = reader.sfixed64(); + break; + case 4: + message.spanId = reader.bytes(); + break; + case 5: + message.traceId = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes an Exemplar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Exemplar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies an Exemplar message. + * @function verify + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Exemplar.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.filteredAttributes != null && message.hasOwnProperty("filteredAttributes")) { + if (!Array.isArray(message.filteredAttributes)) return "filteredAttributes: array expected"; + for (var i = 0; i < message.filteredAttributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.filteredAttributes[i]); + if (error) return "filteredAttributes." + error; + } + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; + } + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + properties.value = 1; + if (typeof message.asDouble !== "number") return "asDouble: number expected"; + } + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (properties.value === 1) return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) return "asInt: integer|Long expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; + } + return null; + }; + /** + * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar + */ + Exemplar.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Exemplar) return object$1; + var message = new $root.opentelemetry.proto.metrics.v1.Exemplar(); + if (object$1.filteredAttributes) { + if (!Array.isArray(object$1.filteredAttributes)) throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected"); + message.filteredAttributes = []; + for (var i = 0; i < object$1.filteredAttributes.length; ++i) { + if (typeof object$1.filteredAttributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected"); + message.filteredAttributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.filteredAttributes[i]); + } + } + if (object$1.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; + else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); + else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; + else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); + } + if (object$1.asDouble != null) message.asDouble = Number(object$1.asDouble); + if (object$1.asInt != null) { + if ($util.Long) (message.asInt = $util.Long.fromValue(object$1.asInt)).unsigned = false; + else if (typeof object$1.asInt === "string") message.asInt = parseInt(object$1.asInt, 10); + else if (typeof object$1.asInt === "number") message.asInt = object$1.asInt; + else if (typeof object$1.asInt === "object") message.asInt = new $util.LongBits(object$1.asInt.low >>> 0, object$1.asInt.high >>> 0).toNumber(); + } + if (object$1.spanId != null) { + if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); + else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; + } + if (object$1.traceId != null) { + if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); + else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; + } + return message; + }; + /** + * Creates a plain object from an Exemplar message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {opentelemetry.proto.metrics.v1.Exemplar} message Exemplar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Exemplar.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.filteredAttributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.timeUnixNano = options.longs === String ? "0" : 0; + if (options.bytes === String) object$1.spanId = ""; + else { + object$1.spanId = []; + if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); + } + if (options.bytes === String) object$1.traceId = ""; + else { + object$1.traceId = []; + if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); + } + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + object$1.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; + if (options.oneofs) object$1.value = "asDouble"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (typeof message.asInt === "number") object$1.asInt = options.longs === String ? String(message.asInt) : message.asInt; + else object$1.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; + if (options.oneofs) object$1.value = "asInt"; + } + if (message.filteredAttributes && message.filteredAttributes.length) { + object$1.filteredAttributes = []; + for (var j = 0; j < message.filteredAttributes.length; ++j) object$1.filteredAttributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.filteredAttributes[j], options); + } + return object$1; + }; + /** + * Converts this Exemplar to JSON. + * @function toJSON + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @instance + * @returns {Object.} JSON object + */ + Exemplar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for Exemplar + * @function getTypeUrl + * @memberof opentelemetry.proto.metrics.v1.Exemplar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Exemplar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Exemplar"; + }; + return Exemplar; + })(); + return v1; + })(); + return metrics$1; + })(); + proto.logs = (function() { + /** + * Namespace logs. + * @memberof opentelemetry.proto + * @namespace + */ + var logs = {}; + logs.v1 = (function() { + /** + * Namespace v1. + * @memberof opentelemetry.proto.logs + * @namespace + */ + var v1 = {}; + v1.LogsData = (function() { + /** + * Properties of a LogsData. + * @memberof opentelemetry.proto.logs.v1 + * @interface ILogsData + * @property {Array.|null} [resourceLogs] LogsData resourceLogs + */ + /** + * Constructs a new LogsData. + * @memberof opentelemetry.proto.logs.v1 + * @classdesc Represents a LogsData. + * @implements ILogsData + * @constructor + * @param {opentelemetry.proto.logs.v1.ILogsData=} [properties] Properties to set + */ + function LogsData(properties) { + this.resourceLogs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * LogsData resourceLogs. + * @member {Array.} resourceLogs + * @memberof opentelemetry.proto.logs.v1.LogsData + * @instance + */ + LogsData.prototype.resourceLogs = $util.emptyArray; + /** + * Creates a new LogsData instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {opentelemetry.proto.logs.v1.ILogsData=} [properties] Properties to set + * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData instance + */ + LogsData.create = function create(properties) { + return new LogsData(properties); + }; + /** + * Encodes the specified LogsData message. Does not implicitly {@link opentelemetry.proto.logs.v1.LogsData.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {opentelemetry.proto.logs.v1.ILogsData} message LogsData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsData.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resourceLogs != null && message.resourceLogs.length) for (var i = 0; i < message.resourceLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified LogsData message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.LogsData.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {opentelemetry.proto.logs.v1.ILogsData} message LogsData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogsData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a LogsData message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsData.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogsData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + if (!(message.resourceLogs && message.resourceLogs.length)) message.resourceLogs = []; + message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a LogsData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogsData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a LogsData message. + * @function verify + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogsData.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { + if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; + for (var i = 0; i < message.resourceLogs.length; ++i) { + var error = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); + if (error) return "resourceLogs." + error; + } + } + return null; + }; + /** + * Creates a LogsData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData + */ + LogsData.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.logs.v1.LogsData) return object$1; + var message = new $root.opentelemetry.proto.logs.v1.LogsData(); + if (object$1.resourceLogs) { + if (!Array.isArray(object$1.resourceLogs)) throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected"); + message.resourceLogs = []; + for (var i = 0; i < object$1.resourceLogs.length; ++i) { + if (typeof object$1.resourceLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected"); + message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object$1.resourceLogs[i]); + } + } + return message; + }; + /** + * Creates a plain object from a LogsData message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {opentelemetry.proto.logs.v1.LogsData} message LogsData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogsData.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.resourceLogs = []; + if (message.resourceLogs && message.resourceLogs.length) { + object$1.resourceLogs = []; + for (var j = 0; j < message.resourceLogs.length; ++j) object$1.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); + } + return object$1; + }; + /** + * Converts this LogsData to JSON. + * @function toJSON + * @memberof opentelemetry.proto.logs.v1.LogsData + * @instance + * @returns {Object.} JSON object + */ + LogsData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for LogsData + * @function getTypeUrl + * @memberof opentelemetry.proto.logs.v1.LogsData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogsData"; + }; + return LogsData; + })(); + v1.ResourceLogs = (function() { + /** + * Properties of a ResourceLogs. + * @memberof opentelemetry.proto.logs.v1 + * @interface IResourceLogs + * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceLogs resource + * @property {Array.|null} [scopeLogs] ResourceLogs scopeLogs + * @property {string|null} [schemaUrl] ResourceLogs schemaUrl + */ + /** + * Constructs a new ResourceLogs. + * @memberof opentelemetry.proto.logs.v1 + * @classdesc Represents a ResourceLogs. + * @implements IResourceLogs + * @constructor + * @param {opentelemetry.proto.logs.v1.IResourceLogs=} [properties] Properties to set + */ + function ResourceLogs(properties) { + this.scopeLogs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ResourceLogs resource. + * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @instance + */ + ResourceLogs.prototype.resource = null; + /** + * ResourceLogs scopeLogs. + * @member {Array.} scopeLogs + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @instance + */ + ResourceLogs.prototype.scopeLogs = $util.emptyArray; + /** + * ResourceLogs schemaUrl. + * @member {string|null|undefined} schemaUrl + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @instance + */ + ResourceLogs.prototype.schemaUrl = null; + /** + * Creates a new ResourceLogs instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {opentelemetry.proto.logs.v1.IResourceLogs=} [properties] Properties to set + * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs instance + */ + ResourceLogs.create = function create(properties) { + return new ResourceLogs(properties); + }; + /** + * Encodes the specified ResourceLogs message. Does not implicitly {@link opentelemetry.proto.logs.v1.ResourceLogs.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {opentelemetry.proto.logs.v1.IResourceLogs} message ResourceLogs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceLogs.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + if (message.scopeLogs != null && message.scopeLogs.length) for (var i = 0; i < message.scopeLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ScopeLogs.encode(message.scopeLogs[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); + return writer; + }; + /** + * Encodes the specified ResourceLogs message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.ResourceLogs.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {opentelemetry.proto.logs.v1.IResourceLogs} message ResourceLogs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceLogs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a ResourceLogs message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceLogs.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ResourceLogs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.scopeLogs && message.scopeLogs.length)) message.scopeLogs = []; + message.scopeLogs.push($root.opentelemetry.proto.logs.v1.ScopeLogs.decode(reader, reader.uint32())); + break; + case 3: + message.schemaUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a ResourceLogs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceLogs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a ResourceLogs message. + * @function verify + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceLogs.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error) return "resource." + error; + } + if (message.scopeLogs != null && message.hasOwnProperty("scopeLogs")) { + if (!Array.isArray(message.scopeLogs)) return "scopeLogs: array expected"; + for (var i = 0; i < message.scopeLogs.length; ++i) { + var error = $root.opentelemetry.proto.logs.v1.ScopeLogs.verify(message.scopeLogs[i]); + if (error) return "scopeLogs." + error; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; + } + return null; + }; + /** + * Creates a ResourceLogs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs + */ + ResourceLogs.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.logs.v1.ResourceLogs) return object$1; + var message = new $root.opentelemetry.proto.logs.v1.ResourceLogs(); + if (object$1.resource != null) { + if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); + } + if (object$1.scopeLogs) { + if (!Array.isArray(object$1.scopeLogs)) throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected"); + message.scopeLogs = []; + for (var i = 0; i < object$1.scopeLogs.length; ++i) { + if (typeof object$1.scopeLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected"); + message.scopeLogs[i] = $root.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(object$1.scopeLogs[i]); + } + } + if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); + return message; + }; + /** + * Creates a plain object from a ResourceLogs message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {opentelemetry.proto.logs.v1.ResourceLogs} message ResourceLogs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceLogs.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.scopeLogs = []; + if (options.defaults) { + object$1.resource = null; + object$1.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeLogs && message.scopeLogs.length) { + object$1.scopeLogs = []; + for (var j = 0; j < message.scopeLogs.length; ++j) object$1.scopeLogs[j] = $root.opentelemetry.proto.logs.v1.ScopeLogs.toObject(message.scopeLogs[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; + return object$1; + }; + /** + * Converts this ResourceLogs to JSON. + * @function toJSON + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @instance + * @returns {Object.} JSON object + */ + ResourceLogs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ResourceLogs + * @function getTypeUrl + * @memberof opentelemetry.proto.logs.v1.ResourceLogs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ResourceLogs"; + }; + return ResourceLogs; + })(); + v1.ScopeLogs = (function() { + /** + * Properties of a ScopeLogs. + * @memberof opentelemetry.proto.logs.v1 + * @interface IScopeLogs + * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeLogs scope + * @property {Array.|null} [logRecords] ScopeLogs logRecords + * @property {string|null} [schemaUrl] ScopeLogs schemaUrl + */ + /** + * Constructs a new ScopeLogs. + * @memberof opentelemetry.proto.logs.v1 + * @classdesc Represents a ScopeLogs. + * @implements IScopeLogs + * @constructor + * @param {opentelemetry.proto.logs.v1.IScopeLogs=} [properties] Properties to set + */ + function ScopeLogs(properties) { + this.logRecords = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * ScopeLogs scope. + * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @instance + */ + ScopeLogs.prototype.scope = null; + /** + * ScopeLogs logRecords. + * @member {Array.} logRecords + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @instance + */ + ScopeLogs.prototype.logRecords = $util.emptyArray; + /** + * ScopeLogs schemaUrl. + * @member {string|null|undefined} schemaUrl + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @instance + */ + ScopeLogs.prototype.schemaUrl = null; + /** + * Creates a new ScopeLogs instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {opentelemetry.proto.logs.v1.IScopeLogs=} [properties] Properties to set + * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs instance + */ + ScopeLogs.create = function create(properties) { + return new ScopeLogs(properties); + }; + /** + * Encodes the specified ScopeLogs message. Does not implicitly {@link opentelemetry.proto.logs.v1.ScopeLogs.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {opentelemetry.proto.logs.v1.IScopeLogs} message ScopeLogs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScopeLogs.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); + if (message.logRecords != null && message.logRecords.length) for (var i = 0; i < message.logRecords.length; ++i) $root.opentelemetry.proto.logs.v1.LogRecord.encode(message.logRecords[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); + return writer; + }; + /** + * Encodes the specified ScopeLogs message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.ScopeLogs.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {opentelemetry.proto.logs.v1.IScopeLogs} message ScopeLogs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScopeLogs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a ScopeLogs message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScopeLogs.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ScopeLogs(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.logRecords && message.logRecords.length)) message.logRecords = []; + message.logRecords.push($root.opentelemetry.proto.logs.v1.LogRecord.decode(reader, reader.uint32())); + break; + case 3: + message.schemaUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a ScopeLogs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScopeLogs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a ScopeLogs message. + * @function verify + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScopeLogs.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) { + var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error) return "scope." + error; + } + if (message.logRecords != null && message.hasOwnProperty("logRecords")) { + if (!Array.isArray(message.logRecords)) return "logRecords: array expected"; + for (var i = 0; i < message.logRecords.length; ++i) { + var error = $root.opentelemetry.proto.logs.v1.LogRecord.verify(message.logRecords[i]); + if (error) return "logRecords." + error; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; + } + return null; + }; + /** + * Creates a ScopeLogs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs + */ + ScopeLogs.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.logs.v1.ScopeLogs) return object$1; + var message = new $root.opentelemetry.proto.logs.v1.ScopeLogs(); + if (object$1.scope != null) { + if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); + } + if (object$1.logRecords) { + if (!Array.isArray(object$1.logRecords)) throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected"); + message.logRecords = []; + for (var i = 0; i < object$1.logRecords.length; ++i) { + if (typeof object$1.logRecords[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected"); + message.logRecords[i] = $root.opentelemetry.proto.logs.v1.LogRecord.fromObject(object$1.logRecords[i]); + } + } + if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); + return message; + }; + /** + * Creates a plain object from a ScopeLogs message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {opentelemetry.proto.logs.v1.ScopeLogs} message ScopeLogs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScopeLogs.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.logRecords = []; + if (options.defaults) { + object$1.scope = null; + object$1.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.logRecords && message.logRecords.length) { + object$1.logRecords = []; + for (var j = 0; j < message.logRecords.length; ++j) object$1.logRecords[j] = $root.opentelemetry.proto.logs.v1.LogRecord.toObject(message.logRecords[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; + return object$1; + }; + /** + * Converts this ScopeLogs to JSON. + * @function toJSON + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @instance + * @returns {Object.} JSON object + */ + ScopeLogs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for ScopeLogs + * @function getTypeUrl + * @memberof opentelemetry.proto.logs.v1.ScopeLogs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScopeLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ScopeLogs"; + }; + return ScopeLogs; + })(); + /** + * SeverityNumber enum. + * @name opentelemetry.proto.logs.v1.SeverityNumber + * @enum {number} + * @property {number} SEVERITY_NUMBER_UNSPECIFIED=0 SEVERITY_NUMBER_UNSPECIFIED value + * @property {number} SEVERITY_NUMBER_TRACE=1 SEVERITY_NUMBER_TRACE value + * @property {number} SEVERITY_NUMBER_TRACE2=2 SEVERITY_NUMBER_TRACE2 value + * @property {number} SEVERITY_NUMBER_TRACE3=3 SEVERITY_NUMBER_TRACE3 value + * @property {number} SEVERITY_NUMBER_TRACE4=4 SEVERITY_NUMBER_TRACE4 value + * @property {number} SEVERITY_NUMBER_DEBUG=5 SEVERITY_NUMBER_DEBUG value + * @property {number} SEVERITY_NUMBER_DEBUG2=6 SEVERITY_NUMBER_DEBUG2 value + * @property {number} SEVERITY_NUMBER_DEBUG3=7 SEVERITY_NUMBER_DEBUG3 value + * @property {number} SEVERITY_NUMBER_DEBUG4=8 SEVERITY_NUMBER_DEBUG4 value + * @property {number} SEVERITY_NUMBER_INFO=9 SEVERITY_NUMBER_INFO value + * @property {number} SEVERITY_NUMBER_INFO2=10 SEVERITY_NUMBER_INFO2 value + * @property {number} SEVERITY_NUMBER_INFO3=11 SEVERITY_NUMBER_INFO3 value + * @property {number} SEVERITY_NUMBER_INFO4=12 SEVERITY_NUMBER_INFO4 value + * @property {number} SEVERITY_NUMBER_WARN=13 SEVERITY_NUMBER_WARN value + * @property {number} SEVERITY_NUMBER_WARN2=14 SEVERITY_NUMBER_WARN2 value + * @property {number} SEVERITY_NUMBER_WARN3=15 SEVERITY_NUMBER_WARN3 value + * @property {number} SEVERITY_NUMBER_WARN4=16 SEVERITY_NUMBER_WARN4 value + * @property {number} SEVERITY_NUMBER_ERROR=17 SEVERITY_NUMBER_ERROR value + * @property {number} SEVERITY_NUMBER_ERROR2=18 SEVERITY_NUMBER_ERROR2 value + * @property {number} SEVERITY_NUMBER_ERROR3=19 SEVERITY_NUMBER_ERROR3 value + * @property {number} SEVERITY_NUMBER_ERROR4=20 SEVERITY_NUMBER_ERROR4 value + * @property {number} SEVERITY_NUMBER_FATAL=21 SEVERITY_NUMBER_FATAL value + * @property {number} SEVERITY_NUMBER_FATAL2=22 SEVERITY_NUMBER_FATAL2 value + * @property {number} SEVERITY_NUMBER_FATAL3=23 SEVERITY_NUMBER_FATAL3 value + * @property {number} SEVERITY_NUMBER_FATAL4=24 SEVERITY_NUMBER_FATAL4 value + */ + v1.SeverityNumber = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_NUMBER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEVERITY_NUMBER_TRACE"] = 1; + values[valuesById[2] = "SEVERITY_NUMBER_TRACE2"] = 2; + values[valuesById[3] = "SEVERITY_NUMBER_TRACE3"] = 3; + values[valuesById[4] = "SEVERITY_NUMBER_TRACE4"] = 4; + values[valuesById[5] = "SEVERITY_NUMBER_DEBUG"] = 5; + values[valuesById[6] = "SEVERITY_NUMBER_DEBUG2"] = 6; + values[valuesById[7] = "SEVERITY_NUMBER_DEBUG3"] = 7; + values[valuesById[8] = "SEVERITY_NUMBER_DEBUG4"] = 8; + values[valuesById[9] = "SEVERITY_NUMBER_INFO"] = 9; + values[valuesById[10] = "SEVERITY_NUMBER_INFO2"] = 10; + values[valuesById[11] = "SEVERITY_NUMBER_INFO3"] = 11; + values[valuesById[12] = "SEVERITY_NUMBER_INFO4"] = 12; + values[valuesById[13] = "SEVERITY_NUMBER_WARN"] = 13; + values[valuesById[14] = "SEVERITY_NUMBER_WARN2"] = 14; + values[valuesById[15] = "SEVERITY_NUMBER_WARN3"] = 15; + values[valuesById[16] = "SEVERITY_NUMBER_WARN4"] = 16; + values[valuesById[17] = "SEVERITY_NUMBER_ERROR"] = 17; + values[valuesById[18] = "SEVERITY_NUMBER_ERROR2"] = 18; + values[valuesById[19] = "SEVERITY_NUMBER_ERROR3"] = 19; + values[valuesById[20] = "SEVERITY_NUMBER_ERROR4"] = 20; + values[valuesById[21] = "SEVERITY_NUMBER_FATAL"] = 21; + values[valuesById[22] = "SEVERITY_NUMBER_FATAL2"] = 22; + values[valuesById[23] = "SEVERITY_NUMBER_FATAL3"] = 23; + values[valuesById[24] = "SEVERITY_NUMBER_FATAL4"] = 24; + return values; + })(); + /** + * LogRecordFlags enum. + * @name opentelemetry.proto.logs.v1.LogRecordFlags + * @enum {number} + * @property {number} LOG_RECORD_FLAGS_DO_NOT_USE=0 LOG_RECORD_FLAGS_DO_NOT_USE value + * @property {number} LOG_RECORD_FLAGS_TRACE_FLAGS_MASK=255 LOG_RECORD_FLAGS_TRACE_FLAGS_MASK value + */ + v1.LogRecordFlags = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_RECORD_FLAGS_DO_NOT_USE"] = 0; + values[valuesById[255] = "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"] = 255; + return values; + })(); + v1.LogRecord = (function() { + /** + * Properties of a LogRecord. + * @memberof opentelemetry.proto.logs.v1 + * @interface ILogRecord + * @property {number|Long|null} [timeUnixNano] LogRecord timeUnixNano + * @property {number|Long|null} [observedTimeUnixNano] LogRecord observedTimeUnixNano + * @property {opentelemetry.proto.logs.v1.SeverityNumber|null} [severityNumber] LogRecord severityNumber + * @property {string|null} [severityText] LogRecord severityText + * @property {opentelemetry.proto.common.v1.IAnyValue|null} [body] LogRecord body + * @property {Array.|null} [attributes] LogRecord attributes + * @property {number|null} [droppedAttributesCount] LogRecord droppedAttributesCount + * @property {number|null} [flags] LogRecord flags + * @property {Uint8Array|null} [traceId] LogRecord traceId + * @property {Uint8Array|null} [spanId] LogRecord spanId + * @property {string|null} [eventName] LogRecord eventName + */ + /** + * Constructs a new LogRecord. + * @memberof opentelemetry.proto.logs.v1 + * @classdesc Represents a LogRecord. + * @implements ILogRecord + * @constructor + * @param {opentelemetry.proto.logs.v1.ILogRecord=} [properties] Properties to set + */ + function LogRecord(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + } + } + /** + * LogRecord timeUnixNano. + * @member {number|Long|null|undefined} timeUnixNano + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.timeUnixNano = null; + /** + * LogRecord observedTimeUnixNano. + * @member {number|Long|null|undefined} observedTimeUnixNano + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.observedTimeUnixNano = null; + /** + * LogRecord severityNumber. + * @member {opentelemetry.proto.logs.v1.SeverityNumber|null|undefined} severityNumber + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.severityNumber = null; + /** + * LogRecord severityText. + * @member {string|null|undefined} severityText + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.severityText = null; + /** + * LogRecord body. + * @member {opentelemetry.proto.common.v1.IAnyValue|null|undefined} body + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.body = null; + /** + * LogRecord attributes. + * @member {Array.} attributes + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.attributes = $util.emptyArray; + /** + * LogRecord droppedAttributesCount. + * @member {number|null|undefined} droppedAttributesCount + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.droppedAttributesCount = null; + /** + * LogRecord flags. + * @member {number|null|undefined} flags + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.flags = null; + /** + * LogRecord traceId. + * @member {Uint8Array|null|undefined} traceId + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.traceId = null; + /** + * LogRecord spanId. + * @member {Uint8Array|null|undefined} spanId + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.spanId = null; + /** + * LogRecord eventName. + * @member {string|null|undefined} eventName + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + */ + LogRecord.prototype.eventName = null; + /** + * Creates a new LogRecord instance using the specified properties. + * @function create + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {opentelemetry.proto.logs.v1.ILogRecord=} [properties] Properties to set + * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord instance + */ + LogRecord.create = function create(properties) { + return new LogRecord(properties); + }; + /** + * Encodes the specified LogRecord message. Does not implicitly {@link opentelemetry.proto.logs.v1.LogRecord.verify|verify} messages. + * @function encode + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {opentelemetry.proto.logs.v1.ILogRecord} message LogRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogRecord.encode = function encode$2(message, writer) { + if (!writer) writer = $Writer.create(); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(9).fixed64(message.timeUnixNano); + if (message.severityNumber != null && Object.hasOwnProperty.call(message, "severityNumber")) writer.uint32(16).int32(message.severityNumber); + if (message.severityText != null && Object.hasOwnProperty.call(message, "severityText")) writer.uint32(26).string(message.severityText); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.body, writer.uint32(42).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(50).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(56).uint32(message.droppedAttributesCount); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(69).fixed32(message.flags); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(74).bytes(message.traceId); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(82).bytes(message.spanId); + if (message.observedTimeUnixNano != null && Object.hasOwnProperty.call(message, "observedTimeUnixNano")) writer.uint32(89).fixed64(message.observedTimeUnixNano); + if (message.eventName != null && Object.hasOwnProperty.call(message, "eventName")) writer.uint32(98).string(message.eventName); + return writer; + }; + /** + * Encodes the specified LogRecord message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.LogRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {opentelemetry.proto.logs.v1.ILogRecord} message LogRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a LogRecord message from the specified reader or buffer. + * @function decode + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogRecord.decode = function decode$2(reader, length, error) { + if (!(reader instanceof $Reader)) reader = $Reader.create(reader); + var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; + switch (tag >>> 3) { + case 1: + message.timeUnixNano = reader.fixed64(); + break; + case 11: + message.observedTimeUnixNano = reader.fixed64(); + break; + case 2: + message.severityNumber = reader.int32(); + break; + case 3: + message.severityText = reader.string(); + break; + case 5: + message.body = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.attributes && message.attributes.length)) message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + case 7: + message.droppedAttributesCount = reader.uint32(); + break; + case 8: + message.flags = reader.fixed32(); + break; + case 9: + message.traceId = reader.bytes(); + break; + case 10: + message.spanId = reader.bytes(); + break; + case 12: + message.eventName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a LogRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a LogRecord message. + * @function verify + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) return "object expected"; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; + } + if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) { + if (!$util.isInteger(message.observedTimeUnixNano) && !(message.observedTimeUnixNano && $util.isInteger(message.observedTimeUnixNano.low) && $util.isInteger(message.observedTimeUnixNano.high))) return "observedTimeUnixNano: integer|Long expected"; + } + if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) switch (message.severityNumber) { + default: return "severityNumber: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: break; + } + if (message.severityText != null && message.hasOwnProperty("severityText")) { + if (!$util.isString(message.severityText)) return "severityText: string expected"; + } + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.body); + if (error) return "body." + error; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) return "attributes: array expected"; + for (var i = 0; i < message.attributes.length; ++i) { + var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error) return "attributes." + error; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) return "flags: integer expected"; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; + } + if (message.eventName != null && message.hasOwnProperty("eventName")) { + if (!$util.isString(message.eventName)) return "eventName: string expected"; + } + return null; + }; + /** + * Creates a LogRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {Object.} object Plain object + * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord + */ + LogRecord.fromObject = function fromObject(object$1) { + if (object$1 instanceof $root.opentelemetry.proto.logs.v1.LogRecord) return object$1; + var message = new $root.opentelemetry.proto.logs.v1.LogRecord(); + if (object$1.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; + else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); + else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; + else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); + } + if (object$1.observedTimeUnixNano != null) { + if ($util.Long) (message.observedTimeUnixNano = $util.Long.fromValue(object$1.observedTimeUnixNano)).unsigned = false; + else if (typeof object$1.observedTimeUnixNano === "string") message.observedTimeUnixNano = parseInt(object$1.observedTimeUnixNano, 10); + else if (typeof object$1.observedTimeUnixNano === "number") message.observedTimeUnixNano = object$1.observedTimeUnixNano; + else if (typeof object$1.observedTimeUnixNano === "object") message.observedTimeUnixNano = new $util.LongBits(object$1.observedTimeUnixNano.low >>> 0, object$1.observedTimeUnixNano.high >>> 0).toNumber(); + } + switch (object$1.severityNumber) { + default: + if (typeof object$1.severityNumber === "number") { + message.severityNumber = object$1.severityNumber; + break; + } + break; + case "SEVERITY_NUMBER_UNSPECIFIED": + case 0: + message.severityNumber = 0; + break; + case "SEVERITY_NUMBER_TRACE": + case 1: + message.severityNumber = 1; + break; + case "SEVERITY_NUMBER_TRACE2": + case 2: + message.severityNumber = 2; + break; + case "SEVERITY_NUMBER_TRACE3": + case 3: + message.severityNumber = 3; + break; + case "SEVERITY_NUMBER_TRACE4": + case 4: + message.severityNumber = 4; + break; + case "SEVERITY_NUMBER_DEBUG": + case 5: + message.severityNumber = 5; + break; + case "SEVERITY_NUMBER_DEBUG2": + case 6: + message.severityNumber = 6; + break; + case "SEVERITY_NUMBER_DEBUG3": + case 7: + message.severityNumber = 7; + break; + case "SEVERITY_NUMBER_DEBUG4": + case 8: + message.severityNumber = 8; + break; + case "SEVERITY_NUMBER_INFO": + case 9: + message.severityNumber = 9; + break; + case "SEVERITY_NUMBER_INFO2": + case 10: + message.severityNumber = 10; + break; + case "SEVERITY_NUMBER_INFO3": + case 11: + message.severityNumber = 11; + break; + case "SEVERITY_NUMBER_INFO4": + case 12: + message.severityNumber = 12; + break; + case "SEVERITY_NUMBER_WARN": + case 13: + message.severityNumber = 13; + break; + case "SEVERITY_NUMBER_WARN2": + case 14: + message.severityNumber = 14; + break; + case "SEVERITY_NUMBER_WARN3": + case 15: + message.severityNumber = 15; + break; + case "SEVERITY_NUMBER_WARN4": + case 16: + message.severityNumber = 16; + break; + case "SEVERITY_NUMBER_ERROR": + case 17: + message.severityNumber = 17; + break; + case "SEVERITY_NUMBER_ERROR2": + case 18: + message.severityNumber = 18; + break; + case "SEVERITY_NUMBER_ERROR3": + case 19: + message.severityNumber = 19; + break; + case "SEVERITY_NUMBER_ERROR4": + case 20: + message.severityNumber = 20; + break; + case "SEVERITY_NUMBER_FATAL": + case 21: + message.severityNumber = 21; + break; + case "SEVERITY_NUMBER_FATAL2": + case 22: + message.severityNumber = 22; + break; + case "SEVERITY_NUMBER_FATAL3": + case 23: + message.severityNumber = 23; + break; + case "SEVERITY_NUMBER_FATAL4": + case 24: + message.severityNumber = 24; + break; + } + if (object$1.severityText != null) message.severityText = String(object$1.severityText); + if (object$1.body != null) { + if (typeof object$1.body !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected"); + message.body = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.body); + } + if (object$1.attributes) { + if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object$1.attributes.length; ++i) { + if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); + } + } + if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; + if (object$1.flags != null) message.flags = object$1.flags >>> 0; + if (object$1.traceId != null) { + if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); + else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; + } + if (object$1.spanId != null) { + if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); + else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; + } + if (object$1.eventName != null) message.eventName = String(object$1.eventName); + return message; + }; + /** + * Creates a plain object from a LogRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {opentelemetry.proto.logs.v1.LogRecord} message LogRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogRecord.toObject = function toObject(message, options) { + if (!options) options = {}; + var object$1 = {}; + if (options.arrays || options.defaults) object$1.attributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.timeUnixNano = options.longs === String ? "0" : 0; + object$1.severityNumber = options.enums === String ? "SEVERITY_NUMBER_UNSPECIFIED" : 0; + object$1.severityText = ""; + object$1.body = null; + object$1.droppedAttributesCount = 0; + object$1.flags = 0; + if (options.bytes === String) object$1.traceId = ""; + else { + object$1.traceId = []; + if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); + } + if (options.bytes === String) object$1.spanId = ""; + else { + object$1.spanId = []; + if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object$1.observedTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object$1.observedTimeUnixNano = options.longs === String ? "0" : 0; + object$1.eventName = ""; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) object$1.severityNumber = options.enums === String ? $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] === void 0 ? message.severityNumber : $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] : message.severityNumber; + if (message.severityText != null && message.hasOwnProperty("severityText")) object$1.severityText = message.severityText; + if (message.body != null && message.hasOwnProperty("body")) object$1.body = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.body, options); + if (message.attributes && message.attributes.length) { + object$1.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; + if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; + if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) if (typeof message.observedTimeUnixNano === "number") object$1.observedTimeUnixNano = options.longs === String ? String(message.observedTimeUnixNano) : message.observedTimeUnixNano; + else object$1.observedTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.observedTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.observedTimeUnixNano.low >>> 0, message.observedTimeUnixNano.high >>> 0).toNumber() : message.observedTimeUnixNano; + if (message.eventName != null && message.hasOwnProperty("eventName")) object$1.eventName = message.eventName; + return object$1; + }; + /** + * Converts this LogRecord to JSON. + * @function toJSON + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @instance + * @returns {Object.} JSON object + */ + LogRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + /** + * Gets the default type url for LogRecord + * @function getTypeUrl + * @memberof opentelemetry.proto.logs.v1.LogRecord + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogRecord"; + }; + return LogRecord; + })(); + return v1; + })(); + return logs; + })(); + return proto; + })(); + return opentelemetry; + })(); + module.exports = $root; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/hex-to-binary.js +var require_hex_to_binary = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hexToBinary = void 0; + function intValue(charCode) { + if (charCode >= 48 && charCode <= 57) return charCode - 48; + if (charCode >= 97 && charCode <= 102) return charCode - 87; + return charCode - 55; + } + function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0; i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = hi << 4 | lo; + } + return buf; + } + exports.hexToBinary = hexToBinary; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js +var require_utils$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getOtlpEncoder = exports.encodeAsString = exports.encodeAsLongBits = exports.toLongBits = exports.hrTimeToNanos = void 0; + const core_1 = require_src$8(); + const hex_to_binary_1 = require_hex_to_binary(); + function hrTimeToNanos(hrTime) { + const NANOSECONDS = BigInt(1e9); + return BigInt(hrTime[0]) * NANOSECONDS + BigInt(hrTime[1]); + } + exports.hrTimeToNanos = hrTimeToNanos; + function toLongBits(value) { + return { + low: Number(BigInt.asUintN(32, value)), + high: Number(BigInt.asUintN(32, value >> BigInt(32))) + }; + } + exports.toLongBits = toLongBits; + function encodeAsLongBits(hrTime) { + return toLongBits(hrTimeToNanos(hrTime)); + } + exports.encodeAsLongBits = encodeAsLongBits; + function encodeAsString(hrTime) { + return hrTimeToNanos(hrTime).toString(); + } + exports.encodeAsString = encodeAsString; + const encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : core_1.hrTimeToNanoseconds; + function identity(value) { + return value; + } + function optionalHexToBinary(str) { + if (str === void 0) return void 0; + return (0, hex_to_binary_1.hexToBinary)(str); + } + const DEFAULT_ENCODER = { + encodeHrTime: encodeAsLongBits, + encodeSpanContext: hex_to_binary_1.hexToBinary, + encodeOptionalSpanContext: optionalHexToBinary + }; + function getOtlpEncoder(options) { + if (options === void 0) return DEFAULT_ENCODER; + const useLongBits = options.useLongBits ?? true; + const useHex = options.useHex ?? false; + return { + encodeHrTime: useLongBits ? encodeAsLongBits : encodeTimestamp, + encodeSpanContext: useHex ? identity : hex_to_binary_1.hexToBinary, + encodeOptionalSpanContext: useHex ? identity : optionalHexToBinary + }; + } + exports.getOtlpEncoder = getOtlpEncoder; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/internal.js +var require_internal$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toAnyValue = exports.toKeyValue = exports.toAttributes = exports.createInstrumentationScope = exports.createResource = void 0; + function createResource(resource) { + const result = { + attributes: toAttributes(resource.attributes), + droppedAttributesCount: 0 + }; + const schemaUrl = resource.schemaUrl; + if (schemaUrl && schemaUrl !== "") result.schemaUrl = schemaUrl; + return result; + } + exports.createResource = createResource; + function createInstrumentationScope(scope) { + return { + name: scope.name, + version: scope.version + }; + } + exports.createInstrumentationScope = createInstrumentationScope; + function toAttributes(attributes) { + return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key])); + } + exports.toAttributes = toAttributes; + function toKeyValue(key, value) { + return { + key, + value: toAnyValue(value) + }; + } + exports.toKeyValue = toKeyValue; + function toAnyValue(value) { + const t = typeof value; + if (t === "string") return { stringValue: value }; + if (t === "number") { + if (!Number.isInteger(value)) return { doubleValue: value }; + return { intValue: value }; + } + if (t === "boolean") return { boolValue: value }; + if (value instanceof Uint8Array) return { bytesValue: value }; + if (Array.isArray(value)) return { arrayValue: { values: value.map(toAnyValue) } }; + if (t === "object" && value != null) return { kvlistValue: { values: Object.entries(value).map(([k, v]) => toKeyValue(k, v)) } }; + return {}; + } + exports.toAnyValue = toAnyValue; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal.js +var require_internal$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toLogAttributes = exports.createExportLogsServiceRequest = void 0; + const utils_1 = require_utils$5(); + const internal_1 = require_internal$3(); + function createExportLogsServiceRequest(logRecords, options) { + return { resourceLogs: logRecordsToResourceLogs(logRecords, (0, utils_1.getOtlpEncoder)(options)) }; + } + exports.createExportLogsServiceRequest = createExportLogsServiceRequest; + function createResourceMap(logRecords) { + const resourceMap = /* @__PURE__ */ new Map(); + for (const record$1 of logRecords) { + const { resource, instrumentationScope: { name, version: version$1 = "", schemaUrl = "" } } = record$1; + let ismMap = resourceMap.get(resource); + if (!ismMap) { + ismMap = /* @__PURE__ */ new Map(); + resourceMap.set(resource, ismMap); + } + const ismKey = `${name}@${version$1}:${schemaUrl}`; + let records = ismMap.get(ismKey); + if (!records) { + records = []; + ismMap.set(ismKey, records); + } + records.push(record$1); + } + return resourceMap; + } + function logRecordsToResourceLogs(logRecords, encoder) { + const resourceMap = createResourceMap(logRecords); + return Array.from(resourceMap, ([resource, ismMap]) => { + const processedResource = (0, internal_1.createResource)(resource); + return { + resource: processedResource, + scopeLogs: Array.from(ismMap, ([, scopeLogs]) => { + return { + scope: (0, internal_1.createInstrumentationScope)(scopeLogs[0].instrumentationScope), + logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)), + schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl + }; + }), + schemaUrl: processedResource.schemaUrl + }; + }); + } + function toLogRecord(log, encoder) { + return { + timeUnixNano: encoder.encodeHrTime(log.hrTime), + observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved), + severityNumber: toSeverityNumber(log.severityNumber), + severityText: log.severityText, + body: (0, internal_1.toAnyValue)(log.body), + eventName: log.eventName, + attributes: toLogAttributes(log.attributes), + droppedAttributesCount: log.droppedAttributesCount, + flags: log.spanContext?.traceFlags, + traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId), + spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId) + }; + } + function toSeverityNumber(severityNumber) { + return severityNumber; + } + function toLogAttributes(attributes) { + return Object.keys(attributes).map((key) => (0, internal_1.toKeyValue)(key, attributes[key])); + } + exports.toLogAttributes = toLogAttributes; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js +var require_logs$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufLogsSerializer = void 0; + const root = require_root(); + const internal_1 = require_internal$2(); + const logsResponseType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; + const logsRequestType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; + exports.ProtobufLogsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportLogsServiceRequest)(arg); + return logsRequestType.encode(request).finish(); + }, + deserializeResponse: (arg) => { + return logsResponseType.decode(arg); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/index.js +var require_protobuf$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufLogsSerializer = void 0; + var logs_1 = require_logs$1(); + Object.defineProperty(exports, "ProtobufLogsSerializer", { + enumerable: true, + get: function() { + return logs_1.ProtobufLogsSerializer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js +var require_AggregationTemporality = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AggregationTemporality = void 0; + (function(AggregationTemporality) { + AggregationTemporality[AggregationTemporality["DELTA"] = 0] = "DELTA"; + AggregationTemporality[AggregationTemporality["CUMULATIVE"] = 1] = "CUMULATIVE"; + })(exports.AggregationTemporality || (exports.AggregationTemporality = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js +var require_MetricData = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DataPointType = exports.InstrumentType = void 0; + (function(InstrumentType) { + InstrumentType["COUNTER"] = "COUNTER"; + InstrumentType["GAUGE"] = "GAUGE"; + InstrumentType["HISTOGRAM"] = "HISTOGRAM"; + InstrumentType["UP_DOWN_COUNTER"] = "UP_DOWN_COUNTER"; + InstrumentType["OBSERVABLE_COUNTER"] = "OBSERVABLE_COUNTER"; + InstrumentType["OBSERVABLE_GAUGE"] = "OBSERVABLE_GAUGE"; + InstrumentType["OBSERVABLE_UP_DOWN_COUNTER"] = "OBSERVABLE_UP_DOWN_COUNTER"; + })(exports.InstrumentType || (exports.InstrumentType = {})); + (function(DataPointType) { + /** + * A histogram data point contains a histogram statistics of collected + * values with a list of explicit bucket boundaries and statistics such + * as min, max, count, and sum of all collected values. + */ + DataPointType[DataPointType["HISTOGRAM"] = 0] = "HISTOGRAM"; + /** + * An exponential histogram data point contains a histogram statistics of + * collected values where bucket boundaries are automatically calculated + * using an exponential function, and statistics such as min, max, count, + * and sum of all collected values. + */ + DataPointType[DataPointType["EXPONENTIAL_HISTOGRAM"] = 1] = "EXPONENTIAL_HISTOGRAM"; + /** + * A gauge metric data point has only a single numeric value. + */ + DataPointType[DataPointType["GAUGE"] = 2] = "GAUGE"; + /** + * A sum metric data point has a single numeric value and a + * monotonicity-indicator. + */ + DataPointType[DataPointType["SUM"] = 3] = "SUM"; + })(exports.DataPointType || (exports.DataPointType = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/utils.js +var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.equalsCaseInsensitive = exports.binarySearchUB = exports.setEquals = exports.FlatMap = exports.isPromiseAllSettledRejectionResult = exports.PromiseAllSettled = exports.callWithTimeout = exports.TimeoutError = exports.instrumentationScopeId = exports.hashAttributes = exports.isNotNullish = void 0; + function isNotNullish(item) { + return item !== void 0 && item !== null; + } + exports.isNotNullish = isNotNullish; + /** + * Converting the unordered attributes into unique identifier string. + * @param attributes user provided unordered Attributes. + */ + function hashAttributes(attributes) { + let keys = Object.keys(attributes); + if (keys.length === 0) return ""; + keys = keys.sort(); + return JSON.stringify(keys.map((key) => [key, attributes[key]])); + } + exports.hashAttributes = hashAttributes; + /** + * Converting the instrumentation scope object to a unique identifier string. + * @param instrumentationScope + */ + function instrumentationScopeId(instrumentationScope) { + return `${instrumentationScope.name}:${instrumentationScope.version ?? ""}:${instrumentationScope.schemaUrl ?? ""}`; + } + exports.instrumentationScopeId = instrumentationScopeId; + /** + * Error that is thrown on timeouts. + */ + var TimeoutError = class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + }; + exports.TimeoutError = TimeoutError; + /** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ + function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; + /** + * Node.js v12.9 lower and browser compatible `Promise.allSettled`. + */ + async function PromiseAllSettled(promises) { + return Promise.all(promises.map(async (p) => { + try { + return { + status: "fulfilled", + value: await p + }; + } catch (e) { + return { + status: "rejected", + reason: e + }; + } + })); + } + exports.PromiseAllSettled = PromiseAllSettled; + function isPromiseAllSettledRejectionResult(it) { + return it.status === "rejected"; + } + exports.isPromiseAllSettledRejectionResult = isPromiseAllSettledRejectionResult; + /** + * Node.js v11.0 lower and browser compatible `Array.prototype.flatMap`. + */ + function FlatMap(arr, fn) { + const result = []; + arr.forEach((it) => { + result.push(...fn(it)); + }); + return result; + } + exports.FlatMap = FlatMap; + function setEquals(lhs, rhs) { + if (lhs.size !== rhs.size) return false; + for (const item of lhs) if (!rhs.has(item)) return false; + return true; + } + exports.setEquals = setEquals; + /** + * Binary search the sorted array to the find upper bound for the value. + * @param arr + * @param value + * @returns + */ + function binarySearchUB(arr, value) { + let lo = 0; + let hi = arr.length - 1; + let ret = arr.length; + while (hi >= lo) { + const mid = lo + Math.trunc((hi - lo) / 2); + if (arr[mid] < value) lo = mid + 1; + else { + ret = mid; + hi = mid - 1; + } + } + return ret; + } + exports.binarySearchUB = binarySearchUB; + function equalsCaseInsensitive(lhs, rhs) { + return lhs.toLowerCase() === rhs.toLowerCase(); + } + exports.equalsCaseInsensitive = equalsCaseInsensitive; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js +var require_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AggregatorKind = void 0; + (function(AggregatorKind) { + AggregatorKind[AggregatorKind["DROP"] = 0] = "DROP"; + AggregatorKind[AggregatorKind["SUM"] = 1] = "SUM"; + AggregatorKind[AggregatorKind["LAST_VALUE"] = 2] = "LAST_VALUE"; + AggregatorKind[AggregatorKind["HISTOGRAM"] = 3] = "HISTOGRAM"; + AggregatorKind[AggregatorKind["EXPONENTIAL_HISTOGRAM"] = 4] = "EXPONENTIAL_HISTOGRAM"; + })(exports.AggregatorKind || (exports.AggregatorKind = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Drop.js +var require_Drop = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DropAggregator = void 0; + const types_1 = require_types$1(); + /** Basic aggregator for None which keeps no recorded value. */ + var DropAggregator = class { + kind = types_1.AggregatorKind.DROP; + createAccumulation() {} + merge(_previous, _delta) {} + diff(_previous, _current) {} + toMetricData(_descriptor, _aggregationTemporality, _accumulationByAttributes, _endTime) {} + }; + exports.DropAggregator = DropAggregator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Histogram.js +var require_Histogram = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.HistogramAggregator = exports.HistogramAccumulation = void 0; + const types_1 = require_types$1(); + const MetricData_1 = require_MetricData(); + const utils_1 = require_utils$4(); + function createNewEmptyCheckpoint(boundaries) { + const counts = boundaries.map(() => 0); + counts.push(0); + return { + buckets: { + boundaries, + counts + }, + sum: 0, + count: 0, + hasMinMax: false, + min: Infinity, + max: -Infinity + }; + } + var HistogramAccumulation = class { + startTime; + _boundaries; + _recordMinMax; + _current; + constructor(startTime, _boundaries, _recordMinMax = true, _current = createNewEmptyCheckpoint(_boundaries)) { + this.startTime = startTime; + this._boundaries = _boundaries; + this._recordMinMax = _recordMinMax; + this._current = _current; + } + record(value) { + if (Number.isNaN(value)) return; + this._current.count += 1; + this._current.sum += value; + if (this._recordMinMax) { + this._current.min = Math.min(value, this._current.min); + this._current.max = Math.max(value, this._current.max); + this._current.hasMinMax = true; + } + const idx = (0, utils_1.binarySearchUB)(this._boundaries, value); + this._current.buckets.counts[idx] += 1; + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + }; + exports.HistogramAccumulation = HistogramAccumulation; + /** + * Basic aggregator which observes events and counts them in pre-defined buckets + * and provides the total sum and count of all observations. + */ + var HistogramAggregator = class { + _boundaries; + _recordMinMax; + kind = types_1.AggregatorKind.HISTOGRAM; + /** + * @param _boundaries sorted upper bounds of recorded values. + * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. + */ + constructor(_boundaries, _recordMinMax) { + this._boundaries = _boundaries; + this._recordMinMax = _recordMinMax; + } + createAccumulation(startTime) { + return new HistogramAccumulation(startTime, this._boundaries, this._recordMinMax); + } + /** + * Return the result of the merge of two histogram accumulations. As long as one Aggregator + * instance produces all Accumulations with constant boundaries we don't need to worry about + * merging accumulations with different boundaries. + */ + merge(previous, delta) { + const previousValue = previous.toPointValue(); + const deltaValue = delta.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const deltaCounts = deltaValue.buckets.counts; + const mergedCounts = new Array(previousCounts.length); + for (let idx = 0; idx < previousCounts.length; idx++) mergedCounts[idx] = previousCounts[idx] + deltaCounts[idx]; + let min = Infinity; + let max = -Infinity; + if (this._recordMinMax) { + if (previousValue.hasMinMax && deltaValue.hasMinMax) { + min = Math.min(previousValue.min, deltaValue.min); + max = Math.max(previousValue.max, deltaValue.max); + } else if (previousValue.hasMinMax) { + min = previousValue.min; + max = previousValue.max; + } else if (deltaValue.hasMinMax) { + min = deltaValue.min; + max = deltaValue.max; + } + } + return new HistogramAccumulation(previous.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: mergedCounts + }, + count: previousValue.count + deltaValue.count, + sum: previousValue.sum + deltaValue.sum, + hasMinMax: this._recordMinMax && (previousValue.hasMinMax || deltaValue.hasMinMax), + min, + max + }); + } + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + */ + diff(previous, current) { + const previousValue = previous.toPointValue(); + const currentValue = current.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const currentCounts = currentValue.buckets.counts; + const diffedCounts = new Array(previousCounts.length); + for (let idx = 0; idx < previousCounts.length; idx++) diffedCounts[idx] = currentCounts[idx] - previousCounts[idx]; + return new HistogramAccumulation(current.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: diffedCounts + }, + count: currentValue.count - previousValue.count, + sum: currentValue.sum - previousValue.sum, + hasMinMax: false, + min: Infinity, + max: -Infinity + }); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.HISTOGRAM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + const pointValue = accumulation.toPointValue(); + const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: { + min: pointValue.hasMinMax ? pointValue.min : void 0, + max: pointValue.hasMinMax ? pointValue.max : void 0, + sum: !allowsNegativeValues ? pointValue.sum : void 0, + buckets: pointValue.buckets, + count: pointValue.count + } + }; + }) + }; + } + }; + exports.HistogramAggregator = HistogramAggregator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/Buckets.js +var require_Buckets = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Buckets = void 0; + var Buckets = class Buckets { + backing; + indexBase; + indexStart; + indexEnd; + /** + * The term index refers to the number of the exponential histogram bucket + * used to determine its boundaries. The lower boundary of a bucket is + * determined by base ** index and the upper boundary of a bucket is + * determined by base ** (index + 1). index values are signed to account + * for values less than or equal to 1. + * + * indexBase is the index of the 0th position in the + * backing array, i.e., backing[0] is the count + * in the bucket with index `indexBase`. + * + * indexStart is the smallest index value represented + * in the backing array. + * + * indexEnd is the largest index value represented in + * the backing array. + */ + constructor(backing = new BucketsBacking(), indexBase = 0, indexStart = 0, indexEnd = 0) { + this.backing = backing; + this.indexBase = indexBase; + this.indexStart = indexStart; + this.indexEnd = indexEnd; + } + /** + * Offset is the bucket index of the smallest entry in the counts array + * @returns {number} + */ + get offset() { + return this.indexStart; + } + /** + * Buckets is a view into the backing array. + * @returns {number} + */ + get length() { + if (this.backing.length === 0) return 0; + if (this.indexEnd === this.indexStart && this.at(0) === 0) return 0; + return this.indexEnd - this.indexStart + 1; + } + /** + * An array of counts, where count[i] carries the count + * of the bucket at index (offset+i). count[i] is the count of + * values greater than base^(offset+i) and less than or equal to + * base^(offset+i+1). + * @returns {number} The logical counts based on the backing array + */ + counts() { + return Array.from({ length: this.length }, (_, i) => this.at(i)); + } + /** + * At returns the count of the bucket at a position in the logical + * array of counts. + * @param position + * @returns {number} + */ + at(position) { + const bias = this.indexBase - this.indexStart; + if (position < bias) position += this.backing.length; + position -= bias; + return this.backing.countAt(position); + } + /** + * incrementBucket increments the backing array index by `increment` + * @param bucketIndex + * @param increment + */ + incrementBucket(bucketIndex, increment) { + this.backing.increment(bucketIndex, increment); + } + /** + * decrementBucket decrements the backing array index by `decrement` + * if decrement is greater than the current value, it's set to 0. + * @param bucketIndex + * @param decrement + */ + decrementBucket(bucketIndex, decrement) { + this.backing.decrement(bucketIndex, decrement); + } + /** + * trim removes leading and / or trailing zero buckets (which can occur + * after diffing two histos) and rotates the backing array so that the + * smallest non-zero index is in the 0th position of the backing array + */ + trim() { + for (let i = 0; i < this.length; i++) if (this.at(i) !== 0) { + this.indexStart += i; + break; + } else if (i === this.length - 1) { + this.indexStart = this.indexEnd = this.indexBase = 0; + return; + } + for (let i = this.length - 1; i >= 0; i--) if (this.at(i) !== 0) { + this.indexEnd -= this.length - i - 1; + break; + } + this._rotate(); + } + /** + * downscale first rotates, then collapses 2**`by`-to-1 buckets. + * @param by + */ + downscale(by) { + this._rotate(); + const size = 1 + this.indexEnd - this.indexStart; + const each = 1 << by; + let inpos = 0; + let outpos = 0; + for (let pos = this.indexStart; pos <= this.indexEnd;) { + let mod = pos % each; + if (mod < 0) mod += each; + for (let i = mod; i < each && inpos < size; i++) { + this._relocateBucket(outpos, inpos); + inpos++; + pos++; + } + outpos++; + } + this.indexStart >>= by; + this.indexEnd >>= by; + this.indexBase = this.indexStart; + } + /** + * Clone returns a deep copy of Buckets + * @returns {Buckets} + */ + clone() { + return new Buckets(this.backing.clone(), this.indexBase, this.indexStart, this.indexEnd); + } + /** + * _rotate shifts the backing array contents so that indexStart == + * indexBase to simplify the downscale logic. + */ + _rotate() { + const bias = this.indexBase - this.indexStart; + if (bias === 0) return; + else if (bias > 0) { + this.backing.reverse(0, this.backing.length); + this.backing.reverse(0, bias); + this.backing.reverse(bias, this.backing.length); + } else { + this.backing.reverse(0, this.backing.length); + this.backing.reverse(0, this.backing.length + bias); + } + this.indexBase = this.indexStart; + } + /** + * _relocateBucket adds the count in counts[src] to counts[dest] and + * resets count[src] to zero. + */ + _relocateBucket(dest, src) { + if (dest === src) return; + this.incrementBucket(dest, this.backing.emptyBucket(src)); + } + }; + exports.Buckets = Buckets; + /** + * BucketsBacking holds the raw buckets and some utility methods to + * manage them. + */ + var BucketsBacking = class BucketsBacking { + _counts; + constructor(_counts = [0]) { + this._counts = _counts; + } + /** + * length returns the physical size of the backing array, which + * is >= buckets.length() + */ + get length() { + return this._counts.length; + } + /** + * countAt returns the count in a specific bucket + */ + countAt(pos) { + return this._counts[pos]; + } + /** + * growTo grows a backing array and copies old entries + * into their correct new positions. + */ + growTo(newSize, oldPositiveLimit, newPositiveLimit) { + const tmp = new Array(newSize).fill(0); + tmp.splice(newPositiveLimit, this._counts.length - oldPositiveLimit, ...this._counts.slice(oldPositiveLimit)); + tmp.splice(0, oldPositiveLimit, ...this._counts.slice(0, oldPositiveLimit)); + this._counts = tmp; + } + /** + * reverse the items in the backing array in the range [from, limit). + */ + reverse(from, limit) { + const num = Math.floor((from + limit) / 2) - from; + for (let i = 0; i < num; i++) { + const tmp = this._counts[from + i]; + this._counts[from + i] = this._counts[limit - i - 1]; + this._counts[limit - i - 1] = tmp; + } + } + /** + * emptyBucket empties the count from a bucket, for + * moving into another. + */ + emptyBucket(src) { + const tmp = this._counts[src]; + this._counts[src] = 0; + return tmp; + } + /** + * increments a bucket by `increment` + */ + increment(bucketIndex, increment) { + this._counts[bucketIndex] += increment; + } + /** + * decrements a bucket by `decrement` + */ + decrement(bucketIndex, decrement) { + if (this._counts[bucketIndex] >= decrement) this._counts[bucketIndex] -= decrement; + else this._counts[bucketIndex] = 0; + } + /** + * clone returns a deep copy of BucketsBacking + */ + clone() { + return new BucketsBacking([...this._counts]); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js +var require_ieee754 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSignificand = exports.getNormalBase2 = exports.MIN_VALUE = exports.MAX_NORMAL_EXPONENT = exports.MIN_NORMAL_EXPONENT = exports.SIGNIFICAND_WIDTH = void 0; + /** + * The functions and constants in this file allow us to interact + * with the internal representation of an IEEE 64-bit floating point + * number. We need to work with all 64-bits, thus, care needs to be + * taken when working with Javascript's bitwise operators (<<, >>, &, + * |, etc) as they truncate operands to 32-bits. In order to work around + * this we work with the 64-bits as two 32-bit halves, perform bitwise + * operations on them independently, and combine the results (if needed). + */ + exports.SIGNIFICAND_WIDTH = 52; + /** + * EXPONENT_MASK is set to 1 for the hi 32-bits of an IEEE 754 + * floating point exponent: 0x7ff00000. + */ + const EXPONENT_MASK = 2146435072; + /** + * SIGNIFICAND_MASK is the mask for the significand portion of the hi 32-bits + * of an IEEE 754 double-precision floating-point value: 0xfffff + */ + const SIGNIFICAND_MASK = 1048575; + /** + * EXPONENT_BIAS is the exponent bias specified for encoding + * the IEEE 754 double-precision floating point exponent: 1023 + */ + const EXPONENT_BIAS = 1023; + /** + * MIN_NORMAL_EXPONENT is the minimum exponent of a normalized + * floating point: -1022. + */ + exports.MIN_NORMAL_EXPONENT = -EXPONENT_BIAS + 1; + /** + * MAX_NORMAL_EXPONENT is the maximum exponent of a normalized + * floating point: 1023. + */ + exports.MAX_NORMAL_EXPONENT = EXPONENT_BIAS; + /** + * MIN_VALUE is the smallest normal number + */ + exports.MIN_VALUE = Math.pow(2, -1022); + /** + * getNormalBase2 extracts the normalized base-2 fractional exponent. + * This returns k for the equation f x 2**k where f is + * in the range [1, 2). Note that this function is not called for + * subnormal numbers. + * @param {number} value - the value to determine normalized base-2 fractional + * exponent for + * @returns {number} the normalized base-2 exponent + */ + function getNormalBase2(value) { + const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); + dv.setFloat64(0, value); + return ((dv.getUint32(0) & EXPONENT_MASK) >> 20) - EXPONENT_BIAS; + } + exports.getNormalBase2 = getNormalBase2; + /** + * GetSignificand returns the 52 bit (unsigned) significand as a signed value. + * @param {number} value - the floating point number to extract the significand from + * @returns {number} The 52-bit significand + */ + function getSignificand(value) { + const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); + dv.setFloat64(0, value); + const hiBits = dv.getUint32(0); + const loBits = dv.getUint32(4); + return (hiBits & SIGNIFICAND_MASK) * Math.pow(2, 32) + loBits; + } + exports.getSignificand = getSignificand; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js +var require_util = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.nextGreaterSquare = exports.ldexp = void 0; + /** + * Note: other languages provide this as a built in function. This is + * a naive, but functionally correct implementation. This is used sparingly, + * when creating a new mapping in a running application. + * + * ldexp returns frac × 2**exp. With the following special cases: + * ldexp(±0, exp) = ±0 + * ldexp(±Inf, exp) = ±Inf + * ldexp(NaN, exp) = NaN + * @param frac + * @param exp + * @returns {number} + */ + function ldexp(frac, exp) { + if (frac === 0 || frac === Number.POSITIVE_INFINITY || frac === Number.NEGATIVE_INFINITY || Number.isNaN(frac)) return frac; + return frac * Math.pow(2, exp); + } + exports.ldexp = ldexp; + /** + * Computes the next power of two that is greater than or equal to v. + * This implementation more efficient than, but functionally equivalent + * to Math.pow(2, Math.ceil(Math.log(x)/Math.log(2))). + * @param v + * @returns {number} + */ + function nextGreaterSquare(v) { + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; + } + exports.nextGreaterSquare = nextGreaterSquare; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/types.js +var require_types = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MappingError = void 0; + var MappingError = class extends Error {}; + exports.MappingError = MappingError; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js +var require_ExponentMapping = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExponentMapping = void 0; + const ieee754 = require_ieee754(); + const util = require_util(); + const types_1 = require_types(); + /** + * ExponentMapping implements exponential mapping functions for + * scales <=0. For scales > 0 LogarithmMapping should be used. + */ + var ExponentMapping = class { + _shift; + constructor(scale) { + this._shift = -scale; + } + /** + * Maps positive floating point values to indexes corresponding to scale + * @param value + * @returns {number} index for provided value at the current scale + */ + mapToIndex(value) { + if (value < ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex(); + return ieee754.getNormalBase2(value) + this._rightShift(ieee754.getSignificand(value) - 1, ieee754.SIGNIFICAND_WIDTH) >> this._shift; + } + /** + * Returns the lower bucket boundary for the given index for scale + * + * @param index + * @returns {number} + */ + lowerBoundary(index) { + const minIndex = this._minNormalLowerBoundaryIndex(); + if (index < minIndex) throw new types_1.MappingError(`underflow: ${index} is < minimum lower boundary: ${minIndex}`); + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index > maxIndex) throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); + return util.ldexp(1, index << this._shift); + } + /** + * The scale used by this mapping + * @returns {number} + */ + get scale() { + if (this._shift === 0) return 0; + return -this._shift; + } + _minNormalLowerBoundaryIndex() { + let index = ieee754.MIN_NORMAL_EXPONENT >> this._shift; + if (this._shift < 2) index--; + return index; + } + _maxNormalLowerBoundaryIndex() { + return ieee754.MAX_NORMAL_EXPONENT >> this._shift; + } + _rightShift(value, shift) { + return Math.floor(value * Math.pow(2, -shift)); + } + }; + exports.ExponentMapping = ExponentMapping; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js +var require_LogarithmMapping = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.LogarithmMapping = void 0; + const ieee754 = require_ieee754(); + const util = require_util(); + const types_1 = require_types(); + /** + * LogarithmMapping implements exponential mapping functions for scale > 0. + * For scales <= 0 the exponent mapping should be used. + */ + var LogarithmMapping = class { + _scale; + _scaleFactor; + _inverseFactor; + constructor(scale) { + this._scale = scale; + this._scaleFactor = util.ldexp(Math.LOG2E, scale); + this._inverseFactor = util.ldexp(Math.LN2, -scale); + } + /** + * Maps positive floating point values to indexes corresponding to scale + * @param value + * @returns {number} index for provided value at the current scale + */ + mapToIndex(value) { + if (value <= ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex() - 1; + if (ieee754.getSignificand(value) === 0) return (ieee754.getNormalBase2(value) << this._scale) - 1; + const index = Math.floor(Math.log(value) * this._scaleFactor); + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index >= maxIndex) return maxIndex; + return index; + } + /** + * Returns the lower bucket boundary for the given index for scale + * + * @param index + * @returns {number} + */ + lowerBoundary(index) { + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index >= maxIndex) { + if (index === maxIndex) return 2 * Math.exp((index - (1 << this._scale)) / this._scaleFactor); + throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); + } + const minIndex = this._minNormalLowerBoundaryIndex(); + if (index <= minIndex) { + if (index === minIndex) return ieee754.MIN_VALUE; + else if (index === minIndex - 1) return Math.exp((index + (1 << this._scale)) / this._scaleFactor) / 2; + throw new types_1.MappingError(`overflow: ${index} is < minimum lower boundary: ${minIndex}`); + } + return Math.exp(index * this._inverseFactor); + } + /** + * The scale used by this mapping + * @returns {number} + */ + get scale() { + return this._scale; + } + _minNormalLowerBoundaryIndex() { + return ieee754.MIN_NORMAL_EXPONENT << this._scale; + } + _maxNormalLowerBoundaryIndex() { + return (ieee754.MAX_NORMAL_EXPONENT + 1 << this._scale) - 1; + } + }; + exports.LogarithmMapping = LogarithmMapping; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/getMapping.js +var require_getMapping = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMapping = void 0; + const ExponentMapping_1 = require_ExponentMapping(); + const LogarithmMapping_1 = require_LogarithmMapping(); + const types_1 = require_types(); + const MIN_SCALE = -10; + const MAX_SCALE = 20; + const PREBUILT_MAPPINGS = Array.from({ length: 31 }, (_, i) => { + if (i > 10) return new LogarithmMapping_1.LogarithmMapping(i - 10); + return new ExponentMapping_1.ExponentMapping(i - 10); + }); + /** + * getMapping returns an appropriate mapping for the given scale. For scales -10 + * to 0 the underlying type will be ExponentMapping. For scales 1 to 20 the + * underlying type will be LogarithmMapping. + * @param scale a number in the range [-10, 20] + * @returns {Mapping} + */ + function getMapping(scale) { + if (scale > MAX_SCALE || scale < MIN_SCALE) throw new types_1.MappingError(`expected scale >= ${MIN_SCALE} && <= ${MAX_SCALE}, got: ${scale}`); + return PREBUILT_MAPPINGS[scale + 10]; + } + exports.getMapping = getMapping; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js +var require_ExponentialHistogram = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = void 0; + const types_1 = require_types$1(); + const MetricData_1 = require_MetricData(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const Buckets_1 = require_Buckets(); + const getMapping_1 = require_getMapping(); + const util_1 = require_util(); + var HighLow = class HighLow { + low; + high; + static combine(h1, h2) { + return new HighLow(Math.min(h1.low, h2.low), Math.max(h1.high, h2.high)); + } + constructor(low, high) { + this.low = low; + this.high = high; + } + }; + const MAX_SCALE = 20; + const DEFAULT_MAX_SIZE = 160; + const MIN_MAX_SIZE = 2; + var ExponentialHistogramAccumulation = class ExponentialHistogramAccumulation { + startTime; + _maxSize; + _recordMinMax; + _sum; + _count; + _zeroCount; + _min; + _max; + _positive; + _negative; + _mapping; + constructor(startTime, _maxSize = DEFAULT_MAX_SIZE, _recordMinMax = true, _sum = 0, _count = 0, _zeroCount = 0, _min = Number.POSITIVE_INFINITY, _max = Number.NEGATIVE_INFINITY, _positive = new Buckets_1.Buckets(), _negative = new Buckets_1.Buckets(), _mapping = (0, getMapping_1.getMapping)(MAX_SCALE)) { + this.startTime = startTime; + this._maxSize = _maxSize; + this._recordMinMax = _recordMinMax; + this._sum = _sum; + this._count = _count; + this._zeroCount = _zeroCount; + this._min = _min; + this._max = _max; + this._positive = _positive; + this._negative = _negative; + this._mapping = _mapping; + if (this._maxSize < MIN_MAX_SIZE) { + api_1.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \ + changing to the minimum size of: ${MIN_MAX_SIZE}`); + this._maxSize = MIN_MAX_SIZE; + } + } + /** + * record updates a histogram with a single count + * @param {Number} value + */ + record(value) { + this.updateByIncrement(value, 1); + } + /** + * Sets the start time for this accumulation + * @param {HrTime} startTime + */ + setStartTime(startTime) { + this.startTime = startTime; + } + /** + * Returns the datapoint representation of this accumulation + * @param {HrTime} startTime + */ + toPointValue() { + return { + hasMinMax: this._recordMinMax, + min: this.min, + max: this.max, + sum: this.sum, + positive: { + offset: this.positive.offset, + bucketCounts: this.positive.counts() + }, + negative: { + offset: this.negative.offset, + bucketCounts: this.negative.counts() + }, + count: this.count, + scale: this.scale, + zeroCount: this.zeroCount + }; + } + /** + * @returns {Number} The sum of values recorded by this accumulation + */ + get sum() { + return this._sum; + } + /** + * @returns {Number} The minimum value recorded by this accumulation + */ + get min() { + return this._min; + } + /** + * @returns {Number} The maximum value recorded by this accumulation + */ + get max() { + return this._max; + } + /** + * @returns {Number} The count of values recorded by this accumulation + */ + get count() { + return this._count; + } + /** + * @returns {Number} The number of 0 values recorded by this accumulation + */ + get zeroCount() { + return this._zeroCount; + } + /** + * @returns {Number} The scale used by this accumulation + */ + get scale() { + if (this._count === this._zeroCount) return 0; + return this._mapping.scale; + } + /** + * positive holds the positive values + * @returns {Buckets} + */ + get positive() { + return this._positive; + } + /** + * negative holds the negative values by their absolute value + * @returns {Buckets} + */ + get negative() { + return this._negative; + } + /** + * updateByIncr supports updating a histogram with a non-negative + * increment. + * @param value + * @param increment + */ + updateByIncrement(value, increment) { + if (Number.isNaN(value)) return; + if (value > this._max) this._max = value; + if (value < this._min) this._min = value; + this._count += increment; + if (value === 0) { + this._zeroCount += increment; + return; + } + this._sum += value * increment; + if (value > 0) this._updateBuckets(this._positive, value, increment); + else this._updateBuckets(this._negative, -value, increment); + } + /** + * merge combines data from previous value into self + * @param {ExponentialHistogramAccumulation} previous + */ + merge(previous) { + if (this._count === 0) { + this._min = previous.min; + this._max = previous.max; + } else if (previous.count !== 0) { + if (previous.min < this.min) this._min = previous.min; + if (previous.max > this.max) this._max = previous.max; + } + this.startTime = previous.startTime; + this._sum += previous.sum; + this._count += previous.count; + this._zeroCount += previous.zeroCount; + const minScale = this._minScale(previous); + this._downscale(this.scale - minScale); + this._mergeBuckets(this.positive, previous, previous.positive, minScale); + this._mergeBuckets(this.negative, previous, previous.negative, minScale); + } + /** + * diff subtracts other from self + * @param {ExponentialHistogramAccumulation} other + */ + diff(other) { + this._min = Infinity; + this._max = -Infinity; + this._sum -= other.sum; + this._count -= other.count; + this._zeroCount -= other.zeroCount; + const minScale = this._minScale(other); + this._downscale(this.scale - minScale); + this._diffBuckets(this.positive, other, other.positive, minScale); + this._diffBuckets(this.negative, other, other.negative, minScale); + } + /** + * clone returns a deep copy of self + * @returns {ExponentialHistogramAccumulation} + */ + clone() { + return new ExponentialHistogramAccumulation(this.startTime, this._maxSize, this._recordMinMax, this._sum, this._count, this._zeroCount, this._min, this._max, this.positive.clone(), this.negative.clone(), this._mapping); + } + /** + * _updateBuckets maps the incoming value to a bucket index for the current + * scale. If the bucket index is outside of the range of the backing array, + * it will rescale the backing array and update the mapping for the new scale. + */ + _updateBuckets(buckets, value, increment) { + let index = this._mapping.mapToIndex(value); + let rescalingNeeded = false; + let high = 0; + let low = 0; + if (buckets.length === 0) { + buckets.indexStart = index; + buckets.indexEnd = buckets.indexStart; + buckets.indexBase = buckets.indexStart; + } else if (index < buckets.indexStart && buckets.indexEnd - index >= this._maxSize) { + rescalingNeeded = true; + low = index; + high = buckets.indexEnd; + } else if (index > buckets.indexEnd && index - buckets.indexStart >= this._maxSize) { + rescalingNeeded = true; + low = buckets.indexStart; + high = index; + } + if (rescalingNeeded) { + const change = this._changeScale(high, low); + this._downscale(change); + index = this._mapping.mapToIndex(value); + } + this._incrementIndexBy(buckets, index, increment); + } + /** + * _incrementIndexBy increments the count of the bucket specified by `index`. + * If the index is outside of the range [buckets.indexStart, buckets.indexEnd] + * the boundaries of the backing array will be adjusted and more buckets will + * be added if needed. + */ + _incrementIndexBy(buckets, index, increment) { + if (increment === 0) return; + if (buckets.length === 0) buckets.indexStart = buckets.indexEnd = buckets.indexBase = index; + if (index < buckets.indexStart) { + const span = buckets.indexEnd - index; + if (span >= buckets.backing.length) this._grow(buckets, span + 1); + buckets.indexStart = index; + } else if (index > buckets.indexEnd) { + const span = index - buckets.indexStart; + if (span >= buckets.backing.length) this._grow(buckets, span + 1); + buckets.indexEnd = index; + } + let bucketIndex = index - buckets.indexBase; + if (bucketIndex < 0) bucketIndex += buckets.backing.length; + buckets.incrementBucket(bucketIndex, increment); + } + /** + * grow resizes the backing array by doubling in size up to maxSize. + * This extends the array with a bunch of zeros and copies the + * existing counts to the same position. + */ + _grow(buckets, needed) { + const size = buckets.backing.length; + const bias = buckets.indexBase - buckets.indexStart; + const oldPositiveLimit = size - bias; + let newSize = (0, util_1.nextGreaterSquare)(needed); + if (newSize > this._maxSize) newSize = this._maxSize; + const newPositiveLimit = newSize - bias; + buckets.backing.growTo(newSize, oldPositiveLimit, newPositiveLimit); + } + /** + * _changeScale computes how much downscaling is needed by shifting the + * high and low values until they are separated by no more than size. + */ + _changeScale(high, low) { + let change = 0; + while (high - low >= this._maxSize) { + high >>= 1; + low >>= 1; + change++; + } + return change; + } + /** + * _downscale subtracts `change` from the current mapping scale. + */ + _downscale(change) { + if (change === 0) return; + if (change < 0) throw new Error(`impossible change of scale: ${this.scale}`); + const newScale = this._mapping.scale - change; + this._positive.downscale(change); + this._negative.downscale(change); + this._mapping = (0, getMapping_1.getMapping)(newScale); + } + /** + * _minScale is used by diff and merge to compute an ideal combined scale + */ + _minScale(other) { + const minScale = Math.min(this.scale, other.scale); + const highLowPos = HighLow.combine(this._highLowAtScale(this.positive, this.scale, minScale), this._highLowAtScale(other.positive, other.scale, minScale)); + const highLowNeg = HighLow.combine(this._highLowAtScale(this.negative, this.scale, minScale), this._highLowAtScale(other.negative, other.scale, minScale)); + return Math.min(minScale - this._changeScale(highLowPos.high, highLowPos.low), minScale - this._changeScale(highLowNeg.high, highLowNeg.low)); + } + /** + * _highLowAtScale is used by diff and merge to compute an ideal combined scale. + */ + _highLowAtScale(buckets, currentScale, newScale) { + if (buckets.length === 0) return new HighLow(0, -1); + const shift = currentScale - newScale; + return new HighLow(buckets.indexStart >> shift, buckets.indexEnd >> shift); + } + /** + * _mergeBuckets translates index values from another histogram and + * adds the values into the corresponding buckets of this histogram. + */ + _mergeBuckets(ours, other, theirs, scale) { + const theirOffset = theirs.offset; + const theirChange = other.scale - scale; + for (let i = 0; i < theirs.length; i++) this._incrementIndexBy(ours, theirOffset + i >> theirChange, theirs.at(i)); + } + /** + * _diffBuckets translates index values from another histogram and + * subtracts the values in the corresponding buckets of this histogram. + */ + _diffBuckets(ours, other, theirs, scale) { + const theirOffset = theirs.offset; + const theirChange = other.scale - scale; + for (let i = 0; i < theirs.length; i++) { + let bucketIndex = (theirOffset + i >> theirChange) - ours.indexBase; + if (bucketIndex < 0) bucketIndex += ours.backing.length; + ours.decrementBucket(bucketIndex, theirs.at(i)); + } + ours.trim(); + } + }; + exports.ExponentialHistogramAccumulation = ExponentialHistogramAccumulation; + /** + * Aggregator for ExponentialHistogramAccumulations + */ + var ExponentialHistogramAggregator = class { + _maxSize; + _recordMinMax; + kind = types_1.AggregatorKind.EXPONENTIAL_HISTOGRAM; + /** + * @param _maxSize Maximum number of buckets for each of the positive + * and negative ranges, exclusive of the zero-bucket. + * @param _recordMinMax If set to true, min and max will be recorded. + * Otherwise, min and max will not be recorded. + */ + constructor(_maxSize, _recordMinMax) { + this._maxSize = _maxSize; + this._recordMinMax = _recordMinMax; + } + createAccumulation(startTime) { + return new ExponentialHistogramAccumulation(startTime, this._maxSize, this._recordMinMax); + } + /** + * Return the result of the merge of two exponential histogram accumulations. + */ + merge(previous, delta) { + const result = delta.clone(); + result.merge(previous); + return result; + } + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + */ + diff(previous, current) { + const result = current.clone(); + result.diff(previous); + return result; + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.EXPONENTIAL_HISTOGRAM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + const pointValue = accumulation.toPointValue(); + const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: { + min: pointValue.hasMinMax ? pointValue.min : void 0, + max: pointValue.hasMinMax ? pointValue.max : void 0, + sum: !allowsNegativeValues ? pointValue.sum : void 0, + positive: { + offset: pointValue.positive.offset, + bucketCounts: pointValue.positive.bucketCounts + }, + negative: { + offset: pointValue.negative.offset, + bucketCounts: pointValue.negative.bucketCounts + }, + count: pointValue.count, + scale: pointValue.scale, + zeroCount: pointValue.zeroCount + } + }; + }) + }; + } + }; + exports.ExponentialHistogramAggregator = ExponentialHistogramAggregator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/LastValue.js +var require_LastValue = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.LastValueAggregator = exports.LastValueAccumulation = void 0; + const types_1 = require_types$1(); + const core_1 = require_src$8(); + const MetricData_1 = require_MetricData(); + var LastValueAccumulation = class { + startTime; + _current; + sampleTime; + constructor(startTime, _current = 0, sampleTime = [0, 0]) { + this.startTime = startTime; + this._current = _current; + this.sampleTime = sampleTime; + } + record(value) { + this._current = value; + this.sampleTime = (0, core_1.millisToHrTime)(Date.now()); + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + }; + exports.LastValueAccumulation = LastValueAccumulation; + /** Basic aggregator which calculates a LastValue from individual measurements. */ + var LastValueAggregator = class { + kind = types_1.AggregatorKind.LAST_VALUE; + createAccumulation(startTime) { + return new LastValueAccumulation(startTime); + } + /** + * Returns the result of the merge of the given accumulations. + * + * Return the newly captured (delta) accumulation for LastValueAggregator. + */ + merge(previous, delta) { + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(delta.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? delta : previous; + return new LastValueAccumulation(previous.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); + } + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + * + * A delta aggregation is not meaningful to LastValueAggregator, just return + * the newly captured (delta) accumulation for LastValueAggregator. + */ + diff(previous, current) { + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(current.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? current : previous; + return new LastValueAccumulation(current.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.GAUGE, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue() + }; + }) + }; + } + }; + exports.LastValueAggregator = LastValueAggregator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Sum.js +var require_Sum = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SumAggregator = exports.SumAccumulation = void 0; + const types_1 = require_types$1(); + const MetricData_1 = require_MetricData(); + var SumAccumulation = class { + startTime; + monotonic; + _current; + reset; + constructor(startTime, monotonic, _current = 0, reset = false) { + this.startTime = startTime; + this.monotonic = monotonic; + this._current = _current; + this.reset = reset; + } + record(value) { + if (this.monotonic && value < 0) return; + this._current += value; + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + }; + exports.SumAccumulation = SumAccumulation; + /** Basic aggregator which calculates a Sum from individual measurements. */ + var SumAggregator = class { + monotonic; + kind = types_1.AggregatorKind.SUM; + constructor(monotonic) { + this.monotonic = monotonic; + } + createAccumulation(startTime) { + return new SumAccumulation(startTime, this.monotonic); + } + /** + * Returns the result of the merge of the given accumulations. + */ + merge(previous, delta) { + const prevPv = previous.toPointValue(); + const deltaPv = delta.toPointValue(); + if (delta.reset) return new SumAccumulation(delta.startTime, this.monotonic, deltaPv, delta.reset); + return new SumAccumulation(previous.startTime, this.monotonic, prevPv + deltaPv); + } + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + */ + diff(previous, current) { + const prevPv = previous.toPointValue(); + const currPv = current.toPointValue(); + /** + * If the SumAggregator is a monotonic one and the previous point value is + * greater than the current one, a reset is deemed to be happened. + * Return the current point value to prevent the value from been reset. + */ + if (this.monotonic && prevPv > currPv) return new SumAccumulation(current.startTime, this.monotonic, currPv, true); + return new SumAccumulation(current.startTime, this.monotonic, currPv - prevPv); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.SUM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue() + }; + }), + isMonotonic: this.monotonic + }; + } + }; + exports.SumAggregator = SumAggregator; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/index.js +var require_aggregator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SumAggregator = exports.SumAccumulation = exports.LastValueAggregator = exports.LastValueAccumulation = exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = exports.HistogramAggregator = exports.HistogramAccumulation = exports.DropAggregator = void 0; + var Drop_1 = require_Drop(); + Object.defineProperty(exports, "DropAggregator", { + enumerable: true, + get: function() { + return Drop_1.DropAggregator; + } + }); + var Histogram_1 = require_Histogram(); + Object.defineProperty(exports, "HistogramAccumulation", { + enumerable: true, + get: function() { + return Histogram_1.HistogramAccumulation; + } + }); + Object.defineProperty(exports, "HistogramAggregator", { + enumerable: true, + get: function() { + return Histogram_1.HistogramAggregator; + } + }); + var ExponentialHistogram_1 = require_ExponentialHistogram(); + Object.defineProperty(exports, "ExponentialHistogramAccumulation", { + enumerable: true, + get: function() { + return ExponentialHistogram_1.ExponentialHistogramAccumulation; + } + }); + Object.defineProperty(exports, "ExponentialHistogramAggregator", { + enumerable: true, + get: function() { + return ExponentialHistogram_1.ExponentialHistogramAggregator; + } + }); + var LastValue_1 = require_LastValue(); + Object.defineProperty(exports, "LastValueAccumulation", { + enumerable: true, + get: function() { + return LastValue_1.LastValueAccumulation; + } + }); + Object.defineProperty(exports, "LastValueAggregator", { + enumerable: true, + get: function() { + return LastValue_1.LastValueAggregator; + } + }); + var Sum_1 = require_Sum(); + Object.defineProperty(exports, "SumAccumulation", { + enumerable: true, + get: function() { + return Sum_1.SumAccumulation; + } + }); + Object.defineProperty(exports, "SumAggregator", { + enumerable: true, + get: function() { + return Sum_1.SumAggregator; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Aggregation.js +var require_Aggregation = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_AGGREGATION = exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = exports.HISTOGRAM_AGGREGATION = exports.LAST_VALUE_AGGREGATION = exports.SUM_AGGREGATION = exports.DROP_AGGREGATION = exports.DefaultAggregation = exports.ExponentialHistogramAggregation = exports.ExplicitBucketHistogramAggregation = exports.HistogramAggregation = exports.LastValueAggregation = exports.SumAggregation = exports.DropAggregation = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const aggregator_1 = require_aggregator(); + const MetricData_1 = require_MetricData(); + /** + * The default drop aggregation. + */ + var DropAggregation = class DropAggregation { + static DEFAULT_INSTANCE = new aggregator_1.DropAggregator(); + createAggregator(_instrument) { + return DropAggregation.DEFAULT_INSTANCE; + } + }; + exports.DropAggregation = DropAggregation; + /** + * The default sum aggregation. + */ + var SumAggregation = class SumAggregation { + static MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(true); + static NON_MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(false); + createAggregator(instrument) { + switch (instrument.type) { + case MetricData_1.InstrumentType.COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: + case MetricData_1.InstrumentType.HISTOGRAM: return SumAggregation.MONOTONIC_INSTANCE; + default: return SumAggregation.NON_MONOTONIC_INSTANCE; + } + } + }; + exports.SumAggregation = SumAggregation; + /** + * The default last value aggregation. + */ + var LastValueAggregation = class LastValueAggregation { + static DEFAULT_INSTANCE = new aggregator_1.LastValueAggregator(); + createAggregator(_instrument) { + return LastValueAggregation.DEFAULT_INSTANCE; + } + }; + exports.LastValueAggregation = LastValueAggregation; + /** + * The default histogram aggregation. + + */ + var HistogramAggregation = class HistogramAggregation { + static DEFAULT_INSTANCE = new aggregator_1.HistogramAggregator([ + 0, + 5, + 10, + 25, + 50, + 75, + 100, + 250, + 500, + 750, + 1e3, + 2500, + 5e3, + 7500, + 1e4 + ], true); + createAggregator(_instrument) { + return HistogramAggregation.DEFAULT_INSTANCE; + } + }; + exports.HistogramAggregation = HistogramAggregation; + /** + * The explicit bucket histogram aggregation. + */ + var ExplicitBucketHistogramAggregation = class { + _recordMinMax; + _boundaries; + /** + * @param boundaries the bucket boundaries of the histogram aggregation + * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. + */ + constructor(boundaries, _recordMinMax = true) { + this._recordMinMax = _recordMinMax; + if (boundaries == null) throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array"); + boundaries = boundaries.concat(); + boundaries = boundaries.sort((a, b) => a - b); + const minusInfinityIndex = boundaries.lastIndexOf(-Infinity); + let infinityIndex = boundaries.indexOf(Infinity); + if (infinityIndex === -1) infinityIndex = void 0; + this._boundaries = boundaries.slice(minusInfinityIndex + 1, infinityIndex); + } + createAggregator(_instrument) { + return new aggregator_1.HistogramAggregator(this._boundaries, this._recordMinMax); + } + }; + exports.ExplicitBucketHistogramAggregation = ExplicitBucketHistogramAggregation; + var ExponentialHistogramAggregation = class { + _maxSize; + _recordMinMax; + constructor(_maxSize = 160, _recordMinMax = true) { + this._maxSize = _maxSize; + this._recordMinMax = _recordMinMax; + } + createAggregator(_instrument) { + return new aggregator_1.ExponentialHistogramAggregator(this._maxSize, this._recordMinMax); + } + }; + exports.ExponentialHistogramAggregation = ExponentialHistogramAggregation; + /** + * The default aggregation. + */ + var DefaultAggregation = class { + _resolve(instrument) { + switch (instrument.type) { + case MetricData_1.InstrumentType.COUNTER: + case MetricData_1.InstrumentType.UP_DOWN_COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: return exports.SUM_AGGREGATION; + case MetricData_1.InstrumentType.GAUGE: + case MetricData_1.InstrumentType.OBSERVABLE_GAUGE: return exports.LAST_VALUE_AGGREGATION; + case MetricData_1.InstrumentType.HISTOGRAM: + if (instrument.advice.explicitBucketBoundaries) return new ExplicitBucketHistogramAggregation(instrument.advice.explicitBucketBoundaries); + return exports.HISTOGRAM_AGGREGATION; + } + api.diag.warn(`Unable to recognize instrument type: ${instrument.type}`); + return exports.DROP_AGGREGATION; + } + createAggregator(instrument) { + return this._resolve(instrument).createAggregator(instrument); + } + }; + exports.DefaultAggregation = DefaultAggregation; + exports.DROP_AGGREGATION = new DropAggregation(); + exports.SUM_AGGREGATION = new SumAggregation(); + exports.LAST_VALUE_AGGREGATION = new LastValueAggregation(); + exports.HISTOGRAM_AGGREGATION = new HistogramAggregation(); + exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = new ExponentialHistogramAggregation(); + exports.DEFAULT_AGGREGATION = new DefaultAggregation(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AggregationOption.js +var require_AggregationOption = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toAggregation = exports.AggregationType = void 0; + const Aggregation_1 = require_Aggregation(); + var AggregationType; + (function(AggregationType) { + AggregationType[AggregationType["DEFAULT"] = 0] = "DEFAULT"; + AggregationType[AggregationType["DROP"] = 1] = "DROP"; + AggregationType[AggregationType["SUM"] = 2] = "SUM"; + AggregationType[AggregationType["LAST_VALUE"] = 3] = "LAST_VALUE"; + AggregationType[AggregationType["EXPLICIT_BUCKET_HISTOGRAM"] = 4] = "EXPLICIT_BUCKET_HISTOGRAM"; + AggregationType[AggregationType["EXPONENTIAL_HISTOGRAM"] = 5] = "EXPONENTIAL_HISTOGRAM"; + })(AggregationType = exports.AggregationType || (exports.AggregationType = {})); + function toAggregation(option) { + switch (option.type) { + case AggregationType.DEFAULT: return Aggregation_1.DEFAULT_AGGREGATION; + case AggregationType.DROP: return Aggregation_1.DROP_AGGREGATION; + case AggregationType.SUM: return Aggregation_1.SUM_AGGREGATION; + case AggregationType.LAST_VALUE: return Aggregation_1.LAST_VALUE_AGGREGATION; + case AggregationType.EXPONENTIAL_HISTOGRAM: { + const expOption = option; + return new Aggregation_1.ExponentialHistogramAggregation(expOption.options?.maxSize, expOption.options?.recordMinMax); + } + case AggregationType.EXPLICIT_BUCKET_HISTOGRAM: { + const expOption = option; + if (expOption.options == null) return Aggregation_1.HISTOGRAM_AGGREGATION; + else return new Aggregation_1.ExplicitBucketHistogramAggregation(expOption.options?.boundaries, expOption.options?.recordMinMax); + } + default: throw new Error("Unsupported Aggregation"); + } + } + exports.toAggregation = toAggregation; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationSelector.js +var require_AggregationSelector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = exports.DEFAULT_AGGREGATION_SELECTOR = void 0; + const AggregationTemporality_1 = require_AggregationTemporality(); + const AggregationOption_1 = require_AggregationOption(); + const DEFAULT_AGGREGATION_SELECTOR = (_instrumentType) => { + return { type: AggregationOption_1.AggregationType.DEFAULT }; + }; + exports.DEFAULT_AGGREGATION_SELECTOR = DEFAULT_AGGREGATION_SELECTOR; + const DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = (_instrumentType) => AggregationTemporality_1.AggregationTemporality.CUMULATIVE; + exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReader.js +var require_MetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricReader = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const utils_1 = require_utils$4(); + const AggregationSelector_1 = require_AggregationSelector(); + /** + * A registered reader of metrics that, when linked to a {@link MetricProducer}, offers global + * control over metrics. + */ + var MetricReader = class { + _shutdown = false; + _metricProducers; + _sdkMetricProducer; + _aggregationTemporalitySelector; + _aggregationSelector; + _cardinalitySelector; + constructor(options) { + this._aggregationSelector = options?.aggregationSelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_SELECTOR; + this._aggregationTemporalitySelector = options?.aggregationTemporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; + this._metricProducers = options?.metricProducers ?? []; + this._cardinalitySelector = options?.cardinalitySelector; + } + setMetricProducer(metricProducer) { + if (this._sdkMetricProducer) throw new Error("MetricReader can not be bound to a MeterProvider again."); + this._sdkMetricProducer = metricProducer; + this.onInitialized(); + } + selectAggregation(instrumentType) { + return this._aggregationSelector(instrumentType); + } + selectAggregationTemporality(instrumentType) { + return this._aggregationTemporalitySelector(instrumentType); + } + selectCardinalityLimit(instrumentType) { + return this._cardinalitySelector ? this._cardinalitySelector(instrumentType) : 2e3; + } + /** + * Handle once the SDK has initialized this {@link MetricReader} + * Overriding this method is optional. + */ + onInitialized() {} + async collect(options) { + if (this._sdkMetricProducer === void 0) throw new Error("MetricReader is not bound to a MetricProducer"); + if (this._shutdown) throw new Error("MetricReader is shutdown"); + const [sdkCollectionResults, ...additionalCollectionResults] = await Promise.all([this._sdkMetricProducer.collect({ timeoutMillis: options?.timeoutMillis }), ...this._metricProducers.map((producer) => producer.collect({ timeoutMillis: options?.timeoutMillis }))]); + const errors = sdkCollectionResults.errors.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.errors)); + return { + resourceMetrics: { + resource: sdkCollectionResults.resourceMetrics.resource, + scopeMetrics: sdkCollectionResults.resourceMetrics.scopeMetrics.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.resourceMetrics.scopeMetrics)) + }, + errors + }; + } + async shutdown(options) { + if (this._shutdown) { + api.diag.error("Cannot call shutdown twice."); + return; + } + if (options?.timeoutMillis == null) await this.onShutdown(); + else await (0, utils_1.callWithTimeout)(this.onShutdown(), options.timeoutMillis); + this._shutdown = true; + } + async forceFlush(options) { + if (this._shutdown) { + api.diag.warn("Cannot forceFlush on already shutdown MetricReader."); + return; + } + if (options?.timeoutMillis == null) { + await this.onForceFlush(); + return; + } + await (0, utils_1.callWithTimeout)(this.onForceFlush(), options.timeoutMillis); + } + }; + exports.MetricReader = MetricReader; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/PeriodicExportingMetricReader.js +var require_PeriodicExportingMetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PeriodicExportingMetricReader = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const MetricReader_1 = require_MetricReader(); + const utils_1 = require_utils$4(); + /** + * {@link MetricReader} which collects metrics based on a user-configurable time interval, and passes the metrics to + * the configured {@link PushMetricExporter} + */ + var PeriodicExportingMetricReader = class extends MetricReader_1.MetricReader { + _interval; + _exporter; + _exportInterval; + _exportTimeout; + constructor(options) { + super({ + aggregationSelector: options.exporter.selectAggregation?.bind(options.exporter), + aggregationTemporalitySelector: options.exporter.selectAggregationTemporality?.bind(options.exporter), + metricProducers: options.metricProducers + }); + if (options.exportIntervalMillis !== void 0 && options.exportIntervalMillis <= 0) throw Error("exportIntervalMillis must be greater than 0"); + if (options.exportTimeoutMillis !== void 0 && options.exportTimeoutMillis <= 0) throw Error("exportTimeoutMillis must be greater than 0"); + if (options.exportTimeoutMillis !== void 0 && options.exportIntervalMillis !== void 0 && options.exportIntervalMillis < options.exportTimeoutMillis) throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis"); + this._exportInterval = options.exportIntervalMillis ?? 6e4; + this._exportTimeout = options.exportTimeoutMillis ?? 3e4; + this._exporter = options.exporter; + } + async _runOnce() { + try { + await (0, utils_1.callWithTimeout)(this._doRun(), this._exportTimeout); + } catch (err) { + if (err instanceof utils_1.TimeoutError) { + api.diag.error("Export took longer than %s milliseconds and timed out.", this._exportTimeout); + return; + } + (0, core_1.globalErrorHandler)(err); + } + } + async _doRun() { + const { resourceMetrics, errors } = await this.collect({ timeoutMillis: this._exportTimeout }); + if (errors.length > 0) api.diag.error("PeriodicExportingMetricReader: metrics collection errors", ...errors); + if (resourceMetrics.resource.asyncAttributesPending) try { + await resourceMetrics.resource.waitForAsyncAttributes?.(); + } catch (e) { + api.diag.debug("Error while resolving async portion of resource: ", e); + (0, core_1.globalErrorHandler)(e); + } + if (resourceMetrics.scopeMetrics.length === 0) return; + const result = await core_1.internal._export(this._exporter, resourceMetrics); + if (result.code !== core_1.ExportResultCode.SUCCESS) throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result.error})`); + } + onInitialized() { + this._interval = setInterval(() => { + this._runOnce(); + }, this._exportInterval); + (0, core_1.unrefTimer)(this._interval); + } + async onForceFlush() { + await this._runOnce(); + await this._exporter.forceFlush(); + } + async onShutdown() { + if (this._interval) clearInterval(this._interval); + await this.onForceFlush(); + await this._exporter.shutdown(); + } + }; + exports.PeriodicExportingMetricReader = PeriodicExportingMetricReader; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/InMemoryMetricExporter.js +var require_InMemoryMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InMemoryMetricExporter = void 0; + const core_1 = require_src$8(); + /** + * In-memory Metrics Exporter is a Push Metric Exporter + * which accumulates metrics data in the local memory and + * allows to inspect it (useful for e.g. unit tests). + */ + var InMemoryMetricExporter = class { + _shutdown = false; + _aggregationTemporality; + _metrics = []; + constructor(aggregationTemporality) { + this._aggregationTemporality = aggregationTemporality; + } + /** + * @inheritedDoc + */ + export(metrics$1, resultCallback) { + if (this._shutdown) { + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.FAILED }), 0); + return; + } + this._metrics.push(metrics$1); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + /** + * Returns all the collected resource metrics + * @returns ResourceMetrics[] + */ + getMetrics() { + return this._metrics; + } + forceFlush() { + return Promise.resolve(); + } + reset() { + this._metrics = []; + } + selectAggregationTemporality(_instrumentType) { + return this._aggregationTemporality; + } + shutdown() { + this._shutdown = true; + return Promise.resolve(); + } + }; + exports.InMemoryMetricExporter = InMemoryMetricExporter; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/ConsoleMetricExporter.js +var require_ConsoleMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ConsoleMetricExporter = void 0; + const core_1 = require_src$8(); + const AggregationSelector_1 = require_AggregationSelector(); + /** + * This is an implementation of {@link PushMetricExporter} that prints metrics to the + * console. This class can be used for diagnostic purposes. + * + * NOTE: This {@link PushMetricExporter} is intended for diagnostics use only, output rendered to the console may change at any time. + */ + var ConsoleMetricExporter = class ConsoleMetricExporter { + _shutdown = false; + _temporalitySelector; + constructor(options) { + this._temporalitySelector = options?.temporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; + } + export(metrics$1, resultCallback) { + if (this._shutdown) { + setImmediate(resultCallback, { code: core_1.ExportResultCode.FAILED }); + return; + } + return ConsoleMetricExporter._sendMetrics(metrics$1, resultCallback); + } + forceFlush() { + return Promise.resolve(); + } + selectAggregationTemporality(_instrumentType) { + return this._temporalitySelector(_instrumentType); + } + shutdown() { + this._shutdown = true; + return Promise.resolve(); + } + static _sendMetrics(metrics$1, done) { + for (const scopeMetrics of metrics$1.scopeMetrics) for (const metric of scopeMetrics.metrics) console.dir({ + descriptor: metric.descriptor, + dataPointType: metric.dataPointType, + dataPoints: metric.dataPoints + }, { depth: null }); + done({ code: core_1.ExportResultCode.SUCCESS }); + } + }; + exports.ConsoleMetricExporter = ConsoleMetricExporter; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js +var require_default_service_name$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = void 0; + function defaultServiceName() { + return `unknown_service:${process.argv0}`; + } + exports.defaultServiceName = defaultServiceName; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/node/index.js +var require_node$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = void 0; + var default_service_name_1 = require_default_service_name$1(); + Object.defineProperty(exports, "defaultServiceName", { + enumerable: true, + get: function() { + return default_service_name_1.defaultServiceName; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/index.js +var require_platform$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = void 0; + var node_1 = require_node$4(); + Object.defineProperty(exports, "defaultServiceName", { + enumerable: true, + get: function() { + return node_1.defaultServiceName; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/utils.js +var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.identity = exports.isPromiseLike = void 0; + const isPromiseLike = (val) => { + return val !== null && typeof val === "object" && typeof val.then === "function"; + }; + exports.isPromiseLike = isPromiseLike; + function identity(_) { + return _; + } + exports.identity = identity; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +var require_ResourceImpl$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const platform_1 = require_platform$4(); + const utils_1 = require_utils$3(); + var ResourceImpl = class ResourceImpl { + _rawAttributes; + _asyncAttributesPending = false; + _schemaUrl; + _memoizedAttributes; + static FromAttributeList(attributes, options) { + const res = new ResourceImpl({}, options); + res._rawAttributes = guardedRawAttributes(attributes); + res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; + return res; + } + constructor(resource, options) { + const attributes = resource.attributes ?? {}; + this._rawAttributes = Object.entries(attributes).map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) this._asyncAttributesPending = true; + return [k, v]; + }); + this._rawAttributes = guardedRawAttributes(this._rawAttributes); + this._schemaUrl = validateSchemaUrl(options?.schemaUrl); + } + get asyncAttributesPending() { + return this._asyncAttributesPending; + } + async waitForAsyncAttributes() { + if (!this.asyncAttributesPending) return; + for (let i = 0; i < this._rawAttributes.length; i++) { + const [k, v] = this._rawAttributes[i]; + this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; + } + this._asyncAttributesPending = false; + } + get attributes() { + if (this.asyncAttributesPending) api_1.diag.error("Accessing resource attributes before async attributes settled"); + if (this._memoizedAttributes) return this._memoizedAttributes; + const attrs = {}; + for (const [k, v] of this._rawAttributes) { + if ((0, utils_1.isPromiseLike)(v)) { + api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); + continue; + } + if (v != null) attrs[k] ??= v; + } + if (!this._asyncAttributesPending) this._memoizedAttributes = attrs; + return attrs; + } + getRawAttributes() { + return this._rawAttributes; + } + get schemaUrl() { + return this._schemaUrl; + } + merge(resource) { + if (resource == null) return this; + const mergedSchemaUrl = mergeSchemaUrl(this, resource); + const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0; + return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); + } + }; + function resourceFromAttributes(attributes, options) { + return ResourceImpl.FromAttributeList(Object.entries(attributes), options); + } + exports.resourceFromAttributes = resourceFromAttributes; + function resourceFromDetectedResource(detectedResource, options) { + return new ResourceImpl(detectedResource, options); + } + exports.resourceFromDetectedResource = resourceFromDetectedResource; + function emptyResource() { + return resourceFromAttributes({}); + } + exports.emptyResource = emptyResource; + function defaultResource() { + return resourceFromAttributes({ + [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] + }); + } + exports.defaultResource = defaultResource; + function guardedRawAttributes(attributes) { + return attributes.map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) return [k, v.catch((err) => { + api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); + })]; + return [k, v]; + }); + } + function validateSchemaUrl(schemaUrl) { + if (typeof schemaUrl === "string" || schemaUrl === void 0) return schemaUrl; + api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); + } + function mergeSchemaUrl(old, updating) { + const oldSchemaUrl = old?.schemaUrl; + const updatingSchemaUrl = updating?.schemaUrl; + const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === ""; + const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === ""; + if (isOldEmpty) return updatingSchemaUrl; + if (isUpdatingEmpty) return oldSchemaUrl; + if (oldSchemaUrl === updatingSchemaUrl) return oldSchemaUrl; + api_1.diag.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", oldSchemaUrl, updatingSchemaUrl); + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detect-resources.js +var require_detect_resources$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.detectResources = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const ResourceImpl_1 = require_ResourceImpl$1(); + /** + * Runs all resource detectors and returns the results merged into a single Resource. + * + * @param config Configuration for resource detection + */ + const detectResources = (config$1 = {}) => { + return (config$1.detectors || []).map((d) => { + try { + const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config$1)); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return (0, ResourceImpl_1.emptyResource)(); + } + }).reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); + }; + exports.detectResources = detectResources; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js +var require_EnvDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.envDetector = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const core_1 = require_src$8(); + /** + * EnvDetector can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + */ + var EnvDetector = class { + _MAX_LENGTH = 255; + _COMMA_SEPARATOR = ","; + _LABEL_KEY_VALUE_SPLITTER = "="; + _ERROR_MESSAGE_INVALID_CHARS = "should be a ASCII string with a length greater than 0 and not exceed " + this._MAX_LENGTH + " characters."; + _ERROR_MESSAGE_INVALID_VALUE = "should be a ASCII string with a length not exceed " + this._MAX_LENGTH + " characters."; + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + detect(_config) { + const attributes = {}; + const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); + const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); + if (rawAttributes) try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e.message}`); + } + if (serviceName) attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; + return { attributes }; + } + /** + * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment + * variable. + * + * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing + * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and + * paths are accepted as attribute keys. Values may be quoted or unquoted in + * general. If a value contains whitespace, =, or " characters, it must + * always be quoted. + * + * @param rawEnvAttributes The resource attributes as a comma-separated list + * of key/value pairs. + * @returns The sanitized resource attributes. + */ + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); + if (keyValuePair.length !== 2) continue; + let [key, value] = keyValuePair; + key = key.trim(); + value = value.trim().split(/^"|"$/).join(""); + if (!this._isValidAndNotEmpty(key)) throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); + if (!this._isValid(value)) throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); + attributes[key] = decodeURIComponent(value); + } + return attributes; + } + /** + * Determines whether the given String is a valid printable ASCII string with + * a length not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid. + */ + _isValid(name) { + return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); + } + _isBaggageOctetString(str) { + for (let i = 0; i < str.length; i++) { + const ch = str.charCodeAt(i); + if (ch < 33 || ch === 44 || ch === 59 || ch === 92 || ch > 126) return false; + } + return true; + } + /** + * Determines whether the given String is a valid printable ASCII string with + * a length greater than 0 and not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid and not empty. + */ + _isValidAndNotEmpty(str) { + return str.length > 0 && this._isValid(str); + } + }; + exports.envDetector = new EnvDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js +var require_semconv$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; + /** + * The cloud account ID the resource is assigned to. + * + * @example 111111111111 + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; + /** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * @example us-east-1c + * + * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + /** + * Name of the cloud provider. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; + /** + * The geographical region the resource is running. + * + * @example us-central1 + * @example us-east-1 + * + * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_REGION = "cloud.region"; + /** + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. + * + * @example a3bf90e006b2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_ID = "container.id"; + /** + * Name of the image the container was built on. + * + * @example gcr.io/opentelemetry/operator + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; + /** + * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. + * + * @example ["v1.27.1", "3.5.7-0"] + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; + /** + * Container name used by container runtime. + * + * @example opentelemetry-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_NAME = "container.name"; + /** + * The CPU architecture the host system is running on. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_ARCH = "host.arch"; + /** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. + * + * @example fdbf79e8af94cb7f9e8df36789187052 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_ID = "host.id"; + /** + * VM image ID or host OS image ID. For Cloud, this value is from the provider. + * + * @example ami-07b06b442921831e5 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_ID = "host.image.id"; + /** + * Name of the VM image or OS install the host was instantiated from. + * + * @example infra-ami-eks-worker-node-7d4ec78312 + * @example CentOS-8-x86_64-1905 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; + /** + * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 0.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; + /** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + * + * @example opentelemetry-test + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_NAME = "host.name"; + /** + * Type of host. For Cloud, this must be the machine type. + * + * @example n1-standard-1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_TYPE = "host.type"; + /** + * The name of the cluster. + * + * @example opentelemetry-cluster + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; + /** + * The name of the Deployment. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + /** + * The name of the namespace that the pod is running in. + * + * @example default + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + /** + * The name of the Pod. + * + * @example opentelemetry-pod-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; + /** + * The operating system type. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OS_TYPE = "os.type"; + /** + * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 14.2.1 + * @example 18.04.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OS_VERSION = "os.version"; + /** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * + * @example cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_COMMAND = "process.command"; + /** + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * + * @example ["cmd/otecol", "--config=config.yaml"] + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; + /** + * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`. + * + * @example otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + /** + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + * + * @example /usr/bin/cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + /** + * The username of the user that owns the process. + * + * @example root + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_OWNER = "process.owner"; + /** + * Process identifier (PID). + * + * @example 1234 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_PID = "process.pid"; + /** + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + * + * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + /** + * The name of the runtime of this process. + * + * @example OpenJDK Runtime Environment + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; + /** + * The version of the runtime of this process, as returned by the runtime without modification. + * + * @example "14.0.2" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + /** + * The string ID of the service instance. + * + * @example 627cc493-f310-47de-96bd-71410b7dec09 + * + * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words + * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to + * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled + * service). + * + * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC + * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of + * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and + * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. + * + * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is + * needed. Similar to what can be seen in the man page for the + * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying + * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it + * or not via another resource attribute. + * + * For applications running behind an application server (like unicorn), we do not recommend using one identifier + * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker + * thread in unicorn) to have its own instance.id. + * + * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the + * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will + * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. + * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance + * for that telemetry. This is typically the case for scraping receivers, as they know the target address and + * port. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + /** + * A namespace for `service.name`. + * + * @example Shop + * + * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; + /** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; + /** + * The name of the web engine. + * + * @example WildFly + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_NAME = "webengine.name"; + /** + * The version of the web engine. + * + * @example 21.0.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_VERSION = "webengine.version"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js +var require_execAsync$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.execAsync = void 0; + const child_process$1 = __require("child_process"); + const util$1 = __require("util"); + exports.execAsync = util$1.promisify(child_process$1.exec); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js +var require_getMachineId_darwin$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const execAsync_1 = require_execAsync$1(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + try { + const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID")); + if (!idLine) return; + const parts = idLine.split("\" = \""); + if (parts.length === 2) return parts[1].slice(0, -1); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js +var require_getMachineId_linux$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const fs_1$3 = __require("fs"); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + for (const path$1 of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try { + return (await fs_1$3.promises.readFile(path$1, { encoding: "utf8" })).trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js +var require_getMachineId_bsd$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const fs_1$2 = __require("fs"); + const execAsync_1 = require_execAsync$1(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + try { + return (await fs_1$2.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + try { + return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js +var require_getMachineId_win$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const process$4 = __require("process"); + const execAsync_1 = require_execAsync$1(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; + let command = "%windir%\\System32\\REG.exe"; + if (process$4.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process$4.env) command = "%windir%\\sysnative\\cmd.exe /c " + command; + try { + const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ"); + if (parts.length === 2) return parts[1].trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js +var require_getMachineId_unsupported$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + api_1.diag.debug("could not read machine-id: unsupported platform"); + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js +var require_getMachineId$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const process$3 = __require("process"); + let getMachineIdImpl; + async function getMachineId() { + if (!getMachineIdImpl) switch (process$3.platform) { + case "darwin": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_darwin$1()))).getMachineId; + break; + case "linux": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_linux$1()))).getMachineId; + break; + case "freebsd": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_bsd$1()))).getMachineId; + break; + case "win32": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_win$1()))).getMachineId; + break; + default: + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_unsupported$1()))).getMachineId; + break; + } + return getMachineIdImpl(); + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js +var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.normalizeType = exports.normalizeArch = void 0; + const normalizeArch = (nodeArchString) => { + switch (nodeArchString) { + case "arm": return "arm32"; + case "ppc": return "ppc32"; + case "x64": return "amd64"; + default: return nodeArchString; + } + }; + exports.normalizeArch = normalizeArch; + const normalizeType = (nodePlatform) => { + switch (nodePlatform) { + case "sunos": return "solaris"; + case "win32": return "windows"; + default: return nodePlatform; + } + }; + exports.normalizeType = normalizeType; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js +var require_HostDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hostDetector = void 0; + const semconv_1 = require_semconv$2(); + const os_1$3 = __require("os"); + const getMachineId_1 = require_getMachineId$1(); + const utils_1 = require_utils$2(); + /** + * HostDetector detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. + */ + var HostDetector = class { + detect(_config) { + return { attributes: { + [semconv_1.ATTR_HOST_NAME]: (0, os_1$3.hostname)(), + [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1$3.arch)()), + [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() + } }; + } + }; + exports.hostDetector = new HostDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js +var require_OSDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.osDetector = void 0; + const semconv_1 = require_semconv$2(); + const os_1$2 = __require("os"); + const utils_1 = require_utils$2(); + /** + * OSDetector detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. + */ + var OSDetector = class { + detect(_config) { + return { attributes: { + [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1$2.platform)()), + [semconv_1.ATTR_OS_VERSION]: (0, os_1$2.release)() + } }; + } + }; + exports.osDetector = new OSDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js +var require_ProcessDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.processDetector = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const semconv_1 = require_semconv$2(); + const os$1 = __require("os"); + /** + * ProcessDetector will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. + */ + var ProcessDetector = class { + detect(_config) { + const attributes = { + [semconv_1.ATTR_PROCESS_PID]: process.pid, + [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, + [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, + [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ + process.argv[0], + ...process.execArgv, + ...process.argv.slice(1) + ], + [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", + [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" + }; + if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; + try { + const userInfo = os$1.userInfo(); + attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; + } catch (e) { + api_1.diag.debug(`error obtaining process owner: ${e}`); + } + return { attributes }; + } + }; + exports.processDetector = new ProcessDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js +var require_ServiceInstanceIdDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = void 0; + const semconv_1 = require_semconv$2(); + const crypto_1$1 = __require("crypto"); + /** + * ServiceInstanceIdDetector detects the resources related to the service instance ID. + */ + var ServiceInstanceIdDetector = class { + detect(_config) { + return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1$1.randomUUID)() } }; + } + }; + /** + * @experimental + */ + exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js +var require_node$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; + var HostDetector_1 = require_HostDetector$1(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return HostDetector_1.hostDetector; + } + }); + var OSDetector_1 = require_OSDetector$1(); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return OSDetector_1.osDetector; + } + }); + var ProcessDetector_1 = require_ProcessDetector$1(); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return ProcessDetector_1.processDetector; + } + }); + var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector$1(); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js +var require_platform$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; + var node_1 = require_node$3(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return node_1.hostDetector; + } + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return node_1.osDetector; + } + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return node_1.processDetector; + } + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return node_1.serviceInstanceIdDetector; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js +var require_NoopDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.NoopDetector = void 0; + var NoopDetector = class { + detect() { + return { attributes: {} }; + } + }; + exports.NoopDetector = NoopDetector; + exports.noopDetector = new NoopDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/index.js +var require_detectors$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; + var EnvDetector_1 = require_EnvDetector$1(); + Object.defineProperty(exports, "envDetector", { + enumerable: true, + get: function() { + return EnvDetector_1.envDetector; + } + }); + var platform_1 = require_platform$3(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return platform_1.hostDetector; + } + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return platform_1.osDetector; + } + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return platform_1.processDetector; + } + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return platform_1.serviceInstanceIdDetector; + } + }); + var NoopDetector_1 = require_NoopDetector$1(); + Object.defineProperty(exports, "noopDetector", { + enumerable: true, + get: function() { + return NoopDetector_1.noopDetector; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/index.js +var require_src$7 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0; + var detect_resources_1 = require_detect_resources$1(); + Object.defineProperty(exports, "detectResources", { + enumerable: true, + get: function() { + return detect_resources_1.detectResources; + } + }); + var detectors_1 = require_detectors$1(); + Object.defineProperty(exports, "envDetector", { + enumerable: true, + get: function() { + return detectors_1.envDetector; + } + }); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return detectors_1.hostDetector; + } + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return detectors_1.osDetector; + } + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return detectors_1.processDetector; + } + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return detectors_1.serviceInstanceIdDetector; + } + }); + var ResourceImpl_1 = require_ResourceImpl$1(); + Object.defineProperty(exports, "resourceFromAttributes", { + enumerable: true, + get: function() { + return ResourceImpl_1.resourceFromAttributes; + } + }); + Object.defineProperty(exports, "defaultResource", { + enumerable: true, + get: function() { + return ResourceImpl_1.defaultResource; + } + }); + Object.defineProperty(exports, "emptyResource", { + enumerable: true, + get: function() { + return ResourceImpl_1.emptyResource; + } + }); + var platform_1 = require_platform$4(); + Object.defineProperty(exports, "defaultServiceName", { + enumerable: true, + get: function() { + return platform_1.defaultServiceName; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/ViewRegistry.js +var require_ViewRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ViewRegistry = void 0; + var ViewRegistry = class { + _registeredViews = []; + addView(view) { + this._registeredViews.push(view); + } + findViews(instrument, meter) { + return this._registeredViews.filter((registeredView) => { + return this._matchInstrument(registeredView.instrumentSelector, instrument) && this._matchMeter(registeredView.meterSelector, meter); + }); + } + _matchInstrument(selector, instrument) { + return (selector.getType() === void 0 || instrument.type === selector.getType()) && selector.getNameFilter().match(instrument.name) && selector.getUnitFilter().match(instrument.unit); + } + _matchMeter(selector, meter) { + return selector.getNameFilter().match(meter.name) && (meter.version === void 0 || selector.getVersionFilter().match(meter.version)) && (meter.schemaUrl === void 0 || selector.getSchemaUrlFilter().match(meter.schemaUrl)); + } + }; + exports.ViewRegistry = ViewRegistry; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js +var require_InstrumentDescriptor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isValidName = exports.isDescriptorCompatibleWith = exports.createInstrumentDescriptorWithView = exports.createInstrumentDescriptor = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const utils_1 = require_utils$4(); + function createInstrumentDescriptor(name, type, options) { + if (!isValidName(name)) api_1.diag.warn(`Invalid metric name: "${name}". The metric name should be a ASCII string with a length no greater than 255 characters.`); + return { + name, + type, + description: options?.description ?? "", + unit: options?.unit ?? "", + valueType: options?.valueType ?? api_1.ValueType.DOUBLE, + advice: options?.advice ?? {} + }; + } + exports.createInstrumentDescriptor = createInstrumentDescriptor; + function createInstrumentDescriptorWithView(view, instrument) { + return { + name: view.name ?? instrument.name, + description: view.description ?? instrument.description, + type: instrument.type, + unit: instrument.unit, + valueType: instrument.valueType, + advice: instrument.advice + }; + } + exports.createInstrumentDescriptorWithView = createInstrumentDescriptorWithView; + function isDescriptorCompatibleWith(descriptor, otherDescriptor) { + return (0, utils_1.equalsCaseInsensitive)(descriptor.name, otherDescriptor.name) && descriptor.unit === otherDescriptor.unit && descriptor.type === otherDescriptor.type && descriptor.valueType === otherDescriptor.valueType; + } + exports.isDescriptorCompatibleWith = isDescriptorCompatibleWith; + const NAME_REGEXP = /^[a-z][a-z0-9_.\-/]{0,254}$/i; + function isValidName(name) { + return name.match(NAME_REGEXP) != null; + } + exports.isValidName = isValidName; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Instruments.js +var require_Instruments = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isObservableInstrument = exports.ObservableUpDownCounterInstrument = exports.ObservableGaugeInstrument = exports.ObservableCounterInstrument = exports.ObservableInstrument = exports.HistogramInstrument = exports.GaugeInstrument = exports.CounterInstrument = exports.UpDownCounterInstrument = exports.SyncInstrument = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + var SyncInstrument = class { + _writableMetricStorage; + _descriptor; + constructor(_writableMetricStorage, _descriptor) { + this._writableMetricStorage = _writableMetricStorage; + this._descriptor = _descriptor; + } + _record(value, attributes = {}, context$1 = api_1.context.active()) { + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${value}`); + return; + } + if (this._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) return; + } + this._writableMetricStorage.record(value, attributes, context$1, (0, core_1.millisToHrTime)(Date.now())); + } + }; + exports.SyncInstrument = SyncInstrument; + /** + * The class implements {@link UpDownCounter} interface. + */ + var UpDownCounterInstrument = class extends SyncInstrument { + /** + * Increment value of counter by the input. Inputs may be negative. + */ + add(value, attributes, ctx) { + this._record(value, attributes, ctx); + } + }; + exports.UpDownCounterInstrument = UpDownCounterInstrument; + /** + * The class implements {@link Counter} interface. + */ + var CounterInstrument = class extends SyncInstrument { + /** + * Increment value of counter by the input. Inputs may not be negative. + */ + add(value, attributes, ctx) { + if (value < 0) { + api_1.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); + } + }; + exports.CounterInstrument = CounterInstrument; + /** + * The class implements {@link Gauge} interface. + */ + var GaugeInstrument = class extends SyncInstrument { + /** + * Records a measurement. + */ + record(value, attributes, ctx) { + this._record(value, attributes, ctx); + } + }; + exports.GaugeInstrument = GaugeInstrument; + /** + * The class implements {@link Histogram} interface. + */ + var HistogramInstrument = class extends SyncInstrument { + /** + * Records a measurement. Value of the measurement must not be negative. + */ + record(value, attributes, ctx) { + if (value < 0) { + api_1.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); + } + }; + exports.HistogramInstrument = HistogramInstrument; + var ObservableInstrument = class { + _observableRegistry; + /** @internal */ + _metricStorages; + /** @internal */ + _descriptor; + constructor(descriptor, metricStorages, _observableRegistry) { + this._observableRegistry = _observableRegistry; + this._descriptor = descriptor; + this._metricStorages = metricStorages; + } + /** + * @see {Observable.addCallback} + */ + addCallback(callback) { + this._observableRegistry.addCallback(callback, this); + } + /** + * @see {Observable.removeCallback} + */ + removeCallback(callback) { + this._observableRegistry.removeCallback(callback, this); + } + }; + exports.ObservableInstrument = ObservableInstrument; + var ObservableCounterInstrument = class extends ObservableInstrument {}; + exports.ObservableCounterInstrument = ObservableCounterInstrument; + var ObservableGaugeInstrument = class extends ObservableInstrument {}; + exports.ObservableGaugeInstrument = ObservableGaugeInstrument; + var ObservableUpDownCounterInstrument = class extends ObservableInstrument {}; + exports.ObservableUpDownCounterInstrument = ObservableUpDownCounterInstrument; + function isObservableInstrument(it) { + return it instanceof ObservableInstrument; + } + exports.isObservableInstrument = isObservableInstrument; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Meter.js +var require_Meter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Meter = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + const Instruments_1 = require_Instruments(); + const MetricData_1 = require_MetricData(); + /** + * This class implements the {@link IMeter} interface. + */ + var Meter = class { + _meterSharedState; + constructor(_meterSharedState) { + this._meterSharedState = _meterSharedState; + } + /** + * Create a {@link Gauge} instrument. + */ + createGauge(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.GAUGE, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.GaugeInstrument(storage, descriptor); + } + /** + * Create a {@link Histogram} instrument. + */ + createHistogram(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.HISTOGRAM, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.HistogramInstrument(storage, descriptor); + } + /** + * Create a {@link Counter} instrument. + */ + createCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.CounterInstrument(storage, descriptor); + } + /** + * Create a {@link UpDownCounter} instrument. + */ + createUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.UP_DOWN_COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.UpDownCounterInstrument(storage, descriptor); + } + /** + * Create a {@link ObservableGauge} instrument. + */ + createObservableGauge(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_GAUGE, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableGaugeInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + /** + * Create a {@link ObservableCounter} instrument. + */ + createObservableCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + /** + * Create a {@link ObservableUpDownCounter} instrument. + */ + createObservableUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableUpDownCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + /** + * @see {@link Meter.addBatchObservableCallback} + */ + addBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.addBatchCallback(callback, observables); + } + /** + * @see {@link Meter.removeBatchObservableCallback} + */ + removeBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.removeBatchCallback(callback, observables); + } + }; + exports.Meter = Meter; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorage.js +var require_MetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricStorage = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + /** + * Internal interface. + * + * Represents a storage from which we can collect metrics. + */ + var MetricStorage = class { + _instrumentDescriptor; + constructor(_instrumentDescriptor) { + this._instrumentDescriptor = _instrumentDescriptor; + } + getInstrumentDescriptor() { + return this._instrumentDescriptor; + } + updateDescription(description) { + this._instrumentDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(this._instrumentDescriptor.name, this._instrumentDescriptor.type, { + description, + valueType: this._instrumentDescriptor.valueType, + unit: this._instrumentDescriptor.unit, + advice: this._instrumentDescriptor.advice + }); + } + }; + exports.MetricStorage = MetricStorage; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/HashMap.js +var require_HashMap = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttributeHashMap = exports.HashMap = void 0; + const utils_1 = require_utils$4(); + var HashMap = class { + _hash; + _valueMap = /* @__PURE__ */ new Map(); + _keyMap = /* @__PURE__ */ new Map(); + constructor(_hash) { + this._hash = _hash; + } + get(key, hashCode) { + hashCode ??= this._hash(key); + return this._valueMap.get(hashCode); + } + getOrDefault(key, defaultFactory) { + const hash = this._hash(key); + if (this._valueMap.has(hash)) return this._valueMap.get(hash); + const val = defaultFactory(); + if (!this._keyMap.has(hash)) this._keyMap.set(hash, key); + this._valueMap.set(hash, val); + return val; + } + set(key, value, hashCode) { + hashCode ??= this._hash(key); + if (!this._keyMap.has(hashCode)) this._keyMap.set(hashCode, key); + this._valueMap.set(hashCode, value); + } + has(key, hashCode) { + hashCode ??= this._hash(key); + return this._valueMap.has(hashCode); + } + *keys() { + const keyIterator = this._keyMap.entries(); + let next = keyIterator.next(); + while (next.done !== true) { + yield [next.value[1], next.value[0]]; + next = keyIterator.next(); + } + } + *entries() { + const valueIterator = this._valueMap.entries(); + let next = valueIterator.next(); + while (next.done !== true) { + yield [ + this._keyMap.get(next.value[0]), + next.value[1], + next.value[0] + ]; + next = valueIterator.next(); + } + } + get size() { + return this._valueMap.size; + } + }; + exports.HashMap = HashMap; + var AttributeHashMap = class extends HashMap { + constructor() { + super(utils_1.hashAttributes); + } + }; + exports.AttributeHashMap = AttributeHashMap; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/DeltaMetricProcessor.js +var require_DeltaMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DeltaMetricProcessor = void 0; + const utils_1 = require_utils$4(); + const HashMap_1 = require_HashMap(); + /** + * Internal interface. + * + * Allows synchronous collection of metrics. This processor should allow + * allocation of new aggregation cells for metrics and convert cumulative + * recording to delta data points. + */ + var DeltaMetricProcessor = class { + _aggregator; + _activeCollectionStorage = new HashMap_1.AttributeHashMap(); + _cumulativeMemoStorage = new HashMap_1.AttributeHashMap(); + _cardinalityLimit; + _overflowAttributes = { "otel.metric.overflow": true }; + _overflowHashCode; + constructor(_aggregator, aggregationCardinalityLimit) { + this._aggregator = _aggregator; + this._cardinalityLimit = (aggregationCardinalityLimit ?? 2e3) - 1; + this._overflowHashCode = (0, utils_1.hashAttributes)(this._overflowAttributes); + } + record(value, attributes, _context, collectionTime) { + let accumulation = this._activeCollectionStorage.get(attributes); + if (!accumulation) { + if (this._activeCollectionStorage.size >= this._cardinalityLimit) { + this._activeCollectionStorage.getOrDefault(this._overflowAttributes, () => this._aggregator.createAccumulation(collectionTime))?.record(value); + return; + } + accumulation = this._aggregator.createAccumulation(collectionTime); + this._activeCollectionStorage.set(attributes, accumulation); + } + accumulation?.record(value); + } + batchCumulate(measurements, collectionTime) { + Array.from(measurements.entries()).forEach(([attributes, value, hashCode]) => { + const accumulation = this._aggregator.createAccumulation(collectionTime); + accumulation?.record(value); + let delta = accumulation; + if (this._cumulativeMemoStorage.has(attributes, hashCode)) { + const previous = this._cumulativeMemoStorage.get(attributes, hashCode); + delta = this._aggregator.diff(previous, accumulation); + } else if (this._cumulativeMemoStorage.size >= this._cardinalityLimit) { + attributes = this._overflowAttributes; + hashCode = this._overflowHashCode; + if (this._cumulativeMemoStorage.has(attributes, hashCode)) { + const previous = this._cumulativeMemoStorage.get(attributes, hashCode); + delta = this._aggregator.diff(previous, accumulation); + } + } + if (this._activeCollectionStorage.has(attributes, hashCode)) { + const active = this._activeCollectionStorage.get(attributes, hashCode); + delta = this._aggregator.merge(active, delta); + } + this._cumulativeMemoStorage.set(attributes, accumulation, hashCode); + this._activeCollectionStorage.set(attributes, delta, hashCode); + }); + } + /** + * Returns a collection of delta metrics. Start time is the when first + * time event collected. + */ + collect() { + const unreportedDelta = this._activeCollectionStorage; + this._activeCollectionStorage = new HashMap_1.AttributeHashMap(); + return unreportedDelta; + } + }; + exports.DeltaMetricProcessor = DeltaMetricProcessor; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/TemporalMetricProcessor.js +var require_TemporalMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TemporalMetricProcessor = void 0; + const AggregationTemporality_1 = require_AggregationTemporality(); + const HashMap_1 = require_HashMap(); + /** + * Internal interface. + * + * Provides unique reporting for each collector. Allows synchronous collection + * of metrics and reports given temporality values. + */ + var TemporalMetricProcessor = class TemporalMetricProcessor { + _aggregator; + _unreportedAccumulations = /* @__PURE__ */ new Map(); + _reportHistory = /* @__PURE__ */ new Map(); + constructor(_aggregator, collectorHandles) { + this._aggregator = _aggregator; + collectorHandles.forEach((handle) => { + this._unreportedAccumulations.set(handle, []); + }); + } + /** + * Builds the {@link MetricData} streams to report against a specific MetricCollector. + * @param collector The information of the MetricCollector. + * @param collectors The registered collectors. + * @param instrumentDescriptor The instrumentation descriptor that these metrics generated with. + * @param currentAccumulations The current accumulation of metric data from instruments. + * @param collectionTime The current collection timestamp. + * @returns The {@link MetricData} points or `null`. + */ + buildMetrics(collector, instrumentDescriptor, currentAccumulations, collectionTime) { + this._stashAccumulations(currentAccumulations); + const unreportedAccumulations = this._getMergedUnreportedAccumulations(collector); + let result = unreportedAccumulations; + let aggregationTemporality; + if (this._reportHistory.has(collector)) { + const last = this._reportHistory.get(collector); + const lastCollectionTime = last.collectionTime; + aggregationTemporality = last.aggregationTemporality; + if (aggregationTemporality === AggregationTemporality_1.AggregationTemporality.CUMULATIVE) result = TemporalMetricProcessor.merge(last.accumulations, unreportedAccumulations, this._aggregator); + else result = TemporalMetricProcessor.calibrateStartTime(last.accumulations, unreportedAccumulations, lastCollectionTime); + } else aggregationTemporality = collector.selectAggregationTemporality(instrumentDescriptor.type); + this._reportHistory.set(collector, { + accumulations: result, + collectionTime, + aggregationTemporality + }); + const accumulationRecords = AttributesMapToAccumulationRecords(result); + if (accumulationRecords.length === 0) return; + return this._aggregator.toMetricData(instrumentDescriptor, aggregationTemporality, accumulationRecords, collectionTime); + } + _stashAccumulations(currentAccumulation) { + const registeredCollectors = this._unreportedAccumulations.keys(); + for (const collector of registeredCollectors) { + let stash = this._unreportedAccumulations.get(collector); + if (stash === void 0) { + stash = []; + this._unreportedAccumulations.set(collector, stash); + } + stash.push(currentAccumulation); + } + } + _getMergedUnreportedAccumulations(collector) { + let result = new HashMap_1.AttributeHashMap(); + const unreportedList = this._unreportedAccumulations.get(collector); + this._unreportedAccumulations.set(collector, []); + if (unreportedList === void 0) return result; + for (const it of unreportedList) result = TemporalMetricProcessor.merge(result, it, this._aggregator); + return result; + } + static merge(last, current, aggregator) { + const result = last; + const iterator = current.entries(); + let next = iterator.next(); + while (next.done !== true) { + const [key, record$1, hash] = next.value; + if (last.has(key, hash)) { + const lastAccumulation = last.get(key, hash); + const accumulation = aggregator.merge(lastAccumulation, record$1); + result.set(key, accumulation, hash); + } else result.set(key, record$1, hash); + next = iterator.next(); + } + return result; + } + /** + * Calibrate the reported metric streams' startTime to lastCollectionTime. Leaves + * the new stream to be the initial observation time unchanged. + */ + static calibrateStartTime(last, current, lastCollectionTime) { + for (const [key, hash] of last.keys()) current.get(key, hash)?.setStartTime(lastCollectionTime); + return current; + } + }; + exports.TemporalMetricProcessor = TemporalMetricProcessor; + function AttributesMapToAccumulationRecords(map) { + return Array.from(map.entries()); + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/AsyncMetricStorage.js +var require_AsyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncMetricStorage = void 0; + const MetricStorage_1 = require_MetricStorage(); + const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); + const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); + const HashMap_1 = require_HashMap(); + /** + * Internal interface. + * + * Stores and aggregates {@link MetricData} for asynchronous instruments. + */ + var AsyncMetricStorage = class extends MetricStorage_1.MetricStorage { + _attributesProcessor; + _aggregationCardinalityLimit; + _deltaMetricStorage; + _temporalMetricStorage; + constructor(_instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { + super(_instrumentDescriptor); + this._attributesProcessor = _attributesProcessor; + this._aggregationCardinalityLimit = _aggregationCardinalityLimit; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); + } + record(measurements, observationTime) { + const processed = new HashMap_1.AttributeHashMap(); + Array.from(measurements.entries()).forEach(([attributes, value]) => { + processed.set(this._attributesProcessor.process(attributes), value); + }); + this._deltaMetricStorage.batchCumulate(processed, observationTime); + } + /** + * Collects the metrics from this storage. The ObservableCallback is invoked + * during the collection. + * + * Note: This is a stateful operation and may reset any interval-related + * state for the MetricCollector. + */ + collect(collector, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + } + }; + exports.AsyncMetricStorage = AsyncMetricStorage; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/RegistrationConflicts.js +var require_RegistrationConflicts = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getConflictResolutionRecipe = exports.getDescriptionResolutionRecipe = exports.getTypeConflictResolutionRecipe = exports.getUnitConflictResolutionRecipe = exports.getValueTypeConflictResolutionRecipe = exports.getIncompatibilityDetails = void 0; + function getIncompatibilityDetails(existing, otherDescriptor) { + let incompatibility = ""; + if (existing.unit !== otherDescriptor.unit) incompatibility += `\t- Unit '${existing.unit}' does not match '${otherDescriptor.unit}'\n`; + if (existing.type !== otherDescriptor.type) incompatibility += `\t- Type '${existing.type}' does not match '${otherDescriptor.type}'\n`; + if (existing.valueType !== otherDescriptor.valueType) incompatibility += `\t- Value Type '${existing.valueType}' does not match '${otherDescriptor.valueType}'\n`; + if (existing.description !== otherDescriptor.description) incompatibility += `\t- Description '${existing.description}' does not match '${otherDescriptor.description}'\n`; + return incompatibility; + } + exports.getIncompatibilityDetails = getIncompatibilityDetails; + function getValueTypeConflictResolutionRecipe(existing, otherDescriptor) { + return `\t- use valueType '${existing.valueType}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; + } + exports.getValueTypeConflictResolutionRecipe = getValueTypeConflictResolutionRecipe; + function getUnitConflictResolutionRecipe(existing, otherDescriptor) { + return `\t- use unit '${existing.unit}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; + } + exports.getUnitConflictResolutionRecipe = getUnitConflictResolutionRecipe; + function getTypeConflictResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type, + unit: otherDescriptor.unit + }; + const selectorString = JSON.stringify(selector); + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}'`; + } + exports.getTypeConflictResolutionRecipe = getTypeConflictResolutionRecipe; + function getDescriptionResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type, + unit: otherDescriptor.unit + }; + const selectorString = JSON.stringify(selector); + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}' + \t- OR - create a new view with the name ${existing.name} and description '${existing.description}' and InstrumentSelector ${selectorString} + \t- OR - create a new view with the name ${otherDescriptor.name} and description '${existing.description}' and InstrumentSelector ${selectorString}`; + } + exports.getDescriptionResolutionRecipe = getDescriptionResolutionRecipe; + function getConflictResolutionRecipe(existing, otherDescriptor) { + if (existing.valueType !== otherDescriptor.valueType) return getValueTypeConflictResolutionRecipe(existing, otherDescriptor); + if (existing.unit !== otherDescriptor.unit) return getUnitConflictResolutionRecipe(existing, otherDescriptor); + if (existing.type !== otherDescriptor.type) return getTypeConflictResolutionRecipe(existing, otherDescriptor); + if (existing.description !== otherDescriptor.description) return getDescriptionResolutionRecipe(existing, otherDescriptor); + return ""; + } + exports.getConflictResolutionRecipe = getConflictResolutionRecipe; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorageRegistry.js +var require_MetricStorageRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricStorageRegistry = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const RegistrationConflicts_1 = require_RegistrationConflicts(); + /** + * Internal class for storing {@link MetricStorage} + */ + var MetricStorageRegistry = class MetricStorageRegistry { + _sharedRegistry = /* @__PURE__ */ new Map(); + _perCollectorRegistry = /* @__PURE__ */ new Map(); + static create() { + return new MetricStorageRegistry(); + } + getStorages(collector) { + let storages = []; + for (const metricStorages of this._sharedRegistry.values()) storages = storages.concat(metricStorages); + const perCollectorStorages = this._perCollectorRegistry.get(collector); + if (perCollectorStorages != null) for (const metricStorages of perCollectorStorages.values()) storages = storages.concat(metricStorages); + return storages; + } + register(storage) { + this._registerStorage(storage, this._sharedRegistry); + } + registerForCollector(collector, storage) { + let storageMap = this._perCollectorRegistry.get(collector); + if (storageMap == null) { + storageMap = /* @__PURE__ */ new Map(); + this._perCollectorRegistry.set(collector, storageMap); + } + this._registerStorage(storage, storageMap); + } + findOrUpdateCompatibleStorage(expectedDescriptor) { + const storages = this._sharedRegistry.get(expectedDescriptor.name); + if (storages === void 0) return null; + return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); + } + findOrUpdateCompatibleCollectorStorage(collector, expectedDescriptor) { + const storageMap = this._perCollectorRegistry.get(collector); + if (storageMap === void 0) return null; + const storages = storageMap.get(expectedDescriptor.name); + if (storages === void 0) return null; + return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); + } + _registerStorage(storage, storageMap) { + const descriptor = storage.getInstrumentDescriptor(); + const storages = storageMap.get(descriptor.name); + if (storages === void 0) { + storageMap.set(descriptor.name, [storage]); + return; + } + storages.push(storage); + } + _findOrUpdateCompatibleStorage(expectedDescriptor, existingStorages) { + let compatibleStorage = null; + for (const existingStorage of existingStorages) { + const existingDescriptor = existingStorage.getInstrumentDescriptor(); + if ((0, InstrumentDescriptor_1.isDescriptorCompatibleWith)(existingDescriptor, expectedDescriptor)) { + if (existingDescriptor.description !== expectedDescriptor.description) { + if (expectedDescriptor.description.length > existingDescriptor.description.length) existingStorage.updateDescription(expectedDescriptor.description); + api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered, but has a different description and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "The longer description will be used.\nTo resolve the conflict:", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } + compatibleStorage = existingStorage; + } else api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "To resolve the conflict:\n", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } + return compatibleStorage; + } + }; + exports.MetricStorageRegistry = MetricStorageRegistry; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MultiWritableMetricStorage.js +var require_MultiWritableMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MultiMetricStorage = void 0; + /** + * Internal interface. + */ + var MultiMetricStorage = class { + _backingStorages; + constructor(_backingStorages) { + this._backingStorages = _backingStorages; + } + record(value, attributes, context$1, recordTime) { + this._backingStorages.forEach((it) => { + it.record(value, attributes, context$1, recordTime); + }); + } + }; + exports.MultiMetricStorage = MultiMetricStorage; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/ObservableResult.js +var require_ObservableResult = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BatchObservableResultImpl = exports.ObservableResultImpl = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const HashMap_1 = require_HashMap(); + const Instruments_1 = require_Instruments(); + /** + * The class implements {@link ObservableResult} interface. + */ + var ObservableResultImpl = class { + _instrumentName; + _valueType; + /** + * @internal + */ + _buffer = new HashMap_1.AttributeHashMap(); + constructor(_instrumentName, _valueType) { + this._instrumentName = _instrumentName; + this._valueType = _valueType; + } + /** + * Observe a measurement of the value associated with the given attributes. + */ + observe(value, attributes = {}) { + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${value}`); + return; + } + if (this._valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) return; + } + this._buffer.set(attributes, value); + } + }; + exports.ObservableResultImpl = ObservableResultImpl; + /** + * The class implements {@link BatchObservableCallback} interface. + */ + var BatchObservableResultImpl = class { + /** + * @internal + */ + _buffer = /* @__PURE__ */ new Map(); + /** + * Observe a measurement of the value associated with the given attributes. + */ + observe(metric, value, attributes = {}) { + if (!(0, Instruments_1.isObservableInstrument)(metric)) return; + let map = this._buffer.get(metric); + if (map == null) { + map = new HashMap_1.AttributeHashMap(); + this._buffer.set(metric, map); + } + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${metric._descriptor.name}: ${value}`); + return; + } + if (metric._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${metric._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) return; + } + map.set(attributes, value); + } + }; + exports.BatchObservableResultImpl = BatchObservableResultImpl; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/ObservableRegistry.js +var require_ObservableRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ObservableRegistry = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const Instruments_1 = require_Instruments(); + const ObservableResult_1 = require_ObservableResult(); + const utils_1 = require_utils$4(); + /** + * An internal interface for managing ObservableCallbacks. + * + * Every registered callback associated with a set of instruments are be evaluated + * exactly once during collection prior to reading data for that instrument. + */ + var ObservableRegistry = class { + _callbacks = []; + _batchCallbacks = []; + addCallback(callback, instrument) { + if (this._findCallback(callback, instrument) >= 0) return; + this._callbacks.push({ + callback, + instrument + }); + } + removeCallback(callback, instrument) { + const idx = this._findCallback(callback, instrument); + if (idx < 0) return; + this._callbacks.splice(idx, 1); + } + addBatchCallback(callback, instruments) { + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + if (observableInstruments.size === 0) { + api_1.diag.error("BatchObservableCallback is not associated with valid instruments", instruments); + return; + } + if (this._findBatchCallback(callback, observableInstruments) >= 0) return; + this._batchCallbacks.push({ + callback, + instruments: observableInstruments + }); + } + removeBatchCallback(callback, instruments) { + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + const idx = this._findBatchCallback(callback, observableInstruments); + if (idx < 0) return; + this._batchCallbacks.splice(idx, 1); + } + /** + * @returns a promise of rejected reasons for invoking callbacks. + */ + async observe(collectionTime, timeoutMillis) { + const callbackFutures = this._observeCallbacks(collectionTime, timeoutMillis); + const batchCallbackFutures = this._observeBatchCallbacks(collectionTime, timeoutMillis); + return (await (0, utils_1.PromiseAllSettled)([...callbackFutures, ...batchCallbackFutures])).filter(utils_1.isPromiseAllSettledRejectionResult).map((it) => it.reason); + } + _observeCallbacks(observationTime, timeoutMillis) { + return this._callbacks.map(async ({ callback, instrument }) => { + const observableResult = new ObservableResult_1.ObservableResultImpl(instrument._descriptor.name, instrument._descriptor.valueType); + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + await callPromise; + instrument._metricStorages.forEach((metricStorage) => { + metricStorage.record(observableResult._buffer, observationTime); + }); + }); + } + _observeBatchCallbacks(observationTime, timeoutMillis) { + return this._batchCallbacks.map(async ({ callback, instruments }) => { + const observableResult = new ObservableResult_1.BatchObservableResultImpl(); + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + await callPromise; + instruments.forEach((instrument) => { + const buffer = observableResult._buffer.get(instrument); + if (buffer == null) return; + instrument._metricStorages.forEach((metricStorage) => { + metricStorage.record(buffer, observationTime); + }); + }); + }); + } + _findCallback(callback, instrument) { + return this._callbacks.findIndex((record$1) => { + return record$1.callback === callback && record$1.instrument === instrument; + }); + } + _findBatchCallback(callback, instruments) { + return this._batchCallbacks.findIndex((record$1) => { + return record$1.callback === callback && (0, utils_1.setEquals)(record$1.instruments, instruments); + }); + } + }; + exports.ObservableRegistry = ObservableRegistry; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/SyncMetricStorage.js +var require_SyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SyncMetricStorage = void 0; + const MetricStorage_1 = require_MetricStorage(); + const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); + const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); + /** + * Internal interface. + * + * Stores and aggregates {@link MetricData} for synchronous instruments. + */ + var SyncMetricStorage = class extends MetricStorage_1.MetricStorage { + _attributesProcessor; + _aggregationCardinalityLimit; + _deltaMetricStorage; + _temporalMetricStorage; + constructor(instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { + super(instrumentDescriptor); + this._attributesProcessor = _attributesProcessor; + this._aggregationCardinalityLimit = _aggregationCardinalityLimit; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); + } + record(value, attributes, context$1, recordTime) { + attributes = this._attributesProcessor.process(attributes, context$1); + this._deltaMetricStorage.record(value, attributes, context$1, recordTime); + } + /** + * Collects the metrics from this storage. + * + * Note: This is a stateful operation and may reset any interval-related + * state for the MetricCollector. + */ + collect(collector, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + } + }; + exports.SyncMetricStorage = SyncMetricStorage; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AttributesProcessor.js +var require_AttributesProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.createMultiAttributesProcessor = exports.createNoopAttributesProcessor = void 0; + var NoopAttributesProcessor = class { + process(incoming, _context) { + return incoming; + } + }; + var MultiAttributesProcessor = class { + _processors; + constructor(_processors) { + this._processors = _processors; + } + process(incoming, context$1) { + let filteredAttributes = incoming; + for (const processor of this._processors) filteredAttributes = processor.process(filteredAttributes, context$1); + return filteredAttributes; + } + }; + var AllowListProcessor = class { + _allowedAttributeNames; + constructor(_allowedAttributeNames) { + this._allowedAttributeNames = _allowedAttributeNames; + } + process(incoming, _context) { + const filteredAttributes = {}; + Object.keys(incoming).filter((attributeName) => this._allowedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); + return filteredAttributes; + } + }; + var DenyListProcessor = class { + _deniedAttributeNames; + constructor(_deniedAttributeNames) { + this._deniedAttributeNames = _deniedAttributeNames; + } + process(incoming, _context) { + const filteredAttributes = {}; + Object.keys(incoming).filter((attributeName) => !this._deniedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); + return filteredAttributes; + } + }; + /** + * @internal + * + * Create an {@link IAttributesProcessor} that acts as a simple pass-through for attributes. + */ + function createNoopAttributesProcessor() { + return NOOP; + } + exports.createNoopAttributesProcessor = createNoopAttributesProcessor; + /** + * @internal + * + * Create an {@link IAttributesProcessor} that applies all processors from the provided list in order. + * + * @param processors Processors to apply in order. + */ + function createMultiAttributesProcessor(processors) { + return new MultiAttributesProcessor(processors); + } + exports.createMultiAttributesProcessor = createMultiAttributesProcessor; + /** + * Create an {@link IAttributesProcessor} that filters by allowed attribute names and drops any names that are not in the + * allow list. + */ + function createAllowListAttributesProcessor(attributeAllowList) { + return new AllowListProcessor(attributeAllowList); + } + exports.createAllowListAttributesProcessor = createAllowListAttributesProcessor; + /** + * Create an {@link IAttributesProcessor} that drops attributes based on the names provided in the deny list + */ + function createDenyListAttributesProcessor(attributeDenyList) { + return new DenyListProcessor(attributeDenyList); + } + exports.createDenyListAttributesProcessor = createDenyListAttributesProcessor; + const NOOP = new NoopAttributesProcessor(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterSharedState.js +var require_MeterSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterSharedState = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + const Meter_1 = require_Meter(); + const utils_1 = require_utils$4(); + const AsyncMetricStorage_1 = require_AsyncMetricStorage(); + const MetricStorageRegistry_1 = require_MetricStorageRegistry(); + const MultiWritableMetricStorage_1 = require_MultiWritableMetricStorage(); + const ObservableRegistry_1 = require_ObservableRegistry(); + const SyncMetricStorage_1 = require_SyncMetricStorage(); + const AttributesProcessor_1 = require_AttributesProcessor(); + /** + * An internal record for shared meter provider states. + */ + var MeterSharedState = class { + _meterProviderSharedState; + _instrumentationScope; + metricStorageRegistry = new MetricStorageRegistry_1.MetricStorageRegistry(); + observableRegistry = new ObservableRegistry_1.ObservableRegistry(); + meter; + constructor(_meterProviderSharedState, _instrumentationScope) { + this._meterProviderSharedState = _meterProviderSharedState; + this._instrumentationScope = _instrumentationScope; + this.meter = new Meter_1.Meter(this); + } + registerMetricStorage(descriptor) { + const storages = this._registerMetricStorage(descriptor, SyncMetricStorage_1.SyncMetricStorage); + if (storages.length === 1) return storages[0]; + return new MultiWritableMetricStorage_1.MultiMetricStorage(storages); + } + registerAsyncMetricStorage(descriptor) { + return this._registerMetricStorage(descriptor, AsyncMetricStorage_1.AsyncMetricStorage); + } + /** + * @param collector opaque handle of {@link MetricCollector} which initiated the collection. + * @param collectionTime the HrTime at which the collection was initiated. + * @param options options for collection. + * @returns the list of metric data collected. + */ + async collect(collector, collectionTime, options) { + /** + * 1. Call all observable callbacks first. + * 2. Collect metric result for the collector. + */ + const errors = await this.observableRegistry.observe(collectionTime, options?.timeoutMillis); + const storages = this.metricStorageRegistry.getStorages(collector); + if (storages.length === 0) return null; + const metricDataList = storages.map((metricStorage) => { + return metricStorage.collect(collector, collectionTime); + }).filter(utils_1.isNotNullish); + if (metricDataList.length === 0) return { errors }; + return { + scopeMetrics: { + scope: this._instrumentationScope, + metrics: metricDataList + }, + errors + }; + } + _registerMetricStorage(descriptor, MetricStorageType) { + let storages = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationScope).map((view) => { + const viewDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptorWithView)(view, descriptor); + const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleStorage(viewDescriptor); + if (compatibleStorage != null) return compatibleStorage; + const viewStorage = new MetricStorageType(viewDescriptor, view.aggregation.createAggregator(viewDescriptor), view.attributesProcessor, this._meterProviderSharedState.metricCollectors, view.aggregationCardinalityLimit); + this.metricStorageRegistry.register(viewStorage); + return viewStorage; + }); + if (storages.length === 0) { + const collectorStorages = this._meterProviderSharedState.selectAggregations(descriptor.type).map(([collector, aggregation]) => { + const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(collector, descriptor); + if (compatibleStorage != null) return compatibleStorage; + const aggregator = aggregation.createAggregator(descriptor); + const cardinalityLimit = collector.selectCardinalityLimit(descriptor.type); + const storage = new MetricStorageType(descriptor, aggregator, (0, AttributesProcessor_1.createNoopAttributesProcessor)(), [collector], cardinalityLimit); + this.metricStorageRegistry.registerForCollector(collector, storage); + return storage; + }); + storages = storages.concat(collectorStorages); + } + return storages; + } + }; + exports.MeterSharedState = MeterSharedState; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterProviderSharedState.js +var require_MeterProviderSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterProviderSharedState = void 0; + const utils_1 = require_utils$4(); + const ViewRegistry_1 = require_ViewRegistry(); + const MeterSharedState_1 = require_MeterSharedState(); + const AggregationOption_1 = require_AggregationOption(); + /** + * An internal record for shared meter provider states. + */ + var MeterProviderSharedState = class { + resource; + viewRegistry = new ViewRegistry_1.ViewRegistry(); + metricCollectors = []; + meterSharedStates = /* @__PURE__ */ new Map(); + constructor(resource) { + this.resource = resource; + } + getMeterSharedState(instrumentationScope) { + const id = (0, utils_1.instrumentationScopeId)(instrumentationScope); + let meterSharedState = this.meterSharedStates.get(id); + if (meterSharedState == null) { + meterSharedState = new MeterSharedState_1.MeterSharedState(this, instrumentationScope); + this.meterSharedStates.set(id, meterSharedState); + } + return meterSharedState; + } + selectAggregations(instrumentType) { + const result = []; + for (const collector of this.metricCollectors) result.push([collector, (0, AggregationOption_1.toAggregation)(collector.selectAggregation(instrumentType))]); + return result; + } + }; + exports.MeterProviderSharedState = MeterProviderSharedState; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricCollector.js +var require_MetricCollector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricCollector = void 0; + const core_1 = require_src$8(); + /** + * An internal opaque interface that the MetricReader receives as + * MetricProducer. It acts as the storage key to the internal metric stream + * state for each MetricReader. + */ + var MetricCollector = class { + _sharedState; + _metricReader; + constructor(_sharedState, _metricReader) { + this._sharedState = _sharedState; + this._metricReader = _metricReader; + } + async collect(options) { + const collectionTime = (0, core_1.millisToHrTime)(Date.now()); + const scopeMetrics = []; + const errors = []; + const meterCollectionPromises = Array.from(this._sharedState.meterSharedStates.values()).map(async (meterSharedState) => { + const current = await meterSharedState.collect(this, collectionTime, options); + if (current?.scopeMetrics != null) scopeMetrics.push(current.scopeMetrics); + if (current?.errors != null) errors.push(...current.errors); + }); + await Promise.all(meterCollectionPromises); + return { + resourceMetrics: { + resource: this._sharedState.resource, + scopeMetrics + }, + errors + }; + } + /** + * Delegates for MetricReader.forceFlush. + */ + async forceFlush(options) { + await this._metricReader.forceFlush(options); + } + /** + * Delegates for MetricReader.shutdown. + */ + async shutdown(options) { + await this._metricReader.shutdown(options); + } + selectAggregationTemporality(instrumentType) { + return this._metricReader.selectAggregationTemporality(instrumentType); + } + selectAggregation(instrumentType) { + return this._metricReader.selectAggregation(instrumentType); + } + /** + * Select the cardinality limit for the given {@link InstrumentType} for this + * collector. + */ + selectCardinalityLimit(instrumentType) { + return this._metricReader.selectCardinalityLimit?.(instrumentType) ?? 2e3; + } + }; + exports.MetricCollector = MetricCollector; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Predicate.js +var require_Predicate = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExactPredicate = exports.PatternPredicate = void 0; + const ESCAPE = /[\^$\\.+?()[\]{}|]/g; + /** + * Wildcard pattern predicate, supports patterns like `*`, `foo*`, `*bar`. + */ + var PatternPredicate = class PatternPredicate { + _matchAll; + _regexp; + constructor(pattern) { + if (pattern === "*") { + this._matchAll = true; + this._regexp = /.*/; + } else { + this._matchAll = false; + this._regexp = new RegExp(PatternPredicate.escapePattern(pattern)); + } + } + match(str) { + if (this._matchAll) return true; + return this._regexp.test(str); + } + static escapePattern(pattern) { + return `^${pattern.replace(ESCAPE, "\\$&").replace("*", ".*")}$`; + } + static hasWildcard(pattern) { + return pattern.includes("*"); + } + }; + exports.PatternPredicate = PatternPredicate; + var ExactPredicate = class { + _matchAll; + _pattern; + constructor(pattern) { + this._matchAll = pattern === void 0; + this._pattern = pattern; + } + match(str) { + if (this._matchAll) return true; + if (str === this._pattern) return true; + return false; + } + }; + exports.ExactPredicate = ExactPredicate; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/InstrumentSelector.js +var require_InstrumentSelector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InstrumentSelector = void 0; + const Predicate_1 = require_Predicate(); + var InstrumentSelector = class { + _nameFilter; + _type; + _unitFilter; + constructor(criteria) { + this._nameFilter = new Predicate_1.PatternPredicate(criteria?.name ?? "*"); + this._type = criteria?.type; + this._unitFilter = new Predicate_1.ExactPredicate(criteria?.unit); + } + getType() { + return this._type; + } + getNameFilter() { + return this._nameFilter; + } + getUnitFilter() { + return this._unitFilter; + } + }; + exports.InstrumentSelector = InstrumentSelector; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/MeterSelector.js +var require_MeterSelector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterSelector = void 0; + const Predicate_1 = require_Predicate(); + var MeterSelector = class { + _nameFilter; + _versionFilter; + _schemaUrlFilter; + constructor(criteria) { + this._nameFilter = new Predicate_1.ExactPredicate(criteria?.name); + this._versionFilter = new Predicate_1.ExactPredicate(criteria?.version); + this._schemaUrlFilter = new Predicate_1.ExactPredicate(criteria?.schemaUrl); + } + getNameFilter() { + return this._nameFilter; + } + /** + * TODO: semver filter? no spec yet. + */ + getVersionFilter() { + return this._versionFilter; + } + getSchemaUrlFilter() { + return this._schemaUrlFilter; + } + }; + exports.MeterSelector = MeterSelector; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/View.js +var require_View = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.View = void 0; + const Predicate_1 = require_Predicate(); + const AttributesProcessor_1 = require_AttributesProcessor(); + const InstrumentSelector_1 = require_InstrumentSelector(); + const MeterSelector_1 = require_MeterSelector(); + const AggregationOption_1 = require_AggregationOption(); + function isSelectorNotProvided(options) { + return options.instrumentName == null && options.instrumentType == null && options.instrumentUnit == null && options.meterName == null && options.meterVersion == null && options.meterSchemaUrl == null; + } + function validateViewOptions(viewOptions) { + if (isSelectorNotProvided(viewOptions)) throw new Error("Cannot create view with no selector arguments supplied"); + if (viewOptions.name != null && (viewOptions?.instrumentName == null || Predicate_1.PatternPredicate.hasWildcard(viewOptions.instrumentName))) throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter."); + } + /** + * Can be passed to a {@link MeterProvider} to select instruments and alter their metric stream. + */ + var View = class { + name; + description; + aggregation; + attributesProcessor; + instrumentSelector; + meterSelector; + aggregationCardinalityLimit; + /** + * Create a new {@link View} instance. + * + * Parameters can be categorized as two types: + * Instrument selection criteria: Used to describe the instrument(s) this view will be applied to. + * Will be treated as additive (the Instrument has to meet all the provided criteria to be selected). + * + * Metric stream altering: Alter the metric stream of instruments selected by instrument selection criteria. + * + * @param viewOptions {@link ViewOptions} for altering the metric stream and instrument selection. + * @param viewOptions.name + * Alters the metric stream: + * This will be used as the name of the metrics stream. + * If not provided, the original Instrument name will be used. + * @param viewOptions.description + * Alters the metric stream: + * This will be used as the description of the metrics stream. + * If not provided, the original Instrument description will be used by default. + * @param viewOptions.attributesProcessors + * Alters the metric stream: + * If provided, the attributes will be modified as defined by the added processors. + * If not provided, all attribute keys will be used by default. + * @param viewOptions.aggregationCardinalityLimit + * Alters the metric stream: + * Sets a limit on the number of unique attribute combinations (cardinality) that can be aggregated. + * If not provided, the default limit of 2000 will be used. + * @param viewOptions.aggregation + * Alters the metric stream: + * Alters the {@link Aggregation} of the metric stream. + * @param viewOptions.instrumentName + * Instrument selection criteria: + * Original name of the Instrument(s) with wildcard support. + * @param viewOptions.instrumentType + * Instrument selection criteria: + * The original type of the Instrument(s). + * @param viewOptions.instrumentUnit + * Instrument selection criteria: + * The unit of the Instrument(s). + * @param viewOptions.meterName + * Instrument selection criteria: + * The name of the Meter. No wildcard support, name must match the meter exactly. + * @param viewOptions.meterVersion + * Instrument selection criteria: + * The version of the Meter. No wildcard support, version must match exactly. + * @param viewOptions.meterSchemaUrl + * Instrument selection criteria: + * The schema URL of the Meter. No wildcard support, schema URL must match exactly. + * + * @example + * // Create a view that changes the Instrument 'my.instrument' to use to an + * // ExplicitBucketHistogramAggregation with the boundaries [20, 30, 40] + * new View({ + * aggregation: new ExplicitBucketHistogramAggregation([20, 30, 40]), + * instrumentName: 'my.instrument' + * }) + */ + constructor(viewOptions) { + validateViewOptions(viewOptions); + if (viewOptions.attributesProcessors != null) this.attributesProcessor = (0, AttributesProcessor_1.createMultiAttributesProcessor)(viewOptions.attributesProcessors); + else this.attributesProcessor = (0, AttributesProcessor_1.createNoopAttributesProcessor)(); + this.name = viewOptions.name; + this.description = viewOptions.description; + this.aggregation = (0, AggregationOption_1.toAggregation)(viewOptions.aggregation ?? { type: AggregationOption_1.AggregationType.DEFAULT }); + this.instrumentSelector = new InstrumentSelector_1.InstrumentSelector({ + name: viewOptions.instrumentName, + type: viewOptions.instrumentType, + unit: viewOptions.instrumentUnit + }); + this.meterSelector = new MeterSelector_1.MeterSelector({ + name: viewOptions.meterName, + version: viewOptions.meterVersion, + schemaUrl: viewOptions.meterSchemaUrl + }); + this.aggregationCardinalityLimit = viewOptions.aggregationCardinalityLimit; + } + }; + exports.View = View; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider.js +var require_MeterProvider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterProvider = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const resources_1 = require_src$7(); + const MeterProviderSharedState_1 = require_MeterProviderSharedState(); + const MetricCollector_1 = require_MetricCollector(); + const View_1 = require_View(); + /** + * This class implements the {@link MeterProvider} interface. + */ + var MeterProvider = class { + _sharedState; + _shutdown = false; + constructor(options) { + this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState(options?.resource ?? (0, resources_1.defaultResource)()); + if (options?.views != null && options.views.length > 0) for (const viewOption of options.views) this._sharedState.viewRegistry.addView(new View_1.View(viewOption)); + if (options?.readers != null && options.readers.length > 0) for (const metricReader of options.readers) { + const collector = new MetricCollector_1.MetricCollector(this._sharedState, metricReader); + metricReader.setMetricProducer(collector); + this._sharedState.metricCollectors.push(collector); + } + } + /** + * Get a meter with the configuration of the MeterProvider. + */ + getMeter(name, version$1 = "", options = {}) { + if (this._shutdown) { + api_1.diag.warn("A shutdown MeterProvider cannot provide a Meter"); + return (0, api_1.createNoopMeter)(); + } + return this._sharedState.getMeterSharedState({ + name, + version: version$1, + schemaUrl: options.schemaUrl + }).meter; + } + /** + * Shut down the MeterProvider and all registered + * MetricReaders. + * + * Returns a promise which is resolved when all flushes are complete. + */ + async shutdown(options) { + if (this._shutdown) { + api_1.diag.warn("shutdown may only be called once per MeterProvider"); + return; + } + this._shutdown = true; + await Promise.all(this._sharedState.metricCollectors.map((collector) => { + return collector.shutdown(options); + })); + } + /** + * Notifies all registered MetricReaders to flush any buffered data. + * + * Returns a promise which is resolved when all flushes are complete. + */ + async forceFlush(options) { + if (this._shutdown) { + api_1.diag.warn("invalid attempt to force flush after MeterProvider shutdown"); + return; + } + await Promise.all(this._sharedState.metricCollectors.map((collector) => { + return collector.forceFlush(options); + })); + } + }; + exports.MeterProvider = MeterProvider; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/index.js +var require_src$6 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TimeoutError = exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.AggregationType = exports.MeterProvider = exports.ConsoleMetricExporter = exports.InMemoryMetricExporter = exports.PeriodicExportingMetricReader = exports.MetricReader = exports.InstrumentType = exports.DataPointType = exports.AggregationTemporality = void 0; + var AggregationTemporality_1 = require_AggregationTemporality(); + Object.defineProperty(exports, "AggregationTemporality", { + enumerable: true, + get: function() { + return AggregationTemporality_1.AggregationTemporality; + } + }); + var MetricData_1 = require_MetricData(); + Object.defineProperty(exports, "DataPointType", { + enumerable: true, + get: function() { + return MetricData_1.DataPointType; + } + }); + Object.defineProperty(exports, "InstrumentType", { + enumerable: true, + get: function() { + return MetricData_1.InstrumentType; + } + }); + var MetricReader_1 = require_MetricReader(); + Object.defineProperty(exports, "MetricReader", { + enumerable: true, + get: function() { + return MetricReader_1.MetricReader; + } + }); + var PeriodicExportingMetricReader_1 = require_PeriodicExportingMetricReader(); + Object.defineProperty(exports, "PeriodicExportingMetricReader", { + enumerable: true, + get: function() { + return PeriodicExportingMetricReader_1.PeriodicExportingMetricReader; + } + }); + var InMemoryMetricExporter_1 = require_InMemoryMetricExporter(); + Object.defineProperty(exports, "InMemoryMetricExporter", { + enumerable: true, + get: function() { + return InMemoryMetricExporter_1.InMemoryMetricExporter; + } + }); + var ConsoleMetricExporter_1 = require_ConsoleMetricExporter(); + Object.defineProperty(exports, "ConsoleMetricExporter", { + enumerable: true, + get: function() { + return ConsoleMetricExporter_1.ConsoleMetricExporter; + } + }); + var MeterProvider_1 = require_MeterProvider(); + Object.defineProperty(exports, "MeterProvider", { + enumerable: true, + get: function() { + return MeterProvider_1.MeterProvider; + } + }); + var AggregationOption_1 = require_AggregationOption(); + Object.defineProperty(exports, "AggregationType", { + enumerable: true, + get: function() { + return AggregationOption_1.AggregationType; + } + }); + var AttributesProcessor_1 = require_AttributesProcessor(); + Object.defineProperty(exports, "createAllowListAttributesProcessor", { + enumerable: true, + get: function() { + return AttributesProcessor_1.createAllowListAttributesProcessor; + } + }); + Object.defineProperty(exports, "createDenyListAttributesProcessor", { + enumerable: true, + get: function() { + return AttributesProcessor_1.createDenyListAttributesProcessor; + } + }); + var utils_1 = require_utils$4(); + Object.defineProperty(exports, "TimeoutError", { + enumerable: true, + get: function() { + return utils_1.TimeoutError; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal-types.js +var require_internal_types = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EAggregationTemporality = void 0; + (function(EAggregationTemporality) { + EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"; + /** DELTA is an AggregationTemporality for a metric aggregator which reports + changes since last report time. Successive metrics contain aggregation of + values from continuous and non-overlapping intervals. + + The values for a DELTA metric are based only on the time interval + associated with one measurement cycle. There is no dependency on + previous measurements like is the case for CUMULATIVE metrics. + + For example, consider a system measuring the number of requests that + it receives and reports the sum of these requests every second as a + DELTA metric: + + 1. The system starts receiving at time=t_0. + 2. A request is received, the system measures 1 request. + 3. A request is received, the system measures 1 request. + 4. A request is received, the system measures 1 request. + 5. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0 to + t_0+1 with a value of 3. + 6. A request is received, the system measures 1 request. + 7. A request is received, the system measures 1 request. + 8. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0+1 to + t_0+2 with a value of 2. */ + EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA"; + /** CUMULATIVE is an AggregationTemporality for a metric aggregator which + reports changes since a fixed start time. This means that current values + of a CUMULATIVE metric depend on all previous measurements since the + start time. Because of this, the sender is required to retain this state + in some form. If this state is lost or invalidated, the CUMULATIVE metric + values MUST be reset and a new fixed start time following the last + reported measurement time sent MUST be used. + + For example, consider a system measuring the number of requests that + it receives and reports the sum of these requests every second as a + CUMULATIVE metric: + + 1. The system starts receiving at time=t_0. + 2. A request is received, the system measures 1 request. + 3. A request is received, the system measures 1 request. + 4. A request is received, the system measures 1 request. + 5. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0 to + t_0+1 with a value of 3. + 6. A request is received, the system measures 1 request. + 7. A request is received, the system measures 1 request. + 8. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0 to + t_0+2 with a value of 5. + 9. The system experiences a fault and loses state. + 10. The system recovers and resumes receiving at time=t_1. + 11. A request is received, the system measures 1 request. + 12. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_1 to + t_0+1 with a value of 1. + + Note: Even though, when reporting changes since last report time, using + CUMULATIVE is valid, it is not recommended. This may cause problems for + systems that do not use start_time to determine when the aggregation + value was reset (e.g. Prometheus). */ + EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"; + })(exports.EAggregationTemporality || (exports.EAggregationTemporality = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal.js +var require_internal$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createExportMetricsServiceRequest = exports.toMetric = exports.toScopeMetrics = exports.toResourceMetrics = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const sdk_metrics_1 = require_src$6(); + const internal_types_1 = require_internal_types(); + const utils_1 = require_utils$5(); + const internal_1 = require_internal$3(); + function toResourceMetrics(resourceMetrics, options) { + const encoder = (0, utils_1.getOtlpEncoder)(options); + const processedResource = (0, internal_1.createResource)(resourceMetrics.resource); + return { + resource: processedResource, + schemaUrl: processedResource.schemaUrl, + scopeMetrics: toScopeMetrics(resourceMetrics.scopeMetrics, encoder) + }; + } + exports.toResourceMetrics = toResourceMetrics; + function toScopeMetrics(scopeMetrics, encoder) { + return Array.from(scopeMetrics.map((metrics$1) => ({ + scope: (0, internal_1.createInstrumentationScope)(metrics$1.scope), + metrics: metrics$1.metrics.map((metricData) => toMetric(metricData, encoder)), + schemaUrl: metrics$1.scope.schemaUrl + }))); + } + exports.toScopeMetrics = toScopeMetrics; + function toMetric(metricData, encoder) { + const out = { + name: metricData.descriptor.name, + description: metricData.descriptor.description, + unit: metricData.descriptor.unit + }; + const aggregationTemporality = toAggregationTemporality(metricData.aggregationTemporality); + switch (metricData.dataPointType) { + case sdk_metrics_1.DataPointType.SUM: + out.sum = { + aggregationTemporality, + isMonotonic: metricData.isMonotonic, + dataPoints: toSingularDataPoints(metricData, encoder) + }; + break; + case sdk_metrics_1.DataPointType.GAUGE: + out.gauge = { dataPoints: toSingularDataPoints(metricData, encoder) }; + break; + case sdk_metrics_1.DataPointType.HISTOGRAM: + out.histogram = { + aggregationTemporality, + dataPoints: toHistogramDataPoints(metricData, encoder) + }; + break; + case sdk_metrics_1.DataPointType.EXPONENTIAL_HISTOGRAM: + out.exponentialHistogram = { + aggregationTemporality, + dataPoints: toExponentialHistogramDataPoints(metricData, encoder) + }; + break; + } + return out; + } + exports.toMetric = toMetric; + function toSingularDataPoint(dataPoint, valueType, encoder) { + const out = { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + switch (valueType) { + case api_1.ValueType.INT: + out.asInt = dataPoint.value; + break; + case api_1.ValueType.DOUBLE: + out.asDouble = dataPoint.value; + break; + } + return out; + } + function toSingularDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + return toSingularDataPoint(dataPoint, metricData.descriptor.valueType, encoder); + }); + } + function toHistogramDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + const histogram = dataPoint.value; + return { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + bucketCounts: histogram.buckets.counts, + explicitBounds: histogram.buckets.boundaries, + count: histogram.count, + sum: histogram.sum, + min: histogram.min, + max: histogram.max, + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + }); + } + function toExponentialHistogramDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + const histogram = dataPoint.value; + return { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + count: histogram.count, + min: histogram.min, + max: histogram.max, + sum: histogram.sum, + positive: { + offset: histogram.positive.offset, + bucketCounts: histogram.positive.bucketCounts + }, + negative: { + offset: histogram.negative.offset, + bucketCounts: histogram.negative.bucketCounts + }, + scale: histogram.scale, + zeroCount: histogram.zeroCount, + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + }); + } + function toAggregationTemporality(temporality) { + switch (temporality) { + case sdk_metrics_1.AggregationTemporality.DELTA: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA; + case sdk_metrics_1.AggregationTemporality.CUMULATIVE: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE; + } + } + function createExportMetricsServiceRequest(resourceMetrics, options) { + return { resourceMetrics: resourceMetrics.map((metrics$1) => toResourceMetrics(metrics$1, options)) }; + } + exports.createExportMetricsServiceRequest = createExportMetricsServiceRequest; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics.js +var require_metrics$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufMetricsSerializer = void 0; + const root = require_root(); + const internal_1 = require_internal$1(); + const metricsResponseType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; + const metricsRequestType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; + exports.ProtobufMetricsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportMetricsServiceRequest)([arg]); + return metricsRequestType.encode(request).finish(); + }, + deserializeResponse: (arg) => { + return metricsResponseType.decode(arg); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/index.js +var require_protobuf$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufMetricsSerializer = void 0; + var metrics_1 = require_metrics$1(); + Object.defineProperty(exports, "ProtobufMetricsSerializer", { + enumerable: true, + get: function() { + return metrics_1.ProtobufMetricsSerializer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +var require_internal = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createExportTraceServiceRequest = exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = void 0; + const internal_1 = require_internal$3(); + const utils_1 = require_utils$5(); + function sdkSpanToOtlpSpan(span, encoder) { + const ctx = span.spanContext(); + const status = span.status; + const parentSpanId = span.parentSpanContext?.spanId ? encoder.encodeSpanContext(span.parentSpanContext?.spanId) : void 0; + return { + traceId: encoder.encodeSpanContext(ctx.traceId), + spanId: encoder.encodeSpanContext(ctx.spanId), + parentSpanId, + traceState: ctx.traceState?.serialize(), + name: span.name, + kind: span.kind == null ? 0 : span.kind + 1, + startTimeUnixNano: encoder.encodeHrTime(span.startTime), + endTimeUnixNano: encoder.encodeHrTime(span.endTime), + attributes: (0, internal_1.toAttributes)(span.attributes), + droppedAttributesCount: span.droppedAttributesCount, + events: span.events.map((event) => toOtlpSpanEvent(event, encoder)), + droppedEventsCount: span.droppedEventsCount, + status: { + code: status.code, + message: status.message + }, + links: span.links.map((link) => toOtlpLink(link, encoder)), + droppedLinksCount: span.droppedLinksCount + }; + } + exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan; + function toOtlpLink(link, encoder) { + return { + attributes: link.attributes ? (0, internal_1.toAttributes)(link.attributes) : [], + spanId: encoder.encodeSpanContext(link.context.spanId), + traceId: encoder.encodeSpanContext(link.context.traceId), + traceState: link.context.traceState?.serialize(), + droppedAttributesCount: link.droppedAttributesCount || 0 + }; + } + exports.toOtlpLink = toOtlpLink; + function toOtlpSpanEvent(timedEvent, encoder) { + return { + attributes: timedEvent.attributes ? (0, internal_1.toAttributes)(timedEvent.attributes) : [], + name: timedEvent.name, + timeUnixNano: encoder.encodeHrTime(timedEvent.time), + droppedAttributesCount: timedEvent.droppedAttributesCount || 0 + }; + } + exports.toOtlpSpanEvent = toOtlpSpanEvent; + function createExportTraceServiceRequest(spans, options) { + return { resourceSpans: spanRecordsToResourceSpans(spans, (0, utils_1.getOtlpEncoder)(options)) }; + } + exports.createExportTraceServiceRequest = createExportTraceServiceRequest; + function createResourceMap(readableSpans) { + const resourceMap = /* @__PURE__ */ new Map(); + for (const record$1 of readableSpans) { + let ilsMap = resourceMap.get(record$1.resource); + if (!ilsMap) { + ilsMap = /* @__PURE__ */ new Map(); + resourceMap.set(record$1.resource, ilsMap); + } + const instrumentationScopeKey = `${record$1.instrumentationScope.name}@${record$1.instrumentationScope.version || ""}:${record$1.instrumentationScope.schemaUrl || ""}`; + let records = ilsMap.get(instrumentationScopeKey); + if (!records) { + records = []; + ilsMap.set(instrumentationScopeKey, records); + } + records.push(record$1); + } + return resourceMap; + } + function spanRecordsToResourceSpans(readableSpans, encoder) { + const resourceMap = createResourceMap(readableSpans); + const out = []; + const entryIterator = resourceMap.entries(); + let entry = entryIterator.next(); + while (!entry.done) { + const [resource, ilmMap] = entry.value; + const scopeResourceSpans = []; + const ilmIterator = ilmMap.values(); + let ilmEntry = ilmIterator.next(); + while (!ilmEntry.done) { + const scopeSpans = ilmEntry.value; + if (scopeSpans.length > 0) { + const spans = scopeSpans.map((readableSpan) => sdkSpanToOtlpSpan(readableSpan, encoder)); + scopeResourceSpans.push({ + scope: (0, internal_1.createInstrumentationScope)(scopeSpans[0].instrumentationScope), + spans, + schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl + }); + } + ilmEntry = ilmIterator.next(); + } + const processedResource = (0, internal_1.createResource)(resource); + const transformedSpans = { + resource: processedResource, + scopeSpans: scopeResourceSpans, + schemaUrl: processedResource.schemaUrl + }; + out.push(transformedSpans); + entry = entryIterator.next(); + } + return out; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace.js +var require_trace$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufTraceSerializer = void 0; + const root = require_root(); + const internal_1 = require_internal(); + const traceResponseType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; + const traceRequestType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; + exports.ProtobufTraceSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportTraceServiceRequest)(arg); + return traceRequestType.encode(request).finish(); + }, + deserializeResponse: (arg) => { + return traceResponseType.decode(arg); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/index.js +var require_protobuf = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufTraceSerializer = void 0; + var trace_1 = require_trace$1(); + Object.defineProperty(exports, "ProtobufTraceSerializer", { + enumerable: true, + get: function() { + return trace_1.ProtobufTraceSerializer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js +var require_logs = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonLogsSerializer = void 0; + const internal_1 = require_internal$2(); + exports.JsonLogsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportLogsServiceRequest)(arg, { + useHex: true, + useLongBits: false + }); + return new TextEncoder().encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) return {}; + const decoder = new TextDecoder(); + return JSON.parse(decoder.decode(arg)); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/index.js +var require_json$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonLogsSerializer = void 0; + var logs_1 = require_logs(); + Object.defineProperty(exports, "JsonLogsSerializer", { + enumerable: true, + get: function() { + return logs_1.JsonLogsSerializer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/metrics.js +var require_metrics = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonMetricsSerializer = void 0; + const internal_1 = require_internal$1(); + exports.JsonMetricsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportMetricsServiceRequest)([arg], { useLongBits: false }); + return new TextEncoder().encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) return {}; + const decoder = new TextDecoder(); + return JSON.parse(decoder.decode(arg)); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/index.js +var require_json$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonMetricsSerializer = void 0; + var metrics_1 = require_metrics(); + Object.defineProperty(exports, "JsonMetricsSerializer", { + enumerable: true, + get: function() { + return metrics_1.JsonMetricsSerializer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/trace.js +var require_trace = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonTraceSerializer = void 0; + const internal_1 = require_internal(); + exports.JsonTraceSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportTraceServiceRequest)(arg, { + useHex: true, + useLongBits: false + }); + return new TextEncoder().encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) return {}; + const decoder = new TextDecoder(); + return JSON.parse(decoder.decode(arg)); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/index.js +var require_json = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonTraceSerializer = void 0; + var trace_1 = require_trace(); + Object.defineProperty(exports, "JsonTraceSerializer", { + enumerable: true, + get: function() { + return trace_1.JsonTraceSerializer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/index.js +var require_src$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonTraceSerializer = exports.JsonMetricsSerializer = exports.JsonLogsSerializer = exports.ProtobufTraceSerializer = exports.ProtobufMetricsSerializer = exports.ProtobufLogsSerializer = void 0; + var protobuf_1 = require_protobuf$2(); + Object.defineProperty(exports, "ProtobufLogsSerializer", { + enumerable: true, + get: function() { + return protobuf_1.ProtobufLogsSerializer; + } + }); + var protobuf_2 = require_protobuf$1(); + Object.defineProperty(exports, "ProtobufMetricsSerializer", { + enumerable: true, + get: function() { + return protobuf_2.ProtobufMetricsSerializer; + } + }); + var protobuf_3 = require_protobuf(); + Object.defineProperty(exports, "ProtobufTraceSerializer", { + enumerable: true, + get: function() { + return protobuf_3.ProtobufTraceSerializer; + } + }); + var json_1 = require_json$2(); + Object.defineProperty(exports, "JsonLogsSerializer", { + enumerable: true, + get: function() { + return json_1.JsonLogsSerializer; + } + }); + var json_2 = require_json$1(); + Object.defineProperty(exports, "JsonMetricsSerializer", { + enumerable: true, + get: function() { + return json_2.JsonMetricsSerializer; + } + }); + var json_3 = require_json(); + Object.defineProperty(exports, "JsonTraceSerializer", { + enumerable: true, + get: function() { + return json_3.JsonTraceSerializer; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js +/** +* Parses headers from config leaving only those that have defined values +* @param partialHeaders +*/ +function validateAndNormalizeHeaders(partialHeaders) { + return () => { + const headers = {}; + Object.entries(partialHeaders?.() ?? {}).forEach(([key, value]) => { + if (typeof value !== "undefined") headers[key] = String(value); + else diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`); + }); + return headers; + }; +} +var init_util = __esmMin((() => { + init_esm$2(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js +function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) { + const requiredHeaders = { ...defaultHeaders() }; + const headers = {}; + return () => { + if (fallbackHeaders != null) Object.assign(headers, fallbackHeaders()); + if (userProvidedHeaders != null) Object.assign(headers, userProvidedHeaders()); + return Object.assign(headers, requiredHeaders); + }; +} +function validateUserProvidedUrl(url) { + if (url == null) return; + try { + const base = globalThis.location?.href; + return new URL(url, base).href; + } catch { + throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`); + } +} +/** +* @param userProvidedConfiguration Configuration options provided by the user in code. +* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. +* @param defaultConfiguration The defaults as defined by the exporter specification +*/ +function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + ...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), + headers: mergeHeaders(validateAndNormalizeHeaders(userProvidedConfiguration.headers), fallbackConfiguration.headers, defaultConfiguration.headers), + url: validateUserProvidedUrl(userProvidedConfiguration.url) ?? fallbackConfiguration.url ?? defaultConfiguration.url + }; +} +function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { + return { + ...getSharedConfigurationDefaults(), + headers: () => requiredHeaders, + url: "http://localhost:4318/" + signalResourcePath + }; +} +var init_otlp_http_configuration = __esmMin((() => { + init_shared_configuration(); + init_util(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-configuration.js +function httpAgentFactoryFromOptions(options) { + return async (protocol) => { + const { Agent } = await (protocol === "http:" ? import("http") : import("https")); + return new Agent(options); + }; +} +/** +* @param userProvidedConfiguration Configuration options provided by the user in code. +* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. +* @param defaultConfiguration The defaults as defined by the exporter specification +*/ +function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + ...mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), + agentFactory: userProvidedConfiguration.agentFactory ?? fallbackConfiguration.agentFactory ?? defaultConfiguration.agentFactory + }; +} +function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { + return { + ...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath), + agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }) + }; +} +var init_otlp_node_http_configuration = __esmMin((() => { + init_otlp_http_configuration(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js +function isExportRetryable(statusCode) { + return [ + 429, + 502, + 503, + 504 + ].includes(statusCode); +} +function parseRetryAfterToMills(retryAfter) { + if (retryAfter == null) return; + const seconds = Number.parseInt(retryAfter, 10); + if (Number.isInteger(seconds)) return seconds > 0 ? seconds * 1e3 : -1; + const delay = new Date(retryAfter).getTime() - Date.now(); + if (delay >= 0) return delay; + return 0; +} +var init_is_export_retryable = __esmMin((() => {})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js +/** +* Sends data using http +* @param request +* @param params +* @param agent +* @param data +* @param onDone +* @param timeoutMillis +*/ +function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) { + const parsedUrl = new URL(params.url); + const req = request({ + hostname: parsedUrl.hostname, + port: parsedUrl.port, + path: parsedUrl.pathname, + method: "POST", + headers: { ...params.headers() }, + agent + }, (res) => { + const responseData = []; + res.on("data", (chunk) => responseData.push(chunk)); + res.on("end", () => { + if (res.statusCode && res.statusCode < 299) onDone({ + status: "success", + data: Buffer.concat(responseData) + }); + else if (res.statusCode && isExportRetryable(res.statusCode)) onDone({ + status: "retryable", + retryInMillis: parseRetryAfterToMills(res.headers["retry-after"]) + }); + else onDone({ + status: "failure", + error: new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString()) + }); + }); + }); + req.setTimeout(timeoutMillis, () => { + req.destroy(); + onDone({ + status: "failure", + error: /* @__PURE__ */ new Error("Request Timeout") + }); + }); + req.on("error", (error) => { + onDone({ + status: "failure", + error + }); + }); + compressAndSend(req, params.compression, data, (error) => { + onDone({ + status: "failure", + error + }); + }); +} +function compressAndSend(req, compression, data, onError) { + let dataStream = readableFromUint8Array(data); + if (compression === "gzip") { + req.setHeader("Content-Encoding", "gzip"); + dataStream = dataStream.on("error", onError).pipe(zlib.createGzip()).on("error", onError); + } + dataStream.pipe(req).on("error", onError); +} +function readableFromUint8Array(buff) { + const readable = new Readable(); + readable.push(buff); + readable.push(null); + return readable; +} +var init_http_transport_utils = __esmMin((() => { + init_is_export_retryable(); + init_types(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-exporter-transport.js +async function requestFunctionFactory(protocol) { + const { request } = await (protocol === "http:" ? import("http") : import("https")); + return request; +} +function createHttpExporterTransport(parameters) { + return new HttpExporterTransport(parameters); +} +var HttpExporterTransport; +var init_http_exporter_transport = __esmMin((() => { + init_http_transport_utils(); + HttpExporterTransport = class { + _parameters; + _utils = null; + constructor(_parameters) { + this._parameters = _parameters; + } + async send(data, timeoutMillis) { + const { agent, request } = await this._loadUtils(); + return new Promise((resolve) => { + sendWithHttp(request, this._parameters, agent, data, (result) => { + resolve(result); + }, timeoutMillis); + }); + } + shutdown() {} + async _loadUtils() { + let utils = this._utils; + if (utils === null) { + const protocol = new URL(this._parameters.url).protocol; + const [agent, request] = await Promise.all([this._parameters.agentFactory(protocol), requestFunctionFactory(protocol)]); + utils = this._utils = { + agent, + request + }; + } + return utils; + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js +/** +* Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER] +*/ +function getJitter() { + return Math.random() * (2 * JITTER) - JITTER; +} +/** +* Creates an Exporter Transport that retries on 'retryable' response. +*/ +function createRetryingTransport(options) { + return new RetryingTransport(options.transport); +} +var MAX_ATTEMPTS, INITIAL_BACKOFF, MAX_BACKOFF, BACKOFF_MULTIPLIER, JITTER, RetryingTransport; +var init_retrying_transport = __esmMin((() => { + MAX_ATTEMPTS = 5; + INITIAL_BACKOFF = 1e3; + MAX_BACKOFF = 5e3; + BACKOFF_MULTIPLIER = 1.5; + JITTER = .2; + RetryingTransport = class { + _transport; + constructor(_transport) { + this._transport = _transport; + } + retry(data, timeoutMillis, inMillis) { + return new Promise((resolve, reject) => { + setTimeout(() => { + this._transport.send(data, timeoutMillis).then(resolve, reject); + }, inMillis); + }); + } + async send(data, timeoutMillis) { + const deadline = Date.now() + timeoutMillis; + let result = await this._transport.send(data, timeoutMillis); + let attempts = MAX_ATTEMPTS; + let nextBackoff = INITIAL_BACKOFF; + while (result.status === "retryable" && attempts > 0) { + attempts--; + const backoff = Math.max(Math.min(nextBackoff, MAX_BACKOFF) + getJitter(), 0); + nextBackoff = nextBackoff * BACKOFF_MULTIPLIER; + const retryInMillis = result.retryInMillis ?? backoff; + const remainingTimeoutMillis = deadline - Date.now(); + if (retryInMillis > remainingTimeoutMillis) return result; + result = await this.retry(data, remainingTimeoutMillis, retryInMillis); + } + return result; + } + shutdown() { + return this._transport.shutdown(); + } + }; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-http-export-delegate.js +function createOtlpHttpExportDelegate(options, serializer) { + return createOtlpExportDelegate({ + transport: createRetryingTransport({ transport: createHttpExporterTransport(options) }), + serializer, + promiseHandler: createBoundedQueueExportPromiseHandler(options) + }, { timeout: options.timeoutMillis }); +} +var init_otlp_http_export_delegate = __esmMin((() => { + init_otlp_export_delegate(); + init_http_exporter_transport(); + init_bounded_queue_export_promise_handler(); + init_retrying_transport(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-env-configuration.js +function parseAndValidateTimeoutFromEnv(timeoutEnvVar) { + const envTimeout = process.env[timeoutEnvVar]?.trim(); + if (envTimeout != null && envTimeout !== "") { + const definedTimeout = Number(envTimeout); + if (Number.isFinite(definedTimeout) && definedTimeout > 0) return definedTimeout; + diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`); + } +} +function getTimeoutFromEnv(signalIdentifier) { + const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`); + const nonSpecificTimeout = parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT"); + return specificTimeout ?? nonSpecificTimeout; +} +function parseAndValidateCompressionFromEnv(compressionEnvVar) { + const compression = process.env[compressionEnvVar]?.trim(); + if (compression === "") return; + if (compression == null || compression === "none" || compression === "gzip") return compression; + diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`); +} +function getCompressionFromEnv(signalIdentifier) { + const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`); + const nonSpecificCompression = parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION"); + return specificCompression ?? nonSpecificCompression; +} +function getSharedConfigurationFromEnvironment(signalIdentifier) { + return { + timeoutMillis: getTimeoutFromEnv(signalIdentifier), + compression: getCompressionFromEnv(signalIdentifier) + }; +} +var init_shared_env_configuration = __esmMin((() => { + init_esm$2(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js +function getStaticHeadersFromEnv(signalIdentifier) { + const signalSpecificRawHeaders = (0, import_src$4.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`); + const nonSignalSpecificRawHeaders = (0, import_src$4.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"); + const signalSpecificHeaders = (0, import_src$4.parseKeyPairsIntoRecord)(signalSpecificRawHeaders); + const nonSignalSpecificHeaders = (0, import_src$4.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders); + if (Object.keys(signalSpecificHeaders).length === 0 && Object.keys(nonSignalSpecificHeaders).length === 0) return; + return Object.assign({}, (0, import_src$4.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders), (0, import_src$4.parseKeyPairsIntoRecord)(signalSpecificRawHeaders)); +} +function appendRootPathToUrlIfNeeded(url) { + try { + return new URL(url).toString(); + } catch { + diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); + return; + } +} +function appendResourcePathToUrl(url, path$1) { + try { + new URL(url); + } catch { + diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); + return; + } + if (!url.endsWith("/")) url = url + "/"; + url += path$1; + try { + new URL(url); + } catch { + diag.warn(`Configuration: Provided URL appended with '${path$1}' is not a valid URL, using 'undefined' instead of '${url}'`); + return; + } + return url; +} +function getNonSpecificUrlFromEnv(signalResourcePath) { + const envUrl = (0, import_src$4.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT"); + if (envUrl === void 0) return; + return appendResourcePathToUrl(envUrl, signalResourcePath); +} +function getSpecificUrlFromEnv(signalIdentifier) { + const envUrl = (0, import_src$4.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`); + if (envUrl === void 0) return; + return appendRootPathToUrlIfNeeded(envUrl); +} +/** +* Reads and returns configuration from the environment +* +* @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS) +* @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs) +*/ +function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) { + return { + ...getSharedConfigurationFromEnvironment(signalIdentifier), + url: getSpecificUrlFromEnv(signalIdentifier) ?? getNonSpecificUrlFromEnv(signalResourcePath), + headers: wrapStaticHeadersInFunction(getStaticHeadersFromEnv(signalIdentifier)) + }; +} +var import_src$4; +var init_otlp_node_http_env_configuration = __esmMin((() => { + import_src$4 = require_src$8(); + init_esm$2(); + init_shared_env_configuration(); + init_shared_configuration(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-node-http-options.js +function convertLegacyAgentOptions(config$1) { + if (typeof config$1.httpAgentOptions === "function") return config$1.httpAgentOptions; + let legacy = config$1.httpAgentOptions; + if (config$1.keepAlive != null) legacy = { + keepAlive: config$1.keepAlive, + ...legacy + }; + if (legacy != null) return httpAgentFactoryFromOptions(legacy); + else return; +} +/** +* @deprecated this will be removed in 2.0 +* @param config +* @param signalIdentifier +* @param signalResourcePath +* @param requiredHeaders +*/ +function convertLegacyHttpOptions(config$1, signalIdentifier, signalResourcePath, requiredHeaders) { + if (config$1.metadata) diag.warn("Metadata cannot be set when using http"); + return mergeOtlpNodeHttpConfigurationWithDefaults({ + url: config$1.url, + headers: wrapStaticHeadersInFunction(config$1.headers), + concurrencyLimit: config$1.concurrencyLimit, + timeoutMillis: config$1.timeoutMillis, + compression: config$1.compression, + agentFactory: convertLegacyAgentOptions(config$1) + }, getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath), getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath)); +} +var init_convert_legacy_node_http_options = __esmMin((() => { + init_esm$2(); + init_shared_configuration(); + init_otlp_node_http_configuration(); + init_index_node_http(); + init_otlp_node_http_env_configuration(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index-node-http.js +var index_node_http_exports = /* @__PURE__ */ __exportAll({ + convertLegacyHttpOptions: () => convertLegacyHttpOptions, + createOtlpHttpExportDelegate: () => createOtlpHttpExportDelegate, + getSharedConfigurationFromEnvironment: () => getSharedConfigurationFromEnvironment, + httpAgentFactoryFromOptions: () => httpAgentFactoryFromOptions +}); +var init_index_node_http = __esmMin((() => { + init_otlp_node_http_configuration(); + init_otlp_http_export_delegate(); + init_shared_env_configuration(); + init_convert_legacy_node_http_options(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js +var require_OTLPTraceExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + const otlp_exporter_base_1 = (init_esm(), __toCommonJS(esm_exports)); + const version_1 = require_version$1(); + const otlp_transformer_1 = require_src$5(); + const node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports)); + /** + * Collector Trace Exporter for Node + */ + var OTLPTraceExporter = class extends otlp_exporter_base_1.OTLPExporterBase { + constructor(config$1 = {}) { + super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config$1, "TRACES", "v1/traces", { + "User-Agent": `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`, + "Content-Type": "application/json" + }), otlp_transformer_1.JsonTraceSerializer)); + } + }; + exports.OTLPTraceExporter = OTLPTraceExporter; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js +var require_node$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + var OTLPTraceExporter_1 = require_OTLPTraceExporter(); + Object.defineProperty(exports, "OTLPTraceExporter", { + enumerable: true, + get: function() { + return OTLPTraceExporter_1.OTLPTraceExporter; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js +var require_platform$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + var node_1 = require_node$2(); + Object.defineProperty(exports, "OTLPTraceExporter", { + enumerable: true, + get: function() { + return node_1.OTLPTraceExporter; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js +var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + var platform_1 = require_platform$2(); + Object.defineProperty(exports, "OTLPTraceExporter", { + enumerable: true, + get: function() { + return platform_1.OTLPTraceExporter; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/default-service-name.js +var require_default_service_name = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._clearDefaultServiceNameCache = exports.defaultServiceName = void 0; + let serviceName; + /** + * Returns the default service name for OpenTelemetry resources. + * In Node.js environments, returns "unknown_service:". + * In browser/edge environments, returns "unknown_service". + */ + function defaultServiceName() { + if (serviceName === void 0) try { + const argv0 = globalThis.process.argv0; + serviceName = argv0 ? `unknown_service:${argv0}` : "unknown_service"; + } catch { + serviceName = "unknown_service"; + } + return serviceName; + } + exports.defaultServiceName = defaultServiceName; + /** @internal For testing purposes only */ + function _clearDefaultServiceNameCache() { + serviceName = void 0; + } + exports._clearDefaultServiceNameCache = _clearDefaultServiceNameCache; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/utils.js +var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPromiseLike = void 0; + const isPromiseLike = (val) => { + return val !== null && typeof val === "object" && typeof val.then === "function"; + }; + exports.isPromiseLike = isPromiseLike; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +var require_ResourceImpl = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const default_service_name_1 = require_default_service_name(); + const utils_1 = require_utils$1(); + var ResourceImpl = class ResourceImpl { + _rawAttributes; + _asyncAttributesPending = false; + _schemaUrl; + _memoizedAttributes; + static FromAttributeList(attributes, options) { + const res = new ResourceImpl({}, options); + res._rawAttributes = guardedRawAttributes(attributes); + res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; + return res; + } + constructor(resource, options) { + const attributes = resource.attributes ?? {}; + this._rawAttributes = Object.entries(attributes).map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) this._asyncAttributesPending = true; + return [k, v]; + }); + this._rawAttributes = guardedRawAttributes(this._rawAttributes); + this._schemaUrl = validateSchemaUrl(options?.schemaUrl); + } + get asyncAttributesPending() { + return this._asyncAttributesPending; + } + async waitForAsyncAttributes() { + if (!this.asyncAttributesPending) return; + for (let i = 0; i < this._rawAttributes.length; i++) { + const [k, v] = this._rawAttributes[i]; + this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; + } + this._asyncAttributesPending = false; + } + get attributes() { + if (this.asyncAttributesPending) api_1.diag.error("Accessing resource attributes before async attributes settled"); + if (this._memoizedAttributes) return this._memoizedAttributes; + const attrs = {}; + for (const [k, v] of this._rawAttributes) { + if ((0, utils_1.isPromiseLike)(v)) { + api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); + continue; + } + if (v != null) attrs[k] ??= v; + } + if (!this._asyncAttributesPending) this._memoizedAttributes = attrs; + return attrs; + } + getRawAttributes() { + return this._rawAttributes; + } + get schemaUrl() { + return this._schemaUrl; + } + merge(resource) { + if (resource == null) return this; + const mergedSchemaUrl = mergeSchemaUrl(this, resource); + const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0; + return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); + } + }; + function resourceFromAttributes(attributes, options) { + return ResourceImpl.FromAttributeList(Object.entries(attributes), options); + } + exports.resourceFromAttributes = resourceFromAttributes; + function resourceFromDetectedResource(detectedResource, options) { + return new ResourceImpl(detectedResource, options); + } + exports.resourceFromDetectedResource = resourceFromDetectedResource; + function emptyResource() { + return resourceFromAttributes({}); + } + exports.emptyResource = emptyResource; + function defaultResource() { + return resourceFromAttributes({ + [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, default_service_name_1.defaultServiceName)(), + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] + }); + } + exports.defaultResource = defaultResource; + function guardedRawAttributes(attributes) { + return attributes.map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) return [k, v.catch((err) => { + api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); + })]; + return [k, v]; + }); + } + function validateSchemaUrl(schemaUrl) { + if (typeof schemaUrl === "string" || schemaUrl === void 0) return schemaUrl; + api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); + } + function mergeSchemaUrl(old, updating) { + const oldSchemaUrl = old?.schemaUrl; + const updatingSchemaUrl = updating?.schemaUrl; + const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === ""; + const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === ""; + if (isOldEmpty) return updatingSchemaUrl; + if (isUpdatingEmpty) return oldSchemaUrl; + if (oldSchemaUrl === updatingSchemaUrl) return oldSchemaUrl; + api_1.diag.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", oldSchemaUrl, updatingSchemaUrl); + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detect-resources.js +var require_detect_resources = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.detectResources = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const ResourceImpl_1 = require_ResourceImpl(); + /** + * Runs all resource detectors and returns the results merged into a single Resource. + * + * @param config Configuration for resource detection + */ + const detectResources = (config$1 = {}) => { + return (config$1.detectors || []).map((d) => { + try { + const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config$1)); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return (0, ResourceImpl_1.emptyResource)(); + } + }).reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); + }; + exports.detectResources = detectResources; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js +var require_EnvDetector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.envDetector = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const core_1 = require_src$9(); + /** + * EnvDetector can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + */ + var EnvDetector = class { + _MAX_LENGTH = 255; + _COMMA_SEPARATOR = ","; + _LABEL_KEY_VALUE_SPLITTER = "="; + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + detect(_config) { + const attributes = {}; + const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); + const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); + if (rawAttributes) try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); + } + if (serviceName) attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; + return { attributes }; + } + /** + * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment + * variable. + * + * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the + * format "key1=value1,key2=value2". The ',' and '=' characters in keys + * and values MUST be percent-encoded. Other characters MAY be percent-encoded. + * + * Per the spec, on any error (e.g., decoding failure), the entire environment + * variable value is discarded. + * + * @param rawEnvAttributes The resource attributes as a comma-separated list + * of key/value pairs. + * @returns The parsed resource attributes. + * @throws Error if parsing fails (caller handles by discarding all attributes) + */ + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR).filter((attr) => attr.trim() !== ""); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); + if (keyValuePair.length !== 2) throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); + const [rawKey, rawValue] = keyValuePair; + const key = rawKey.trim(); + const value = rawValue.trim(); + if (key.length === 0) throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); + let decodedKey; + let decodedValue; + try { + decodedKey = decodeURIComponent(key); + decodedValue = decodeURIComponent(value); + } catch (e) { + throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`); + } + if (decodedKey.length > this._MAX_LENGTH) throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); + if (decodedValue.length > this._MAX_LENGTH) throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); + attributes[decodedKey] = decodedValue; + } + return attributes; + } + }; + exports.envDetector = new EnvDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js +var require_semconv$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; + /** + * The cloud account ID the resource is assigned to. + * + * @example 111111111111 + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; + /** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * @example us-east-1c + * + * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + /** + * Name of the cloud provider. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; + /** + * The geographical region the resource is running. + * + * @example us-central1 + * @example us-east-1 + * + * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_REGION = "cloud.region"; + /** + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. + * + * @example a3bf90e006b2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_ID = "container.id"; + /** + * Name of the image the container was built on. + * + * @example gcr.io/opentelemetry/operator + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; + /** + * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. + * + * @example ["v1.27.1", "3.5.7-0"] + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; + /** + * Container name used by container runtime. + * + * @example opentelemetry-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_NAME = "container.name"; + /** + * The CPU architecture the host system is running on. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_ARCH = "host.arch"; + /** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. + * + * @example fdbf79e8af94cb7f9e8df36789187052 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_ID = "host.id"; + /** + * VM image ID or host OS image ID. For Cloud, this value is from the provider. + * + * @example ami-07b06b442921831e5 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_ID = "host.image.id"; + /** + * Name of the VM image or OS install the host was instantiated from. + * + * @example infra-ami-eks-worker-node-7d4ec78312 + * @example CentOS-8-x86_64-1905 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; + /** + * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 0.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; + /** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + * + * @example opentelemetry-test + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_NAME = "host.name"; + /** + * Type of host. For Cloud, this must be the machine type. + * + * @example n1-standard-1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_TYPE = "host.type"; + /** + * The name of the cluster. + * + * @example opentelemetry-cluster + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; + /** + * The name of the Deployment. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + /** + * The name of the namespace that the pod is running in. + * + * @example default + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + /** + * The name of the Pod. + * + * @example opentelemetry-pod-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; + /** + * The operating system type. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OS_TYPE = "os.type"; + /** + * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 14.2.1 + * @example 18.04.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OS_VERSION = "os.version"; + /** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * + * @example cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_COMMAND = "process.command"; + /** + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * + * @example ["cmd/otecol", "--config=config.yaml"] + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; + /** + * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`. + * + * @example otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + /** + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + * + * @example /usr/bin/cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + /** + * The username of the user that owns the process. + * + * @example root + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_OWNER = "process.owner"; + /** + * Process identifier (PID). + * + * @example 1234 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_PID = "process.pid"; + /** + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + * + * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + /** + * The name of the runtime of this process. + * + * @example OpenJDK Runtime Environment + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; + /** + * The version of the runtime of this process, as returned by the runtime without modification. + * + * @example "14.0.2" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + /** + * The string ID of the service instance. + * + * @example 627cc493-f310-47de-96bd-71410b7dec09 + * + * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words + * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to + * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled + * service). + * + * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC + * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of + * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and + * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. + * + * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is + * needed. Similar to what can be seen in the man page for the + * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying + * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it + * or not via another resource attribute. + * + * For applications running behind an application server (like unicorn), we do not recommend using one identifier + * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker + * thread in unicorn) to have its own instance.id. + * + * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the + * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will + * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. + * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance + * for that telemetry. This is typically the case for scraping receivers, as they know the target address and + * port. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + /** + * A namespace for `service.name`. + * + * @example Shop + * + * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; + /** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; + /** + * The name of the web engine. + * + * @example WildFly + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_NAME = "webengine.name"; + /** + * The version of the web engine. + * + * @example 21.0.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_VERSION = "webengine.version"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js +var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.execAsync = void 0; + const child_process = __require("child_process"); + const util = __require("util"); + exports.execAsync = util.promisify(child_process.exec); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js +var require_getMachineId_darwin = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const execAsync_1 = require_execAsync(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + try { + const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID")); + if (!idLine) return; + const parts = idLine.split("\" = \""); + if (parts.length === 2) return parts[1].slice(0, -1); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js +var require_getMachineId_linux = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const fs_1$1 = __require("fs"); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + for (const path$1 of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try { + return (await fs_1$1.promises.readFile(path$1, { encoding: "utf8" })).trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js +var require_getMachineId_bsd = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const fs_1 = __require("fs"); + const execAsync_1 = require_execAsync(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + try { + return (await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + try { + return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js +var require_getMachineId_win = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const process$2 = __require("process"); + const execAsync_1 = require_execAsync(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; + let command = "%windir%\\System32\\REG.exe"; + if (process$2.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process$2.env) command = "%windir%\\sysnative\\cmd.exe /c " + command; + try { + const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ"); + if (parts.length === 2) return parts[1].trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js +var require_getMachineId_unsupported = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + api_1.diag.debug("could not read machine-id: unsupported platform"); + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js +var require_getMachineId = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const process$1 = __require("process"); + let getMachineIdImpl; + async function getMachineId() { + if (!getMachineIdImpl) switch (process$1.platform) { + case "darwin": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_darwin()))).getMachineId; + break; + case "linux": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_linux()))).getMachineId; + break; + case "freebsd": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_bsd()))).getMachineId; + break; + case "win32": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_win()))).getMachineId; + break; + default: + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_unsupported()))).getMachineId; + break; + } + return getMachineIdImpl(); + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js +var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.normalizeType = exports.normalizeArch = void 0; + const normalizeArch = (nodeArchString) => { + switch (nodeArchString) { + case "arm": return "arm32"; + case "ppc": return "ppc32"; + case "x64": return "amd64"; + default: return nodeArchString; + } + }; + exports.normalizeArch = normalizeArch; + const normalizeType = (nodePlatform) => { + switch (nodePlatform) { + case "sunos": return "solaris"; + case "win32": return "windows"; + default: return nodePlatform; + } + }; + exports.normalizeType = normalizeType; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js +var require_HostDetector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hostDetector = void 0; + const semconv_1 = require_semconv$1(); + const os_1$1 = __require("os"); + const getMachineId_1 = require_getMachineId(); + const utils_1 = require_utils(); + /** + * HostDetector detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. + */ + var HostDetector = class { + detect(_config) { + return { attributes: { + [semconv_1.ATTR_HOST_NAME]: (0, os_1$1.hostname)(), + [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1$1.arch)()), + [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() + } }; + } + }; + exports.hostDetector = new HostDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js +var require_OSDetector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.osDetector = void 0; + const semconv_1 = require_semconv$1(); + const os_1 = __require("os"); + const utils_1 = require_utils(); + /** + * OSDetector detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. + */ + var OSDetector = class { + detect(_config) { + return { attributes: { + [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), + [semconv_1.ATTR_OS_VERSION]: (0, os_1.release)() + } }; + } + }; + exports.osDetector = new OSDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js +var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.processDetector = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const semconv_1 = require_semconv$1(); + const os = __require("os"); + /** + * ProcessDetector will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. + */ + var ProcessDetector = class { + detect(_config) { + const attributes = { + [semconv_1.ATTR_PROCESS_PID]: process.pid, + [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, + [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, + [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ + process.argv[0], + ...process.execArgv, + ...process.argv.slice(1) + ], + [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", + [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" + }; + if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; + try { + const userInfo = os.userInfo(); + attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; + } catch (e) { + api_1.diag.debug(`error obtaining process owner: ${e}`); + } + return { attributes }; + } + }; + exports.processDetector = new ProcessDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js +var require_ServiceInstanceIdDetector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = void 0; + const semconv_1 = require_semconv$1(); + const crypto_1 = __require("crypto"); + /** + * ServiceInstanceIdDetector detects the resources related to the service instance ID. + */ + var ServiceInstanceIdDetector = class { + detect(_config) { + return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)() } }; + } + }; + /** + * @experimental + */ + exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js +var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; + var HostDetector_1 = require_HostDetector(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return HostDetector_1.hostDetector; + } + }); + var OSDetector_1 = require_OSDetector(); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return OSDetector_1.osDetector; + } + }); + var ProcessDetector_1 = require_ProcessDetector(); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return ProcessDetector_1.processDetector; + } + }); + var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector(); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js +var require_platform$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; + var node_1 = require_node$1(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return node_1.hostDetector; + } + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return node_1.osDetector; + } + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return node_1.processDetector; + } + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return node_1.serviceInstanceIdDetector; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js +var require_NoopDetector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.NoopDetector = void 0; + var NoopDetector = class { + detect() { + return { attributes: {} }; + } + }; + exports.NoopDetector = NoopDetector; + exports.noopDetector = new NoopDetector(); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/index.js +var require_detectors = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; + var EnvDetector_1 = require_EnvDetector(); + Object.defineProperty(exports, "envDetector", { + enumerable: true, + get: function() { + return EnvDetector_1.envDetector; + } + }); + var platform_1 = require_platform$1(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return platform_1.hostDetector; + } + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return platform_1.osDetector; + } + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return platform_1.processDetector; + } + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return platform_1.serviceInstanceIdDetector; + } + }); + var NoopDetector_1 = require_NoopDetector(); + Object.defineProperty(exports, "noopDetector", { + enumerable: true, + get: function() { + return NoopDetector_1.noopDetector; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/index.js +var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0; + var detect_resources_1 = require_detect_resources(); + Object.defineProperty(exports, "detectResources", { + enumerable: true, + get: function() { + return detect_resources_1.detectResources; + } + }); + var detectors_1 = require_detectors(); + Object.defineProperty(exports, "envDetector", { + enumerable: true, + get: function() { + return detectors_1.envDetector; + } + }); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return detectors_1.hostDetector; + } + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return detectors_1.osDetector; + } + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return detectors_1.processDetector; + } + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return detectors_1.serviceInstanceIdDetector; + } + }); + var ResourceImpl_1 = require_ResourceImpl(); + Object.defineProperty(exports, "resourceFromAttributes", { + enumerable: true, + get: function() { + return ResourceImpl_1.resourceFromAttributes; + } + }); + Object.defineProperty(exports, "defaultResource", { + enumerable: true, + get: function() { + return ResourceImpl_1.defaultResource; + } + }); + Object.defineProperty(exports, "emptyResource", { + enumerable: true, + get: function() { + return ResourceImpl_1.emptyResource; + } + }); + var default_service_name_1 = require_default_service_name(); + Object.defineProperty(exports, "defaultServiceName", { + enumerable: true, + get: function() { + return default_service_name_1.defaultServiceName; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/enums.js +var require_enums = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExceptionEventName = void 0; + exports.ExceptionEventName = "exception"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Span.js +var require_Span = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SpanImpl = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const enums_1 = require_enums(); + /** + * This class represents a span. + */ + var SpanImpl = class { + _spanContext; + kind; + parentSpanContext; + attributes = {}; + links = []; + events = []; + startTime; + resource; + instrumentationScope; + _droppedAttributesCount = 0; + _droppedEventsCount = 0; + _droppedLinksCount = 0; + _attributesCount = 0; + name; + status = { code: api_1.SpanStatusCode.UNSET }; + endTime = [0, 0]; + _ended = false; + _duration = [-1, -1]; + _spanProcessor; + _spanLimits; + _attributeValueLengthLimit; + _recordEndMetrics; + _performanceStartTime; + _performanceOffset; + _startTimeProvided; + /** + * Constructs a new SpanImpl instance. + */ + constructor(opts) { + const now = Date.now(); + this._spanContext = opts.spanContext; + this._performanceStartTime = core_1.otperformance.now(); + this._performanceOffset = now - (this._performanceStartTime + core_1.otperformance.timeOrigin); + this._startTimeProvided = opts.startTime != null; + this._spanLimits = opts.spanLimits; + this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0; + this._spanProcessor = opts.spanProcessor; + this.name = opts.name; + this.parentSpanContext = opts.parentSpanContext; + this.kind = opts.kind; + if (opts.links) for (const link of opts.links) this.addLink(link); + this.startTime = this._getTime(opts.startTime ?? now); + this.resource = opts.resource; + this.instrumentationScope = opts.scope; + this._recordEndMetrics = opts.recordEndMetrics; + if (opts.attributes != null) this.setAttributes(opts.attributes); + this._spanProcessor.onStart(this, opts.context); + } + spanContext() { + return this._spanContext; + } + setAttribute(key, value) { + if (value == null || this._isSpanEnded()) return this; + if (key.length === 0) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + return this; + } + if (!(0, core_1.isAttributeValue)(value)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + return this; + } + const { attributeCountLimit } = this._spanLimits; + const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key); + if (attributeCountLimit !== void 0 && this._attributesCount >= attributeCountLimit && isNewKey) { + this._droppedAttributesCount++; + return this; + } + this.attributes[key] = this._truncateToSize(value); + if (isNewKey) this._attributesCount++; + return this; + } + setAttributes(attributes) { + for (const key in attributes) if (Object.prototype.hasOwnProperty.call(attributes, key)) this.setAttribute(key, attributes[key]); + return this; + } + /** + * + * @param name Span Name + * @param [attributesOrStartTime] Span attributes or start time + * if type is {@type TimeInput} and 3rd param is undefined + * @param [timeStamp] Specified time stamp for the event + */ + addEvent(name, attributesOrStartTime, timeStamp) { + if (this._isSpanEnded()) return this; + const { eventCountLimit } = this._spanLimits; + if (eventCountLimit === 0) { + api_1.diag.warn("No events allowed."); + this._droppedEventsCount++; + return this; + } + if (eventCountLimit !== void 0 && this.events.length >= eventCountLimit) { + if (this._droppedEventsCount === 0) api_1.diag.debug("Dropping extra events."); + this.events.shift(); + this._droppedEventsCount++; + } + if ((0, core_1.isTimeInput)(attributesOrStartTime)) { + if (!(0, core_1.isTimeInput)(timeStamp)) timeStamp = attributesOrStartTime; + attributesOrStartTime = void 0; + } + const sanitized = (0, core_1.sanitizeAttributes)(attributesOrStartTime); + const { attributePerEventCountLimit } = this._spanLimits; + const attributes = {}; + let droppedAttributesCount = 0; + let eventAttributesCount = 0; + for (const attr in sanitized) { + if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; + const attrVal = sanitized[attr]; + if (attributePerEventCountLimit !== void 0 && eventAttributesCount >= attributePerEventCountLimit) { + droppedAttributesCount++; + continue; + } + attributes[attr] = this._truncateToSize(attrVal); + eventAttributesCount++; + } + this.events.push({ + name, + attributes, + time: this._getTime(timeStamp), + droppedAttributesCount + }); + return this; + } + addLink(link) { + if (this._isSpanEnded()) return this; + const { linkCountLimit } = this._spanLimits; + if (linkCountLimit === 0) { + this._droppedLinksCount++; + return this; + } + if (linkCountLimit !== void 0 && this.links.length >= linkCountLimit) { + if (this._droppedLinksCount === 0) api_1.diag.debug("Dropping extra links."); + this.links.shift(); + this._droppedLinksCount++; + } + const { attributePerLinkCountLimit } = this._spanLimits; + const sanitized = (0, core_1.sanitizeAttributes)(link.attributes); + const attributes = {}; + let droppedAttributesCount = 0; + let linkAttributesCount = 0; + for (const attr in sanitized) { + if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; + const attrVal = sanitized[attr]; + if (attributePerLinkCountLimit !== void 0 && linkAttributesCount >= attributePerLinkCountLimit) { + droppedAttributesCount++; + continue; + } + attributes[attr] = this._truncateToSize(attrVal); + linkAttributesCount++; + } + const processedLink = { context: link.context }; + if (linkAttributesCount > 0) processedLink.attributes = attributes; + if (droppedAttributesCount > 0) processedLink.droppedAttributesCount = droppedAttributesCount; + this.links.push(processedLink); + return this; + } + addLinks(links) { + for (const link of links) this.addLink(link); + return this; + } + setStatus(status) { + if (this._isSpanEnded()) return this; + if (status.code === api_1.SpanStatusCode.UNSET) return this; + if (this.status.code === api_1.SpanStatusCode.OK) return this; + const newStatus = { code: status.code }; + if (status.code === api_1.SpanStatusCode.ERROR) { + if (typeof status.message === "string") newStatus.message = status.message; + else if (status.message != null) api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); + } + this.status = newStatus; + return this; + } + updateName(name) { + if (this._isSpanEnded()) return this; + this.name = name; + return this; + } + end(endTime) { + if (this._isSpanEnded()) { + api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); + return; + } + this.endTime = this._getTime(endTime); + this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); + if (this._duration[0] < 0) { + api_1.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.", this.startTime, this.endTime); + this.endTime = this.startTime.slice(); + this._duration = [0, 0]; + } + if (this._droppedEventsCount > 0) api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); + if (this._droppedLinksCount > 0) api_1.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`); + if (this._spanProcessor.onEnding) this._spanProcessor.onEnding(this); + this._recordEndMetrics?.(); + this._ended = true; + this._spanProcessor.onEnd(this); + } + _getTime(inp) { + if (typeof inp === "number" && inp <= core_1.otperformance.now()) return (0, core_1.hrTime)(inp + this._performanceOffset); + if (typeof inp === "number") return (0, core_1.millisToHrTime)(inp); + if (inp instanceof Date) return (0, core_1.millisToHrTime)(inp.getTime()); + if ((0, core_1.isTimeInputHrTime)(inp)) return inp; + if (this._startTimeProvided) return (0, core_1.millisToHrTime)(Date.now()); + const msDuration = core_1.otperformance.now() - this._performanceStartTime; + return (0, core_1.addHrTimes)(this.startTime, (0, core_1.millisToHrTime)(msDuration)); + } + isRecording() { + return this._ended === false; + } + recordException(exception, time$2) { + const attributes = {}; + if (typeof exception === "string") attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception; + else if (exception) { + if (exception.code) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.code.toString(); + else if (exception.name) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.name; + if (exception.message) attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception.message; + if (exception.stack) attributes[semantic_conventions_1.ATTR_EXCEPTION_STACKTRACE] = exception.stack; + } + if (attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] || attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]) this.addEvent(enums_1.ExceptionEventName, attributes, time$2); + else api_1.diag.warn(`Failed to record an exception ${exception}`); + } + get duration() { + return this._duration; + } + get ended() { + return this._ended; + } + get droppedAttributesCount() { + return this._droppedAttributesCount; + } + get droppedEventsCount() { + return this._droppedEventsCount; + } + get droppedLinksCount() { + return this._droppedLinksCount; + } + _isSpanEnded() { + if (this._ended) { + const error = /* @__PURE__ */ new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); + api_1.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error); + } + return this._ended; + } + _truncateToLimitUtil(value, limit) { + if (value.length <= limit) return value; + return value.substring(0, limit); + } + /** + * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then + * return string with truncated to {@code attributeValueLengthLimit} characters + * + * If the given attribute value is array of strings then + * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters + * + * Otherwise return same Attribute {@code value} + * + * @param value Attribute value + * @returns truncated attribute value if required, otherwise same value + */ + _truncateToSize(value) { + const limit = this._attributeValueLengthLimit; + if (limit <= 0) { + api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); + return value; + } + if (typeof value === "string") return this._truncateToLimitUtil(value, limit); + if (Array.isArray(value)) return value.map((val) => typeof val === "string" ? this._truncateToLimitUtil(val, limit) : val); + return value; + } + }; + exports.SpanImpl = SpanImpl; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Sampler.js +var require_Sampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SamplingDecision = void 0; + (function(SamplingDecision$1) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision$1[SamplingDecision$1["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision$1[SamplingDecision$1["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision$1[SamplingDecision$1["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; + })(exports.SamplingDecision || (exports.SamplingDecision = {})); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOffSampler.js +var require_AlwaysOffSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AlwaysOffSampler = void 0; + const Sampler_1 = require_Sampler(); + /** Sampler that samples no traces. */ + var AlwaysOffSampler = class { + shouldSample() { + return { decision: Sampler_1.SamplingDecision.NOT_RECORD }; + } + toString() { + return "AlwaysOffSampler"; + } + }; + exports.AlwaysOffSampler = AlwaysOffSampler; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOnSampler.js +var require_AlwaysOnSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AlwaysOnSampler = void 0; + const Sampler_1 = require_Sampler(); + /** Sampler that samples all traces. */ + var AlwaysOnSampler = class { + shouldSample() { + return { decision: Sampler_1.SamplingDecision.RECORD_AND_SAMPLED }; + } + toString() { + return "AlwaysOnSampler"; + } + }; + exports.AlwaysOnSampler = AlwaysOnSampler; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/ParentBasedSampler.js +var require_ParentBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ParentBasedSampler = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + const AlwaysOffSampler_1 = require_AlwaysOffSampler(); + const AlwaysOnSampler_1 = require_AlwaysOnSampler(); + /** + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. + */ + var ParentBasedSampler = class { + _root; + _remoteParentSampled; + _remoteParentNotSampled; + _localParentSampled; + _localParentNotSampled; + constructor(config$1) { + this._root = config$1.root; + if (!this._root) { + (0, core_1.globalErrorHandler)(/* @__PURE__ */ new Error("ParentBasedSampler must have a root sampler configured")); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = config$1.remoteParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = config$1.remoteParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = config$1.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = config$1.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context$1, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context$1); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) return this._root.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._remoteParentSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); + return this._remoteParentNotSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._localParentSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); + return this._localParentNotSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } + }; + exports.ParentBasedSampler = ParentBasedSampler; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/TraceIdRatioBasedSampler.js +var require_TraceIdRatioBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceIdRatioBasedSampler = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const Sampler_1 = require_Sampler(); + /** Sampler that samples a given fraction of traces based of trace id deterministically. */ + var TraceIdRatioBasedSampler = class { + _ratio; + _upperBound; + constructor(ratio = 0) { + this._ratio = this._normalize(ratio); + this._upperBound = Math.floor(this._ratio * 4294967295); + } + shouldSample(context$1, traceId) { + return { decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED : Sampler_1.SamplingDecision.NOT_RECORD }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== "number" || isNaN(ratio)) return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < 32; i += 8) { + let part = 0; + for (let j = 0; j < 8; j++) { + const c = traceId.charCodeAt(i + j); + const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87; + part = part << 4 | v; + } + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } + }; + exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/config.js +var require_config = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + const AlwaysOffSampler_1 = require_AlwaysOffSampler(); + const AlwaysOnSampler_1 = require_AlwaysOnSampler(); + const ParentBasedSampler_1 = require_ParentBasedSampler(); + const TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); + var TracesSamplerValues; + (function(TracesSamplerValues) { + TracesSamplerValues["AlwaysOff"] = "always_off"; + TracesSamplerValues["AlwaysOn"] = "always_on"; + TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues["TraceIdRatio"] = "traceidratio"; + })(TracesSamplerValues || (TracesSamplerValues = {})); + const DEFAULT_RATIO = 1; + /** + * Load default configuration. For fields with primitive values, any user-provided + * value will override the corresponding default value. For fields with + * non-primitive values (like `spanLimits`), the user-provided value will be + * used to extend the default value. + */ + function loadDefaultConfig() { + return { + sampler: buildSamplerFromEnv(), + forceFlushTimeoutMillis: 3e4, + generalLimits: { + attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, + attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? 128 + }, + spanLimits: { + attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, + attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? 128, + linkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT") ?? 128, + eventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT") ?? 128, + attributePerEventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT") ?? 128, + attributePerLinkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT") ?? 128 + } + }; + } + exports.loadDefaultConfig = loadDefaultConfig; + /** + * Based on environment, builds a sampler, complies with specification. + */ + function buildSamplerFromEnv() { + const sampler = (0, core_1.getStringFromEnv)("OTEL_TRACES_SAMPLER") ?? TracesSamplerValues.ParentBasedAlwaysOn; + switch (sampler) { + case TracesSamplerValues.AlwaysOn: return new AlwaysOnSampler_1.AlwaysOnSampler(); + case TracesSamplerValues.AlwaysOff: return new AlwaysOffSampler_1.AlwaysOffSampler(); + case TracesSamplerValues.ParentBasedAlwaysOn: return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOnSampler_1.AlwaysOnSampler() }); + case TracesSamplerValues.ParentBasedAlwaysOff: return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOffSampler_1.AlwaysOffSampler() }); + case TracesSamplerValues.TraceIdRatio: return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()); + case TracesSamplerValues.ParentBasedTraceIdRatio: return new ParentBasedSampler_1.ParentBasedSampler({ root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()) }); + default: + api_1.diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`); + return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOnSampler_1.AlwaysOnSampler() }); + } + } + exports.buildSamplerFromEnv = buildSamplerFromEnv; + function getSamplerProbabilityFromEnv() { + const probability = (0, core_1.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG"); + if (probability == null) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + if (probability < 0 || probability > 1) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + return probability; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js +var require_utility = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.reconfigureLimits = exports.mergeConfig = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = void 0; + const config_1 = require_config(); + const core_1 = require_src$9(); + exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; + exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; + /** + * Function to merge Default configuration (as specified in './config') with + * user provided configurations. + */ + function mergeConfig(userConfig) { + const perInstanceDefaults = { sampler: (0, config_1.buildSamplerFromEnv)() }; + const DEFAULT_CONFIG = (0, config_1.loadDefaultConfig)(); + const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig); + target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); + target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); + return target; + } + exports.mergeConfig = mergeConfig; + /** + * When general limits are provided and model specific limits are not, + * configures the model specific limits by using the values from the general ones. + * @param userConfig User provided tracer configuration + */ + function reconfigureLimits(userConfig) { + const spanLimits = Object.assign({}, userConfig.spanLimits); + /** + * Reassign span attribute count limit to use first non null value defined by user or use default value + */ + spanLimits.attributeCountLimit = userConfig.spanLimits?.attributeCountLimit ?? userConfig.generalLimits?.attributeCountLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT; + /** + * Reassign span attribute value length limit to use first non null value defined by user or use default value + */ + spanLimits.attributeValueLengthLimit = userConfig.spanLimits?.attributeValueLengthLimit ?? userConfig.generalLimits?.attributeValueLengthLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; + return Object.assign({}, userConfig, { spanLimits }); + } + exports.reconfigureLimits = reconfigureLimits; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/BatchSpanProcessorBase.js +var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BatchSpanProcessorBase = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + /** + * Implementation of the {@link SpanProcessor} that batches spans exported by + * the SDK then pushes them to the exporter pipeline. + */ + var BatchSpanProcessorBase = class { + _maxExportBatchSize; + _maxQueueSize; + _scheduledDelayMillis; + _exportTimeoutMillis; + _exporter; + _isExporting = false; + _finishedSpans = []; + _timer; + _shutdownOnce; + _droppedSpansCount = 0; + constructor(exporter, config$1) { + this._exporter = exporter; + this._maxExportBatchSize = typeof config$1?.maxExportBatchSize === "number" ? config$1.maxExportBatchSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE") ?? 512; + this._maxQueueSize = typeof config$1?.maxQueueSize === "number" ? config$1.maxQueueSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE") ?? 2048; + this._scheduledDelayMillis = typeof config$1?.scheduledDelayMillis === "number" ? config$1.scheduledDelayMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY") ?? 5e3; + this._exportTimeoutMillis = typeof config$1?.exportTimeoutMillis === "number" ? config$1.exportTimeoutMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT") ?? 3e4; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + if (this._maxExportBatchSize > this._maxQueueSize) { + api_1.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"); + this._maxExportBatchSize = this._maxQueueSize; + } + } + forceFlush() { + if (this._shutdownOnce.isCalled) return this._shutdownOnce.promise; + return this._flushAll(); + } + onStart(_span, _parentContext) {} + onEnd(span) { + if (this._shutdownOnce.isCalled) return; + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) return; + this._addToBuffer(span); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return Promise.resolve().then(() => { + return this.onShutdown(); + }).then(() => { + return this._flushAll(); + }).then(() => { + return this._exporter.shutdown(); + }); + } + /** Add a span in the buffer. */ + _addToBuffer(span) { + if (this._finishedSpans.length >= this._maxQueueSize) { + if (this._droppedSpansCount === 0) api_1.diag.debug("maxQueueSize reached, dropping spans"); + this._droppedSpansCount++; + return; + } + if (this._droppedSpansCount > 0) { + api_1.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`); + this._droppedSpansCount = 0; + } + this._finishedSpans.push(span); + this._maybeStartTimer(); + } + /** + * Send all spans to the exporter respecting the batch size limit + * This function is used only on forceFlush or shutdown, + * for all other cases _flush should be used + * */ + _flushAll() { + return new Promise((resolve, reject) => { + const promises = []; + const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); + for (let i = 0, j = count; i < j; i++) promises.push(this._flushOneBatch()); + Promise.all(promises).then(() => { + resolve(); + }).catch(reject); + }); + } + _flushOneBatch() { + this._clearTimer(); + if (this._finishedSpans.length === 0) return Promise.resolve(); + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + reject(/* @__PURE__ */ new Error("Timeout")); + }, this._exportTimeoutMillis); + api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + let spans; + if (this._finishedSpans.length <= this._maxExportBatchSize) { + spans = this._finishedSpans; + this._finishedSpans = []; + } else spans = this._finishedSpans.splice(0, this._maxExportBatchSize); + const doExport = () => this._exporter.export(spans, (result) => { + clearTimeout(timer); + if (result.code === core_1.ExportResultCode.SUCCESS) resolve(); + else reject(result.error ?? /* @__PURE__ */ new Error("BatchSpanProcessor: span export failed")); + }); + let pendingResources = null; + for (let i = 0, len = spans.length; i < len; i++) { + const span = spans[i]; + if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) { + pendingResources ??= []; + pendingResources.push(span.resource.waitForAsyncAttributes()); + } + } + if (pendingResources === null) doExport(); + else Promise.all(pendingResources).then(doExport, (err) => { + (0, core_1.globalErrorHandler)(err); + reject(err); + }); + }); + }); + } + _maybeStartTimer() { + if (this._isExporting) return; + const flush = () => { + this._isExporting = true; + this._flushOneBatch().finally(() => { + this._isExporting = false; + if (this._finishedSpans.length > 0) { + this._clearTimer(); + this._maybeStartTimer(); + } + }).catch((e) => { + this._isExporting = false; + (0, core_1.globalErrorHandler)(e); + }); + }; + if (this._finishedSpans.length >= this._maxExportBatchSize) return flush(); + if (this._timer !== void 0) return; + this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); + if (typeof this._timer !== "number") this._timer.unref(); + } + _clearTimer() { + if (this._timer !== void 0) { + clearTimeout(this._timer); + this._timer = void 0; + } + } + }; + exports.BatchSpanProcessorBase = BatchSpanProcessorBase; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/export/BatchSpanProcessor.js +var require_BatchSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BatchSpanProcessor = void 0; + const BatchSpanProcessorBase_1 = require_BatchSpanProcessorBase(); + var BatchSpanProcessor = class extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { + onShutdown() {} + }; + exports.BatchSpanProcessor = BatchSpanProcessor; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/RandomIdGenerator.js +var require_RandomIdGenerator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RandomIdGenerator = void 0; + const SPAN_ID_BYTES = 8; + const TRACE_ID_BYTES = 16; + var RandomIdGenerator = class { + /** + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. + */ + generateTraceId = getIdGenerator(TRACE_ID_BYTES); + /** + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. + */ + generateSpanId = getIdGenerator(SPAN_ID_BYTES); + }; + exports.RandomIdGenerator = RandomIdGenerator; + const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); + function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i * 4); + for (let i = 0; i < bytes; i++) if (SHARED_BUFFER[i] > 0) break; + else if (i === bytes - 1) SHARED_BUFFER[bytes - 1] = 1; + return SHARED_BUFFER.toString("hex", 0, bytes); + }; + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js +var require_node = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; + var BatchSpanProcessor_1 = require_BatchSpanProcessor(); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return BatchSpanProcessor_1.BatchSpanProcessor; + } + }); + var RandomIdGenerator_1 = require_RandomIdGenerator(); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return RandomIdGenerator_1.RandomIdGenerator; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/index.js +var require_platform = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; + var node_1 = require_node(); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return node_1.BatchSpanProcessor; + } + }); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return node_1.RandomIdGenerator; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/semconv.js +var require_semconv = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.METRIC_OTEL_SDK_SPAN_STARTED = exports.METRIC_OTEL_SDK_SPAN_LIVE = exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = void 0; + /** + * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = "otel.span.parent.origin"; + /** + * The result value of the sampler for this span + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = "otel.span.sampling_result"; + /** + * The number of created spans with `recording=true` for which the end operation has not been called yet. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.METRIC_OTEL_SDK_SPAN_LIVE = "otel.sdk.span.live"; + /** + * The number of created spans. + * + * @note Implementations **MUST** record this metric for all spans, even for non-recording ones. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.METRIC_OTEL_SDK_SPAN_STARTED = "otel.sdk.span.started"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/TracerMetrics.js +var require_TracerMetrics = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TracerMetrics = void 0; + const Sampler_1 = require_Sampler(); + const semconv_1 = require_semconv(); + /** + * Generates `otel.sdk.span.*` metrics. + * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics + */ + var TracerMetrics = class { + startedSpans; + liveSpans; + constructor(meter) { + this.startedSpans = meter.createCounter(semconv_1.METRIC_OTEL_SDK_SPAN_STARTED, { + unit: "{span}", + description: "The number of created spans." + }); + this.liveSpans = meter.createUpDownCounter(semconv_1.METRIC_OTEL_SDK_SPAN_LIVE, { + unit: "{span}", + description: "The number of currently live spans." + }); + } + startSpan(parentSpanCtx, samplingDecision) { + const samplingDecisionStr = samplingDecisionToString(samplingDecision); + this.startedSpans.add(1, { + [semconv_1.ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx), + [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr + }); + if (samplingDecision === Sampler_1.SamplingDecision.NOT_RECORD) return () => {}; + const liveSpanAttributes = { [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr }; + this.liveSpans.add(1, liveSpanAttributes); + return () => { + this.liveSpans.add(-1, liveSpanAttributes); + }; + } + }; + exports.TracerMetrics = TracerMetrics; + function parentOrigin(parentSpanContext) { + if (!parentSpanContext) return "none"; + if (parentSpanContext.isRemote) return "remote"; + return "local"; + } + function samplingDecisionToString(decision) { + switch (decision) { + case Sampler_1.SamplingDecision.RECORD_AND_SAMPLED: return "RECORD_AND_SAMPLE"; + case Sampler_1.SamplingDecision.RECORD: return "RECORD_ONLY"; + case Sampler_1.SamplingDecision.NOT_RECORD: return "DROP"; + } + } +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/version.js +var require_version = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.7.1"; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Tracer.js +var require_Tracer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Tracer = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + const Span_1 = require_Span(); + const utility_1 = require_utility(); + const platform_1 = require_platform(); + const TracerMetrics_1 = require_TracerMetrics(); + const version_1 = require_version(); + /** + * This class represents a basic tracer. + */ + var Tracer = class { + _sampler; + _generalLimits; + _spanLimits; + _idGenerator; + instrumentationScope; + _resource; + _spanProcessor; + _tracerMetrics; + /** + * Constructs a new Tracer instance. + */ + constructor(instrumentationScope, config$1, resource, spanProcessor) { + const localConfig = (0, utility_1.mergeConfig)(config$1); + this._sampler = localConfig.sampler; + this._generalLimits = localConfig.generalLimits; + this._spanLimits = localConfig.spanLimits; + this._idGenerator = config$1.idGenerator || new platform_1.RandomIdGenerator(); + this._resource = resource; + this._spanProcessor = spanProcessor; + this.instrumentationScope = instrumentationScope; + const meter = localConfig.meterProvider ? localConfig.meterProvider.getMeter("@opentelemetry/sdk-trace", version_1.VERSION) : api.createNoopMeter(); + this._tracerMetrics = new TracerMetrics_1.TracerMetrics(meter); + } + /** + * Starts a new Span or returns the default NoopSpan based on the sampling + * decision. + */ + startSpan(name, options = {}, context$1 = api.context.active()) { + if (options.root) context$1 = api.trace.deleteSpan(context$1); + const parentSpan = api.trace.getSpan(context$1); + if ((0, core_1.isTracingSuppressed)(context$1)) { + api.diag.debug("Instrumentation suppressed, returning Noop Span"); + return api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); + } + const parentSpanContext = parentSpan?.spanContext(); + const spanId = this._idGenerator.generateSpanId(); + let validParentSpanContext; + let traceId; + let traceState; + if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) traceId = this._idGenerator.generateTraceId(); + else { + traceId = parentSpanContext.traceId; + traceState = parentSpanContext.traceState; + validParentSpanContext = parentSpanContext; + } + const spanKind = options.kind ?? api.SpanKind.INTERNAL; + const links = (options.links ?? []).map((link) => { + return { + context: link.context, + attributes: (0, core_1.sanitizeAttributes)(link.attributes) + }; + }); + const attributes = (0, core_1.sanitizeAttributes)(options.attributes); + const samplingResult = this._sampler.shouldSample(context$1, traceId, name, spanKind, attributes, links); + const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision); + traceState = samplingResult.traceState ?? traceState; + const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE; + const spanContext = { + traceId, + spanId, + traceFlags, + traceState + }; + if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { + api.diag.debug("Recording is off, propagating context in a non-recording span"); + return api.trace.wrapSpanContext(spanContext); + } + const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); + return new Span_1.SpanImpl({ + resource: this._resource, + scope: this.instrumentationScope, + context: context$1, + spanContext, + name, + kind: spanKind, + links, + parentSpanContext: validParentSpanContext, + attributes: initAttributes, + startTime: options.startTime, + spanProcessor: this._spanProcessor, + spanLimits: this._spanLimits, + recordEndMetrics + }); + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) return; + else if (arguments.length === 2) fn = arg2; + else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx ?? api.context.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = api.trace.setSpan(parentContext, span); + return api.context.with(contextWithSpanSet, fn, void 0, span); + } + /** Returns the active {@link GeneralLimits}. */ + getGeneralLimits() { + return this._generalLimits; + } + /** Returns the active {@link SpanLimits}. */ + getSpanLimits() { + return this._spanLimits; + } + }; + exports.Tracer = Tracer; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/MultiSpanProcessor.js +var require_MultiSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MultiSpanProcessor = void 0; + const core_1 = require_src$9(); + /** + * Implementation of the {@link SpanProcessor} that simply forwards all + * received events to a list of {@link SpanProcessor}s. + */ + var MultiSpanProcessor = class { + _spanProcessors; + constructor(spanProcessors) { + this._spanProcessors = spanProcessors; + } + forceFlush() { + const promises = []; + for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.forceFlush()); + return new Promise((resolve) => { + Promise.all(promises).then(() => { + resolve(); + }).catch((error) => { + (0, core_1.globalErrorHandler)(error || /* @__PURE__ */ new Error("MultiSpanProcessor: forceFlush failed")); + resolve(); + }); + }); + } + onStart(span, context$1) { + for (const spanProcessor of this._spanProcessors) spanProcessor.onStart(span, context$1); + } + onEnding(span) { + for (const spanProcessor of this._spanProcessors) if (spanProcessor.onEnding) spanProcessor.onEnding(span); + } + onEnd(span) { + for (const spanProcessor of this._spanProcessors) spanProcessor.onEnd(span); + } + shutdown() { + const promises = []; + for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.shutdown()); + return new Promise((resolve, reject) => { + Promise.all(promises).then(() => { + resolve(); + }, reject); + }); + } + }; + exports.MultiSpanProcessor = MultiSpanProcessor; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js +var require_BasicTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BasicTracerProvider = exports.ForceFlushState = void 0; + const core_1 = require_src$9(); + const resources_1 = require_src$3(); + const Tracer_1 = require_Tracer(); + const config_1 = require_config(); + const MultiSpanProcessor_1 = require_MultiSpanProcessor(); + const utility_1 = require_utility(); + var ForceFlushState; + (function(ForceFlushState) { + ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved"; + ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout"; + ForceFlushState[ForceFlushState["error"] = 2] = "error"; + ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved"; + })(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); + /** + * This class represents a basic tracer provider which platform libraries can extend + */ + var BasicTracerProvider = class { + _config; + _tracers = /* @__PURE__ */ new Map(); + _resource; + _activeSpanProcessor; + constructor(config$1 = {}) { + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config$1)); + this._resource = mergedConfig.resource ?? (0, resources_1.defaultResource)(); + this._config = Object.assign({}, mergedConfig, { resource: this._resource }); + const spanProcessors = []; + if (config$1.spanProcessors?.length) spanProcessors.push(...config$1.spanProcessors); + this._activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(spanProcessors); + } + getTracer(name, version$1, options) { + const key = `${name}@${version$1 || ""}:${options?.schemaUrl || ""}`; + if (!this._tracers.has(key)) this._tracers.set(key, new Tracer_1.Tracer({ + name, + version: version$1, + schemaUrl: options?.schemaUrl + }, this._config, this._resource, this._activeSpanProcessor)); + return this._tracers.get(key); + } + forceFlush() { + const timeout = this._config.forceFlushTimeoutMillis; + const promises = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => { + return new Promise((resolve) => { + let state; + const timeoutInterval = setTimeout(() => { + resolve(/* @__PURE__ */ new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); + state = ForceFlushState.timeout; + }, timeout); + spanProcessor.forceFlush().then(() => { + clearTimeout(timeoutInterval); + if (state !== ForceFlushState.timeout) { + state = ForceFlushState.resolved; + resolve(state); + } + }).catch((error) => { + clearTimeout(timeoutInterval); + state = ForceFlushState.error; + resolve(error); + }); + }); + }); + return new Promise((resolve, reject) => { + Promise.all(promises).then((results) => { + const errors = results.filter((result) => result !== ForceFlushState.resolved); + if (errors.length > 0) reject(errors); + else resolve(); + }).catch((error) => reject([error])); + }); + } + shutdown() { + return this._activeSpanProcessor.shutdown(); + } + }; + exports.BasicTracerProvider = BasicTracerProvider; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/ConsoleSpanExporter.js +var require_ConsoleSpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ConsoleSpanExporter = void 0; + const core_1 = require_src$9(); + /** + * This is implementation of {@link SpanExporter} that prints spans to the + * console. This class can be used for diagnostic purposes. + * + * NOTE: This {@link SpanExporter} is intended for diagnostics use only, output rendered to the console may change at any time. + */ + var ConsoleSpanExporter = class { + /** + * Export spans. + * @param spans + * @param resultCallback + */ + export(spans, resultCallback) { + return this._sendSpans(spans, resultCallback); + } + /** + * Shutdown the exporter. + */ + shutdown() { + this._sendSpans([]); + return this.forceFlush(); + } + /** + * Exports any pending spans in exporter + */ + forceFlush() { + return Promise.resolve(); + } + /** + * converts span info into more readable format + * @param span + */ + _exportInfo(span) { + return { + resource: { attributes: span.resource.attributes }, + instrumentationScope: span.instrumentationScope, + traceId: span.spanContext().traceId, + parentSpanContext: span.parentSpanContext, + traceState: span.spanContext().traceState?.serialize(), + name: span.name, + id: span.spanContext().spanId, + kind: span.kind, + timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), + duration: (0, core_1.hrTimeToMicroseconds)(span.duration), + attributes: span.attributes, + status: span.status, + events: span.events, + links: span.links + }; + } + /** + * Showing spans in console + * @param spans + * @param done + */ + _sendSpans(spans, done) { + for (const span of spans) console.dir(this._exportInfo(span), { depth: 3 }); + if (done) return done({ code: core_1.ExportResultCode.SUCCESS }); + } + }; + exports.ConsoleSpanExporter = ConsoleSpanExporter; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/InMemorySpanExporter.js +var require_InMemorySpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InMemorySpanExporter = void 0; + const core_1 = require_src$9(); + /** + * This class can be used for testing purposes. It stores the exported spans + * in a list in memory that can be retrieved using the `getFinishedSpans()` + * method. + */ + var InMemorySpanExporter = class { + _finishedSpans = []; + /** + * Indicates if the exporter has been "shutdown." + * When false, exported spans will not be stored in-memory. + */ + _stopped = false; + export(spans, resultCallback) { + if (this._stopped) return resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: /* @__PURE__ */ new Error("Exporter has been stopped") + }); + this._finishedSpans.push(...spans); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + shutdown() { + this._stopped = true; + this._finishedSpans = []; + return this.forceFlush(); + } + /** + * Exports any pending spans in the exporter + */ + forceFlush() { + return Promise.resolve(); + } + reset() { + this._finishedSpans = []; + } + getFinishedSpans() { + return this._finishedSpans; + } + }; + exports.InMemorySpanExporter = InMemorySpanExporter; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/SimpleSpanProcessor.js +var require_SimpleSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SimpleSpanProcessor = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + /** + * An implementation of the {@link SpanProcessor} that converts the {@link Span} + * to {@link ReadableSpan} and passes it to the configured exporter. + * + * Only spans that are sampled are converted. + * + * NOTE: This {@link SpanProcessor} exports every ended span individually instead of batching spans together, which causes significant performance overhead with most exporters. For production use, please consider using the {@link BatchSpanProcessor} instead. + */ + var SimpleSpanProcessor = class { + _exporter; + _shutdownOnce; + _pendingExports; + constructor(exporter) { + this._exporter = exporter; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + this._pendingExports = /* @__PURE__ */ new Set(); + } + async forceFlush() { + await Promise.all(Array.from(this._pendingExports)); + if (this._exporter.forceFlush) await this._exporter.forceFlush(); + } + onStart(_span, _parentContext) {} + onEnd(span) { + if (this._shutdownOnce.isCalled) return; + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) return; + const pendingExport = this._doExport(span).catch((err) => (0, core_1.globalErrorHandler)(err)); + this._pendingExports.add(pendingExport); + pendingExport.finally(() => this._pendingExports.delete(pendingExport)); + } + async _doExport(span) { + if (span.resource.asyncAttributesPending) await span.resource.waitForAsyncAttributes?.(); + const result = await core_1.internal._export(this._exporter, [span]); + if (result.code !== core_1.ExportResultCode.SUCCESS) throw result.error ?? /* @__PURE__ */ new Error(`SimpleSpanProcessor: span export failed (status ${result})`); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return this._exporter.shutdown(); + } + }; + exports.SimpleSpanProcessor = SimpleSpanProcessor; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js +var require_NoopSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NoopSpanProcessor = void 0; + /** No-op implementation of SpanProcessor */ + var NoopSpanProcessor = class { + onStart(_span, _context) {} + onEnd(_span) {} + shutdown() { + return Promise.resolve(); + } + forceFlush() { + return Promise.resolve(); + } + }; + exports.NoopSpanProcessor = NoopSpanProcessor; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/index.js +var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.BasicTracerProvider = void 0; + var BasicTracerProvider_1 = require_BasicTracerProvider(); + Object.defineProperty(exports, "BasicTracerProvider", { + enumerable: true, + get: function() { + return BasicTracerProvider_1.BasicTracerProvider; + } + }); + var platform_1 = require_platform(); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return platform_1.BatchSpanProcessor; + } + }); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return platform_1.RandomIdGenerator; + } + }); + var ConsoleSpanExporter_1 = require_ConsoleSpanExporter(); + Object.defineProperty(exports, "ConsoleSpanExporter", { + enumerable: true, + get: function() { + return ConsoleSpanExporter_1.ConsoleSpanExporter; + } + }); + var InMemorySpanExporter_1 = require_InMemorySpanExporter(); + Object.defineProperty(exports, "InMemorySpanExporter", { + enumerable: true, + get: function() { + return InMemorySpanExporter_1.InMemorySpanExporter; + } + }); + var SimpleSpanProcessor_1 = require_SimpleSpanProcessor(); + Object.defineProperty(exports, "SimpleSpanProcessor", { + enumerable: true, + get: function() { + return SimpleSpanProcessor_1.SimpleSpanProcessor; + } + }); + var NoopSpanProcessor_1 = require_NoopSpanProcessor(); + Object.defineProperty(exports, "NoopSpanProcessor", { + enumerable: true, + get: function() { + return NoopSpanProcessor_1.NoopSpanProcessor; + } + }); + var AlwaysOffSampler_1 = require_AlwaysOffSampler(); + Object.defineProperty(exports, "AlwaysOffSampler", { + enumerable: true, + get: function() { + return AlwaysOffSampler_1.AlwaysOffSampler; + } + }); + var AlwaysOnSampler_1 = require_AlwaysOnSampler(); + Object.defineProperty(exports, "AlwaysOnSampler", { + enumerable: true, + get: function() { + return AlwaysOnSampler_1.AlwaysOnSampler; + } + }); + var ParentBasedSampler_1 = require_ParentBasedSampler(); + Object.defineProperty(exports, "ParentBasedSampler", { + enumerable: true, + get: function() { + return ParentBasedSampler_1.ParentBasedSampler; + } + }); + var TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); + Object.defineProperty(exports, "TraceIdRatioBasedSampler", { + enumerable: true, + get: function() { + return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; + } + }); + var Sampler_1 = require_Sampler(); + Object.defineProperty(exports, "SamplingDecision", { + enumerable: true, + get: function() { + return Sampler_1.SamplingDecision; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@langfuse+otel@5.4.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.7.1_@opentelemetry+_e259bc6b5059078fd5966601016fecbc/node_modules/@langfuse/otel/dist/index.mjs +var import_src$1 = require_src$9(); +var import_src$2 = require_src$4(); +var import_src$3 = require_src$2(); +var MediaService = class { + constructor(params) { + this.pendingMediaUploads = /* @__PURE__ */ new Set(); + this.apiClient = params.apiClient; + } + get logger() { + return getGlobalLogger(); + } + async flush() { + await Promise.all(Array.from(this.pendingMediaUploads)); + } + async process(span) { + var _a$3; + const mediaAttributes = [ + LangfuseOtelSpanAttributes.OBSERVATION_INPUT, + LangfuseOtelSpanAttributes.TRACE_INPUT, + LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT, + LangfuseOtelSpanAttributes.TRACE_OUTPUT, + LangfuseOtelSpanAttributes.OBSERVATION_METADATA, + LangfuseOtelSpanAttributes.TRACE_METADATA + ]; + for (const mediaAttribute of mediaAttributes) { + const mediaRelevantAttributeKeys = Object.keys(span.attributes).filter((attributeName) => attributeName.startsWith(mediaAttribute)); + for (const key of mediaRelevantAttributeKeys) { + const value = span.attributes[key]; + if (typeof value !== "string") { + this.logger.warn(`Span attribute ${mediaAttribute} is not a stringified object. Skipping media handling.`); + continue; + } + let mediaReplacedValue = value; + const foundMedia = [...new Set((_a$3 = value.match(/data:[^;]+;base64,[A-Za-z0-9+/]+=*/g)) != null ? _a$3 : [])]; + if (foundMedia.length === 0) continue; + for (const mediaDataUri of foundMedia) { + const media = new LangfuseMedia({ + base64DataUri: mediaDataUri, + source: "base64_data_uri" + }); + const langfuseMediaTag = await media.getTag(); + if (!langfuseMediaTag) { + this.logger.warn("Failed to create Langfuse media tag. Skipping media item."); + continue; + } + this.scheduleUpload({ + span, + media, + field: mediaAttribute.includes("input") ? "input" : mediaAttribute.includes("output") ? "output" : "metadata" + }); + mediaReplacedValue = mediaReplacedValue.replaceAll(mediaDataUri, langfuseMediaTag); + } + span.attributes[key] = mediaReplacedValue; + } + } + if (span.instrumentationScope.name === "ai") for (const mediaAttribute of ["ai.prompt.messages", "ai.prompt"]) { + const value = span.attributes[mediaAttribute]; + if (!value || typeof value !== "string") continue; + let mediaReplacedValue = value; + try { + const parsed = JSON.parse(value); + if (Array.isArray(parsed)) { + for (const message of parsed) if (Array.isArray(message["content"])) { + const contentParts = message["content"]; + for (const part of contentParts) if (part["type"] === "file") { + let base64Content = null; + if (part["data"] != null && part["mediaType"] != null && typeof part["data"] !== "object" && !String(part["data"]).startsWith("http")) base64Content = part["data"]; + if (part["image"] != null && part["mediaType"] != null && !part["image"].startsWith("http")) base64Content = part["image"]; + if (!base64Content) continue; + const media = new LangfuseMedia({ + contentType: part["mediaType"], + contentBytes: base64ToBytes(base64Content), + source: "bytes" + }); + const langfuseMediaTag = await media.getTag(); + if (!langfuseMediaTag) { + this.logger.warn("Failed to create Langfuse media tag. Skipping media item."); + continue; + } + this.scheduleUpload({ + span, + media, + field: "input" + }); + mediaReplacedValue = mediaReplacedValue.replaceAll(base64Content, langfuseMediaTag); + } + } + } + span.attributes[mediaAttribute] = mediaReplacedValue; + } catch (err) { + this.logger.warn(`Failed to handle media for AI SDK attribute ${mediaAttribute} for span ${span.spanContext().spanId}`, err); + } + } + } + scheduleUpload(params) { + const { span, field, media } = params; + const uploadPromise = this.handleUpload({ + media, + traceId: span.spanContext().traceId, + observationId: span.spanContext().spanId, + field + }).catch((err) => { + this.logger.error("Media upload failed with error: ", err); + }); + this.pendingMediaUploads.add(uploadPromise); + uploadPromise.finally(() => { + this.pendingMediaUploads.delete(uploadPromise); + }); + } + async handleUpload({ media, traceId, observationId, field }) { + try { + const contentSha256Hash = await media.getSha256Hash(); + if (!media.contentLength || !media._contentType || !contentSha256Hash || !media._contentBytes) return; + const { uploadUrl, mediaId } = await this.apiClient.media.getUploadUrl({ + contentLength: media.contentLength, + traceId, + observationId, + field, + contentType: media._contentType, + sha256Hash: contentSha256Hash + }); + if (!uploadUrl) { + this.logger.debug(`Media status: Media with ID ${mediaId} already uploaded. Skipping duplicate upload.`); + return; + } + const clientSideMediaId = await media.getId(); + if (clientSideMediaId !== mediaId) { + this.logger.error(`Media integrity error: Media ID mismatch between SDK (${clientSideMediaId}) and Server (${mediaId}). Upload cancelled. Please check media ID generation logic.`); + return; + } + this.logger.debug(`Uploading media ${mediaId}...`); + const startTime = Date.now(); + const uploadResponse = await this.uploadWithBackoff({ + uploadUrl, + contentBytes: media._contentBytes, + contentType: media._contentType, + contentSha256Hash, + maxRetries: 3, + baseDelay: 1e3 + }); + if (!uploadResponse) throw Error("Media upload process failed"); + await this.apiClient.media.patch(mediaId, { + uploadedAt: (/* @__PURE__ */ new Date()).toISOString(), + uploadHttpStatus: uploadResponse.status, + uploadHttpError: await uploadResponse.text(), + uploadTimeMs: Date.now() - startTime + }); + this.logger.debug(`Media upload status reported for ${mediaId}`); + } catch (err) { + this.logger.error(`Error processing media item: ${err}`); + } + } + async uploadWithBackoff(params) { + const { uploadUrl, contentType, contentSha256Hash, contentBytes, maxRetries, baseDelay } = params; + for (let attempt = 0; attempt <= maxRetries; attempt++) try { + let parsedHostname; + try { + parsedHostname = new URL(uploadUrl).hostname; + } catch { + parsedHostname = ""; + } + const headers = parsedHostname === "storage.googleapis.com" || parsedHostname.endsWith(".storage.googleapis.com") ? { "Content-Type": contentType } : { + "Content-Type": contentType, + "x-amz-checksum-sha256": contentSha256Hash, + "x-ms-blob-type": "BlockBlob" + }; + const uploadResponse = await fetch(uploadUrl, { + method: "PUT", + body: contentBytes, + headers + }); + if (attempt < maxRetries && uploadResponse.status !== 200 && uploadResponse.status !== 201) throw new Error(`Upload failed with status ${uploadResponse.status}`); + return uploadResponse; + } catch (e) { + if (attempt === maxRetries) throw e; + const delay = baseDelay * Math.pow(2, attempt); + const jitter = Math.random() * 1e3; + await new Promise((resolve) => setTimeout(resolve, delay + jitter)); + } + } +}; +var KNOWN_LLM_INSTRUMENTATION_SCOPE_PREFIXES = [ + LANGFUSE_TRACER_NAME, + "agent_framework", + "ai", + "haystack", + "langsmith", + "litellm", + "openinference", + "opentelemetry.instrumentation.anthropic", + "opentelemetry.instrumentation.aws_bedrock", + "opentelemetry.instrumentation.bedrock", + "opentelemetry.instrumentation.gemini", + "opentelemetry.instrumentation.google_genai", + "opentelemetry.instrumentation.google_generativeai", + "opentelemetry.instrumentation.openai", + "opentelemetry.instrumentation.openai_v2", + "opentelemetry.instrumentation.vertex_ai", + "opentelemetry.instrumentation.vertexai", + "strands-agents", + "vllm" +]; +var EXACT_LLM_INSTRUMENTATION_SCOPES = /* @__PURE__ */ new Set(["ai"]); +function isLangfuseSpan(span) { + return span.instrumentationScope.name === LANGFUSE_TRACER_NAME; +} +function isGenAISpan(span) { + return Object.keys(span.attributes).some((attributeKey) => attributeKey.startsWith("gen_ai.")); +} +function isKnownLLMInstrumentor(span) { + const scope = span.instrumentationScope.name; + return KNOWN_LLM_INSTRUMENTATION_SCOPE_PREFIXES.some((prefix) => scope === prefix || !EXACT_LLM_INSTRUMENTATION_SCOPES.has(prefix) && scope.startsWith(`${prefix}.`)); +} +function isDefaultExportSpan(span) { + return isLangfuseSpan(span) || isGenAISpan(span) || isKnownLLMInstrumentor(span); +} +var LangfuseSpanProcessor = class { + /** + * Creates a new LangfuseSpanProcessor instance. + * + * @param params - Configuration parameters for the processor + * + * @example + * ```typescript + * const processor = new LangfuseSpanProcessor({ + * publicKey: 'pk_...', + * secretKey: 'sk_...', + * environment: 'staging', + * flushAt: 10, + * flushInterval: 2, + * mask: ({ data }) => { + * // Custom masking logic + * return typeof data === 'string' + * ? data.replace(/secret_\w+/g, 'secret_***') + * : data; + * }, + * shouldExportSpan: ({ otelSpan }) => { + * // Full override of default filtering: + * // export only spans from specific services + * return otelSpan.name.startsWith("my-service"); + * } + * }); + * ``` + */ + constructor(params) { + this.pendingEndedSpans = /* @__PURE__ */ new Set(); + this.spanExportExpectationById = /* @__PURE__ */ new Map(); + var _a$3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m; + const logger = getGlobalLogger(); + const publicKey = (_a$3 = params == null ? void 0 : params.publicKey) != null ? _a$3 : getEnv("LANGFUSE_PUBLIC_KEY"); + const secretKey = (_b = params == null ? void 0 : params.secretKey) != null ? _b : getEnv("LANGFUSE_SECRET_KEY"); + const baseUrl = (_e = (_d = (_c = params == null ? void 0 : params.baseUrl) != null ? _c : getEnv("LANGFUSE_BASE_URL")) != null ? _d : getEnv("LANGFUSE_BASEURL")) != null ? _e : "https://cloud.langfuse.com"; + if (!(params == null ? void 0 : params.exporter) && !publicKey) logger.warn("No exporter configured and no public key provided in constructor or as LANGFUSE_PUBLIC_KEY env var. Span exports will fail."); + if (!(params == null ? void 0 : params.exporter) && !secretKey) logger.warn("No exporter configured and no secret key provided in constructor or as LANGFUSE_SECRET_KEY env var. Span exports will fail."); + const flushAt = (_f = params == null ? void 0 : params.flushAt) != null ? _f : getEnv("LANGFUSE_FLUSH_AT"); + const flushIntervalSeconds = (_g = params == null ? void 0 : params.flushInterval) != null ? _g : getEnv("LANGFUSE_FLUSH_INTERVAL"); + const authHeaderValue = base64Encode(`${publicKey}:${secretKey}`); + const timeoutSeconds = (_i = params == null ? void 0 : params.timeout) != null ? _i : Number((_h = getEnv("LANGFUSE_TIMEOUT")) != null ? _h : 5); + const exporter = (_j = params == null ? void 0 : params.exporter) != null ? _j : new import_src$2.OTLPTraceExporter({ + url: `${baseUrl}/api/public/otel/v1/traces`, + headers: { + Authorization: `Basic ${authHeaderValue}`, + "x-langfuse-sdk-name": "javascript", + "x-langfuse-sdk-version": LANGFUSE_SDK_VERSION, + "x-langfuse-public-key": publicKey != null ? publicKey : "", + ...params == null ? void 0 : params.additionalHeaders + }, + timeoutMillis: timeoutSeconds * 1e3 + }); + this.processor = (params == null ? void 0 : params.exportMode) === "immediate" ? new import_src$3.SimpleSpanProcessor(exporter) : new import_src$3.BatchSpanProcessor(exporter, { + maxExportBatchSize: flushAt ? Number(flushAt) : void 0, + scheduledDelayMillis: flushIntervalSeconds ? Number(flushIntervalSeconds) * 1e3 : void 0 + }); + this.publicKey = publicKey; + this.baseUrl = baseUrl; + this.environment = (_k = params == null ? void 0 : params.environment) != null ? _k : getEnv("LANGFUSE_TRACING_ENVIRONMENT"); + this.release = (_l = params == null ? void 0 : params.release) != null ? _l : getEnv("LANGFUSE_RELEASE"); + this.mask = params == null ? void 0 : params.mask; + this.shouldExportSpan = (_m = params == null ? void 0 : params.shouldExportSpan) != null ? _m : ({ otelSpan }) => isDefaultExportSpan(otelSpan); + this.apiClient = new LangfuseAPIClient({ + baseUrl: this.baseUrl, + username: this.publicKey, + password: secretKey, + xLangfusePublicKey: this.publicKey, + xLangfuseSdkVersion: LANGFUSE_SDK_VERSION, + xLangfuseSdkName: "javascript", + environment: "", + headers: params == null ? void 0 : params.additionalHeaders + }); + this.mediaService = new MediaService({ apiClient: this.apiClient }); + logger.debug("Initialized LangfuseSpanProcessor with params:", { + publicKey, + baseUrl, + environment: this.environment, + release: this.release, + timeoutSeconds, + flushAt, + flushIntervalSeconds + }); + } + get logger() { + return getGlobalLogger(); + } + /** + * Called when a span is started. Adds environment, release, and propagated attributes to the span. + * + * @param span - The span that was started + * @param parentContext - The parent context + * + * @override + */ + onStart(span, parentContext) { + span.setAttributes({ + [LangfuseOtelSpanAttributes.ENVIRONMENT]: this.environment, + [LangfuseOtelSpanAttributes.RELEASE]: this.release, + ...getPropagatedAttributesFromContext(parentContext) + }); + try { + this.markAppRootCandidate(span, parentContext); + } catch (err) { + this.logger.debug("App-root start-time check failed. Span will not be marked as app root.", { spanName: span.name }, err); + } + return this.processor.onStart(span, parentContext); + } + /** + * Called when a span ends. Processes the span for export to Langfuse. + * + * This method: + * 1. Checks if the span should be exported using shouldExportSpan + * (custom override or default smart filter) + * 2. Applies data masking to sensitive attributes + * 3. Handles media content extraction and upload + * 4. Logs span details in debug mode + * 5. Passes the span to the parent processor for export + * + * @param span - The span that ended + * + * @override + */ + onEnd(span) { + this.spanExportExpectationById.delete(span.spanContext().spanId); + const processEndedSpanPromise = this.processEndedSpan(span).catch((err) => { + this.logger.error(err); + }); + this.pendingEndedSpans.add(processEndedSpanPromise); + processEndedSpanPromise.finally(() => this.pendingEndedSpans.delete(processEndedSpanPromise)); + } + async flush() { + await Promise.all(Array.from(this.pendingEndedSpans)); + await this.mediaService.flush(); + } + /** + * Forces an immediate flush of all pending spans and media uploads. + * + * @returns Promise that resolves when all pending operations are complete + * + * @override + */ + async forceFlush() { + await this.flush(); + return this.processor.forceFlush(); + } + /** + * Gracefully shuts down the processor, ensuring all pending operations are completed. + * + * @returns Promise that resolves when shutdown is complete + * + * @override + */ + async shutdown() { + await this.flush(); + return this.processor.shutdown(); + } + async processEndedSpan(span) { + var _a$3, _b; + try { + if (this.shouldExportSpan({ otelSpan: span }) === false) { + this.logger.debug("Dropped span due to shouldExportSpan filter.", { + spanName: span.name, + instrumentationScope: span.instrumentationScope.name + }); + return; + } + } catch (err) { + this.logger.error("shouldExportSpan failed with error. Dropping span.", { + spanName: span.name, + instrumentationScope: span.instrumentationScope.name + }, err); + return; + } + await this.applyMaskInPlace(span); + await this.mediaService.process(span); + if (this.logger.isLevelEnabled(LogLevel.DEBUG)) this.logger.debug(`Processed span: +${JSON.stringify({ + name: span.name, + traceId: span.spanContext().traceId, + spanId: span.spanContext().spanId, + parentSpanId: (_b = (_a$3 = span.parentSpanContext) == null ? void 0 : _a$3.spanId) != null ? _b : null, + attributes: span.attributes, + startTime: new Date((0, import_src$1.hrTimeToMilliseconds)(span.startTime)), + endTime: new Date((0, import_src$1.hrTimeToMilliseconds)(span.endTime)), + durationMs: (0, import_src$1.hrTimeToMilliseconds)(span.duration), + kind: span.kind, + status: span.status, + resource: span.resource.attributes, + instrumentationScope: span.instrumentationScope + }, null, 2)}`); + this.processor.onEnd(span); + } + markAppRootCandidate(span, parentContext) { + var _a$3; + const traceId = span.spanContext().traceId; + const spanId = span.spanContext().spanId; + const parentSpanId = (_a$3 = span.parentSpanContext) == null ? void 0 : _a$3.spanId; + const expectedExportedAtStart = this.isExpectedExportedAtStart(span); + const propagatedClaim = getLangfuseTraceIdFromBaggage(parentContext); + const isParentExpectedExported = parentSpanId !== void 0 ? this.spanExportExpectationById.get(parentSpanId) === true : false; + const suppressedByParentClaim = propagatedClaim === traceId; + this.spanExportExpectationById.set(spanId, expectedExportedAtStart); + if (expectedExportedAtStart && !isParentExpectedExported && !suppressedByParentClaim) span.setAttribute(LangfuseOtelSpanAttributes.IS_APP_ROOT, true); + } + isExpectedExportedAtStart(span) { + const readable = span; + try { + return this.shouldExportSpan({ otelSpan: readable }) === true; + } catch (err) { + this.logger.debug("shouldExportSpan threw during app-root start-time check. Span will not be marked as app root.", { + spanName: span.name, + instrumentationScope: readable.instrumentationScope.name + }, err); + return false; + } + } + async applyMaskInPlace(span) { + const maskCandidates = [ + LangfuseOtelSpanAttributes.OBSERVATION_INPUT, + LangfuseOtelSpanAttributes.TRACE_INPUT, + LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT, + LangfuseOtelSpanAttributes.TRACE_OUTPUT, + LangfuseOtelSpanAttributes.OBSERVATION_METADATA, + LangfuseOtelSpanAttributes.TRACE_METADATA + ]; + for (const maskCandidate of maskCandidates) if (maskCandidate in span.attributes) span.attributes[maskCandidate] = await this.applyMask(span.attributes[maskCandidate]); + } + async applyMask(data) { + if (!this.mask) return data; + try { + return await this.mask({ data }); + } catch (err) { + this.logger.warn(`Applying mask function failed due to error, fully masking property. Error: ${err}`); + return ""; + } + } +}; + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js +var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AbstractAsyncHooksContextManager = void 0; + const events_1 = __require("events"); + const ADD_LISTENER_METHODS = [ + "addListener", + "on", + "once", + "prependListener", + "prependOnceListener" + ]; + var AbstractAsyncHooksContextManager = class { + /** + * Binds a the certain context or the active one to the target function and then returns the target + * @param context A context (span) to be bind to target + * @param target a function or event emitter. When target or one of its callbacks is called, + * the provided context will be used as the active context for the duration of the call. + */ + bind(context$1, target) { + if (target instanceof events_1.EventEmitter) return this._bindEventEmitter(context$1, target); + if (typeof target === "function") return this._bindFunction(context$1, target); + return target; + } + _bindFunction(context$1, target) { + const manager = this; + const contextWrapper = function(...args) { + return manager.with(context$1, () => target.apply(this, args)); + }; + Object.defineProperty(contextWrapper, "length", { + enumerable: false, + configurable: true, + writable: false, + value: target.length + }); + /** + * It isn't possible to tell Typescript that contextWrapper is the same as T + * so we forced to cast as any here. + */ + return contextWrapper; + } + /** + * By default, EventEmitter call their callback with their context, which we do + * not want, instead we will bind a specific context to all callbacks that + * go through it. + * @param context the context we want to bind + * @param ee EventEmitter an instance of EventEmitter to patch + */ + _bindEventEmitter(context$1, ee) { + if (this._getPatchMap(ee) !== void 0) return ee; + this._createPatchMap(ee); + ADD_LISTENER_METHODS.forEach((methodName) => { + if (ee[methodName] === void 0) return; + ee[methodName] = this._patchAddListener(ee, ee[methodName], context$1); + }); + if (typeof ee.removeListener === "function") ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); + if (typeof ee.off === "function") ee.off = this._patchRemoveListener(ee, ee.off); + if (typeof ee.removeAllListeners === "function") ee.removeAllListeners = this._patchRemoveAllListeners(ee, ee.removeAllListeners); + return ee; + } + /** + * Patch methods that remove a given listener so that we match the "patched" + * version of that listener (the one that propagate context). + * @param ee EventEmitter instance + * @param original reference to the patched method + */ + _patchRemoveListener(ee, original) { + const contextManager = this; + return function(event, listener) { + const events = contextManager._getPatchMap(ee)?.[event]; + if (events === void 0) return original.call(this, event, listener); + const patchedListener = events.get(listener); + return original.call(this, event, patchedListener || listener); + }; + } + /** + * Patch methods that remove all listeners so we remove our + * internal references for a given event. + * @param ee EventEmitter instance + * @param original reference to the patched method + */ + _patchRemoveAllListeners(ee, original) { + const contextManager = this; + return function(event) { + const map = contextManager._getPatchMap(ee); + if (map !== void 0) { + if (arguments.length === 0) contextManager._createPatchMap(ee); + else if (map[event] !== void 0) delete map[event]; + } + return original.apply(this, arguments); + }; + } + /** + * Patch methods on an event emitter instance that can add listeners so we + * can force them to propagate a given context. + * @param ee EventEmitter instance + * @param original reference to the patched method + * @param [context] context to propagate when calling listeners + */ + _patchAddListener(ee, original, context$1) { + const contextManager = this; + return function(event, listener) { + /** + * This check is required to prevent double-wrapping the listener. + * The implementation for ee.once wraps the listener and calls ee.on. + * Without this check, we would wrap that wrapped listener. + * This causes an issue because ee.removeListener depends on the onceWrapper + * to properly remove the listener. If we wrap their wrapper, we break + * that detection. + */ + if (contextManager._wrapped) return original.call(this, event, listener); + let map = contextManager._getPatchMap(ee); + if (map === void 0) map = contextManager._createPatchMap(ee); + let listeners = map[event]; + if (listeners === void 0) { + listeners = /* @__PURE__ */ new WeakMap(); + map[event] = listeners; + } + const patchedListener = contextManager.bind(context$1, listener); + listeners.set(listener, patchedListener); + /** + * See comment at the start of this function for the explanation of this property. + */ + contextManager._wrapped = true; + try { + return original.call(this, event, patchedListener); + } finally { + contextManager._wrapped = false; + } + }; + } + _createPatchMap(ee) { + const map = Object.create(null); + ee[this._kOtListeners] = map; + return map; + } + _getPatchMap(ee) { + return ee[this._kOtListeners]; + } + _kOtListeners = Symbol("OtListeners"); + _wrapped = false; + }; + exports.AbstractAsyncHooksContextManager = AbstractAsyncHooksContextManager; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncHooksContextManager.js +var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncHooksContextManager = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const asyncHooks = __require("async_hooks"); + const AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); + /** + * @deprecated Use AsyncLocalStorageContextManager instead. + */ + var AsyncHooksContextManager = class extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + _asyncHook; + _contexts = /* @__PURE__ */ new Map(); + _stack = []; + constructor() { + super(); + this._asyncHook = asyncHooks.createHook({ + init: this._init.bind(this), + before: this._before.bind(this), + after: this._after.bind(this), + destroy: this._destroy.bind(this), + promiseResolve: this._destroy.bind(this) + }); + } + active() { + return this._stack[this._stack.length - 1] ?? api_1.ROOT_CONTEXT; + } + with(context$1, fn, thisArg, ...args) { + this._enterContext(context$1); + try { + return fn.call(thisArg, ...args); + } finally { + this._exitContext(); + } + } + enable() { + this._asyncHook.enable(); + return this; + } + disable() { + this._asyncHook.disable(); + this._contexts.clear(); + this._stack = []; + return this; + } + /** + * Init hook will be called when userland create a async context, setting the + * context as the current one if it exist. + * @param uid id of the async context + * @param type the resource type + */ + _init(uid, type) { + if (type === "TIMERWRAP") return; + const context$1 = this._stack[this._stack.length - 1]; + if (context$1 !== void 0) this._contexts.set(uid, context$1); + } + /** + * Destroy hook will be called when a given context is no longer used so we can + * remove its attached context. + * @param uid uid of the async context + */ + _destroy(uid) { + this._contexts.delete(uid); + } + /** + * Before hook is called just before executing a async context. + * @param uid uid of the async context + */ + _before(uid) { + const context$1 = this._contexts.get(uid); + if (context$1 !== void 0) this._enterContext(context$1); + } + /** + * After hook is called just after completing the execution of a async context. + */ + _after() { + this._exitContext(); + } + /** + * Set the given context as active + */ + _enterContext(context$1) { + this._stack.push(context$1); + } + /** + * Remove the context at the root of the stack + */ + _exitContext() { + this._stack.pop(); + } + }; + exports.AsyncHooksContextManager = AsyncHooksContextManager; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js +var require_AsyncLocalStorageContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncLocalStorageContextManager = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const async_hooks_1 = __require("async_hooks"); + const AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); + var AsyncLocalStorageContextManager = class extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + _asyncLocalStorage; + constructor() { + super(); + this._asyncLocalStorage = new async_hooks_1.AsyncLocalStorage(); + } + active() { + return this._asyncLocalStorage.getStore() ?? api_1.ROOT_CONTEXT; + } + with(context$1, fn, thisArg, ...args) { + const cb = thisArg == null ? fn : fn.bind(thisArg); + return this._asyncLocalStorage.run(context$1, cb, ...args); + } + enable() { + return this; + } + disable() { + this._asyncLocalStorage.disable(); + return this; + } + }; + exports.AsyncLocalStorageContextManager = AsyncLocalStorageContextManager; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/index.js +var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncLocalStorageContextManager = exports.AsyncHooksContextManager = void 0; + var AsyncHooksContextManager_1 = require_AsyncHooksContextManager(); + Object.defineProperty(exports, "AsyncHooksContextManager", { + enumerable: true, + get: function() { + return AsyncHooksContextManager_1.AsyncHooksContextManager; + } + }); + var AsyncLocalStorageContextManager_1 = require_AsyncLocalStorageContextManager(); + Object.defineProperty(exports, "AsyncLocalStorageContextManager", { + enumerable: true, + get: function() { + return AsyncLocalStorageContextManager_1.AsyncLocalStorageContextManager; + } + }); +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/NodeTracerProvider.js +var require_NodeTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NodeTracerProvider = void 0; + const context_async_hooks_1 = require_src$1(); + const sdk_trace_base_1 = require_src$2(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$9(); + function setupContextManager(contextManager) { + if (contextManager === null) return; + if (contextManager === void 0) { + const defaultContextManager = new context_async_hooks_1.AsyncLocalStorageContextManager(); + defaultContextManager.enable(); + api_1.context.setGlobalContextManager(defaultContextManager); + return; + } + contextManager.enable(); + api_1.context.setGlobalContextManager(contextManager); + } + function setupPropagator(propagator) { + if (propagator === null) return; + if (propagator === void 0) { + api_1.propagation.setGlobalPropagator(new core_1.CompositePropagator({ propagators: [new core_1.W3CTraceContextPropagator(), new core_1.W3CBaggagePropagator()] })); + return; + } + api_1.propagation.setGlobalPropagator(propagator); + } + /** + * Register this TracerProvider for use with the OpenTelemetry API. + * Undefined values may be replaced with defaults, and + * null values will be skipped. + * + * @param config Configuration object for SDK registration + */ + var NodeTracerProvider = class extends sdk_trace_base_1.BasicTracerProvider { + constructor(config$1 = {}) { + super(config$1); + } + /** + * Register this TracerProvider for use with the OpenTelemetry API. + * Undefined values may be replaced with defaults, and + * null values will be skipped. + * + * @param config Configuration object for SDK registration + */ + register(config$1 = {}) { + api_1.trace.setGlobalTracerProvider(this); + setupContextManager(config$1.contextManager); + setupPropagator(config$1.propagator); + } + }; + exports.NodeTracerProvider = NodeTracerProvider; +})); + +//#endregion +//#region node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/index.js +var require_src = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceIdRatioBasedSampler = exports.SimpleSpanProcessor = exports.SamplingDecision = exports.RandomIdGenerator = exports.ParentBasedSampler = exports.NoopSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.BatchSpanProcessor = exports.BasicTracerProvider = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NodeTracerProvider = void 0; + var NodeTracerProvider_1 = require_NodeTracerProvider(); + Object.defineProperty(exports, "NodeTracerProvider", { + enumerable: true, + get: function() { + return NodeTracerProvider_1.NodeTracerProvider; + } + }); + var sdk_trace_base_1 = require_src$2(); + Object.defineProperty(exports, "AlwaysOffSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.AlwaysOffSampler; + } + }); + Object.defineProperty(exports, "AlwaysOnSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.AlwaysOnSampler; + } + }); + Object.defineProperty(exports, "BasicTracerProvider", { + enumerable: true, + get: function() { + return sdk_trace_base_1.BasicTracerProvider; + } + }); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return sdk_trace_base_1.BatchSpanProcessor; + } + }); + Object.defineProperty(exports, "ConsoleSpanExporter", { + enumerable: true, + get: function() { + return sdk_trace_base_1.ConsoleSpanExporter; + } + }); + Object.defineProperty(exports, "InMemorySpanExporter", { + enumerable: true, + get: function() { + return sdk_trace_base_1.InMemorySpanExporter; + } + }); + Object.defineProperty(exports, "NoopSpanProcessor", { + enumerable: true, + get: function() { + return sdk_trace_base_1.NoopSpanProcessor; + } + }); + Object.defineProperty(exports, "ParentBasedSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.ParentBasedSampler; + } + }); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return sdk_trace_base_1.RandomIdGenerator; + } + }); + Object.defineProperty(exports, "SamplingDecision", { + enumerable: true, + get: function() { + return sdk_trace_base_1.SamplingDecision; + } + }); + Object.defineProperty(exports, "SimpleSpanProcessor", { + enumerable: true, + get: function() { + return sdk_trace_base_1.SimpleSpanProcessor; + } + }); + Object.defineProperty(exports, "TraceIdRatioBasedSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.TraceIdRatioBasedSampler; + } + }); +})); + +//#endregion +//#region src/instrumentation.ts +var import_src = require_src(); +/** +* Configure an isolated OpenTelemetry tracer provider wired to Langfuse. +* +* We register a dedicated `NodeTracerProvider` (rather than the full auto- +* instrumenting `NodeSDK`) so the bundle stays small and free of dynamic +* instrumentation loading. Registering the provider also installs the +* AsyncLocalStorage context manager that `propagateAttributes` relies on. +* +* We use `exportMode: "batched"` and flush once at the end: the whole +* transcript is converted in-process, so batching every span into one (or a +* few) requests is far faster than one request per span — important for the +* hook's timeout budget. `shutdown()` below calls `forceFlush()` before the +* process exits. +*/ +function setupInstrumentation(config$1) { + const spanProcessor = new LangfuseSpanProcessor({ + publicKey: config$1.public_key, + secretKey: config$1.secret_key, + baseUrl: config$1.base_url, + environment: config$1.environment, + exportMode: "batched", + shouldExportSpan: () => true + }); + const provider = new import_src.NodeTracerProvider({ spanProcessors: [spanProcessor] }); + provider.register(); + return { shutdown: async () => { + await spanProcessor.forceFlush(); + await provider.shutdown(); + } }; +} + +//#endregion +//#region node_modules/.pnpm/@langfuse+tracing@5.4.1_@opentelemetry+api@1.9.1/node_modules/@langfuse/tracing/dist/index.mjs +init_esm$2(); +function createTraceAttributes({ input, output } = {}) { + const attributes = { + [LangfuseOtelSpanAttributes.TRACE_INPUT]: _serialize(input), + [LangfuseOtelSpanAttributes.TRACE_OUTPUT]: _serialize(output) + }; + return Object.fromEntries(Object.entries(attributes).filter(([_, v]) => v != null)); +} +function createObservationAttributes(type, attributes) { + const { metadata, input, output, level, statusMessage, version: version$1, completionStartTime, model, modelParameters, usageDetails, costDetails, prompt } = attributes; + let otelAttributes = { + [LangfuseOtelSpanAttributes.OBSERVATION_TYPE]: type, + [LangfuseOtelSpanAttributes.OBSERVATION_LEVEL]: level, + [LangfuseOtelSpanAttributes.OBSERVATION_STATUS_MESSAGE]: statusMessage, + [LangfuseOtelSpanAttributes.VERSION]: version$1, + [LangfuseOtelSpanAttributes.OBSERVATION_INPUT]: _serialize(input), + [LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT]: _serialize(output), + [LangfuseOtelSpanAttributes.OBSERVATION_MODEL]: model, + [LangfuseOtelSpanAttributes.OBSERVATION_USAGE_DETAILS]: _serialize(usageDetails), + [LangfuseOtelSpanAttributes.OBSERVATION_COST_DETAILS]: _serialize(costDetails), + [LangfuseOtelSpanAttributes.OBSERVATION_COMPLETION_START_TIME]: _serialize(completionStartTime), + [LangfuseOtelSpanAttributes.OBSERVATION_MODEL_PARAMETERS]: _serialize(modelParameters), + ...prompt && !prompt.isFallback ? { + [LangfuseOtelSpanAttributes.OBSERVATION_PROMPT_NAME]: prompt.name, + [LangfuseOtelSpanAttributes.OBSERVATION_PROMPT_VERSION]: prompt.version + } : {}, + ..._flattenAndSerializeMetadata(metadata, "observation") + }; + return Object.fromEntries(Object.entries(otelAttributes).filter(([_, v]) => v != null)); +} +function _serialize(obj) { + try { + if (typeof obj === "string") return obj; + return obj != null ? JSON.stringify(obj) : void 0; + } catch { + return ""; + } +} +function _flattenAndSerializeMetadata(metadata, type) { + const prefix = type === "observation" ? LangfuseOtelSpanAttributes.OBSERVATION_METADATA : LangfuseOtelSpanAttributes.TRACE_METADATA; + const metadataAttributes = {}; + if (metadata === void 0 || metadata === null) return metadataAttributes; + if (typeof metadata !== "object" || Array.isArray(metadata)) { + const serialized = _serialize(metadata); + if (serialized) metadataAttributes[prefix] = serialized; + } else for (const [key, value] of Object.entries(metadata)) { + const serialized = typeof value === "string" ? value : _serialize(value); + if (serialized) metadataAttributes[`${prefix}.${key}`] = serialized; + } + return metadataAttributes; +} +var LANGFUSE_GLOBAL_SYMBOL = Symbol.for("langfuse"); +function createState() { + return { isolatedTracerProvider: null }; +} +function getGlobalState() { + const initialState = createState(); + try { + const g = globalThis; + if (typeof g !== "object" || g === null) { + getGlobalLogger().warn("globalThis is not available, using fallback state"); + return initialState; + } + if (!g[LANGFUSE_GLOBAL_SYMBOL]) Object.defineProperty(g, LANGFUSE_GLOBAL_SYMBOL, { + value: initialState, + writable: false, + configurable: false, + enumerable: false + }); + return g[LANGFUSE_GLOBAL_SYMBOL]; + } catch (err) { + if (err instanceof Error) getGlobalLogger().error(`Failed to access global state: ${err.message}`); + else getGlobalLogger().error(`Failed to access global state: ${String(err)}`); + return initialState; + } +} +function getLangfuseTracerProvider() { + const { isolatedTracerProvider } = getGlobalState(); + if (isolatedTracerProvider) return isolatedTracerProvider; + return trace.getTracerProvider(); +} +function getLangfuseTracer() { + return getLangfuseTracerProvider().getTracer(LANGFUSE_TRACER_NAME, LANGFUSE_SDK_VERSION); +} +var LangfuseBaseObservation = class { + constructor(params) { + this.otelSpan = params.otelSpan; + this.id = params.otelSpan.spanContext().spanId; + this.traceId = params.otelSpan.spanContext().traceId; + this.type = params.type; + if (params.attributes) this.otelSpan.setAttributes(createObservationAttributes(params.type, params.attributes)); + } + /** Gets the Langfuse OpenTelemetry tracer instance */ + get tracer() { + return getLangfuseTracer(); + } + /** + * Ends the observation, marking it as complete. + * + * @param endTime - Optional end time, defaults to current time + */ + end(endTime) { + this.otelSpan.end(endTime); + } + updateOtelSpanAttributes(attributes) { + this.otelSpan.setAttributes(createObservationAttributes(this.type, attributes)); + } + /** + * Set trace-level input and output for the trace this observation belongs to. + * + * @deprecated This is a legacy method for backward compatibility with Langfuse platform + * features that still rely on trace-level input/output (e.g., legacy LLM-as-a-judge + * evaluators). It will be removed in a future major version. + * + * For setting other trace attributes (userId, sessionId, metadata, tags, version), + * use {@link propagateAttributes} instead. + * + * @param attributes - Input and output data to associate with the trace + * @returns The observation instance for method chaining + * + * @example + * ```typescript + * const span = startObservation('my-operation'); + * span.setTraceIO({ + * input: { query: 'user question' }, + * output: { response: 'assistant answer' } + * }); + * ``` + */ + setTraceIO(attributes) { + this.otelSpan.setAttributes(createTraceAttributes(attributes)); + return this; + } + /** + * Make the trace this observation belongs to publicly accessible via its URL. + * + * When a trace is published, anyone with the trace link can view the full trace + * without needing to be logged in to Langfuse. This action cannot be undone + * programmatically - once any span in a trace is published, the entire trace + * becomes public. + * + * @returns The observation instance for method chaining + * + * @example + * ```typescript + * const span = startObservation('my-operation'); + * span.setTraceAsPublic(); + * ``` + */ + setTraceAsPublic() { + this.otelSpan.setAttributes({ [LangfuseOtelSpanAttributes.TRACE_PUBLIC]: true }); + return this; + } + startObservation(name, attributes, options) { + const { asType = "span" } = options || {}; + return startObservation(name, attributes, { + asType, + parentSpanContext: this.otelSpan.spanContext() + }); + } +}; +var LangfuseSpan = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "span" + }); + } + /** + * Updates this span with new attributes. + * + * @param attributes - Span attributes to set + * @returns This span for method chaining + * + * @example + * ```typescript + * span.update({ + * output: { result: 'success' }, + * level: 'DEFAULT', + * metadata: { duration: 150 } + * }); + * ``` + */ + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseAgent = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "agent" + }); + } + /** + * Updates this agent observation with new attributes. + * + * @param attributes - Agent attributes to set + * @returns This agent for method chaining + * + * @example + * ```typescript + * agent.update({ + * output: { + * taskCompleted: true, + * iterationsUsed: 5, + * toolsInvoked: ['web-search', 'calculator', 'summarizer'], + * finalResult: 'Research completed with high confidence' + * }, + * metadata: { + * efficiency: 0.85, + * qualityScore: 0.92, + * resourcesConsumed: { tokens: 15000, apiCalls: 12 } + * } + * }); + * ``` + */ + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseTool = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "tool" + }); + } + /** + * Updates this tool observation with new attributes. + * + * @param attributes - Tool attributes to set + * @returns This tool for method chaining + * + * @example + * ```typescript + * tool.update({ + * output: { + * result: searchResults, + * count: searchResults.length, + * relevanceScore: 0.89, + * executionTime: 1250 + * }, + * metadata: { + * cacheHit: false, + * apiCost: 0.025, + * rateLimitRemaining: 950 + * } + * }); + * ``` + */ + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseChain = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "chain" + }); + } + /** + * Updates this chain observation with new attributes. + * + * @param attributes - Chain attributes to set + * @returns This chain for method chaining + * + * @example + * ```typescript + * chain.update({ + * output: { + * stepsCompleted: 5, + * stepsSuccessful: 4, + * finalResult: processedData, + * pipelineEfficiency: 0.87 + * }, + * metadata: { + * bottleneckStep: 'data-validation', + * parallelizationOpportunities: ['step-2', 'step-3'], + * optimizationSuggestions: ['cache-intermediate-results'] + * } + * }); + * ``` + */ + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseRetriever = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "retriever" + }); + } + /** + * Updates this retriever observation with new attributes. + * + * @param attributes - Retriever attributes to set + * @returns This retriever for method chaining + */ + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseEvaluator = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "evaluator" + }); + } + /** + * Updates this evaluator observation with new attributes. + * + * @param attributes - Evaluator attributes to set + * @returns This evaluator for method chaining + */ + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseGuardrail = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "guardrail" + }); + } + /** + * Updates this guardrail observation with new attributes. + * + * @param attributes - Guardrail attributes to set + * @returns This guardrail for method chaining + */ + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseGeneration = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "generation" + }); + } + update(attributes) { + this.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseEmbedding = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "embedding" + }); + } + /** + * Updates this embedding observation with new attributes. + * + * @param attributes - Embedding attributes to set + * @returns This embedding for method chaining + */ + update(attributes) { + this.updateOtelSpanAttributes(attributes); + return this; + } +}; +var LangfuseEvent = class extends LangfuseBaseObservation { + constructor(params) { + super({ + ...params, + type: "event" + }); + this.otelSpan.end(params.timestamp); + } +}; +function createOtelSpan(params) { + return getLangfuseTracer().startSpan(params.name, { startTime: params.startTime }, createParentContext(params.parentSpanContext)); +} +function createParentContext(parentSpanContext) { + if (!parentSpanContext) return; + return trace.setSpanContext(context.active(), parentSpanContext); +} +function startObservation(name, attributes, options) { + var _a$3; + const { asType = "span", ...observationOptions } = options || {}; + const otelSpan = createOtelSpan({ + name, + ...observationOptions + }); + switch (asType) { + case "generation": return new LangfuseGeneration({ + otelSpan, + attributes + }); + case "embedding": return new LangfuseEmbedding({ + otelSpan, + attributes + }); + case "agent": return new LangfuseAgent({ + otelSpan, + attributes + }); + case "tool": return new LangfuseTool({ + otelSpan, + attributes + }); + case "chain": return new LangfuseChain({ + otelSpan, + attributes + }); + case "retriever": return new LangfuseRetriever({ + otelSpan, + attributes + }); + case "evaluator": return new LangfuseEvaluator({ + otelSpan, + attributes + }); + case "guardrail": return new LangfuseGuardrail({ + otelSpan, + attributes + }); + case "event": return new LangfuseEvent({ + otelSpan, + attributes, + timestamp: (_a$3 = observationOptions == null ? void 0 : observationOptions.startTime) != null ? _a$3 : /* @__PURE__ */ new Date() + }); + case "span": + default: return new LangfuseSpan({ + otelSpan, + attributes + }); + } +} + +//#endregion +//#region src/utils.ts +/** Read and JSON-parse the hook payload Claude Code writes to stdin. */ +function readStdin() { + return new Promise((resolve, reject) => { + let buffer = ""; + process.stdin.setEncoding("utf-8"); + process.stdin.on("data", (chunk) => buffer += chunk); + process.stdin.on("end", () => { + const trimmed = buffer.trim(); + if (!trimmed) { + reject(/* @__PURE__ */ new Error("empty hook stdin")); + return; + } + try { + resolve(JSON.parse(trimmed)); + } catch (error) { + reject(/* @__PURE__ */ new Error(`failed to parse hook stdin: ${error instanceof Error ? error.message : String(error)}`)); + } + }); + process.stdin.once("error", reject); + }); +} +function isPrimitive(value) { + const t = typeof value; + return t === "string" || t === "number" || t === "boolean"; +} +/** Stringify a value for display, leaving strings untouched. */ +function toText(value) { + if (value == null) return ""; + if (typeof value === "string") return value; + if (isPrimitive(value)) return String(value); + try { + return JSON.stringify(value); + } catch { + return String(value); + } +} +/** Parse a Claude Code ISO 8601 timestamp (with trailing `Z`) into ms epoch. */ +function parseTimestamp(value) { + if (typeof value !== "string" || !value) return void 0; + const ms = Date.parse(value); + return Number.isFinite(ms) ? ms : void 0; +} +/** +* Truncate large text to keep traces lightweight. Returns the (possibly +* shortened) value plus metadata describing what was dropped, or `undefined` +* metadata when nothing was truncated. +*/ +function truncate(value, maxChars) { + if (value.length <= maxChars) return { text: value }; + return { + text: value.slice(0, maxChars), + meta: { + truncated: true, + originalLength: value.length + } + }; +} +/** Build a clip() that truncates long strings to `maxChars`. */ +function makeClip(maxChars) { + function clip(value) { + if (typeof value !== "string") return value; + const { text, meta: meta$2 } = truncate(value, maxChars); + return meta$2 ? `${text}\n…[truncated ${meta$2.originalLength - text.length} chars]` : text; + } + return clip; +} +let debugEnabled = false; +function setDebug(enabled) { + debugEnabled = enabled; +} +function debugLog(...args) { + if (!debugEnabled) return; + console.error("[langfuse-claude-code]", ...args); +} + +//#endregion +//#region src/parse.ts +function getMessage(row) { + return row.message && typeof row.message === "object" ? row.message : void 0; +} +function getContent(row) { + const msg = getMessage(row); + if (msg && msg.content !== void 0) return msg.content; + return row.content; +} +/** Resolve a row's role from `type` or `message.role`. */ +function getRole(row) { + if (row.type === "user" || row.type === "assistant") return row.type; + const role = getMessage(row)?.role; + if (role === "user" || role === "assistant") return role; +} +function blocks(content) { + return Array.isArray(content) ? content : []; +} +/** Concatenate the text blocks (or a plain string) of a message's content. */ +function extractText(content) { + if (typeof content === "string") return content; + return blocks(content).filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).filter(Boolean).join("\n"); +} +function getToolUses(content) { + return blocks(content).filter((b) => b.type === "tool_use"); +} +function getToolResults(content) { + return blocks(content).filter((b) => b.type === "tool_result"); +} +/** A user row is a tool-result carrier when its content holds tool_result blocks. */ +function isToolResultRow(row) { + return getRole(row) === "user" && getToolResults(getContent(row)).length > 0; +} +function getModel(row) { + const model = getMessage(row)?.model; + return typeof model === "string" && model ? model : "claude"; +} +function getMessageId(row) { + const id = getMessage(row)?.id; + return typeof id === "string" && id ? id : void 0; +} +/** Normalize Anthropic token usage to Langfuse `usageDetails` keys. */ +function getUsage(row) { + const usage = getMessage(row)?.usage; + if (!usage || typeof usage !== "object") return void 0; + const u = usage; + const details = {}; + for (const [src, dst] of [ + ["input_tokens", "input"], + ["output_tokens", "output"], + ["cache_read_input_tokens", "cache_read_input_tokens"], + ["cache_creation_input_tokens", "cache_creation_input_tokens"] + ]) { + const v = u[src]; + if (typeof v === "number" && v > 0) details[dst] = v; + } + return Object.keys(details).length > 0 ? details : void 0; +} +/** +* Group transcript rows into turns. +* +* A turn is: one user message (not a tool-result carrier), followed by the +* assistant messages it produced, plus the tool_result rows those tool calls +* resolved to (which arrive as later `user` rows). Assistant messages are +* deduped by `message.id` — Claude Code can rewrite a streaming row in place, +* and the latest copy wins — while preserving first-appearance order. +*/ +function buildTurns(rows) { + const turns = []; + let currentUser = null; + let assistantOrder = []; + let assistantLatest = /* @__PURE__ */ new Map(); + let toolResultsById = /* @__PURE__ */ new Map(); + const flush = () => { + if (currentUser === null || assistantLatest.size === 0) return; + const userText = extractText(getContent(currentUser)); + const userTimestamp = parseTimestamp(currentUser.timestamp); + const assistants = assistantOrder.map((id) => assistantLatest.get(id)).filter((m) => m !== void 0); + const steps = assistants.map((am) => { + const amContent = getContent(am); + const amTs = parseTimestamp(am.timestamp); + const toolCalls = getToolUses(amContent).map((tu) => { + const id = String(tu.id ?? ""); + const result = id ? toolResultsById.get(id) : void 0; + return { + id, + name: typeof tu.name === "string" ? tu.name : "unknown", + input: tu.input, + startTime: amTs, + endTime: result?.timestamp, + output: result?.content + }; + }); + return { + text: extractText(amContent) || void 0, + model: getModel(am), + usage: getUsage(am), + toolCalls, + timestamp: amTs + }; + }); + const lastAssistant = assistants[assistants.length - 1]; + const finalAssistantText = extractText(getContent(lastAssistant)) || void 0; + const candidateEnds = [parseTimestamp(lastAssistant.timestamp)]; + for (const tr of toolResultsById.values()) if (tr.timestamp !== void 0) candidateEnds.push(tr.timestamp); + const endTimestamp = candidateEnds.filter((t) => t !== void 0).reduce((max, t) => max === void 0 || t > max ? t : max, void 0); + turns.push({ + userText, + userTimestamp, + finalAssistantText, + endTimestamp, + steps + }); + }; + for (const row of rows) { + if (isToolResultRow(row)) { + const ts = parseTimestamp(row.timestamp); + for (const tr of getToolResults(getContent(row))) if (tr.tool_use_id) toolResultsById.set(String(tr.tool_use_id), { + content: tr.content, + timestamp: ts + }); + continue; + } + const role = getRole(row); + if (role === "user") { + flush(); + currentUser = row; + assistantOrder = []; + assistantLatest = /* @__PURE__ */ new Map(); + toolResultsById = /* @__PURE__ */ new Map(); + continue; + } + if (role === "assistant") { + if (currentUser === null) continue; + const id = getMessageId(row) ?? `noid:${assistantOrder.length}`; + if (!assistantLatest.has(id)) assistantOrder.push(id); + assistantLatest.set(id, row); + continue; + } + } + flush(); + return turns; +} + +//#endregion +//#region src/state.ts +const EMPTY_STATE = { + offset: 0, + turnCount: 0 +}; +function sidecarPath(transcriptPath) { + return `${transcriptPath}.langfuse`; +} +async function loadState(transcriptPath) { + try { + const raw = JSON.parse(await fs.readFile(sidecarPath(transcriptPath), "utf-8")); + return { + offset: Number.isFinite(raw.offset) ? Number(raw.offset) : 0, + turnCount: Number.isFinite(raw.turnCount) ? Number(raw.turnCount) : 0 + }; + } catch (error) { + if (error.code !== "ENOENT") debugLog("failed to read state sidecar; starting fresh:", error); + return { ...EMPTY_STATE }; + } +} +async function saveState(transcriptPath, state) { + try { + await fs.writeFile(sidecarPath(transcriptPath), JSON.stringify(state), "utf-8"); + } catch (error) { + debugLog("failed to write state sidecar:", error); + } +} +/** +* Read transcript rows appended since `state.offset`. +* +* Reads raw bytes from the offset to EOF, then only consumes up to the last +* complete line (the final newline). A partial trailing line — the transcript +* may still be mid-write — is left for the next invocation by not advancing the +* offset past it. If the file shrank (rotation/truncation), we restart from the +* beginning. +*/ +async function readNewRows(transcriptPath, state) { + let offset = state.offset; + let size; + try { + size = (await fs.stat(transcriptPath)).size; + } catch (error) { + debugLog("failed to stat transcript:", error); + return { + rows: [], + offset + }; + } + if (size < offset) { + debugLog(`transcript shrank (${size} < ${offset}); restarting from the beginning`); + offset = 0; + } + if (size === offset) return { + rows: [], + offset + }; + const length = size - offset; + const buffer = Buffer.alloc(length); + let fh; + try { + fh = await fs.open(transcriptPath, "r"); + await fh.read(buffer, 0, length, offset); + } catch (error) { + debugLog("failed to read transcript:", error); + return { + rows: [], + offset + }; + } finally { + await fh?.close(); + } + const lastNewline = buffer.lastIndexOf(10); + if (lastNewline < 0) return { + rows: [], + offset + }; + const complete = buffer.subarray(0, lastNewline + 1); + const newOffset = offset + complete.length; + const rows = []; + for (const raw of complete.toString("utf-8").split("\n")) { + const trimmed = raw.trim(); + if (!trimmed) continue; + try { + rows.push(JSON.parse(trimmed)); + } catch {} + } + return { + rows, + offset: newOffset + }; +} + +//#endregion +//#region src/trace.ts +/** A Date is required to backdate a span; fall back to `undefined` (= now). */ +function asDate(ts) { + return ts !== void 0 ? new Date(ts) : void 0; +} +function buildGenerationOutput(step, clip) { + const output = { role: "assistant" }; + if (step.text) output.content = clip(step.text); + if (step.toolCalls.length > 0) output.tool_calls = step.toolCalls.map((tc) => ({ + id: tc.id, + name: tc.name, + input: clip(tc.input) + })); + return Object.keys(output).length > 1 ? output : void 0; +} +function emitToolCall(tc, parent, clip, fallbackEnd) { + startObservation(`Tool: ${tc.name}`, { + input: clip(tc.input), + output: tc.output != null ? clip(toText(tc.output)) : void 0, + metadata: { + "claude.tool_id": tc.id, + "claude.tool_name": tc.name + } + }, { + asType: "tool", + startTime: asDate(tc.startTime), + parentSpanContext: parent.otelSpan.spanContext() + }).end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); +} +/** Emit a single turn as a Langfuse observation tree. */ +function emitTurn(turn, turnNum, transcriptPath, config$1) { + const clip = makeClip(config$1.max_chars); + const root = startObservation(`Claude Code - Turn ${turnNum}`, { + input: { + role: "user", + content: clip(turn.userText) + }, + output: turn.finalAssistantText != null ? { + role: "assistant", + content: clip(turn.finalAssistantText) + } : void 0, + metadata: { + "claude.source": "claude-code", + "claude.turn_number": turnNum, + "claude.transcript_path": transcriptPath, + "claude.assistant_message_count": turn.steps.length + } + }, { + asType: "span", + startTime: asDate(turn.userTimestamp) + }); + let prevTs = turn.userTimestamp; + let prevToolResults; + turn.steps.forEach((step, idx) => { + const input = idx === 0 ? { + role: "user", + content: clip(turn.userText) + } : prevToolResults ? { + role: "tool", + tool_results: prevToolResults + } : void 0; + const generation = startObservation(`Claude Generation ${idx + 1}`, { + input, + output: buildGenerationOutput(step, clip), + model: step.model, + usageDetails: step.usage, + metadata: { + "claude.step_index": idx, + "claude.tool_count": step.toolCalls.length + } + }, { + asType: "generation", + startTime: asDate(prevTs ?? step.timestamp), + parentSpanContext: root.otelSpan.spanContext() + }); + const resultTimes = []; + for (const tc of step.toolCalls) { + emitToolCall(tc, generation, clip, step.timestamp); + if (tc.endTime !== void 0) resultTimes.push(tc.endTime); + } + const genEnd = resultTimes.length > 0 ? Math.max(...resultTimes) : step.timestamp ?? prevTs; + generation.end(asDate(genEnd)); + prevToolResults = step.toolCalls.length > 0 ? step.toolCalls.map((tc) => ({ + tool_use_id: tc.id, + tool_name: tc.name, + output: tc.output != null ? clip(toText(tc.output)) : void 0 + })) : void 0; + if (resultTimes.length > 0) prevTs = Math.max(...resultTimes); + else if (step.timestamp !== void 0) prevTs = step.timestamp; + }); + root.end(asDate(turn.endTimestamp ?? prevTs ?? turn.userTimestamp)); +} +/** +* Convert the newly appended part of a Claude Code transcript into Langfuse +* traces. Each turn becomes its own trace, grouped into a Langfuse session via +* the Claude Code session id. State is tracked in a sidecar so each turn is +* uploaded exactly once. +*/ +async function convertTranscript(transcriptPath, sessionId, config$1) { + const state = await loadState(transcriptPath); + const { rows, offset } = await readNewRows(transcriptPath, state); + if (rows.length === 0) { + debugLog("no new transcript rows to process"); + await saveState(transcriptPath, { + ...state, + offset + }); + return; + } + const turns = buildTurns(rows); + debugLog(`parsed ${turns.length} new turn(s) from ${transcriptPath}`); + let emitted = 0; + for (const turn of turns) { + const turnNum = state.turnCount + emitted + 1; + try { + await propagateAttributes({ + sessionId, + traceName: `Claude Code - Turn ${turnNum}`, + tags: ["claude-code", ...config$1.tags ?? []], + ...config$1.user_id ? { userId: config$1.user_id } : {}, + ...config$1.metadata ? { metadata: config$1.metadata } : {} + }, async () => { + emitTurn(turn, turnNum, transcriptPath, config$1); + }); + emitted += 1; + } catch (error) { + debugLog(`failed to emit turn ${turnNum}:`, error); + if (config$1.fail_on_error) throw error; + } + } + await saveState(transcriptPath, { + offset, + turnCount: state.turnCount + emitted + }); +} + +//#endregion +//#region src/index.ts +let failOnError = process.env.CC_LANGFUSE_FAIL_ON_ERROR === "true"; +/** +* Entry point for the Claude Code `Stop` hook. +* +* Claude Code pipes a JSON payload to stdin after every turn. We resolve +* config, bail out unless Langfuse credentials are present, then convert the +* newly appended transcript rows into Langfuse traces. +* +* The hook fails open: any error is logged (in debug mode) and swallowed so a +* tracing problem never blocks the Claude Code session. Set +* `CC_LANGFUSE_FAIL_ON_ERROR=true` while testing if you want Claude Code to +* report hook failures instead. +*/ +async function runHook() { + let hookInput; + try { + hookInput = await readStdin(); + } catch { + return; + } + const cwd = hookInput.cwd; + const config$1 = await getConfig(cwd ? { cwd } : void 0); + setDebug(config$1.debug); + failOnError = config$1.fail_on_error; + if (!config$1.public_key || !config$1.secret_key) { + debugLog("missing LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY; skipping"); + return; + } + const sessionId = hookInput.session_id ?? hookInput.sessionId; + const transcriptPath = hookInput.transcript_path ?? hookInput.transcriptPath; + if (!sessionId || !transcriptPath) { + debugLog("hook payload missing session_id or transcript_path; skipping"); + return; + } + const instrumentation = setupInstrumentation(config$1); + try { + await convertTranscript(transcriptPath, sessionId, config$1); + } catch (error) { + debugLog("failed to convert transcript:", error); + if (config$1.fail_on_error) throw error; + } finally { + try { + await instrumentation.shutdown(); + } catch (error) { + debugLog("error during flush/shutdown:", error); + if (config$1.fail_on_error) throw error; + } + } +} +runHook().catch((error) => { + if (process.env.CC_LANGFUSE_DEBUG === "true") console.error("[langfuse-claude-code] fatal:", error); + if (failOnError) process.exitCode = 1; +}); + +//#endregion +export { runHook }; \ No newline at end of file diff --git a/hooks/hooks.json b/hooks/hooks.json index 13058d2..6158364 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -5,7 +5,8 @@ "hooks": [ { "type": "command", - "command": "python3 \"${CLAUDE_PLUGIN_ROOT}\"/hooks/langfuse_hook.py" + "command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/index.mjs\"", + "timeout": 30 } ] } diff --git a/hooks/langfuse_hook.py b/hooks/langfuse_hook.py deleted file mode 100644 index ba1a60d..0000000 --- a/hooks/langfuse_hook.py +++ /dev/null @@ -1,783 +0,0 @@ -#!/usr/bin/env python3 -""" -Claude Code -> Langfuse hook - -""" - -import json -import logging -import os -import sys -import threading -import time -import hashlib -from dataclasses import dataclass -from datetime import datetime, timedelta, timezone -from logging.handlers import RotatingFileHandler -from pathlib import Path -from typing import Any, Dict, List, Optional, Tuple - -# --- Langfuse import (fail-open) --- -try: - from langfuse import Langfuse, propagate_attributes - from opentelemetry import trace as otel_trace_api -except Exception: - sys.exit(0) - -# --- Paths --- -STATE_DIR = Path.home() / ".claude" / "state" -LOG_FILE = STATE_DIR / "langfuse_hook.log" -STATE_FILE = STATE_DIR / "langfuse_state.json" -LOCK_FILE = STATE_DIR / "langfuse_state.lock" - -def _opt(name: str) -> str: - """Read a plugin userConfig value (CLAUDE_PLUGIN_OPTION_) with a fallback to a plain env var.""" - return os.environ.get(f"CLAUDE_PLUGIN_OPTION_{name}") or os.environ.get(name) or "" - -DEBUG = _opt("CC_LANGFUSE_DEBUG").lower() == "true" -try: - MAX_CHARS = int(_opt("CC_LANGFUSE_MAX_CHARS") or "20000") -except ValueError: - MAX_CHARS = 20000 - -# ----------------- Logging ----------------- -_logger: Optional[logging.Logger] = None - -def _get_logger() -> Optional[logging.Logger]: - global _logger - if _logger is not None: - return _logger - try: - STATE_DIR.mkdir(parents=True, exist_ok=True) - lg = logging.getLogger("langfuse_hook") - lg.setLevel(logging.DEBUG if DEBUG else logging.INFO) - if not lg.handlers: - h = RotatingFileHandler(str(LOG_FILE), maxBytes=5_000_000, backupCount=3) - h.setFormatter(logging.Formatter( - "%(asctime)s [%(levelname)s] %(message)s", - datefmt="%Y-%m-%d %H:%M:%S", - )) - lg.addHandler(h) - _logger = lg - return _logger - except Exception: - return None - -def debug(msg: str) -> None: - if not DEBUG: - return - lg = _get_logger() - if lg is not None: - try: - lg.debug(msg) - except Exception: - pass - -def info(msg: str) -> None: - lg = _get_logger() - if lg is not None: - try: - lg.info(msg) - except Exception: - pass - -# ----------------- State locking (best-effort) ----------------- -class FileLock: - def __init__(self, path: Path, timeout_s: float = 2.0): - self.path = path - self.timeout_s = timeout_s - self._fh = None - - def __enter__(self): - STATE_DIR.mkdir(parents=True, exist_ok=True) - self._fh = open(self.path, "a+", encoding="utf-8") - self.acquired = False - try: - import fcntl # Unix only - except ImportError: - # No fcntl available (e.g. Windows) — proceed without lock. - return self - deadline = time.time() + self.timeout_s - try: - while True: - try: - fcntl.flock(self._fh.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB) - self.acquired = True - return self - except BlockingIOError: - if time.time() > deadline: - raise TimeoutError( - f"could not acquire {self.path} within {self.timeout_s}s" - ) - time.sleep(0.05) - except BaseException: - # __exit__ is not called when __enter__ raises — close the fh - # we just opened so it doesn't leak. - try: - self._fh.close() - except Exception: - pass - raise - - def __exit__(self, exc_type, exc, tb): - try: - import fcntl - fcntl.flock(self._fh.fileno(), fcntl.LOCK_UN) - except Exception: - pass - try: - self._fh.close() - except Exception: - pass - -def load_state() -> Dict[str, Any]: - try: - if not STATE_FILE.exists(): - return {} - return json.loads(STATE_FILE.read_text(encoding="utf-8")) - except Exception: - return {} - -def save_state(state: Dict[str, Any]) -> None: - try: - # Drop session entries older than 30 days to keep the file bounded. - cutoff = datetime.now(timezone.utc) - timedelta(days=30) - for k in list(state.keys()): - entry = state.get(k) - if not isinstance(entry, dict): - continue - updated = entry.get("updated") - if not isinstance(updated, str): - continue - try: - ts = datetime.fromisoformat(updated.replace("Z", "+00:00")) - except Exception: - continue - if ts < cutoff: - del state[k] - STATE_DIR.mkdir(parents=True, exist_ok=True) - tmp = STATE_FILE.with_suffix(".tmp") - tmp.write_text(json.dumps(state, indent=2, sort_keys=True), encoding="utf-8") - os.replace(tmp, STATE_FILE) - except Exception as e: - debug(f"save_state failed: {e}") - -def state_key(session_id: str, transcript_path: str) -> str: - # stable key even if session_id collides - raw = f"{session_id}::{transcript_path}" - return hashlib.sha256(raw.encode("utf-8")).hexdigest() - -# ----------------- Hook payload ----------------- -def read_hook_payload() -> Dict[str, Any]: - """ - Claude Code hooks pass a JSON payload on stdin. - This script tolerates missing/empty stdin by returning {}. - """ - try: - data = sys.stdin.read() - debug(f"stdin received {len(data)} chars") - if not data.strip(): - return {} - parsed = json.loads(data) - if isinstance(parsed, dict): - debug(f"payload top-level keys: {sorted(parsed.keys())}") - return parsed - except Exception as e: - debug(f"read_hook_payload exception: {e!r}") - return {} - -def extract_session_and_transcript(payload: Dict[str, Any]) -> Tuple[Optional[str], Optional[Path]]: - """ - Tries a few plausible field names; exact keys can vary across hook types/versions. - Prefer structured values from stdin over heuristics. - """ - session_id = ( - payload.get("sessionId") - or payload.get("session_id") - or payload.get("session", {}).get("id") - ) - - transcript = ( - payload.get("transcriptPath") - or payload.get("transcript_path") - or payload.get("transcript", {}).get("path") - ) - - if transcript: - try: - transcript_path = Path(transcript).expanduser().resolve() - except Exception: - transcript_path = None - else: - transcript_path = None - - return session_id, transcript_path - -# ----------------- Transcript parsing helpers ----------------- -def get_content(msg: Dict[str, Any]) -> Any: - if not isinstance(msg, dict): - return None - if "message" in msg and isinstance(msg.get("message"), dict): - return msg["message"].get("content") - return msg.get("content") - -def get_role(msg: Dict[str, Any]) -> Optional[str]: - # Claude Code transcript lines commonly have type=user/assistant OR message.role - t = msg.get("type") - if t in ("user", "assistant"): - return t - m = msg.get("message") - if isinstance(m, dict): - r = m.get("role") - if r in ("user", "assistant"): - return r - return None - -def is_tool_result(msg: Dict[str, Any]) -> bool: - role = get_role(msg) - if role != "user": - return False - content = get_content(msg) - if isinstance(content, list): - return any(isinstance(x, dict) and x.get("type") == "tool_result" for x in content) - return False - -def iter_tool_results(content: Any) -> List[Dict[str, Any]]: - out: List[Dict[str, Any]] = [] - if isinstance(content, list): - for x in content: - if isinstance(x, dict) and x.get("type") == "tool_result": - out.append(x) - return out - -def iter_tool_uses(content: Any) -> List[Dict[str, Any]]: - out: List[Dict[str, Any]] = [] - if isinstance(content, list): - for x in content: - if isinstance(x, dict) and x.get("type") == "tool_use": - out.append(x) - return out - -def extract_text(content: Any) -> str: - if isinstance(content, str): - return content - if isinstance(content, list): - parts: List[str] = [] - for x in content: - if isinstance(x, dict) and x.get("type") == "text": - parts.append(x.get("text", "")) - elif isinstance(x, str): - parts.append(x) - return "\n".join([p for p in parts if p]) - return "" - -def truncate_text(s: str, max_chars: int = MAX_CHARS) -> Tuple[str, Dict[str, Any]]: - if s is None: - return "", {"truncated": False, "orig_len": 0} - orig_len = len(s) - if orig_len <= max_chars: - return s, {"truncated": False, "orig_len": orig_len} - head = s[:max_chars] - return head, {"truncated": True, "orig_len": orig_len, "kept_len": len(head), "sha256": hashlib.sha256(s.encode("utf-8")).hexdigest()} - -def get_model(msg: Dict[str, Any]) -> str: - m = msg.get("message") - if isinstance(m, dict): - return m.get("model") or "claude" - return "claude" - -def get_usage(msg: Dict[str, Any]) -> Optional[Dict[str, int]]: - """Extract Anthropic token usage from an assistant message, if present.""" - m = msg.get("message") - if not isinstance(m, dict): - return None - u = m.get("usage") - if not isinstance(u, dict): - return None - details: Dict[str, int] = {} - for src, dst in ( - ("input_tokens", "input"), - ("output_tokens", "output"), - ("cache_read_input_tokens", "cache_read_input_tokens"), - ("cache_creation_input_tokens", "cache_creation_input_tokens"), - ): - v = u.get(src) - if isinstance(v, int) and v > 0: - details[dst] = v - return details or None - -def get_message_id(msg: Dict[str, Any]) -> Optional[str]: - m = msg.get("message") - if isinstance(m, dict): - mid = m.get("id") - if isinstance(mid, str) and mid: - return mid - return None - -def parse_ts(value: Any) -> Optional[datetime]: - """Parse a Claude Code jsonl row timestamp (ISO 8601 with trailing Z).""" - if isinstance(value, dict): - value = value.get("timestamp") - if not isinstance(value, str) or not value: - return None - try: - return datetime.fromisoformat(value.replace("Z", "+00:00")) - except Exception: - return None - -# ----------------- Incremental reader ----------------- -@dataclass -class SessionState: - offset: int = 0 - buffer: str = "" - turn_count: int = 0 - -def load_session_state(global_state: Dict[str, Any], key: str) -> SessionState: - s = global_state.get(key, {}) - return SessionState( - offset=int(s.get("offset", 0)), - buffer=str(s.get("buffer", "")), - turn_count=int(s.get("turn_count", 0)), - ) - -def write_session_state(global_state: Dict[str, Any], key: str, ss: SessionState) -> None: - global_state[key] = { - "offset": ss.offset, - "buffer": ss.buffer, - "turn_count": ss.turn_count, - "updated": datetime.now(timezone.utc).isoformat(), - } - -def read_new_jsonl(transcript_path: Path, ss: SessionState) -> Tuple[List[Dict[str, Any]], SessionState]: - """ - Reads only new bytes since ss.offset. Keeps ss.buffer for partial last line. - Returns parsed JSON lines (best-effort) and updated state. - """ - if not transcript_path.exists(): - return [], ss - - try: - file_size = transcript_path.stat().st_size - if file_size < ss.offset: - # Transcript was rotated or truncated — restart from the beginning. - debug(f"transcript shrank ({file_size} < {ss.offset}); restarting") - ss.offset = 0 - ss.buffer = "" - with open(transcript_path, "rb") as f: - f.seek(ss.offset) - chunk = f.read() - new_offset = f.tell() - except Exception as e: - debug(f"read_new_jsonl failed: {e}") - return [], ss - - if not chunk: - return [], ss - - try: - text = chunk.decode("utf-8", errors="replace") - except Exception: - text = chunk.decode(errors="replace") - - combined = ss.buffer + text - lines = combined.split("\n") - # last element may be incomplete - ss.buffer = lines[-1] - ss.offset = new_offset - - msgs: List[Dict[str, Any]] = [] - for line in lines[:-1]: - line = line.strip() - if not line: - continue - try: - msgs.append(json.loads(line)) - except Exception: - continue - - return msgs, ss - -# ----------------- Turn assembly ----------------- -@dataclass -class Turn: - user_msg: Dict[str, Any] - assistant_msgs: List[Dict[str, Any]] - tool_results_by_id: Dict[str, Any] - -def build_turns(messages: List[Dict[str, Any]]) -> List[Turn]: - """ - Groups incremental transcript rows into turns: - user (non-tool-result) -> assistant messages -> (tool_result rows, possibly interleaved) - Uses: - - assistant message dedupe by message.id (latest row wins) - - tool results dedupe by tool_use_id (latest wins) - """ - turns: List[Turn] = [] - current_user: Optional[Dict[str, Any]] = None - - # assistant messages for current turn: - assistant_order: List[str] = [] # message ids in order of first appearance (or synthetic) - assistant_latest: Dict[str, Dict[str, Any]] = {} # id -> latest msg - - tool_results_by_id: Dict[str, Any] = {} # tool_use_id -> content - - def flush_turn(): - nonlocal current_user, assistant_order, assistant_latest, tool_results_by_id, turns - if current_user is None: - return - if not assistant_latest: - return - assistants = [assistant_latest[mid] for mid in assistant_order if mid in assistant_latest] - turns.append(Turn(user_msg=current_user, assistant_msgs=assistants, tool_results_by_id=dict(tool_results_by_id))) - - for msg in messages: - role = get_role(msg) - - # tool_result rows show up as role=user with content blocks of type tool_result - if is_tool_result(msg): - row_ts = msg.get("timestamp") - for tr in iter_tool_results(get_content(msg)): - tid = tr.get("tool_use_id") - if tid: - tool_results_by_id[str(tid)] = {"content": tr.get("content"), "timestamp": row_ts} - continue - - if role == "user": - # new user message -> finalize previous turn - flush_turn() - - # start a new turn - current_user = msg - assistant_order = [] - assistant_latest = {} - tool_results_by_id = {} - continue - - if role == "assistant": - if current_user is None: - # ignore assistant rows until we see a user message - continue - - mid = get_message_id(msg) or f"noid:{len(assistant_order)}" - if mid not in assistant_latest: - assistant_order.append(mid) - assistant_latest[mid] = msg - continue - - # ignore unknown rows - - # flush last - flush_turn() - return turns - -# ----------------- Langfuse emit ----------------- -def _to_ns(ts: Optional[datetime]) -> Optional[int]: - """Convert a datetime to OTel-style nanoseconds since epoch.""" - if ts is None: - return None - return int(ts.timestamp() * 1_000_000_000) - - -def _start_backdated(langfuse: Langfuse, *, name: str, as_type: str, - start_time: Optional[datetime], - parent_otel_span: Any = None, - **obs_kwargs: Any) -> Any: - """Create a Langfuse observation with an explicit OTel start_time. - - Bypasses langfuse.start_observation() (which has no start_time kwarg in - SDK 4.x) by talking to the underlying OTel tracer directly and then - wrapping the resulting span with the Langfuse observation type. - - Depends on SDK 4.x internals: langfuse._otel_tracer and - langfuse._create_observation_from_otel_span. If a future SDK version - renames or removes these, raise a clear error instead of letting an - AttributeError get swallowed by the broad emit_turn handler. - """ - if not hasattr(langfuse, "_otel_tracer") or not hasattr(langfuse, "_create_observation_from_otel_span"): - try: - sdk_version = getattr(__import__("langfuse"), "__version__", "unknown") - except Exception: - sdk_version = "unknown" - raise RuntimeError( - f"Langfuse SDK {sdk_version} is missing _otel_tracer or " - f"_create_observation_from_otel_span. This hook targets SDK 4.x; " - f"pin with `pip install \"langfuse>=4.0,<5\"` or update the hook script." - ) - start_ns = _to_ns(start_time) - if parent_otel_span is not None: - with otel_trace_api.use_span(parent_otel_span, end_on_exit=False): - otel_span = langfuse._otel_tracer.start_span(name=name, start_time=start_ns) - else: - otel_span = langfuse._otel_tracer.start_span(name=name, start_time=start_ns) - return langfuse._create_observation_from_otel_span( - otel_span=otel_span, - as_type=as_type, - **obs_kwargs, - ) - - -def emit_turn(langfuse: Langfuse, session_id: str, turn_num: int, turn: Turn, transcript_path: Path) -> None: - user_text_raw = extract_text(get_content(turn.user_msg)) - user_text, user_text_meta = truncate_text(user_text_raw) - - last_assistant = turn.assistant_msgs[-1] - final_assistant_text, _ = truncate_text(extract_text(get_content(last_assistant))) - - user_ts = parse_ts(turn.user_msg) - last_assistant_ts = parse_ts(last_assistant) - # Pick a turn end_time: latest among final assistant message or any tool result - candidate_end_ts = [t for t in [last_assistant_ts] if t is not None] - for tr in turn.tool_results_by_id.values(): - t = parse_ts(tr) - if t is not None: - candidate_end_ts.append(t) - turn_end_ts = max(candidate_end_ts) if candidate_end_ts else None - - with propagate_attributes( - session_id=session_id, - trace_name=f"Claude Code - Turn {turn_num}", - tags=["claude-code"], - ): - trace_span = _start_backdated( - langfuse, - name=f"Claude Code - Turn {turn_num}", - as_type="span", - start_time=user_ts, - input={"role": "user", "content": user_text}, - metadata={ - "source": "claude-code", - "session_id": session_id, - "turn_number": turn_num, - "transcript_path": str(transcript_path), - "user_text": user_text_meta, - "assistant_message_count": len(turn.assistant_msgs), - }, - ) - parent_otel_span = trace_span._otel_span - - # Iterate each assistant message: emit generation, then its tool_use children. - # prev_ts = the moment the next generation could have started (= when the previous - # batch of tool results all returned, or the original user message timestamp). - prev_ts = user_ts - prev_tool_results: List[Dict[str, Any]] = [] # populated after each batch, surfaced as next gen's input - - for idx, am in enumerate(turn.assistant_msgs): - am_ts = parse_ts(am) - am_text_raw = extract_text(get_content(am)) - am_text, am_text_meta = truncate_text(am_text_raw) - model = get_model(am) - tool_uses = iter_tool_uses(get_content(am)) - - # Build generation input: user message for first generation, otherwise tool results from - # the prior batch (best partial reconstruction of the prompt context). - if idx == 0: - gen_input: Any = {"role": "user", "content": user_text} - elif prev_tool_results: - gen_input = {"role": "tool", "tool_results": prev_tool_results} - else: - gen_input = None - - # Build generation output: include both the text response and any tool calls the LLM - # decided to make. Most assistant messages in tool-using turns are tool-call-only, so - # without tool_calls in the output, the observation looks empty. - gen_tool_calls = [] - for tu in tool_uses: - tu_input = tu.get("input") - if isinstance(tu_input, str): - tu_input_serialized, _ = truncate_text(tu_input) - else: - tu_input_serialized = tu_input - gen_tool_calls.append({ - "id": tu.get("id"), - "name": tu.get("name"), - "input": tu_input_serialized, - }) - - gen_output: Dict[str, Any] = {"role": "assistant"} - if am_text: - gen_output["content"] = am_text - if gen_tool_calls: - gen_output["tool_calls"] = gen_tool_calls - - gen_kwargs: Dict[str, Any] = dict( - model=model, - input=gen_input, - output=gen_output, - metadata={ - "assistant_index": idx, - "assistant_text": am_text_meta, - "tool_count": len(tool_uses), - }, - ) - usage_details = get_usage(am) - if usage_details is not None: - gen_kwargs["usage_details"] = usage_details - - gen_span = _start_backdated( - langfuse, - name=f"Claude Generation {idx + 1}", - as_type="generation", - start_time=prev_ts or am_ts, - parent_otel_span=parent_otel_span, - **gen_kwargs, - ) - - # Tool observations: nested under this generation. Each starts when the assistant - # emitted the tool_use (am_ts) and ends when its tool_result row arrived. - batch_result_ts: List[datetime] = [] - batch_tool_results: List[Dict[str, Any]] = [] - for tu in tool_uses: - tid = str(tu.get("id") or "") - tname = tu.get("name") or "unknown" - tinput_raw = tu.get("input") if isinstance(tu.get("input"), (dict, list, str, int, float, bool)) else {} - if isinstance(tinput_raw, str): - tinput, tinput_meta = truncate_text(tinput_raw) - else: - tinput, tinput_meta = tinput_raw, None - - tr_entry = turn.tool_results_by_id.get(tid) if tid else None - if tr_entry: - out_raw = tr_entry.get("content") - out_str = out_raw if isinstance(out_raw, str) else json.dumps(out_raw, ensure_ascii=False) - out_trunc, out_meta = truncate_text(out_str) - tr_ts = parse_ts(tr_entry.get("timestamp")) - else: - out_trunc, out_meta, tr_ts = None, None, None - if tr_ts is not None: - batch_result_ts.append(tr_ts) - - tool_span = _start_backdated( - langfuse, - name=f"Tool: {tname}", - as_type="tool", - start_time=am_ts, - parent_otel_span=gen_span._otel_span, - input=tinput, - metadata={ - "tool_name": tname, - "tool_id": tid, - "input_meta": tinput_meta, - "output_meta": out_meta, - }, - ) - tool_span.update(output=out_trunc) - tool_span.end(end_time=_to_ns(tr_ts or am_ts)) - - batch_tool_results.append({ - "tool_use_id": tid, - "tool_name": tname, - "output": out_trunc, - }) - - # End the generation AFTER its tools so the timeline cleanly contains them. - # If there were tool calls, gen ends with the last result; otherwise at am_ts. - gen_end_ts = max(batch_result_ts) if batch_result_ts else am_ts - gen_span.end(end_time=_to_ns(gen_end_ts or am_ts or prev_ts)) - - # Carry this batch's results into the next generation's input. - prev_tool_results = batch_tool_results - - # Advance prev_ts: next generation can only start after this batch's tool results returned. - if batch_result_ts: - prev_ts = max(batch_result_ts) - elif am_ts is not None: - prev_ts = am_ts - - trace_span.update(output={"role": "assistant", "content": final_assistant_text}) - trace_span.end(end_time=_to_ns(turn_end_ts or last_assistant_ts or user_ts)) - -# ----------------- Main ----------------- -def main() -> int: - start = time.time() - debug("Hook started") - - public_key = _opt("LANGFUSE_PUBLIC_KEY") or _opt("CC_LANGFUSE_PUBLIC_KEY") - secret_key = _opt("LANGFUSE_SECRET_KEY") or _opt("CC_LANGFUSE_SECRET_KEY") - host = _opt("LANGFUSE_BASE_URL") or _opt("CC_LANGFUSE_BASE_URL") or "https://us.cloud.langfuse.com" - - if not public_key or not secret_key: - return 0 - - payload = read_hook_payload() - session_id, transcript_path = extract_session_and_transcript(payload) - - if not session_id or not transcript_path: - # No structured payload; fail open (do not guess) - debug("Missing session_id or transcript_path from hook payload; exiting.") - return 0 - - if not transcript_path.exists(): - debug(f"Transcript path does not exist: {transcript_path}") - return 0 - - langfuse = None - try: - langfuse = Langfuse(public_key=public_key, secret_key=secret_key, host=host) - except Exception: - return 0 - - try: - with FileLock(LOCK_FILE): - state = load_state() - key = state_key(session_id, str(transcript_path)) - ss = load_session_state(state, key) - - msgs, ss = read_new_jsonl(transcript_path, ss) - if not msgs: - write_session_state(state, key, ss) - save_state(state) - return 0 - - turns = build_turns(msgs) - if not turns: - write_session_state(state, key, ss) - save_state(state) - return 0 - - # emit turns - emitted = 0 - for t in turns: - emitted += 1 - turn_num = ss.turn_count + emitted - try: - emit_turn(langfuse, session_id, turn_num, t, transcript_path) - except Exception as e: - # Log at INFO so SDK incompatibilities (and other emit failures) - # are visible without needing CC_LANGFUSE_DEBUG=true. - info(f"emit_turn failed: {type(e).__name__}: {e}") - # continue emitting other turns - - ss.turn_count += emitted - write_session_state(state, key, ss) - save_state(state) - - dur = time.time() - start - info(f"Processed {emitted} turns in {dur:.2f}s (session={session_id})") - return 0 - - except TimeoutError as e: - debug(f"lock timeout, skipping: {e}") - return 0 - - except Exception as e: - debug(f"Unexpected failure: {e}") - return 0 - - finally: - # Cap flush+shutdown at 5s so a slow/unreachable Langfuse can't stall Claude Code. - if langfuse is not None: - try: - def _flush_and_shutdown(): - try: - langfuse.flush() - except Exception: - pass - langfuse.shutdown() - t = threading.Thread(target=_flush_and_shutdown, daemon=True) - t.start() - t.join(5.0) - except Exception: - pass - -if __name__ == "__main__": - sys.exit(main()) diff --git a/package.json b/package.json new file mode 100644 index 0000000..d139cf0 --- /dev/null +++ b/package.json @@ -0,0 +1,56 @@ +{ + "name": "@langfuse/claude-observability-plugin", + "version": "2.0.0", + "description": "Claude Code plugin that traces sessions, turns, generations, and tool calls to Langfuse", + "keywords": [ + "claude-code", + "claude", + "anthropic", + "langfuse", + "observability", + "tracing", + "opentelemetry" + ], + "homepage": "https://langfuse.com/integrations/other/claude-code", + "bugs": { + "url": "https://github.com/langfuse/Claude-Observability-Plugin/issues" + }, + "license": "MIT", + "author": "Langfuse", + "repository": { + "type": "git", + "url": "https://github.com/langfuse/Claude-Observability-Plugin.git" + }, + "type": "module", + "scripts": { + "build": "tsdown --config tsdown.config.ts", + "test": "vitest run", + "test:watch": "vitest", + "format": "prettier --write .", + "format:check": "prettier --check .", + "lint:tsc": "tsc --noEmit", + "lint:dist": "pnpm run build && git diff --exit-code -- dist/index.mjs", + "lint": "pnpm run format:check && pnpm run lint:tsc && pnpm run lint:dist" + }, + "dependencies": { + "@langfuse/otel": "^5.4.1", + "@langfuse/tracing": "^5.4.1", + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/core": "^2.0.1", + "@opentelemetry/exporter-trace-otlp-http": "^0.205.0", + "@opentelemetry/sdk-trace-base": "^2.0.1", + "@opentelemetry/sdk-trace-node": "^2.0.1", + "zod": "^4.1.13" + }, + "devDependencies": { + "@types/node": "^22.10.0", + "prettier": "^3.4.2", + "tsdown": "^0.18.0", + "typescript": "^5.7.2", + "vitest": "^4.0.0" + }, + "engines": { + "node": ">=20" + }, + "packageManager": "pnpm@10.33.0" +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..4a4a4d7 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1743 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@langfuse/otel': + specifier: ^5.4.1 + version: 5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1)) + '@langfuse/tracing': + specifier: ^5.4.1 + version: 5.4.1(@opentelemetry/api@1.9.1) + '@opentelemetry/api': + specifier: ^1.9.0 + version: 1.9.1 + '@opentelemetry/core': + specifier: ^2.0.1 + version: 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-trace-otlp-http': + specifier: ^0.205.0 + version: 0.205.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': + specifier: ^2.0.1 + version: 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-node': + specifier: ^2.0.1 + version: 2.7.1(@opentelemetry/api@1.9.1) + zod: + specifier: ^4.1.13 + version: 4.4.3 + devDependencies: + '@types/node': + specifier: ^22.10.0 + version: 22.19.20 + prettier: + specifier: ^3.4.2 + version: 3.8.3 + tsdown: + specifier: ^0.18.0 + version: 0.18.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(typescript@5.9.3) + typescript: + specifier: ^5.7.2 + version: 5.9.3 + vitest: + specifier: ^4.0.0 + version: 4.1.8(@opentelemetry/api@1.9.1)(@types/node@22.19.20)(vite@8.0.16(@types/node@22.19.20)) + +packages: + + '@babel/generator@7.29.7': + resolution: {integrity: sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.29.7': + resolution: {integrity: sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/types@7.29.7': + resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==} + engines: {node: '>=6.9.0'} + + '@emnapi/core@1.10.0': + resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} + + '@emnapi/runtime@1.10.0': + resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} + + '@emnapi/wasi-threads@1.2.1': + resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} + + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@langfuse/core@5.4.1': + resolution: {integrity: sha512-TjaRTr9fGqaWuyYKFSezKxN4DWAaK/lq//hRMw8rQKFkZUs6vTgUODxqZTFTR6np5VnLVw+eZLlnHROPKbXqdg==} + peerDependencies: + '@opentelemetry/api': ^1.9.0 + + '@langfuse/otel@5.4.1': + resolution: {integrity: sha512-w69aVC2fTmd7hyCTaX8zhhivHlsGVgZ551XOf6yMSOi3k8tlDML4dinnjJUP/6qTvdH54NYcmAIp5KZRbkouxg==} + engines: {node: '>=20'} + peerDependencies: + '@opentelemetry/api': ^1.9.0 + '@opentelemetry/core': ^2.0.1 + '@opentelemetry/exporter-trace-otlp-http': '>=0.202.0 <1.0.0' + '@opentelemetry/sdk-trace-base': ^2.0.1 + + '@langfuse/tracing@5.4.1': + resolution: {integrity: sha512-nPyoPXXNMaJgaUZgIE0haWI/hrT7l4r/irp0o/FGaBYR2V07EFNvSKFcqOsX1pQvVvB6HyfNlYQm7AoQJj+fqQ==} + engines: {node: '>=20'} + peerDependencies: + '@opentelemetry/api': ^1.9.0 + + '@napi-rs/wasm-runtime@1.1.4': + resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + + '@opentelemetry/api-logs@0.205.0': + resolution: {integrity: sha512-wBlPk1nFB37Hsm+3Qy73yQSobVn28F4isnWIBvKpd5IUH/eat8bwcL02H9yzmHyyPmukeccSl2mbN5sDQZYnPg==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/api@1.9.1': + resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/context-async-hooks@2.7.1': + resolution: {integrity: sha512-OPFBYuXEn1E4ja3Y6eeA7O+ZnLBNcXTV5Cgsn1VaqBZ6hC5FnpZPLBNme1LJY8ZtF4aOujPKFoeWN4ik487KuQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/core@2.1.0': + resolution: {integrity: sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/core@2.7.1': + resolution: {integrity: sha512-QAqIj32AtK6+pEVNG7EOVxHdE06RP+FM5qpiEJ4RtDcFIqKUZHYhl7/7UY5efhwmwNAg7j8QbJVBLxMerc0+gw==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/exporter-trace-otlp-http@0.205.0': + resolution: {integrity: sha512-vr2bwwPCSc9u7rbKc74jR+DXFvyMFQo9o5zs+H/fgbK672Whw/1izUKVf+xfWOdJOvuwTnfWxy+VAY+4TSo74Q==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/otlp-exporter-base@0.205.0': + resolution: {integrity: sha512-2MN0C1IiKyo34M6NZzD6P9Nv9Dfuz3OJ3rkZwzFmF6xzjDfqqCTatc9v1EpNfaP55iDOCLHFyYNCgs61FFgtUQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/otlp-transformer@0.205.0': + resolution: {integrity: sha512-KmObgqPtk9k/XTlWPJHdMbGCylRAmMJNXIRh6VYJmvlRDMfe+DonH41G7eenG8t4FXn3fxOGh14o/WiMRR6vPg==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/resources@2.1.0': + resolution: {integrity: sha512-1CJjf3LCvoefUOgegxi8h6r4B/wLSzInyhGP2UmIBYNlo4Qk5CZ73e1eEyWmfXvFtm1ybkmfb2DqWvspsYLrWw==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/resources@2.7.1': + resolution: {integrity: sha512-DeT6KKolmC4e/dRQvMQ/RwlnzhaqeiFOXY5ngoOPJ07GgVVKxZOg9EcrNZb5aTzUn+iCrJldAgOfQm1O/QfPAQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/sdk-logs@0.205.0': + resolution: {integrity: sha512-nyqhNQ6eEzPWQU60Nc7+A5LIq8fz3UeIzdEVBQYefB4+msJZ2vuVtRuk9KxPMw1uHoHDtYEwkr2Ct0iG29jU8w==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.4.0 <1.10.0' + + '@opentelemetry/sdk-metrics@2.1.0': + resolution: {integrity: sha512-J9QX459mzqHLL9Y6FZ4wQPRZG4TOpMCyPOh6mkr/humxE1W2S3Bvf4i75yiMW9uyed2Kf5rxmLhTm/UK8vNkAw==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.9.0 <1.10.0' + + '@opentelemetry/sdk-trace-base@2.1.0': + resolution: {integrity: sha512-uTX9FBlVQm4S2gVQO1sb5qyBLq/FPjbp+tmGoxu4tIgtYGmBYB44+KX/725RFDe30yBSaA9Ml9fqphe1hbUyLQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/sdk-trace-base@2.7.1': + resolution: {integrity: sha512-NAYIlsF8MPUsKqJMiDQJTMPOmlbawC1Iz/omMLygZ1C9am8fTKYjTaI+OZM+WTY3t3Glo0wnOg/6/pac6RGPPw==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/sdk-trace-node@2.7.1': + resolution: {integrity: sha512-pCpQxU68lV+I9s9svqMyVu5iHdDDUnqUpSxqwyCU8A9ejEsSnMPCbearwsUO4yk08ZJzAIUCFuReMdVQvHrdvg==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/semantic-conventions@1.41.1': + resolution: {integrity: sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==} + engines: {node: '>=14'} + + '@oxc-project/types@0.103.0': + resolution: {integrity: sha512-bkiYX5kaXWwUessFRSoXFkGIQTmc6dLGdxuRTrC+h8PSnIdZyuXHHlLAeTmOue5Br/a0/a7dHH0Gca6eXn9MKg==} + + '@oxc-project/types@0.127.0': + resolution: {integrity: sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==} + + '@oxc-project/types@0.133.0': + resolution: {integrity: sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==} + + '@protobufjs/aspromise@1.1.2': + resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} + + '@protobufjs/base64@1.1.2': + resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} + + '@protobufjs/codegen@2.0.5': + resolution: {integrity: sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==} + + '@protobufjs/eventemitter@1.1.1': + resolution: {integrity: sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==} + + '@protobufjs/fetch@1.1.1': + resolution: {integrity: sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==} + + '@protobufjs/float@1.0.2': + resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} + + '@protobufjs/inquire@1.1.2': + resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==} + + '@protobufjs/path@1.1.2': + resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} + + '@protobufjs/pool@1.1.0': + resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} + + '@protobufjs/utf8@1.1.1': + resolution: {integrity: sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==} + + '@quansync/fs@1.0.0': + resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} + + '@rolldown/binding-android-arm64@1.0.0-beta.57': + resolution: {integrity: sha512-GoOVDy8bjw9z1K30Oo803nSzXJS/vWhFijFsW3kzvZCO8IZwFnNa6pGctmbbJstKl3Fv6UBwyjJQN6msejW0IQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-android-arm64@1.0.0-rc.17': + resolution: {integrity: sha512-s70pVGhw4zqGeFnXWvAzJDlvxhlRollagdCCKRgOsgUOH3N1l0LIxf83AtGzmb5SiVM4Hjl5HyarMRfdfj3DaQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-android-arm64@1.0.3': + resolution: {integrity: sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-beta.57': + resolution: {integrity: sha512-9c4FOhRGpl+PX7zBK5p17c5efpF9aSpTPgyigv57hXf5NjQUaJOOiejPLAtFiKNBIfm5Uu6yFkvLKzOafNvlTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-arm64@1.0.0-rc.17': + resolution: {integrity: sha512-4ksWc9n0mhlZpZ9PMZgTGjeOPRu8MB1Z3Tz0Mo02eWfWCHMW1zN82Qz/pL/rC+yQa+8ZnutMF0JjJe7PjwasYw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-arm64@1.0.3': + resolution: {integrity: sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.57': + resolution: {integrity: sha512-6RsB8Qy4LnGqNGJJC/8uWeLWGOvbRL/KG5aJ8XXpSEupg/KQtlBEiFaYU/Ma5Usj1s+bt3ItkqZYAI50kSplBA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-rc.17': + resolution: {integrity: sha512-SUSDOI6WwUVNcWxd02QEBjLdY1VPHvlEkw6T/8nYG322iYWCTxRb1vzk4E+mWWYehTp7ERibq54LSJGjmouOsw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.3': + resolution: {integrity: sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.57': + resolution: {integrity: sha512-uA9kG7+MYkHTbqwv67Tx+5GV5YcKd33HCJIi0311iYBd25yuwyIqvJfBdt1VVB8tdOlyTb9cPAgfCki8nhwTQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-freebsd-x64@1.0.0-rc.17': + resolution: {integrity: sha512-hwnz3nw9dbJ05EDO/PvcjaaewqqDy7Y1rn1UO81l8iIK1GjenME75dl16ajbvSSMfv66WXSRCYKIqfgq2KCfxw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-freebsd-x64@1.0.3': + resolution: {integrity: sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': + resolution: {integrity: sha512-3KkS0cHsllT2T+Te+VZMKHNw6FPQihYsQh+8J4jkzwgvAQpbsbXmrqhkw3YU/QGRrD8qgcOvBr6z5y6Jid+rmw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': + resolution: {integrity: sha512-IS+W7epTcwANmFSQFrS1SivEXHtl1JtuQA9wlxrZTcNi6mx+FDOYrakGevvvTwgj2JvWiK8B29/qD9BELZPyXQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.3': + resolution: {integrity: sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': + resolution: {integrity: sha512-A3/wu1RgsHhqP3rVH2+sM81bpk+Qd2XaHTl8LtX5/1LNR7QVBFBCpAoiXwjTdGnI5cMdBVi7Z1pi52euW760Fw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': + resolution: {integrity: sha512-e6usGaHKW5BMNZOymS1UcEYGowQMWcgZ71Z17Sl/h2+ZziNJ1a9n3Zvcz6LdRyIW5572wBCTH/Z+bKuZouGk9Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-gnu@1.0.3': + resolution: {integrity: sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': + resolution: {integrity: sha512-d0kIVezTQtazpyWjiJIn5to8JlwfKITDqwsFv0Xc6s31N16CD2PC/Pl2OtKgS7n8WLOJbfqgIp5ixYzTAxCqMg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': + resolution: {integrity: sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-arm64-musl@1.0.3': + resolution: {integrity: sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': + resolution: {integrity: sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-ppc64-gnu@1.0.3': + resolution: {integrity: sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': + resolution: {integrity: sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.3': + resolution: {integrity: sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': + resolution: {integrity: sha512-E199LPijo98yrLjPCmETx8EF43sZf9t3guSrLee/ej1rCCc3zDVTR4xFfN9BRAapGVl7/8hYqbbiQPTkv73kUg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': + resolution: {integrity: sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.3': + resolution: {integrity: sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': + resolution: {integrity: sha512-++EQDpk/UJ33kY/BNsh7A7/P1sr/jbMuQ8cE554ZIy+tCUWCivo9zfyjDUoiMdnxqX6HLJEqqGnbGQOvzm2OMQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': + resolution: {integrity: sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-x64-musl@1.0.3': + resolution: {integrity: sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': + resolution: {integrity: sha512-voDEBcNqxbUv/GeXKFtxXVWA+H45P/8Dec4Ii/SbyJyGvCqV1j+nNHfnFUIiRQ2Q40DwPe/djvgYBs9PpETiMA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': + resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-openharmony-arm64@1.0.3': + resolution: {integrity: sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.57': + resolution: {integrity: sha512-bRhcF7NLlCnpkzLVlVhrDEd0KH22VbTPkPTbMjlYvqhSmarxNIq5vtlQS8qmV7LkPKHrNLWyJW/V/sOyFba26Q==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.17': + resolution: {integrity: sha512-LEXei6vo0E5wTGwpkJ4KoT3OZJRnglwldt5ziLzOlc6qqb55z4tWNq2A+PFqCJuvWWdP53CVhG1Z9NtToDPJrA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-wasm32-wasi@1.0.3': + resolution: {integrity: sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.57': + resolution: {integrity: sha512-rnDVGRks2FQ2hgJ2g15pHtfxqkGFGjJQUDWzYznEkE8Ra2+Vag9OffxdbJMZqBWXHVM0iS4dv8qSiEn7bO+n1Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.17': + resolution: {integrity: sha512-gUmyzBl3SPMa6hrqFUth9sVfcLBlYsbMzBx5PlexMroZStgzGqlZ26pYG89rBb45Mnia+oil6YAIFeEWGWhoZA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-arm64-msvc@1.0.3': + resolution: {integrity: sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': + resolution: {integrity: sha512-OqIUyNid1M4xTj6VRXp/Lht/qIP8fo25QyAZlCP+p6D2ATCEhyW4ZIFLnC9zAGN/HMbXoCzvwfa8Jjg/8J4YEg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': + resolution: {integrity: sha512-3hkiolcUAvPB9FLb3UZdfjVVNWherN1f/skkGWJP/fgSQhYUZpSIRr0/I8ZK9TkF3F7kxvJAk0+IcKvPHk9qQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.3': + resolution: {integrity: sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-beta.57': + resolution: {integrity: sha512-aQNelgx14tGA+n2tNSa9x6/jeoCL9fkDeCei7nOKnHx0fEFRRMu5ReiITo+zZD5TzWDGGRjbSYCs93IfRIyTuQ==} + + '@rolldown/pluginutils@1.0.0-rc.17': + resolution: {integrity: sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==} + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@tybys/wasm-util@0.10.2': + resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/node@22.19.20': + resolution: {integrity: sha512-6tELRwSDYWW9EdZhbeZmYGZ1/7Djkt+Ah3/ScEYT9cDord7UJzasR/4D3VONg9tQI5CDp+/CZC1AXj2pCFOvpw==} + + '@vitest/expect@4.1.8': + resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==} + + '@vitest/mocker@4.1.8': + resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==} + peerDependencies: + msw: ^2.4.9 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@4.1.8': + resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==} + + '@vitest/runner@4.1.8': + resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==} + + '@vitest/snapshot@4.1.8': + resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==} + + '@vitest/spy@4.1.8': + resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==} + + '@vitest/utils@4.1.8': + resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==} + + ansis@4.3.1: + resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} + engines: {node: '>=14'} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + ast-kit@2.2.0: + resolution: {integrity: sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw==} + engines: {node: '>=20.19.0'} + + birpc@4.0.0: + resolution: {integrity: sha512-LShSxJP0KTmd101b6DRyGBj57LZxSDYWKitQNW/mi8GRMvZb078Uf9+pveax1DrVL89vm7mWe+TovdI/UDOuPw==} + + cac@6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + + chai@6.2.2: + resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} + engines: {node: '>=18'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dts-resolver@2.1.3: + resolution: {integrity: sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw==} + engines: {node: '>=20.19.0'} + peerDependencies: + oxc-resolver: '>=11.0.0' + peerDependenciesMeta: + oxc-resolver: + optional: true + + empathic@2.0.1: + resolution: {integrity: sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==} + engines: {node: '>=14'} + + es-module-lexer@2.1.0: + resolution: {integrity: sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + expect-type@1.3.0: + resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} + engines: {node: '>=12.0.0'} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + get-tsconfig@4.14.0: + resolution: {integrity: sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==} + + hookable@6.1.1: + resolution: {integrity: sha512-U9LYDy1CwhMCnprUfeAZWZGByVbhd54hwepegYTK7Pi5NvqEj63ifz5z+xukznehT7i6NIZRu89Ay1AZmRsLEQ==} + + import-without-cache@0.2.5: + resolution: {integrity: sha512-B6Lc2s6yApwnD2/pMzFh/d5AVjdsDXjgkeJ766FmFuJELIGHNycKRj+l3A39yZPM4CchqNCB4RITEAYB1KUM6A==} + engines: {node: '>=20.19.0'} + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + + long@5.3.2: + resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + nanoid@3.3.12: + resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + obug@2.1.2: + resolution: {integrity: sha512-AWGB9WFcRXOQs48Z/udjI5ZcZMHXwX8XPByNpOydgcGsDLIzjGizhoMWJyKAWze7AVW/2W1i+/gPX4YtKe5cyg==} + engines: {node: '>=12.20.0'} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} + + postcss@8.5.15: + resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==} + engines: {node: ^10 || ^12 || >=14} + + prettier@3.8.3: + resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} + engines: {node: '>=14'} + hasBin: true + + protobufjs@7.6.2: + resolution: {integrity: sha512-N9EiLovGEQOJSPF26Ij7qUGvahfEnq0eeYZ02aigIedkmz1qZSwjnP9SBITHJuF/6MYbIW4HDN8zdYjsjqJKXQ==} + engines: {node: '>=12.0.0'} + + quansync@1.0.0: + resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + rolldown-plugin-dts@0.20.0: + resolution: {integrity: sha512-cLAY1kN2ilTYMfZcFlGWbXnu6Nb+8uwUBsi+Mjbh4uIx7IN8uMOmJ7RxrrRgPsO4H7eSz3E+JwGoL1gyugiyUA==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@ts-macro/tsc': ^0.3.6 + '@typescript/native-preview': '>=7.0.0-dev.20250601.1' + rolldown: ^1.0.0-beta.57 + typescript: ^5.0.0 + vue-tsc: ~3.2.0 + peerDependenciesMeta: + '@ts-macro/tsc': + optional: true + '@typescript/native-preview': + optional: true + typescript: + optional: true + vue-tsc: + optional: true + + rolldown@1.0.0-beta.57: + resolution: {integrity: sha512-lMMxcNN71GMsSko8RyeTaFoATHkCh4IWU7pYF73ziMYjhHZWfVesC6GQ+iaJCvZmVjvgSks9Ks1aaqEkBd8udg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + rolldown@1.0.0-rc.17: + resolution: {integrity: sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + rolldown@1.0.3: + resolution: {integrity: sha512-i00lAJ2ks1BYr7rjNjKC7BcqAS7nVfiT3QX1SI5aY+AFHblCmaUf9OE9dbdzDvW6dJxbi2ZCZiy9v3CcwOiX3g==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + semver@7.8.2: + resolution: {integrity: sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==} + engines: {node: '>=10'} + hasBin: true + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@4.1.0: + resolution: {integrity: sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@1.2.4: + resolution: {integrity: sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==} + engines: {node: '>=18'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + tinyrainbow@3.1.0: + resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} + engines: {node: '>=14.0.0'} + + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + + tsdown@0.18.4: + resolution: {integrity: sha512-J/tRS6hsZTkvqmt4+xdELUCkQYDuUCXgBv0fw3ImV09WPGbEKfsPD65E+WUjSu3E7Z6tji9XZ1iWs8rbGqB/ZA==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + '@arethetypeswrong/core': ^0.18.1 + '@vitejs/devtools': '*' + publint: ^0.3.0 + typescript: ^5.0.0 + unplugin-lightningcss: ^0.4.0 + unplugin-unused: ^0.5.0 + peerDependenciesMeta: + '@arethetypeswrong/core': + optional: true + '@vitejs/devtools': + optional: true + publint: + optional: true + typescript: + optional: true + unplugin-lightningcss: + optional: true + unplugin-unused: + optional: true + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + unconfig-core@7.5.0: + resolution: {integrity: sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==} + + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + + unrun@0.2.39: + resolution: {integrity: sha512-h9FxYVpztY/wwq+bauLOh6Y3CWu2IVeRLq5lxzneBiIU9Tn86OGp9xiQrGhnYspAmg5dzdY0Cc8+Y70kuTARCg==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + vite@8.0.16: + resolution: {integrity: sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.1.18 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@4.1.8: + resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.1.8 + '@vitest/browser-preview': 4.1.8 + '@vitest/browser-webdriverio': 4.1.8 + '@vitest/coverage-istanbul': 4.1.8 + '@vitest/coverage-v8': 4.1.8 + '@vitest/ui': 4.1.8 + happy-dom: '*' + jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + +snapshots: + + '@babel/generator@7.29.7': + dependencies: + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + jsesc: 3.1.0 + + '@babel/helper-string-parser@7.29.7': {} + + '@babel/helper-validator-identifier@7.29.7': {} + + '@babel/parser@7.29.7': + dependencies: + '@babel/types': 7.29.7 + + '@babel/types@7.29.7': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@emnapi/core@1.10.0': + dependencies: + '@emnapi/wasi-threads': 1.2.1 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.10.0': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.2.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@jridgewell/gen-mapping@0.3.13': + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.5.5': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.5 + + '@langfuse/core@5.4.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@langfuse/otel@5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1))': + dependencies: + '@langfuse/core': 5.4.1(@opentelemetry/api@1.9.1) + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-trace-otlp-http': 0.205.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/api@1.9.1) + + '@langfuse/tracing@5.4.1(@opentelemetry/api@1.9.1)': + dependencies: + '@langfuse/core': 5.4.1(@opentelemetry/api@1.9.1) + '@opentelemetry/api': 1.9.1 + + '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@tybys/wasm-util': 0.10.2 + optional: true + + '@opentelemetry/api-logs@0.205.0': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@opentelemetry/api@1.9.1': {} + + '@opentelemetry/context-async-hooks@2.7.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@opentelemetry/core@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-exporter-base': 0.205.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.205.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.1.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/otlp-exporter-base@0.205.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.205.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/otlp-transformer@0.205.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.205.0 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs': 0.205.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-metrics': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.1.0(@opentelemetry/api@1.9.1) + protobufjs: 7.6.2 + + '@opentelemetry/resources@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/sdk-logs@0.205.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.205.0 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/sdk-metrics@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/sdk-trace-base@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/sdk-trace-node@2.7.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/context-async-hooks': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/api@1.9.1) + + '@opentelemetry/semantic-conventions@1.41.1': {} + + '@oxc-project/types@0.103.0': {} + + '@oxc-project/types@0.127.0': {} + + '@oxc-project/types@0.133.0': {} + + '@protobufjs/aspromise@1.1.2': {} + + '@protobufjs/base64@1.1.2': {} + + '@protobufjs/codegen@2.0.5': {} + + '@protobufjs/eventemitter@1.1.1': {} + + '@protobufjs/fetch@1.1.1': + dependencies: + '@protobufjs/aspromise': 1.1.2 + + '@protobufjs/float@1.0.2': {} + + '@protobufjs/inquire@1.1.2': {} + + '@protobufjs/path@1.1.2': {} + + '@protobufjs/pool@1.1.0': {} + + '@protobufjs/utf8@1.1.1': {} + + '@quansync/fs@1.0.0': + dependencies: + quansync: 1.0.0 + + '@rolldown/binding-android-arm64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-android-arm64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-android-arm64@1.0.3': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.3': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-darwin-x64@1.0.3': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.3': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.3': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.3': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.3': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.3': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.3': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.3': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.3': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.3': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + dependencies: + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-rc.17': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.3': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.57': + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.17': + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.3': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.3': + optional: true + + '@rolldown/pluginutils@1.0.0-beta.57': {} + + '@rolldown/pluginutils@1.0.0-rc.17': {} + + '@rolldown/pluginutils@1.0.1': {} + + '@standard-schema/spec@1.1.0': {} + + '@tybys/wasm-util@0.10.2': + dependencies: + tslib: 2.8.1 + optional: true + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.9': {} + + '@types/node@22.19.20': + dependencies: + undici-types: 6.21.0 + + '@vitest/expect@4.1.8': + dependencies: + '@standard-schema/spec': 1.1.0 + '@types/chai': 5.2.3 + '@vitest/spy': 4.1.8 + '@vitest/utils': 4.1.8 + chai: 6.2.2 + tinyrainbow: 3.1.0 + + '@vitest/mocker@4.1.8(vite@8.0.16(@types/node@22.19.20))': + dependencies: + '@vitest/spy': 4.1.8 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 8.0.16(@types/node@22.19.20) + + '@vitest/pretty-format@4.1.8': + dependencies: + tinyrainbow: 3.1.0 + + '@vitest/runner@4.1.8': + dependencies: + '@vitest/utils': 4.1.8 + pathe: 2.0.3 + + '@vitest/snapshot@4.1.8': + dependencies: + '@vitest/pretty-format': 4.1.8 + '@vitest/utils': 4.1.8 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@4.1.8': {} + + '@vitest/utils@4.1.8': + dependencies: + '@vitest/pretty-format': 4.1.8 + convert-source-map: 2.0.0 + tinyrainbow: 3.1.0 + + ansis@4.3.1: {} + + assertion-error@2.0.1: {} + + ast-kit@2.2.0: + dependencies: + '@babel/parser': 7.29.7 + pathe: 2.0.3 + + birpc@4.0.0: {} + + cac@6.7.14: {} + + chai@6.2.2: {} + + convert-source-map@2.0.0: {} + + defu@6.1.7: {} + + detect-libc@2.1.2: {} + + dts-resolver@2.1.3: {} + + empathic@2.0.1: {} + + es-module-lexer@2.1.0: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + + expect-type@1.3.0: {} + + fdir@6.5.0(picomatch@4.0.4): + optionalDependencies: + picomatch: 4.0.4 + + fsevents@2.3.3: + optional: true + + get-tsconfig@4.14.0: + dependencies: + resolve-pkg-maps: 1.0.0 + + hookable@6.1.1: {} + + import-without-cache@0.2.5: {} + + jsesc@3.1.0: {} + + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + + long@5.3.2: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.5 + + nanoid@3.3.12: {} + + obug@2.1.2: {} + + pathe@2.0.3: {} + + picocolors@1.1.1: {} + + picomatch@4.0.4: {} + + postcss@8.5.15: + dependencies: + nanoid: 3.3.12 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + prettier@3.8.3: {} + + protobufjs@7.6.2: + dependencies: + '@protobufjs/aspromise': 1.1.2 + '@protobufjs/base64': 1.1.2 + '@protobufjs/codegen': 2.0.5 + '@protobufjs/eventemitter': 1.1.1 + '@protobufjs/fetch': 1.1.1 + '@protobufjs/float': 1.0.2 + '@protobufjs/inquire': 1.1.2 + '@protobufjs/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.1 + '@types/node': 22.19.20 + long: 5.3.2 + + quansync@1.0.0: {} + + resolve-pkg-maps@1.0.0: {} + + rolldown-plugin-dts@0.20.0(rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0))(typescript@5.9.3): + dependencies: + '@babel/generator': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 + ast-kit: 2.2.0 + birpc: 4.0.0 + dts-resolver: 2.1.3 + get-tsconfig: 4.14.0 + obug: 2.1.2 + rolldown: 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - oxc-resolver + + rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): + dependencies: + '@oxc-project/types': 0.103.0 + '@rolldown/pluginutils': 1.0.0-beta.57 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-beta.57 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.57 + '@rolldown/binding-darwin-x64': 1.0.0-beta.57 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.57 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.57 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.57 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.57 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.57 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.57 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.57 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.57 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.57 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + + rolldown@1.0.0-rc.17: + dependencies: + '@oxc-project/types': 0.127.0 + '@rolldown/pluginutils': 1.0.0-rc.17 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-rc.17 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.17 + '@rolldown/binding-darwin-x64': 1.0.0-rc.17 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.17 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.17 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.17 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.17 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.17 + '@rolldown/binding-wasm32-wasi': 1.0.0-rc.17 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.17 + '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.17 + + rolldown@1.0.3: + dependencies: + '@oxc-project/types': 0.133.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.3 + '@rolldown/binding-darwin-arm64': 1.0.3 + '@rolldown/binding-darwin-x64': 1.0.3 + '@rolldown/binding-freebsd-x64': 1.0.3 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.3 + '@rolldown/binding-linux-arm64-gnu': 1.0.3 + '@rolldown/binding-linux-arm64-musl': 1.0.3 + '@rolldown/binding-linux-ppc64-gnu': 1.0.3 + '@rolldown/binding-linux-s390x-gnu': 1.0.3 + '@rolldown/binding-linux-x64-gnu': 1.0.3 + '@rolldown/binding-linux-x64-musl': 1.0.3 + '@rolldown/binding-openharmony-arm64': 1.0.3 + '@rolldown/binding-wasm32-wasi': 1.0.3 + '@rolldown/binding-win32-arm64-msvc': 1.0.3 + '@rolldown/binding-win32-x64-msvc': 1.0.3 + + semver@7.8.2: {} + + siginfo@2.0.0: {} + + source-map-js@1.2.1: {} + + stackback@0.0.2: {} + + std-env@4.1.0: {} + + tinybench@2.9.0: {} + + tinyexec@1.2.4: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + + tinyrainbow@3.1.0: {} + + tree-kill@1.2.2: {} + + tsdown@0.18.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(typescript@5.9.3): + dependencies: + ansis: 4.3.1 + cac: 6.7.14 + defu: 6.1.7 + empathic: 2.0.1 + hookable: 6.1.1 + import-without-cache: 0.2.5 + obug: 2.1.2 + picomatch: 4.0.4 + rolldown: 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + rolldown-plugin-dts: 0.20.0(rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0))(typescript@5.9.3) + semver: 7.8.2 + tinyexec: 1.2.4 + tinyglobby: 0.2.17 + tree-kill: 1.2.2 + unconfig-core: 7.5.0 + unrun: 0.2.39 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + - '@ts-macro/tsc' + - '@typescript/native-preview' + - oxc-resolver + - synckit + - vue-tsc + + tslib@2.8.1: + optional: true + + typescript@5.9.3: {} + + unconfig-core@7.5.0: + dependencies: + '@quansync/fs': 1.0.0 + quansync: 1.0.0 + + undici-types@6.21.0: {} + + unrun@0.2.39: + dependencies: + rolldown: 1.0.0-rc.17 + + vite@8.0.16(@types/node@22.19.20): + dependencies: + lightningcss: 1.32.0 + picomatch: 4.0.4 + postcss: 8.5.15 + rolldown: 1.0.3 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 22.19.20 + fsevents: 2.3.3 + + vitest@4.1.8(@opentelemetry/api@1.9.1)(@types/node@22.19.20)(vite@8.0.16(@types/node@22.19.20)): + dependencies: + '@vitest/expect': 4.1.8 + '@vitest/mocker': 4.1.8(vite@8.0.16(@types/node@22.19.20)) + '@vitest/pretty-format': 4.1.8 + '@vitest/runner': 4.1.8 + '@vitest/snapshot': 4.1.8 + '@vitest/spy': 4.1.8 + '@vitest/utils': 4.1.8 + es-module-lexer: 2.1.0 + expect-type: 1.3.0 + magic-string: 0.30.21 + obug: 2.1.2 + pathe: 2.0.3 + picomatch: 4.0.4 + std-env: 4.1.0 + tinybench: 2.9.0 + tinyexec: 1.2.4 + tinyglobby: 0.2.17 + tinyrainbow: 3.1.0 + vite: 8.0.16(@types/node@22.19.20) + why-is-node-running: 2.3.0 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 22.19.20 + transitivePeerDependencies: + - msw + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + + zod@4.4.3: {} diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..1aeb4bc --- /dev/null +++ b/src/config.ts @@ -0,0 +1,183 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; + +import { z } from "zod"; + +/** + * Resolved tracer configuration. + * + * Resolution order (lowest → highest precedence): + * defaults → ~/.claude/langfuse.json → /.claude/langfuse.json → env + * + * Claude Code exposes a plugin's `userConfig` values as + * `CLAUDE_PLUGIN_OPTION_` environment variables. For every setting we + * read the `CLAUDE_PLUGIN_OPTION_` form first, then the plain `` + * environment variable, so the plugin works whether configured through the + * Claude Code install prompt or a shell export. + */ +export const ConfigSchema = z.object({ + // LANGFUSE_PUBLIC_KEY | CC_LANGFUSE_PUBLIC_KEY + public_key: z.string().optional(), + // LANGFUSE_SECRET_KEY | CC_LANGFUSE_SECRET_KEY + secret_key: z.string().optional(), + // LANGFUSE_BASE_URL | CC_LANGFUSE_BASE_URL + base_url: z.string(), + // LANGFUSE_TRACING_ENVIRONMENT | CC_LANGFUSE_ENVIRONMENT + environment: z.string().optional(), + // CC_LANGFUSE_USER_ID + user_id: z.string().optional(), + // CC_LANGFUSE_TAGS (JSON array or comma-separated list) + tags: z.array(z.string()).optional(), + // CC_LANGFUSE_METADATA (JSON object; values coerced to strings) + metadata: z.record(z.string(), z.string()).optional(), + // CC_LANGFUSE_MAX_CHARS — truncate large inputs/outputs + max_chars: z.number().int().positive(), + // CC_LANGFUSE_DEBUG + debug: z.boolean(), + // CC_LANGFUSE_FAIL_ON_ERROR + fail_on_error: z.boolean(), +}); + +export type Config = z.infer; + +const PartialConfigSchema = ConfigSchema.partial(); + +const DEFAULTS: Pick = { + base_url: "https://us.cloud.langfuse.com", + max_chars: 20_000, + debug: false, + fail_on_error: false, +}; + +function parseBoolean(value: unknown): boolean | undefined { + if (typeof value === "boolean") return value; + if (typeof value !== "string") return undefined; + const normalized = value.trim().toLowerCase(); + if (["1", "true", "yes", "on"].includes(normalized)) return true; + if (["0", "false", "no", "off"].includes(normalized)) return false; + return undefined; +} + +function parseTags(value: unknown): string[] | undefined { + if (Array.isArray(value)) return value.map(String); + if (typeof value !== "string" || value.trim().length === 0) return undefined; + const trimmed = value.trim(); + if (trimmed.startsWith("[")) { + try { + const parsed = JSON.parse(trimmed); + if (Array.isArray(parsed)) return parsed.map(String); + } catch { + // fall through to comma-separated parsing + } + } + return trimmed + .split(",") + .map((t) => t.trim()) + .filter(Boolean); +} + +function parseMetadata(value: unknown): Record | undefined { + let obj: unknown = value; + if (typeof value === "string") { + if (value.trim().length === 0) return undefined; + try { + obj = JSON.parse(value); + } catch { + return undefined; + } + } + if (obj == null || typeof obj !== "object" || Array.isArray(obj)) { + return undefined; + } + const out: Record = {}; + for (const [k, v] of Object.entries(obj as Record)) { + out[k] = typeof v === "string" ? v : JSON.stringify(v); + } + return out; +} + +function parseInteger(value: unknown): number | undefined { + if (typeof value === "number" && Number.isFinite(value)) return value; + if (typeof value !== "string") return undefined; + const parsed = Number.parseInt(value.trim(), 10); + return Number.isFinite(parsed) ? parsed : undefined; +} + +function stripUndefined>(value: T): Partial { + return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined)) as Partial; +} + +async function readConfigFile(file: string): Promise | undefined> { + try { + const raw = JSON.parse(await fs.readFile(file, "utf-8")) as Record; + // Normalize the few fields that need coercion before zod validation. + return PartialConfigSchema.parse( + stripUndefined({ + ...raw, + tags: raw.tags != null ? parseTags(raw.tags) : undefined, + metadata: raw.metadata != null ? parseMetadata(raw.metadata) : undefined, + max_chars: raw.max_chars != null ? parseInteger(raw.max_chars) : undefined, + debug: raw.debug != null ? parseBoolean(raw.debug) : undefined, + fail_on_error: raw.fail_on_error != null ? parseBoolean(raw.fail_on_error) : undefined, + }), + ); + } catch { + return undefined; + } +} + +/** + * Read an option, preferring the Claude Code plugin-config form + * (`CLAUDE_PLUGIN_OPTION_`) over the plain environment variable. + */ +function opt(name: string, env: Record): string | undefined { + return env[`CLAUDE_PLUGIN_OPTION_${name}`] ?? env[name]; +} + +/** Resolve `LANGFUSE_` with a `CC_LANGFUSE_` fallback. */ +function getVar(suffix: string, env: Record): string | undefined { + return opt(`LANGFUSE_${suffix}`, env) ?? opt(`CC_LANGFUSE_${suffix}`, env); +} + +function readEnvConfig(env: Record): Partial { + return PartialConfigSchema.parse( + stripUndefined({ + public_key: getVar("PUBLIC_KEY", env), + secret_key: getVar("SECRET_KEY", env), + base_url: getVar("BASE_URL", env), + environment: opt("LANGFUSE_TRACING_ENVIRONMENT", env) ?? opt("CC_LANGFUSE_ENVIRONMENT", env), + user_id: opt("CC_LANGFUSE_USER_ID", env), + tags: parseTags(opt("CC_LANGFUSE_TAGS", env)), + metadata: parseMetadata(opt("CC_LANGFUSE_METADATA", env)), + max_chars: parseInteger(opt("CC_LANGFUSE_MAX_CHARS", env)), + debug: parseBoolean(opt("CC_LANGFUSE_DEBUG", env)), + fail_on_error: parseBoolean(opt("CC_LANGFUSE_FAIL_ON_ERROR", env)), + }), + ); +} + +const getHomeDir = () => process.env.HOME ?? os.homedir(); + +export async function getConfig(options?: { + home?: string; + cwd?: string; + env?: Record; +}): Promise { + const home = options?.home ?? getHomeDir(); + const cwd = options?.cwd ?? process.cwd(); + const env = options?.env ?? process.env; + + const [globalConfig, localConfig] = await Promise.all([ + readConfigFile(path.join(home, ".claude", "langfuse.json")), + readConfigFile(path.join(cwd, ".claude", "langfuse.json")), + ]); + const envConfig = readEnvConfig(env); + + return ConfigSchema.parse({ + ...DEFAULTS, + ...globalConfig, + ...localConfig, + ...envConfig, + }); +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..f093829 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,72 @@ +import { getConfig } from "./config.js"; +import { setupInstrumentation } from "./instrumentation.js"; +import { convertTranscript } from "./trace.js"; +import type { HookInput } from "./types.js"; +import { debugLog, readStdin, setDebug } from "./utils.js"; + +let failOnError = process.env.CC_LANGFUSE_FAIL_ON_ERROR === "true"; + +/** + * Entry point for the Claude Code `Stop` hook. + * + * Claude Code pipes a JSON payload to stdin after every turn. We resolve + * config, bail out unless Langfuse credentials are present, then convert the + * newly appended transcript rows into Langfuse traces. + * + * The hook fails open: any error is logged (in debug mode) and swallowed so a + * tracing problem never blocks the Claude Code session. Set + * `CC_LANGFUSE_FAIL_ON_ERROR=true` while testing if you want Claude Code to + * report hook failures instead. + */ +export async function runHook(): Promise { + let hookInput: HookInput; + try { + hookInput = await readStdin(); + } catch { + // No usable payload — nothing we can do. + return; + } + + const cwd = hookInput.cwd; + const config = await getConfig(cwd ? { cwd } : undefined); + setDebug(config.debug); + failOnError = config.fail_on_error; + + if (!config.public_key || !config.secret_key) { + debugLog("missing LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY; skipping"); + return; + } + + const sessionId = hookInput.session_id ?? hookInput.sessionId; + const transcriptPath = hookInput.transcript_path ?? hookInput.transcriptPath; + if (!sessionId || !transcriptPath) { + debugLog("hook payload missing session_id or transcript_path; skipping"); + return; + } + + const instrumentation = setupInstrumentation(config); + try { + await convertTranscript(transcriptPath, sessionId, config); + } catch (error) { + debugLog("failed to convert transcript:", error); + if (config.fail_on_error) throw error; + } finally { + try { + await instrumentation.shutdown(); + } catch (error) { + debugLog("error during flush/shutdown:", error); + if (config.fail_on_error) throw error; + } + } +} + +runHook().catch((error) => { + // Last-resort guard: fail open unless explicitly requested for testing. + if (process.env.CC_LANGFUSE_DEBUG === "true") { + // eslint-disable-next-line no-console + console.error("[langfuse-claude-code] fatal:", error); + } + if (failOnError) { + process.exitCode = 1; + } +}); diff --git a/src/instrumentation.ts b/src/instrumentation.ts new file mode 100644 index 0000000..cf05b97 --- /dev/null +++ b/src/instrumentation.ts @@ -0,0 +1,47 @@ +import { LangfuseSpanProcessor } from "@langfuse/otel"; +import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node"; + +import type { Config } from "./config.js"; + +export type Instrumentation = { + /** Flush buffered spans and tear down the tracer provider. */ + shutdown: () => Promise; +}; + +/** + * Configure an isolated OpenTelemetry tracer provider wired to Langfuse. + * + * We register a dedicated `NodeTracerProvider` (rather than the full auto- + * instrumenting `NodeSDK`) so the bundle stays small and free of dynamic + * instrumentation loading. Registering the provider also installs the + * AsyncLocalStorage context manager that `propagateAttributes` relies on. + * + * We use `exportMode: "batched"` and flush once at the end: the whole + * transcript is converted in-process, so batching every span into one (or a + * few) requests is far faster than one request per span — important for the + * hook's timeout budget. `shutdown()` below calls `forceFlush()` before the + * process exits. + */ +export function setupInstrumentation(config: Config): Instrumentation { + const spanProcessor = new LangfuseSpanProcessor({ + publicKey: config.public_key, + secretKey: config.secret_key, + baseUrl: config.base_url, + environment: config.environment, + exportMode: "batched", + // The hook only ever creates Langfuse spans, so export all of them. + shouldExportSpan: () => true, + }); + + const provider = new NodeTracerProvider({ + spanProcessors: [spanProcessor], + }); + provider.register(); + + return { + shutdown: async () => { + await spanProcessor.forceFlush(); + await provider.shutdown(); + }, + }; +} diff --git a/src/parse.ts b/src/parse.ts new file mode 100644 index 0000000..cc4e7e9 --- /dev/null +++ b/src/parse.ts @@ -0,0 +1,188 @@ +import type { + AssistantStep, + ContentBlock, + ToolCall, + TranscriptMessage, + TranscriptRow, + Turn, + UsageDetails, +} from "./types.js"; +import { parseTimestamp } from "./utils.js"; + +function getMessage(row: TranscriptRow): TranscriptMessage | undefined { + return row.message && typeof row.message === "object" ? row.message : undefined; +} + +function getContent(row: TranscriptRow): string | ContentBlock[] | undefined { + const msg = getMessage(row); + if (msg && msg.content !== undefined) return msg.content; + return row.content; +} + +/** Resolve a row's role from `type` or `message.role`. */ +function getRole(row: TranscriptRow): "user" | "assistant" | undefined { + if (row.type === "user" || row.type === "assistant") return row.type; + const role = getMessage(row)?.role; + if (role === "user" || role === "assistant") return role; + return undefined; +} + +function blocks(content: string | ContentBlock[] | undefined): ContentBlock[] { + return Array.isArray(content) ? content : []; +} + +/** Concatenate the text blocks (or a plain string) of a message's content. */ +function extractText(content: string | ContentBlock[] | undefined): string { + if (typeof content === "string") return content; + return blocks(content) + .filter((b) => b.type === "text" && typeof b.text === "string") + .map((b) => b.text as string) + .filter(Boolean) + .join("\n"); +} + +function getToolUses(content: string | ContentBlock[] | undefined): ContentBlock[] { + return blocks(content).filter((b) => b.type === "tool_use"); +} + +function getToolResults(content: string | ContentBlock[] | undefined): ContentBlock[] { + return blocks(content).filter((b) => b.type === "tool_result"); +} + +/** A user row is a tool-result carrier when its content holds tool_result blocks. */ +function isToolResultRow(row: TranscriptRow): boolean { + return getRole(row) === "user" && getToolResults(getContent(row)).length > 0; +} + +function getModel(row: TranscriptRow): string { + const model = getMessage(row)?.model; + return typeof model === "string" && model ? model : "claude"; +} + +function getMessageId(row: TranscriptRow): string | undefined { + const id = getMessage(row)?.id; + return typeof id === "string" && id ? id : undefined; +} + +/** Normalize Anthropic token usage to Langfuse `usageDetails` keys. */ +function getUsage(row: TranscriptRow): UsageDetails | undefined { + const usage = getMessage(row)?.usage; + if (!usage || typeof usage !== "object") return undefined; + const u = usage as Record; + const details: UsageDetails = {}; + const map: Array<[string, string]> = [ + ["input_tokens", "input"], + ["output_tokens", "output"], + ["cache_read_input_tokens", "cache_read_input_tokens"], + ["cache_creation_input_tokens", "cache_creation_input_tokens"], + ]; + for (const [src, dst] of map) { + const v = u[src]; + if (typeof v === "number" && v > 0) details[dst] = v; + } + return Object.keys(details).length > 0 ? details : undefined; +} + +/** + * Group transcript rows into turns. + * + * A turn is: one user message (not a tool-result carrier), followed by the + * assistant messages it produced, plus the tool_result rows those tool calls + * resolved to (which arrive as later `user` rows). Assistant messages are + * deduped by `message.id` — Claude Code can rewrite a streaming row in place, + * and the latest copy wins — while preserving first-appearance order. + */ +export function buildTurns(rows: TranscriptRow[]): Turn[] { + const turns: Turn[] = []; + + let currentUser: TranscriptRow | null = null; + let assistantOrder: string[] = []; + let assistantLatest = new Map(); + let toolResultsById = new Map(); + + const flush = () => { + if (currentUser === null || assistantLatest.size === 0) return; + + const userContent = getContent(currentUser); + const userText = extractText(userContent); + const userTimestamp = parseTimestamp(currentUser.timestamp); + + const assistants = assistantOrder + .map((id) => assistantLatest.get(id)) + .filter((m): m is TranscriptRow => m !== undefined); + + const steps: AssistantStep[] = assistants.map((am) => { + const amContent = getContent(am); + const amTs = parseTimestamp(am.timestamp); + const toolCalls: ToolCall[] = getToolUses(amContent).map((tu) => { + const id = String(tu.id ?? ""); + const result = id ? toolResultsById.get(id) : undefined; + return { + id, + name: typeof tu.name === "string" ? tu.name : "unknown", + input: tu.input, + startTime: amTs, + endTime: result?.timestamp, + output: result?.content, + }; + }); + return { + text: extractText(amContent) || undefined, + model: getModel(am), + usage: getUsage(am), + toolCalls, + timestamp: amTs, + }; + }); + + const lastAssistant = assistants[assistants.length - 1]; + const finalAssistantText = extractText(getContent(lastAssistant)) || undefined; + + // Turn ends at the latest of the final assistant message or any tool result. + const candidateEnds = [parseTimestamp(lastAssistant.timestamp)]; + for (const tr of toolResultsById.values()) { + if (tr.timestamp !== undefined) candidateEnds.push(tr.timestamp); + } + const endTimestamp = candidateEnds + .filter((t): t is number => t !== undefined) + .reduce((max, t) => (max === undefined || t > max ? t : max), undefined); + + turns.push({ userText, userTimestamp, finalAssistantText, endTimestamp, steps }); + }; + + for (const row of rows) { + if (isToolResultRow(row)) { + const ts = parseTimestamp(row.timestamp); + for (const tr of getToolResults(getContent(row))) { + if (tr.tool_use_id) { + toolResultsById.set(String(tr.tool_use_id), { content: tr.content, timestamp: ts }); + } + } + continue; + } + + const role = getRole(row); + + if (role === "user") { + // New user message → finalize the previous turn and start a new one. + flush(); + currentUser = row; + assistantOrder = []; + assistantLatest = new Map(); + toolResultsById = new Map(); + continue; + } + + if (role === "assistant") { + if (currentUser === null) continue; // ignore assistant rows before any user message + const id = getMessageId(row) ?? `noid:${assistantOrder.length}`; + if (!assistantLatest.has(id)) assistantOrder.push(id); + assistantLatest.set(id, row); + continue; + } + // ignore unknown rows + } + + flush(); + return turns; +} diff --git a/src/state.ts b/src/state.ts new file mode 100644 index 0000000..8db9e47 --- /dev/null +++ b/src/state.ts @@ -0,0 +1,119 @@ +import * as fs from "node:fs/promises"; + +import type { TranscriptRow } from "./types.js"; +import { debugLog } from "./utils.js"; + +/** + * Per-transcript dedup state. + * + * The `Stop` hook fires after every turn and the whole transcript is appended + * to over the life of a session, so re-reading from the top each time would + * re-upload every turn. We keep a sidecar file (`.langfuse`) next + * to the transcript recording the byte offset already processed and how many + * turns have been emitted so far, then on the next invocation read only the + * bytes appended since. + */ +export type TranscriptState = { + /** Byte offset into the transcript already processed. */ + offset: number; + /** Number of turns emitted so far (for stable turn numbering). */ + turnCount: number; +}; + +const EMPTY_STATE: TranscriptState = { offset: 0, turnCount: 0 }; + +function sidecarPath(transcriptPath: string): string { + return `${transcriptPath}.langfuse`; +} + +export async function loadState(transcriptPath: string): Promise { + try { + const raw = JSON.parse( + await fs.readFile(sidecarPath(transcriptPath), "utf-8"), + ) as Partial; + return { + offset: Number.isFinite(raw.offset) ? Number(raw.offset) : 0, + turnCount: Number.isFinite(raw.turnCount) ? Number(raw.turnCount) : 0, + }; + } catch (error) { + if ((error as NodeJS.ErrnoException).code !== "ENOENT") { + debugLog("failed to read state sidecar; starting fresh:", error); + } + return { ...EMPTY_STATE }; + } +} + +export async function saveState(transcriptPath: string, state: TranscriptState): Promise { + try { + await fs.writeFile(sidecarPath(transcriptPath), JSON.stringify(state), "utf-8"); + } catch (error) { + // Best-effort: a failed write only risks re-uploading turns next time. + debugLog("failed to write state sidecar:", error); + } +} + +/** + * Read transcript rows appended since `state.offset`. + * + * Reads raw bytes from the offset to EOF, then only consumes up to the last + * complete line (the final newline). A partial trailing line — the transcript + * may still be mid-write — is left for the next invocation by not advancing the + * offset past it. If the file shrank (rotation/truncation), we restart from the + * beginning. + */ +export async function readNewRows( + transcriptPath: string, + state: TranscriptState, +): Promise<{ rows: TranscriptRow[]; offset: number }> { + let offset = state.offset; + let size: number; + try { + size = (await fs.stat(transcriptPath)).size; + } catch (error) { + debugLog("failed to stat transcript:", error); + return { rows: [], offset }; + } + + if (size < offset) { + debugLog(`transcript shrank (${size} < ${offset}); restarting from the beginning`); + offset = 0; + } + if (size === offset) { + return { rows: [], offset }; + } + + const length = size - offset; + const buffer = Buffer.alloc(length); + let fh: fs.FileHandle | undefined; + try { + fh = await fs.open(transcriptPath, "r"); + await fh.read(buffer, 0, length, offset); + } catch (error) { + debugLog("failed to read transcript:", error); + return { rows: [], offset }; + } finally { + await fh?.close(); + } + + const lastNewline = buffer.lastIndexOf(0x0a); + if (lastNewline < 0) { + // No complete line yet — wait for the next invocation. + return { rows: [], offset }; + } + + const complete = buffer.subarray(0, lastNewline + 1); + const newOffset = offset + complete.length; + + const rows: TranscriptRow[] = []; + for (const raw of complete.toString("utf-8").split("\n")) { + const trimmed = raw.trim(); + if (!trimmed) continue; + try { + rows.push(JSON.parse(trimmed) as TranscriptRow); + } catch { + // skip malformed lines rather than aborting the whole upload + } + } + + return { rows, offset: newOffset }; +} diff --git a/src/trace.ts b/src/trace.ts new file mode 100644 index 0000000..8673cdb --- /dev/null +++ b/src/trace.ts @@ -0,0 +1,182 @@ +import { propagateAttributes, startObservation } from "@langfuse/tracing"; + +import type { Config } from "./config.js"; +import { buildTurns } from "./parse.js"; +import { loadState, readNewRows, saveState } from "./state.js"; +import type { AssistantStep, ToolCall, Turn } from "./types.js"; +import { debugLog, makeClip, toText, type Clip } from "./utils.js"; + +/** A Date is required to backdate a span; fall back to `undefined` (= now). */ +function asDate(ts: number | undefined): Date | undefined { + return ts !== undefined ? new Date(ts) : undefined; +} + +function buildGenerationOutput( + step: AssistantStep, + clip: Clip, +): Record | undefined { + const output: Record = { role: "assistant" }; + if (step.text) output.content = clip(step.text); + if (step.toolCalls.length > 0) { + output.tool_calls = step.toolCalls.map((tc) => ({ + id: tc.id, + name: tc.name, + input: clip(tc.input), + })); + } + // Only "role" present → nothing meaningful to show. + return Object.keys(output).length > 1 ? output : undefined; +} + +function emitToolCall( + tc: ToolCall, + parent: ReturnType, + clip: Clip, + fallbackEnd: number | undefined, +): void { + const tool = startObservation( + `Tool: ${tc.name}`, + { + input: clip(tc.input), + output: tc.output != null ? clip(toText(tc.output)) : undefined, + metadata: { "claude.tool_id": tc.id, "claude.tool_name": tc.name }, + }, + { + asType: "tool", + startTime: asDate(tc.startTime), + parentSpanContext: parent.otelSpan.spanContext(), + }, + ); + tool.end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); +} + +/** Emit a single turn as a Langfuse observation tree. */ +function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: Config): void { + const clip = makeClip(config.max_chars); + + const root = startObservation( + `Claude Code - Turn ${turnNum}`, + { + input: { role: "user", content: clip(turn.userText) }, + output: + turn.finalAssistantText != null + ? { role: "assistant", content: clip(turn.finalAssistantText) } + : undefined, + metadata: { + "claude.source": "claude-code", + "claude.turn_number": turnNum, + "claude.transcript_path": transcriptPath, + "claude.assistant_message_count": turn.steps.length, + }, + }, + { + asType: "span", + startTime: asDate(turn.userTimestamp), + }, + ); + + // The moment the next generation could have started: the original user + // message, or when the previous batch of tool results all returned. + let prevTs = turn.userTimestamp; + let prevToolResults: Array> | undefined; + + turn.steps.forEach((step, idx) => { + const input = + idx === 0 + ? { role: "user", content: clip(turn.userText) } + : prevToolResults + ? { role: "tool", tool_results: prevToolResults } + : undefined; + + const generation = startObservation( + `Claude Generation ${idx + 1}`, + { + input, + output: buildGenerationOutput(step, clip), + model: step.model, + usageDetails: step.usage, + metadata: { "claude.step_index": idx, "claude.tool_count": step.toolCalls.length }, + }, + { + asType: "generation", + startTime: asDate(prevTs ?? step.timestamp), + parentSpanContext: root.otelSpan.spanContext(), + }, + ); + + const resultTimes: number[] = []; + for (const tc of step.toolCalls) { + emitToolCall(tc, generation, clip, step.timestamp); + if (tc.endTime !== undefined) resultTimes.push(tc.endTime); + } + + // End the generation after its tools so the timeline cleanly contains them. + const genEnd = resultTimes.length > 0 ? Math.max(...resultTimes) : (step.timestamp ?? prevTs); + generation.end(asDate(genEnd)); + + // Carry this batch's results into the next generation's input. + prevToolResults = + step.toolCalls.length > 0 + ? step.toolCalls.map((tc) => ({ + tool_use_id: tc.id, + tool_name: tc.name, + output: tc.output != null ? clip(toText(tc.output)) : undefined, + })) + : undefined; + + // The next generation can only start once this batch's results returned. + if (resultTimes.length > 0) prevTs = Math.max(...resultTimes); + else if (step.timestamp !== undefined) prevTs = step.timestamp; + }); + + root.end(asDate(turn.endTimestamp ?? prevTs ?? turn.userTimestamp)); +} + +/** + * Convert the newly appended part of a Claude Code transcript into Langfuse + * traces. Each turn becomes its own trace, grouped into a Langfuse session via + * the Claude Code session id. State is tracked in a sidecar so each turn is + * uploaded exactly once. + */ +export async function convertTranscript( + transcriptPath: string, + sessionId: string, + config: Config, +): Promise { + const state = await loadState(transcriptPath); + const { rows, offset } = await readNewRows(transcriptPath, state); + + if (rows.length === 0) { + debugLog("no new transcript rows to process"); + await saveState(transcriptPath, { ...state, offset }); + return; + } + + const turns = buildTurns(rows); + debugLog(`parsed ${turns.length} new turn(s) from ${transcriptPath}`); + + let emitted = 0; + for (const turn of turns) { + const turnNum = state.turnCount + emitted + 1; + try { + await propagateAttributes( + { + sessionId, + traceName: `Claude Code - Turn ${turnNum}`, + tags: ["claude-code", ...(config.tags ?? [])], + ...(config.user_id ? { userId: config.user_id } : {}), + ...(config.metadata ? { metadata: config.metadata } : {}), + }, + async () => { + emitTurn(turn, turnNum, transcriptPath, config); + }, + ); + emitted += 1; + } catch (error) { + debugLog(`failed to emit turn ${turnNum}:`, error); + if (config.fail_on_error) throw error; + } + } + + await saveState(transcriptPath, { offset, turnCount: state.turnCount + emitted }); +} diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..44851a7 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,90 @@ +/** + * Types for the subset of the Claude Code transcript JSONL we consume. + * + * Claude Code persists every session as a newline-delimited JSON file. Each + * line is a "row" describing one message in the conversation. The shapes vary + * slightly across Claude Code versions, so only the fields the tracer reads are + * typed; everything else is left open via index signatures so we never crash on + * an unknown version. + * + * A row is broadly one of: + * - a user message (`type: "user"`, or `message.role === "user"`) + * - an assistant message (`type: "assistant"`, or `message.role === "assistant"`) + * + * Tool results are delivered as *user* rows whose `content` array contains + * `tool_result` blocks. Tool calls are `tool_use` blocks inside assistant rows. + */ + +export type ContentBlock = { + type: string; + text?: string; + // tool_use + id?: string; + name?: string; + input?: unknown; + // tool_result + tool_use_id?: string; + content?: unknown; + [key: string]: unknown; +}; + +export type TranscriptMessage = { + role?: string; + content?: string | ContentBlock[]; + model?: string; + id?: string; + usage?: Record; + [key: string]: unknown; +}; + +export type TranscriptRow = { + type?: string; + message?: TranscriptMessage; + content?: string | ContentBlock[]; + timestamp?: string; + [key: string]: unknown; +}; + +/** Payload Claude Code passes to the `Stop` hook on stdin. */ +export type HookInput = { + session_id?: string; + sessionId?: string; + transcript_path?: string; + transcriptPath?: string; + hook_event_name?: string; + cwd?: string; + [key: string]: unknown; +}; + +/** Anthropic token usage, normalized to Langfuse `usageDetails` keys. */ +export type UsageDetails = Record; + +/** A single tool invocation: a `tool_use` block matched to its `tool_result`. */ +export type ToolCall = { + id: string; + name: string; + input: unknown; + /** When the assistant emitted the tool_use. */ + startTime?: number; + /** When the tool_result row arrived. */ + endTime?: number; + output?: unknown; +}; + +/** A single assistant message within a turn (one LLM response). */ +export type AssistantStep = { + text?: string; + model: string; + usage?: UsageDetails; + toolCalls: ToolCall[]; + timestamp?: number; +}; + +/** A fully assembled Claude Code turn, ready to convert into observations. */ +export type Turn = { + userText: string; + userTimestamp?: number; + finalAssistantText?: string; + endTimestamp?: number; + steps: AssistantStep[]; +}; diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..0e05ca7 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,92 @@ +/** Read and JSON-parse the hook payload Claude Code writes to stdin. */ +export function readStdin(): Promise { + return new Promise((resolve, reject) => { + let buffer = ""; + process.stdin.setEncoding("utf-8"); + process.stdin.on("data", (chunk) => (buffer += chunk)); + process.stdin.on("end", () => { + const trimmed = buffer.trim(); + if (!trimmed) { + reject(new Error("empty hook stdin")); + return; + } + try { + resolve(JSON.parse(trimmed) as T); + } catch (error) { + reject( + new Error( + `failed to parse hook stdin: ${error instanceof Error ? error.message : String(error)}`, + ), + ); + } + }); + process.stdin.once("error", reject); + }); +} + +export function isPrimitive(value: unknown): value is string | number | boolean { + const t = typeof value; + return t === "string" || t === "number" || t === "boolean"; +} + +/** Stringify a value for display, leaving strings untouched. */ +export function toText(value: unknown): string { + if (value == null) return ""; + if (typeof value === "string") return value; + if (isPrimitive(value)) return String(value); + try { + return JSON.stringify(value); + } catch { + return String(value); + } +} + +/** Parse a Claude Code ISO 8601 timestamp (with trailing `Z`) into ms epoch. */ +export function parseTimestamp(value: unknown): number | undefined { + if (typeof value !== "string" || !value) return undefined; + const ms = Date.parse(value); + return Number.isFinite(ms) ? ms : undefined; +} + +/** + * Truncate large text to keep traces lightweight. Returns the (possibly + * shortened) value plus metadata describing what was dropped, or `undefined` + * metadata when nothing was truncated. + */ +export function truncate( + value: string, + maxChars: number, +): { text: string; meta?: { truncated: true; originalLength: number } } { + if (value.length <= maxChars) return { text: value }; + return { + text: value.slice(0, maxChars), + meta: { truncated: true, originalLength: value.length }, + }; +} + +export type Clip = { + (value: string): string; + (value: unknown): unknown; +}; + +/** Build a clip() that truncates long strings to `maxChars`. */ +export function makeClip(maxChars: number): Clip { + function clip(value: string): string; + function clip(value: unknown): unknown; + function clip(value: unknown): unknown { + if (typeof value !== "string") return value; + const { text, meta } = truncate(value, maxChars); + return meta ? `${text}\n…[truncated ${meta.originalLength - text.length} chars]` : text; + } + return clip; +} + +let debugEnabled = false; +export function setDebug(enabled: boolean): void { + debugEnabled = enabled; +} +export function debugLog(...args: unknown[]): void { + if (!debugEnabled) return; + // eslint-disable-next-line no-console + console.error("[langfuse-claude-code]", ...args); +} diff --git a/test/config.test.ts b/test/config.test.ts new file mode 100644 index 0000000..a94b697 --- /dev/null +++ b/test/config.test.ts @@ -0,0 +1,56 @@ +import { describe, expect, it } from "vitest"; + +import { getConfig } from "../src/config.js"; + +const NONEXISTENT = "/nonexistent-dir-for-tests"; + +function baseOpts(env: Record) { + // Point home/cwd at a path with no langfuse.json so only env is exercised. + return { home: NONEXISTENT, cwd: NONEXISTENT, env }; +} + +describe("getConfig", () => { + it("applies defaults when nothing is set", async () => { + const config = await getConfig(baseOpts({})); + expect(config.base_url).toBe("https://us.cloud.langfuse.com"); + expect(config.max_chars).toBe(20_000); + expect(config.debug).toBe(false); + expect(config.public_key).toBeUndefined(); + }); + + it("reads plain LANGFUSE_* environment variables", async () => { + const config = await getConfig( + baseOpts({ LANGFUSE_PUBLIC_KEY: "pk", LANGFUSE_SECRET_KEY: "sk" }), + ); + expect(config.public_key).toBe("pk"); + expect(config.secret_key).toBe("sk"); + }); + + it("prefers the CLAUDE_PLUGIN_OPTION_* form over the plain variable", async () => { + const config = await getConfig( + baseOpts({ + LANGFUSE_PUBLIC_KEY: "plain", + CLAUDE_PLUGIN_OPTION_LANGFUSE_PUBLIC_KEY: "fromPlugin", + }), + ); + expect(config.public_key).toBe("fromPlugin"); + }); + + it("falls back to CC_LANGFUSE_* aliases", async () => { + const config = await getConfig(baseOpts({ CC_LANGFUSE_SECRET_KEY: "sk" })); + expect(config.secret_key).toBe("sk"); + }); + + it("coerces booleans, integers, and tags", async () => { + const config = await getConfig( + baseOpts({ + CC_LANGFUSE_DEBUG: "true", + CC_LANGFUSE_MAX_CHARS: "500", + CC_LANGFUSE_TAGS: "a, b ,c", + }), + ); + expect(config.debug).toBe(true); + expect(config.max_chars).toBe(500); + expect(config.tags).toEqual(["a", "b", "c"]); + }); +}); diff --git a/test/parse.test.ts b/test/parse.test.ts new file mode 100644 index 0000000..a6df6f0 --- /dev/null +++ b/test/parse.test.ts @@ -0,0 +1,126 @@ +import { describe, expect, it } from "vitest"; + +import { buildTurns } from "../src/parse.js"; +import type { TranscriptRow } from "../src/types.js"; + +const rows: TranscriptRow[] = [ + { + type: "user", + timestamp: "2026-06-08T10:00:00.000Z", + message: { role: "user", content: "list files" }, + }, + { + type: "assistant", + timestamp: "2026-06-08T10:00:01.000Z", + message: { + id: "msg_1", + role: "assistant", + model: "claude-opus-4-8", + usage: { input_tokens: 120, output_tokens: 45, cache_read_input_tokens: 1000 }, + content: [ + { type: "text", text: "Checking." }, + { type: "tool_use", id: "tu_1", name: "Bash", input: { command: "ls" } }, + ], + }, + }, + { + type: "user", + timestamp: "2026-06-08T10:00:02.500Z", + message: { + role: "user", + content: [{ type: "tool_result", tool_use_id: "tu_1", content: "README.md\nsrc" }], + }, + }, + { + type: "assistant", + timestamp: "2026-06-08T10:00:03.000Z", + message: { + id: "msg_2", + role: "assistant", + model: "claude-opus-4-8", + usage: { input_tokens: 200, output_tokens: 20 }, + content: [{ type: "text", text: "Two entries." }], + }, + }, + { + type: "user", + timestamp: "2026-06-08T10:01:00.000Z", + message: { role: "user", content: "thanks" }, + }, + { + type: "assistant", + timestamp: "2026-06-08T10:01:01.000Z", + message: { + id: "msg_3", + role: "assistant", + model: "claude-opus-4-8", + content: [{ type: "text", text: "Welcome!" }], + }, + }, +]; + +describe("buildTurns", () => { + it("groups rows into turns delimited by user messages", () => { + const turns = buildTurns(rows); + expect(turns).toHaveLength(2); + expect(turns[0].userText).toBe("list files"); + expect(turns[1].userText).toBe("thanks"); + }); + + it("captures multiple assistant steps within a turn", () => { + const [turn] = buildTurns(rows); + expect(turn.steps).toHaveLength(2); + expect(turn.finalAssistantText).toBe("Two entries."); + }); + + it("matches tool_use blocks to their tool_result", () => { + const [turn] = buildTurns(rows); + const tool = turn.steps[0].toolCalls[0]; + expect(tool.name).toBe("Bash"); + expect(tool.input).toEqual({ command: "ls" }); + expect(tool.output).toBe("README.md\nsrc"); + expect(tool.endTime).toBe(Date.parse("2026-06-08T10:00:02.500Z")); + }); + + it("normalizes Anthropic token usage to Langfuse usage keys", () => { + const [turn] = buildTurns(rows); + expect(turn.steps[0].usage).toEqual({ + input: 120, + output: 45, + cache_read_input_tokens: 1000, + }); + }); + + it("backdates turn timestamps from the transcript", () => { + const [turn] = buildTurns(rows); + expect(turn.userTimestamp).toBe(Date.parse("2026-06-08T10:00:00.000Z")); + expect(turn.endTimestamp).toBe(Date.parse("2026-06-08T10:00:03.000Z")); + }); + + it("dedupes assistant messages by id, keeping the latest copy", () => { + const streamed: TranscriptRow[] = [ + { type: "user", message: { role: "user", content: "hi" } }, + { + type: "assistant", + message: { id: "a", role: "assistant", content: [{ type: "text", text: "par" }] }, + }, + { + type: "assistant", + message: { id: "a", role: "assistant", content: [{ type: "text", text: "partial done" }] }, + }, + ]; + const [turn] = buildTurns(streamed); + expect(turn.steps).toHaveLength(1); + expect(turn.steps[0].text).toBe("partial done"); + }); + + it("ignores assistant rows before any user message", () => { + const orphan: TranscriptRow[] = [ + { + type: "assistant", + message: { id: "x", role: "assistant", content: [{ type: "text", text: "hi" }] }, + }, + ]; + expect(buildTurns(orphan)).toHaveLength(0); + }); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..583c39f --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "ESNext", + "moduleResolution": "bundler", + "target": "ES2022", + "lib": ["ES2022"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "types": ["node"], + "forceConsistentCasingInFileNames": true, + "verbatimModuleSyntax": true, + "noEmit": true + }, + "include": ["src", "test"], + "exclude": ["node_modules", "dist"] +} diff --git a/tsdown.config.ts b/tsdown.config.ts new file mode 100644 index 0000000..b492d3d --- /dev/null +++ b/tsdown.config.ts @@ -0,0 +1,23 @@ +import { defineConfig } from "tsdown"; + +// The plugin runs as a standalone Claude Code hook (`node dist/index.mjs`) +// without an install step, so the bundle must be fully self-contained. We +// bundle every runtime dependency (Langfuse SDK, OpenTelemetry, zod) and keep +// only Node.js built-ins external. +export default defineConfig({ + entry: ["src/index.ts"], + outDir: "dist", + format: ["esm"], + platform: "node", + target: "node20", + noExternal: [/^@langfuse\//, /^@opentelemetry\//, /^zod$/, /^zod\//], + dts: false, + clean: true, + minify: false, + // Emit a single self-contained file. OpenTelemetry's resource detection uses + // dynamic imports (platform-specific machine-id helpers); inlining them keeps + // the hook to one shippable `dist/index.mjs`. + outputOptions: { + inlineDynamicImports: true, + }, +}); From fa489c194c709ae4b90f61ceea1669bd39840ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Maierh=C3=B6fer?= Date: Tue, 9 Jun 2026 15:27:16 +0200 Subject: [PATCH 2/8] Drop the step number from generation observation names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generation observations are now all named "Claude Generation" instead of "Claude Generation 1", "Claude Generation 2", … The per-step index is still available on the observation via the claude.step_index metadata field. Co-Authored-By: Claude Opus 4.8 --- dist/index.mjs | 17 ++++++++--------- src/trace.ts | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dist/index.mjs b/dist/index.mjs index 2155c30..e5398a0 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -46887,15 +46887,14 @@ function emitTurn(turn, turnNum, transcriptPath, config$1) { let prevTs = turn.userTimestamp; let prevToolResults; turn.steps.forEach((step, idx) => { - const input = idx === 0 ? { - role: "user", - content: clip(turn.userText) - } : prevToolResults ? { - role: "tool", - tool_results: prevToolResults - } : void 0; - const generation = startObservation(`Claude Generation ${idx + 1}`, { - input, + const generation = startObservation("Claude Generation", { + input: idx === 0 ? { + role: "user", + content: clip(turn.userText) + } : prevToolResults ? { + role: "tool", + tool_results: prevToolResults + } : void 0, output: buildGenerationOutput(step, clip), model: step.model, usageDetails: step.usage, diff --git a/src/trace.ts b/src/trace.ts index 8673cdb..0ca8694 100644 --- a/src/trace.ts +++ b/src/trace.ts @@ -89,7 +89,7 @@ function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: C : undefined; const generation = startObservation( - `Claude Generation ${idx + 1}`, + "Claude Generation", { input, output: buildGenerationOutput(step, clip), From 2890290c4aa8c21ba87c694c935eda75d873c194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Maierh=C3=B6fer?= Date: Tue, 9 Jun 2026 15:28:35 +0200 Subject: [PATCH 3/8] Release 2.0.1 Ships the "Claude Generation" observation rename. Patch bump so installs tracking the branch pick up the new bundle. Co-Authored-By: Claude Opus 4.8 --- .claude-plugin/plugin.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 2af8dec..c95bb5f 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "langfuse", "description": "The Langfuse x Claude Code Observability Plugin", - "version": "2.0.0", + "version": "2.0.1", "author": { "name": "Langfuse" }, diff --git a/package.json b/package.json index d139cf0..b823893 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langfuse/claude-observability-plugin", - "version": "2.0.0", + "version": "2.0.1", "description": "Claude Code plugin that traces sessions, turns, generations, and tool calls to Langfuse", "keywords": [ "claude-code", From 072e4b1b522cabc7cd6c522e439df7d7c37b10aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Maierh=C3=B6fer?= Date: Tue, 9 Jun 2026 15:30:02 +0200 Subject: [PATCH 4/8] Make the turn the root "agent" observation, drop the turn number from its name The root turn observation is now an agent-type observation named "Claude Code Turn" (was a span named "Claude Code - Turn N"); the trace name matches. The turn number remains available via the claude.turn_number metadata field. Release 2.0.2. Co-Authored-By: Claude Opus 4.8 --- .claude-plugin/plugin.json | 2 +- dist/index.mjs | 6 +++--- package.json | 2 +- src/trace.ts | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index c95bb5f..a620cf7 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "langfuse", "description": "The Langfuse x Claude Code Observability Plugin", - "version": "2.0.1", + "version": "2.0.2", "author": { "name": "Langfuse" }, diff --git a/dist/index.mjs b/dist/index.mjs index e5398a0..1b41f4a 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -46865,7 +46865,7 @@ function emitToolCall(tc, parent, clip, fallbackEnd) { /** Emit a single turn as a Langfuse observation tree. */ function emitTurn(turn, turnNum, transcriptPath, config$1) { const clip = makeClip(config$1.max_chars); - const root = startObservation(`Claude Code - Turn ${turnNum}`, { + const root = startObservation("Claude Code Turn", { input: { role: "user", content: clip(turn.userText) @@ -46881,7 +46881,7 @@ function emitTurn(turn, turnNum, transcriptPath, config$1) { "claude.assistant_message_count": turn.steps.length } }, { - asType: "span", + asType: "agent", startTime: asDate(turn.userTimestamp) }); let prevTs = turn.userTimestamp; @@ -46949,7 +46949,7 @@ async function convertTranscript(transcriptPath, sessionId, config$1) { try { await propagateAttributes({ sessionId, - traceName: `Claude Code - Turn ${turnNum}`, + traceName: "Claude Code Turn", tags: ["claude-code", ...config$1.tags ?? []], ...config$1.user_id ? { userId: config$1.user_id } : {}, ...config$1.metadata ? { metadata: config$1.metadata } : {} diff --git a/package.json b/package.json index b823893..a7ce948 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langfuse/claude-observability-plugin", - "version": "2.0.1", + "version": "2.0.2", "description": "Claude Code plugin that traces sessions, turns, generations, and tool calls to Langfuse", "keywords": [ "claude-code", diff --git a/src/trace.ts b/src/trace.ts index 0ca8694..20069e0 100644 --- a/src/trace.ts +++ b/src/trace.ts @@ -55,7 +55,7 @@ function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: C const clip = makeClip(config.max_chars); const root = startObservation( - `Claude Code - Turn ${turnNum}`, + "Claude Code Turn", { input: { role: "user", content: clip(turn.userText) }, output: @@ -70,7 +70,7 @@ function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: C }, }, { - asType: "span", + asType: "agent", startTime: asDate(turn.userTimestamp), }, ); @@ -162,7 +162,7 @@ export async function convertTranscript( await propagateAttributes( { sessionId, - traceName: `Claude Code - Turn ${turnNum}`, + traceName: "Claude Code Turn", tags: ["claude-code", ...(config.tags ?? [])], ...(config.user_id ? { userId: config.user_id } : {}), ...(config.metadata ? { metadata: config.metadata } : {}), From 9d2866a3a1876424e12085716b45c5256eaae567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Maierh=C3=B6fer?= Date: Tue, 9 Jun 2026 15:32:50 +0200 Subject: [PATCH 5/8] Default user_id to the logged-in Claude Code account email When no user_id is configured (via CC_LANGFUSE_USER_ID, env, or langfuse.json), fall back to the email of the logged-in Claude Code user, read from ~/.claude.json (oauthAccount.emailAddress). This attaches the user to every trace/observation so sessions can be filtered by user in Langfuse. An explicit user_id still takes precedence. Release 2.1.0. Co-Authored-By: Claude Opus 4.8 --- .claude-plugin/plugin.json | 2 +- README.md | 2 +- dist/index.mjs | 21 +++++++++++++++++++++ package.json | 2 +- src/config.ts | 33 +++++++++++++++++++++++++++++++++ test/config.test.ts | 37 ++++++++++++++++++++++++++++++++++++- 6 files changed, 93 insertions(+), 4 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index a620cf7..0e17020 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "langfuse", "description": "The Langfuse x Claude Code Observability Plugin", - "version": "2.0.2", + "version": "2.1.0", "author": { "name": "Langfuse" }, diff --git a/README.md b/README.md index 0e4c3af..0d16a0c 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Configuration is resolved as **defaults → `~/.claude/langfuse.json` → ` | `LANGFUSE_SECRET_KEY` / `CC_LANGFUSE_SECRET_KEY` | Yes | — | Langfuse secret key (`sk-lf-...`) | | `LANGFUSE_BASE_URL` / `CC_LANGFUSE_BASE_URL` | No | `https://us.cloud.langfuse.com` | Langfuse host / data region | | `LANGFUSE_TRACING_ENVIRONMENT` / `CC_LANGFUSE_ENVIRONMENT` | No | — | Environment label for the traces (e.g. `production`) | -| `CC_LANGFUSE_USER_ID` | No | — | Attach a user id to all traces | +| `CC_LANGFUSE_USER_ID` | No | Claude Code account email | Attach a user id to all traces | | `CC_LANGFUSE_TAGS` | No | — | Extra tags for all traces (JSON array or comma-separated) | | `CC_LANGFUSE_METADATA` | No | — | JSON object of metadata to attach to all traces | | `CC_LANGFUSE_MAX_CHARS` | No | `20000` | Truncate inputs/outputs longer than this many characters | diff --git a/dist/index.mjs b/dist/index.mjs index 1b41f4a..45bdb45 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -4286,6 +4286,11 @@ const DEFAULTS = { debug: false, fail_on_error: false }; +/** +* Shape of the parts of `~/.claude.json` we read. Claude Code stores the +* logged-in account (including the email) under `oauthAccount`. +*/ +const ClaudeAccountSchema = object({ oauthAccount: object({ emailAddress: string().optional() }).passthrough().optional() }).passthrough(); function parseBoolean(value) { if (typeof value === "boolean") return value; if (typeof value !== "string") return void 0; @@ -4377,6 +4382,20 @@ function readEnvConfig(env) { fail_on_error: parseBoolean(opt("CC_LANGFUSE_FAIL_ON_ERROR", env)) })); } +/** +* Read the logged-in Claude Code user's email from `~/.claude.json`, used as a +* `user_id` fallback when one isn't explicitly configured. Returns undefined if +* the file is missing/unreadable or has no account email. +*/ +async function readClaudeUserEmail(claudeJsonFile) { + try { + const raw = JSON.parse(await fs.readFile(claudeJsonFile, "utf-8")); + const email$1 = ClaudeAccountSchema.parse(raw).oauthAccount?.emailAddress?.trim(); + return email$1 && email$1.length > 0 ? email$1 : void 0; + } catch { + return; + } +} const getHomeDir = () => process.env.HOME ?? os$2.homedir(); async function getConfig(options) { const home = options?.home ?? getHomeDir(); @@ -4384,8 +4403,10 @@ async function getConfig(options) { const env = options?.env ?? process.env; const [globalConfig$1, localConfig] = await Promise.all([readConfigFile(path.join(home, ".claude", "langfuse.json")), readConfigFile(path.join(cwd, ".claude", "langfuse.json"))]); const envConfig = readEnvConfig(env); + const claudeUserId = globalConfig$1?.user_id ?? localConfig?.user_id ?? envConfig.user_id ? void 0 : await readClaudeUserEmail(path.join(home, ".claude.json")); return ConfigSchema.parse({ ...DEFAULTS, + ...claudeUserId ? { user_id: claudeUserId } : {}, ...globalConfig$1, ...localConfig, ...envConfig diff --git a/package.json b/package.json index a7ce948..5e14212 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langfuse/claude-observability-plugin", - "version": "2.0.2", + "version": "2.1.0", "description": "Claude Code plugin that traces sessions, turns, generations, and tool calls to Langfuse", "keywords": [ "claude-code", diff --git a/src/config.ts b/src/config.ts index 1aeb4bc..876a96a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -50,6 +50,16 @@ const DEFAULTS: Pick): Partial ); } +/** + * Read the logged-in Claude Code user's email from `~/.claude.json`, used as a + * `user_id` fallback when one isn't explicitly configured. Returns undefined if + * the file is missing/unreadable or has no account email. + */ +async function readClaudeUserEmail(claudeJsonFile: string): Promise { + try { + const raw = JSON.parse(await fs.readFile(claudeJsonFile, "utf-8")) as unknown; + const email = ClaudeAccountSchema.parse(raw).oauthAccount?.emailAddress?.trim(); + return email && email.length > 0 ? email : undefined; + } catch { + return undefined; + } +} + const getHomeDir = () => process.env.HOME ?? os.homedir(); export async function getConfig(options?: { @@ -174,8 +199,16 @@ export async function getConfig(options?: { ]); const envConfig = readEnvConfig(env); + // Fall back to the logged-in Claude Code account email as user_id, but only + // when no explicit user_id was provided via config files or environment. + const explicitUserId = globalConfig?.user_id ?? localConfig?.user_id ?? envConfig.user_id; + const claudeUserId = explicitUserId + ? undefined + : await readClaudeUserEmail(path.join(home, ".claude.json")); + return ConfigSchema.parse({ ...DEFAULTS, + ...(claudeUserId ? { user_id: claudeUserId } : {}), ...globalConfig, ...localConfig, ...envConfig, diff --git a/test/config.test.ts b/test/config.test.ts index a94b697..cb7ed7a 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -1,4 +1,8 @@ -import { describe, expect, it } from "vitest"; +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; + +import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { getConfig } from "../src/config.js"; @@ -54,3 +58,34 @@ describe("getConfig", () => { expect(config.tags).toEqual(["a", "b", "c"]); }); }); + +describe("getConfig — Claude Code user email fallback", () => { + let home: string; + + beforeAll(async () => { + home = await fs.mkdtemp(path.join(os.tmpdir(), "cc-langfuse-test-")); + await fs.writeFile( + path.join(home, ".claude.json"), + JSON.stringify({ oauthAccount: { emailAddress: "dev@example.com" } }), + "utf-8", + ); + }); + + afterAll(async () => { + await fs.rm(home, { recursive: true, force: true }); + }); + + it("uses the account email as user_id when none is configured", async () => { + const config = await getConfig({ home, cwd: NONEXISTENT, env: {} }); + expect(config.user_id).toBe("dev@example.com"); + }); + + it("lets an explicit user_id override the account email", async () => { + const config = await getConfig({ + home, + cwd: NONEXISTENT, + env: { CC_LANGFUSE_USER_ID: "explicit-user" }, + }); + expect(config.user_id).toBe("explicit-user"); + }); +}); From 09d3551e80028cf8fbc43e4ef327ac937774ca19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20Maierh=C3=B6fer?= Date: Tue, 9 Jun 2026 15:57:06 +0200 Subject: [PATCH 6/8] Expand subagents inline as nested observations Claude Code records each subagent (spawned via the Agent/Task tool) as its own transcript at //subagents/agent-.jsonl, with a sibling .meta.json whose toolUseId links it to the spawning tool_use block in the main transcript. Discover those subagent transcripts, parse them with the same turn builder, and nest each subagent's generations and tool calls under the exact tool call that launched it. Nesting recurses (a subagent can spawn subagents) and is guarded against cycles via a visited set. - src/subagents.ts: discover subagents and index them by spawning tool_use id - src/state.ts: factor out parseRows / readAllRows for full-file reads - src/trace.ts: async emit pipeline with a reusable emitSteps helper; expand subagents under their tool observation - tests for discovery; README documents the new Subagents behavior Release 2.2.0. Co-Authored-By: Claude Opus 4.8 --- .claude-plugin/plugin.json | 2 +- README.md | 3 +- dist/index.mjs | 220 ++++++++++++++++++++++++++---------- package.json | 2 +- src/state.ts | 33 ++++-- src/subagents.ts | 75 +++++++++++++ src/trace.ts | 225 +++++++++++++++++++++++++++---------- test/subagents.test.ts | 54 +++++++++ 8 files changed, 479 insertions(+), 135 deletions(-) create mode 100644 src/subagents.ts create mode 100644 test/subagents.test.ts diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 0e17020..1715ec2 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "langfuse", "description": "The Langfuse x Claude Code Observability Plugin", - "version": "2.1.0", + "version": "2.2.0", "author": { "name": "Langfuse" }, diff --git a/README.md b/README.md index 0d16a0c..2dd0952 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,10 @@ Once enabled, each Claude Code turn shows up in Langfuse as a trace you can insp After each turn, a `Stop` hook reads the new part of the session transcript and uploads it to Langfuse as a [trace](https://langfuse.com/docs/observability/data-model). The structure mirrors how Claude Code actually works: -- **Turn** (`Claude Code - Turn N`) — one trace per turn, from your prompt to the final answer. +- **Turn** (`Claude Code Turn`, an agent observation) — one trace per turn, from your prompt to the final answer. - **Generations** — one per assistant message within the turn, with the model name, assistant text, the tool calls it requested, and token usage (including cache reads/writes). - **Tool calls** — `Bash`, `Read`, `Edit`, MCP tools, etc., each nested under the generation that issued it, with its input and output. +- **Subagents** — when a turn spawns a subagent (the `Agent`/`Task` tool), the subagent's own transcript is expanded inline and nested under the spawning tool call: its generations, token usage, and tool calls all show up as children. - **Sessions** — all turns from one Claude Code session are grouped via the session id, so you can replay the whole session in Langfuse's [Sessions](https://langfuse.com/docs/observability/features/sessions) view. Original timestamps are preserved on every span, so the Langfuse timeline reflects real wall-clock timing. diff --git a/dist/index.mjs b/dist/index.mjs index 45bdb45..25c70e9 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -46762,6 +46762,22 @@ function buildTurns(rows) { //#endregion //#region src/state.ts +/** Parse newline-delimited JSON transcript text into rows, skipping bad lines. */ +function parseRows(text) { + const rows = []; + for (const raw of text.split("\n")) { + const trimmed = raw.trim(); + if (!trimmed) continue; + try { + rows.push(JSON.parse(trimmed)); + } catch {} + } + return rows; +} +/** Read and parse an entire transcript file (used for subagent transcripts). */ +async function readAllRows(file) { + return parseRows(await fs.readFile(file, "utf-8")); +} const EMPTY_STATE = { offset: 0, turnCount: 0 @@ -46839,20 +46855,50 @@ async function readNewRows(transcriptPath, state) { }; const complete = buffer.subarray(0, lastNewline + 1); const newOffset = offset + complete.length; - const rows = []; - for (const raw of complete.toString("utf-8").split("\n")) { - const trimmed = raw.trim(); - if (!trimmed) continue; - try { - rows.push(JSON.parse(trimmed)); - } catch {} - } return { - rows, + rows: parseRows(complete.toString("utf-8")), offset: newOffset }; } +//#endregion +//#region src/subagents.ts +/** +* Discover subagent transcripts for a main transcript by reading the sibling +* `subagents/*.meta.json` files. Returns an empty index if there are none (or +* the directory is missing) — subagents are optional. +*/ +async function discoverSubagents(transcriptPath) { + const index = /* @__PURE__ */ new Map(); + const subDir = path.join(transcriptPath.replace(/\.jsonl$/i, ""), "subagents"); + let entries; + try { + entries = await fs.readdir(subDir, { withFileTypes: true }); + } catch (error) { + if (error.code !== "ENOENT") debugLog("failed to read subagents directory:", error); + return index; + } + for (const entry of entries) { + if (!entry.isFile() || !entry.name.endsWith(".meta.json")) continue; + const metaPath = path.join(subDir, entry.name); + try { + const meta$2 = JSON.parse(await fs.readFile(metaPath, "utf-8")); + if (typeof meta$2.toolUseId !== "string" || !meta$2.toolUseId) continue; + const file = path.join(subDir, entry.name.replace(/\.meta\.json$/, ".jsonl")); + index.set(meta$2.toolUseId, { + file, + agentType: typeof meta$2.agentType === "string" ? meta$2.agentType : "subagent", + description: typeof meta$2.description === "string" ? meta$2.description : void 0, + toolUseId: meta$2.toolUseId + }); + } catch (error) { + debugLog(`failed to parse subagent meta ${entry.name}:`, error); + } + } + if (index.size > 0) debugLog(`discovered ${index.size} subagent transcript(s)`); + return index; +} + //#endregion //#region src/trace.ts /** A Date is required to backdate a span; fall back to `undefined` (= now). */ @@ -46869,54 +46915,22 @@ function buildGenerationOutput(step, clip) { })); return Object.keys(output).length > 1 ? output : void 0; } -function emitToolCall(tc, parent, clip, fallbackEnd) { - startObservation(`Tool: ${tc.name}`, { - input: clip(tc.input), - output: tc.output != null ? clip(toText(tc.output)) : void 0, - metadata: { - "claude.tool_id": tc.id, - "claude.tool_name": tc.name - } - }, { - asType: "tool", - startTime: asDate(tc.startTime), - parentSpanContext: parent.otelSpan.spanContext() - }).end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); -} -/** Emit a single turn as a Langfuse observation tree. */ -function emitTurn(turn, turnNum, transcriptPath, config$1) { - const clip = makeClip(config$1.max_chars); - const root = startObservation("Claude Code Turn", { - input: { - role: "user", - content: clip(turn.userText) - }, - output: turn.finalAssistantText != null ? { - role: "assistant", - content: clip(turn.finalAssistantText) - } : void 0, - metadata: { - "claude.source": "claude-code", - "claude.turn_number": turnNum, - "claude.transcript_path": transcriptPath, - "claude.assistant_message_count": turn.steps.length - } - }, { - asType: "agent", - startTime: asDate(turn.userTimestamp) - }); - let prevTs = turn.userTimestamp; +/** +* Emit a sequence of assistant steps (one generation each, with nested tool +* observations) under `parent`. Returns the timestamp the last step ended, so +* the caller can close the parent observation cleanly. +*/ +async function emitSteps(parent, steps, firstInput, startTs, ctx) { + let prevTs = startTs; let prevToolResults; - turn.steps.forEach((step, idx) => { + for (let idx = 0; idx < steps.length; idx++) { + const step = steps[idx]; const generation = startObservation("Claude Generation", { - input: idx === 0 ? { - role: "user", - content: clip(turn.userText) - } : prevToolResults ? { + input: idx === 0 ? firstInput : prevToolResults ? { role: "tool", tool_results: prevToolResults } : void 0, - output: buildGenerationOutput(step, clip), + output: buildGenerationOutput(step, ctx.clip), model: step.model, usageDetails: step.usage, metadata: { @@ -46926,11 +46940,11 @@ function emitTurn(turn, turnNum, transcriptPath, config$1) { }, { asType: "generation", startTime: asDate(prevTs ?? step.timestamp), - parentSpanContext: root.otelSpan.spanContext() + parentSpanContext: parent.otelSpan.spanContext() }); const resultTimes = []; for (const tc of step.toolCalls) { - emitToolCall(tc, generation, clip, step.timestamp); + await emitToolCall(tc, generation, step.timestamp, ctx); if (tc.endTime !== void 0) resultTimes.push(tc.endTime); } const genEnd = resultTimes.length > 0 ? Math.max(...resultTimes) : step.timestamp ?? prevTs; @@ -46938,17 +46952,101 @@ function emitTurn(turn, turnNum, transcriptPath, config$1) { prevToolResults = step.toolCalls.length > 0 ? step.toolCalls.map((tc) => ({ tool_use_id: tc.id, tool_name: tc.name, - output: tc.output != null ? clip(toText(tc.output)) : void 0 + output: tc.output != null ? ctx.clip(toText(tc.output)) : void 0 })) : void 0; if (resultTimes.length > 0) prevTs = Math.max(...resultTimes); else if (step.timestamp !== void 0) prevTs = step.timestamp; + } + return prevTs; +} +async function emitToolCall(tc, parent, fallbackEnd, ctx) { + const tool = startObservation(`Tool: ${tc.name}`, { + input: ctx.clip(tc.input), + output: tc.output != null ? ctx.clip(toText(tc.output)) : void 0, + metadata: { + "claude.tool_id": tc.id, + "claude.tool_name": tc.name + } + }, { + asType: "tool", + startTime: asDate(tc.startTime), + parentSpanContext: parent.otelSpan.spanContext() + }); + const subagent = ctx.subagents.get(tc.id); + if (subagent && !ctx.visited.has(subagent.file)) await emitSubagent(tool, subagent, tc, ctx); + tool.end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); +} +/** Expand a subagent transcript as nested observations under its tool call. */ +async function emitSubagent(parentTool, subagent, tc, ctx) { + ctx.visited.add(subagent.file); + let rows; + try { + rows = await readAllRows(subagent.file); + } catch (error) { + debugLog(`failed to read subagent transcript ${subagent.file}:`, error); + return; + } + const turns = buildTurns(rows); + if (turns.length === 0) return; + for (const turn of turns) { + const agent = startObservation(`Subagent: ${subagent.agentType}`, { + input: { + role: "user", + content: ctx.clip(turn.userText) + }, + output: turn.finalAssistantText != null ? { + role: "assistant", + content: ctx.clip(turn.finalAssistantText) + } : void 0, + metadata: { + "claude.subagent_type": subagent.agentType, + "claude.subagent_description": subagent.description, + "claude.spawning_tool_id": tc.id + } + }, { + asType: "agent", + startTime: asDate(turn.userTimestamp), + parentSpanContext: parentTool.otelSpan.spanContext() + }); + const lastTs = await emitSteps(agent, turn.steps, { + role: "user", + content: ctx.clip(turn.userText) + }, turn.userTimestamp, ctx); + agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); + } +} +/** Emit a single turn as a Langfuse observation tree. */ +async function emitTurn(turn, turnNum, transcriptPath, ctx) { + const root = startObservation("Claude Code Turn", { + input: { + role: "user", + content: ctx.clip(turn.userText) + }, + output: turn.finalAssistantText != null ? { + role: "assistant", + content: ctx.clip(turn.finalAssistantText) + } : void 0, + metadata: { + "claude.source": "claude-code", + "claude.turn_number": turnNum, + "claude.transcript_path": transcriptPath, + "claude.assistant_message_count": turn.steps.length + } + }, { + asType: "agent", + startTime: asDate(turn.userTimestamp) }); - root.end(asDate(turn.endTimestamp ?? prevTs ?? turn.userTimestamp)); + const lastTs = await emitSteps(root, turn.steps, { + role: "user", + content: ctx.clip(turn.userText) + }, turn.userTimestamp, ctx); + root.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); } /** * Convert the newly appended part of a Claude Code transcript into Langfuse * traces. Each turn becomes its own trace, grouped into a Langfuse session via -* the Claude Code session id. State is tracked in a sidecar so each turn is +* the Claude Code session id. Subagent transcripts are nested under the tool +* call that spawned them. State is tracked in a sidecar so each turn is * uploaded exactly once. */ async function convertTranscript(transcriptPath, sessionId, config$1) { @@ -46964,9 +47062,15 @@ async function convertTranscript(transcriptPath, sessionId, config$1) { } const turns = buildTurns(rows); debugLog(`parsed ${turns.length} new turn(s) from ${transcriptPath}`); + const subagents = await discoverSubagents(transcriptPath); let emitted = 0; for (const turn of turns) { const turnNum = state.turnCount + emitted + 1; + const ctx = { + clip: makeClip(config$1.max_chars), + subagents, + visited: /* @__PURE__ */ new Set() + }; try { await propagateAttributes({ sessionId, @@ -46975,7 +47079,7 @@ async function convertTranscript(transcriptPath, sessionId, config$1) { ...config$1.user_id ? { userId: config$1.user_id } : {}, ...config$1.metadata ? { metadata: config$1.metadata } : {} }, async () => { - emitTurn(turn, turnNum, transcriptPath, config$1); + await emitTurn(turn, turnNum, transcriptPath, ctx); }); emitted += 1; } catch (error) { diff --git a/package.json b/package.json index 5e14212..2dfd1ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langfuse/claude-observability-plugin", - "version": "2.1.0", + "version": "2.2.0", "description": "Claude Code plugin that traces sessions, turns, generations, and tool calls to Langfuse", "keywords": [ "claude-code", diff --git a/src/state.ts b/src/state.ts index 8db9e47..0e808ef 100644 --- a/src/state.ts +++ b/src/state.ts @@ -3,6 +3,26 @@ import * as fs from "node:fs/promises"; import type { TranscriptRow } from "./types.js"; import { debugLog } from "./utils.js"; +/** Parse newline-delimited JSON transcript text into rows, skipping bad lines. */ +export function parseRows(text: string): TranscriptRow[] { + const rows: TranscriptRow[] = []; + for (const raw of text.split("\n")) { + const trimmed = raw.trim(); + if (!trimmed) continue; + try { + rows.push(JSON.parse(trimmed) as TranscriptRow); + } catch { + // skip malformed lines rather than aborting the whole upload + } + } + return rows; +} + +/** Read and parse an entire transcript file (used for subagent transcripts). */ +export async function readAllRows(file: string): Promise { + return parseRows(await fs.readFile(file, "utf-8")); +} + /** * Per-transcript dedup state. * @@ -104,16 +124,5 @@ export async function readNewRows( const complete = buffer.subarray(0, lastNewline + 1); const newOffset = offset + complete.length; - const rows: TranscriptRow[] = []; - for (const raw of complete.toString("utf-8").split("\n")) { - const trimmed = raw.trim(); - if (!trimmed) continue; - try { - rows.push(JSON.parse(trimmed) as TranscriptRow); - } catch { - // skip malformed lines rather than aborting the whole upload - } - } - - return { rows, offset: newOffset }; + return { rows: parseRows(complete.toString("utf-8")), offset: newOffset }; } diff --git a/src/subagents.ts b/src/subagents.ts new file mode 100644 index 0000000..c34c74f --- /dev/null +++ b/src/subagents.ts @@ -0,0 +1,75 @@ +import * as fs from "node:fs/promises"; +import * as path from "node:path"; + +import { debugLog } from "./utils.js"; + +/** + * A subagent transcript discovered alongside the main session transcript. + * + * Claude Code records each subagent (spawned via the `Agent`/`Task` tool) as + * its own transcript next to the main one: + * + * /.jsonl ← main transcript + * //subagents/agent-.jsonl ← subagent transcript + * //subagents/agent-.meta.json ← {agentType, description, toolUseId} + * + * The `meta.json`'s `toolUseId` is the `id` of the spawning tool_use block in + * the main transcript, which is how we attach a subagent under the exact tool + * call that launched it. + */ +export type SubagentInfo = { + file: string; + agentType: string; + description?: string; + toolUseId: string; +}; + +/** Map of spawning tool_use id → subagent transcript. */ +export type SubagentIndex = Map; + +/** + * Discover subagent transcripts for a main transcript by reading the sibling + * `subagents/*.meta.json` files. Returns an empty index if there are none (or + * the directory is missing) — subagents are optional. + */ +export async function discoverSubagents(transcriptPath: string): Promise { + const index: SubagentIndex = new Map(); + + // "

/.jsonl" → "//subagents" + const subDir = path.join(transcriptPath.replace(/\.jsonl$/i, ""), "subagents"); + + let entries; + try { + entries = await fs.readdir(subDir, { withFileTypes: true }); + } catch (error) { + if ((error as NodeJS.ErrnoException).code !== "ENOENT") { + debugLog("failed to read subagents directory:", error); + } + return index; + } + + for (const entry of entries) { + if (!entry.isFile() || !entry.name.endsWith(".meta.json")) continue; + const metaPath = path.join(subDir, entry.name); + try { + const meta = JSON.parse(await fs.readFile(metaPath, "utf-8")) as { + agentType?: unknown; + description?: unknown; + toolUseId?: unknown; + }; + if (typeof meta.toolUseId !== "string" || !meta.toolUseId) continue; + const file = path.join(subDir, entry.name.replace(/\.meta\.json$/, ".jsonl")); + index.set(meta.toolUseId, { + file, + agentType: typeof meta.agentType === "string" ? meta.agentType : "subagent", + description: typeof meta.description === "string" ? meta.description : undefined, + toolUseId: meta.toolUseId, + }); + } catch (error) { + debugLog(`failed to parse subagent meta ${entry.name}:`, error); + } + } + + if (index.size > 0) debugLog(`discovered ${index.size} subagent transcript(s)`); + return index; +} diff --git a/src/trace.ts b/src/trace.ts index 20069e0..5eb5c0b 100644 --- a/src/trace.ts +++ b/src/trace.ts @@ -1,8 +1,9 @@ -import { propagateAttributes, startObservation } from "@langfuse/tracing"; +import { propagateAttributes, startObservation, type LangfuseObservation } from "@langfuse/tracing"; import type { Config } from "./config.js"; import { buildTurns } from "./parse.js"; -import { loadState, readNewRows, saveState } from "./state.js"; +import { loadState, readAllRows, readNewRows, saveState } from "./state.js"; +import { discoverSubagents, type SubagentIndex, type SubagentInfo } from "./subagents.js"; import type { AssistantStep, ToolCall, Turn } from "./types.js"; import { debugLog, makeClip, toText, type Clip } from "./utils.js"; @@ -11,6 +12,14 @@ function asDate(ts: number | undefined): Date | undefined { return ts !== undefined ? new Date(ts) : undefined; } +/** Shared state threaded through the recursive emit functions. */ +type EmitCtx = { + clip: Clip; + subagents: SubagentIndex; + /** Subagent transcript files already expanded — guards against cycles. */ + visited: Set; +}; + function buildGenerationOutput( step: AssistantStep, clip: Clip, @@ -28,62 +37,28 @@ function buildGenerationOutput( return Object.keys(output).length > 1 ? output : undefined; } -function emitToolCall( - tc: ToolCall, - parent: ReturnType, - clip: Clip, - fallbackEnd: number | undefined, -): void { - const tool = startObservation( - `Tool: ${tc.name}`, - { - input: clip(tc.input), - output: tc.output != null ? clip(toText(tc.output)) : undefined, - metadata: { "claude.tool_id": tc.id, "claude.tool_name": tc.name }, - }, - { - asType: "tool", - startTime: asDate(tc.startTime), - parentSpanContext: parent.otelSpan.spanContext(), - }, - ); - tool.end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); -} - -/** Emit a single turn as a Langfuse observation tree. */ -function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: Config): void { - const clip = makeClip(config.max_chars); - - const root = startObservation( - "Claude Code Turn", - { - input: { role: "user", content: clip(turn.userText) }, - output: - turn.finalAssistantText != null - ? { role: "assistant", content: clip(turn.finalAssistantText) } - : undefined, - metadata: { - "claude.source": "claude-code", - "claude.turn_number": turnNum, - "claude.transcript_path": transcriptPath, - "claude.assistant_message_count": turn.steps.length, - }, - }, - { - asType: "agent", - startTime: asDate(turn.userTimestamp), - }, - ); - - // The moment the next generation could have started: the original user - // message, or when the previous batch of tool results all returned. - let prevTs = turn.userTimestamp; +/** + * Emit a sequence of assistant steps (one generation each, with nested tool + * observations) under `parent`. Returns the timestamp the last step ended, so + * the caller can close the parent observation cleanly. + */ +async function emitSteps( + parent: LangfuseObservation, + steps: AssistantStep[], + firstInput: unknown, + startTs: number | undefined, + ctx: EmitCtx, +): Promise { + // The moment the next generation could have started: the parent's start + // (user message / subagent prompt), or when the previous tool batch returned. + let prevTs = startTs; let prevToolResults: Array> | undefined; - turn.steps.forEach((step, idx) => { + for (let idx = 0; idx < steps.length; idx++) { + const step = steps[idx]; const input = idx === 0 - ? { role: "user", content: clip(turn.userText) } + ? firstInput : prevToolResults ? { role: "tool", tool_results: prevToolResults } : undefined; @@ -92,7 +67,7 @@ function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: C "Claude Generation", { input, - output: buildGenerationOutput(step, clip), + output: buildGenerationOutput(step, ctx.clip), model: step.model, usageDetails: step.usage, metadata: { "claude.step_index": idx, "claude.tool_count": step.toolCalls.length }, @@ -100,13 +75,13 @@ function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: C { asType: "generation", startTime: asDate(prevTs ?? step.timestamp), - parentSpanContext: root.otelSpan.spanContext(), + parentSpanContext: parent.otelSpan.spanContext(), }, ); const resultTimes: number[] = []; for (const tc of step.toolCalls) { - emitToolCall(tc, generation, clip, step.timestamp); + await emitToolCall(tc, generation, step.timestamp, ctx); if (tc.endTime !== undefined) resultTimes.push(tc.endTime); } @@ -120,22 +95,145 @@ function emitTurn(turn: Turn, turnNum: number, transcriptPath: string, config: C ? step.toolCalls.map((tc) => ({ tool_use_id: tc.id, tool_name: tc.name, - output: tc.output != null ? clip(toText(tc.output)) : undefined, + output: tc.output != null ? ctx.clip(toText(tc.output)) : undefined, })) : undefined; // The next generation can only start once this batch's results returned. if (resultTimes.length > 0) prevTs = Math.max(...resultTimes); else if (step.timestamp !== undefined) prevTs = step.timestamp; - }); + } - root.end(asDate(turn.endTimestamp ?? prevTs ?? turn.userTimestamp)); + return prevTs; +} + +async function emitToolCall( + tc: ToolCall, + parent: LangfuseObservation, + fallbackEnd: number | undefined, + ctx: EmitCtx, +): Promise { + const tool = startObservation( + `Tool: ${tc.name}`, + { + input: ctx.clip(tc.input), + output: tc.output != null ? ctx.clip(toText(tc.output)) : undefined, + metadata: { "claude.tool_id": tc.id, "claude.tool_name": tc.name }, + }, + { + asType: "tool", + startTime: asDate(tc.startTime), + parentSpanContext: parent.otelSpan.spanContext(), + }, + ); + + // If this tool call spawned a subagent, nest the subagent's work under it. + const subagent = ctx.subagents.get(tc.id); + if (subagent && !ctx.visited.has(subagent.file)) { + await emitSubagent(tool, subagent, tc, ctx); + } + + tool.end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); +} + +/** Expand a subagent transcript as nested observations under its tool call. */ +async function emitSubagent( + parentTool: LangfuseObservation, + subagent: SubagentInfo, + tc: ToolCall, + ctx: EmitCtx, +): Promise { + ctx.visited.add(subagent.file); + + let rows; + try { + rows = await readAllRows(subagent.file); + } catch (error) { + debugLog(`failed to read subagent transcript ${subagent.file}:`, error); + return; + } + + const turns = buildTurns(rows); + if (turns.length === 0) return; + + for (const turn of turns) { + const agent = startObservation( + `Subagent: ${subagent.agentType}`, + { + input: { role: "user", content: ctx.clip(turn.userText) }, + output: + turn.finalAssistantText != null + ? { role: "assistant", content: ctx.clip(turn.finalAssistantText) } + : undefined, + metadata: { + "claude.subagent_type": subagent.agentType, + "claude.subagent_description": subagent.description, + "claude.spawning_tool_id": tc.id, + }, + }, + { + asType: "agent", + startTime: asDate(turn.userTimestamp), + parentSpanContext: parentTool.otelSpan.spanContext(), + }, + ); + + const lastTs = await emitSteps( + agent, + turn.steps, + { role: "user", content: ctx.clip(turn.userText) }, + turn.userTimestamp, + ctx, + ); + + agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); + } +} + +/** Emit a single turn as a Langfuse observation tree. */ +async function emitTurn( + turn: Turn, + turnNum: number, + transcriptPath: string, + ctx: EmitCtx, +): Promise { + const root = startObservation( + "Claude Code Turn", + { + input: { role: "user", content: ctx.clip(turn.userText) }, + output: + turn.finalAssistantText != null + ? { role: "assistant", content: ctx.clip(turn.finalAssistantText) } + : undefined, + metadata: { + "claude.source": "claude-code", + "claude.turn_number": turnNum, + "claude.transcript_path": transcriptPath, + "claude.assistant_message_count": turn.steps.length, + }, + }, + { + asType: "agent", + startTime: asDate(turn.userTimestamp), + }, + ); + + const lastTs = await emitSteps( + root, + turn.steps, + { role: "user", content: ctx.clip(turn.userText) }, + turn.userTimestamp, + ctx, + ); + + root.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); } /** * Convert the newly appended part of a Claude Code transcript into Langfuse * traces. Each turn becomes its own trace, grouped into a Langfuse session via - * the Claude Code session id. State is tracked in a sidecar so each turn is + * the Claude Code session id. Subagent transcripts are nested under the tool + * call that spawned them. State is tracked in a sidecar so each turn is * uploaded exactly once. */ export async function convertTranscript( @@ -155,9 +253,12 @@ export async function convertTranscript( const turns = buildTurns(rows); debugLog(`parsed ${turns.length} new turn(s) from ${transcriptPath}`); + const subagents = await discoverSubagents(transcriptPath); + let emitted = 0; for (const turn of turns) { const turnNum = state.turnCount + emitted + 1; + const ctx: EmitCtx = { clip: makeClip(config.max_chars), subagents, visited: new Set() }; try { await propagateAttributes( { @@ -168,7 +269,7 @@ export async function convertTranscript( ...(config.metadata ? { metadata: config.metadata } : {}), }, async () => { - emitTurn(turn, turnNum, transcriptPath, config); + await emitTurn(turn, turnNum, transcriptPath, ctx); }, ); emitted += 1; diff --git a/test/subagents.test.ts b/test/subagents.test.ts new file mode 100644 index 0000000..166f2fe --- /dev/null +++ b/test/subagents.test.ts @@ -0,0 +1,54 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; + +import { afterAll, beforeAll, describe, expect, it } from "vitest"; + +import { discoverSubagents } from "../src/subagents.js"; + +describe("discoverSubagents", () => { + let dir: string; + let transcript: string; + + beforeAll(async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "cc-subagents-")); + const sessionId = "11111111-2222-3333-4444-555555555555"; + transcript = path.join(dir, `${sessionId}.jsonl`); + await fs.writeFile(transcript, "", "utf-8"); + + const subDir = path.join(dir, sessionId, "subagents"); + await fs.mkdir(subDir, { recursive: true }); + await fs.writeFile( + path.join(subDir, "agent-abc.meta.json"), + JSON.stringify({ agentType: "Explore", description: "find things", toolUseId: "toolu_1" }), + "utf-8", + ); + await fs.writeFile(path.join(subDir, "agent-abc.jsonl"), "", "utf-8"); + // A meta with no toolUseId should be ignored. + await fs.writeFile( + path.join(subDir, "agent-def.meta.json"), + JSON.stringify({ agentType: "Plan" }), + "utf-8", + ); + }); + + afterAll(async () => { + await fs.rm(dir, { recursive: true, force: true }); + }); + + it("indexes subagents by their spawning tool_use id", async () => { + const index = await discoverSubagents(transcript); + expect(index.size).toBe(1); + const info = index.get("toolu_1"); + expect(info?.agentType).toBe("Explore"); + expect(info?.description).toBe("find things"); + expect(info?.file).toBe( + path.join(dir, "11111111-2222-3333-4444-555555555555", "subagents", "agent-abc.jsonl"), + ); + }); + + it("returns an empty index when there is no subagents directory", async () => { + const index = await discoverSubagents(path.join(dir, "no-such-session.jsonl")); + expect(index.size).toBe(0); + }); +}); From f550a002c9a2cc9770f09a340c935f6ff07c1f3b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 10 Jun 2026 06:53:04 +0000 Subject: [PATCH 7/8] Switch the TypeScript hook runtime from Node.js to Bun - hooks.json now runs the committed bundle with bun instead of node - Bundle dist/index.mjs with 'bun build' (single self-contained ESM file, dynamic imports inlined) instead of tsdown; drop tsdown.config.ts - Port tests from vitest to Bun's built-in test runner (bun:test) - Replace pnpm with bun: bun.lock instead of pnpm-lock.yaml, scripts use bun, engines require bun >= 1.2, packageManager dropped - Update README prerequisites and development docs to Bun - Bump plugin version to 3.0.0 (runtime prerequisite change) Verified end-to-end under Bun against a mock Langfuse OTLP endpoint: turn/generation/tool span tree, session-id and user-id context propagation via AsyncLocalStorage, token usage, backdated timestamps, exactly-once sidecar dedup, and fail-open behavior all intact. https://claude.ai/code/session_015es18wH2qWjsuPtZrXQCjA --- .claude-plugin/plugin.json | 2 +- .prettierignore | 2 +- README.md | 16 +- bun.lock | 114 + dist/index.mjs | 98199 ++++++++++++++++++----------------- hooks/hooks.json | 2 +- package.json | 22 +- pnpm-lock.yaml | 1743 - src/instrumentation.ts | 4 +- test/config.test.ts | 2 +- test/parse.test.ts | 2 +- test/subagents.test.ts | 2 +- tsconfig.json | 2 +- tsdown.config.ts | 23 - 14 files changed, 51751 insertions(+), 48384 deletions(-) create mode 100644 bun.lock delete mode 100644 pnpm-lock.yaml delete mode 100644 tsdown.config.ts diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 1715ec2..ed823e0 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "langfuse", "description": "The Langfuse x Claude Code Observability Plugin", - "version": "2.2.0", + "version": "3.0.0", "author": { "name": "Langfuse" }, diff --git a/.prettierignore b/.prettierignore index e854151..59b45ea 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,4 @@ node_modules dist -pnpm-lock.yaml +bun.lock .claude diff --git a/README.md b/README.md index 2dd0952..49c56a8 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,10 @@ Original timestamps are preserved on every span, so the Langfuse timeline reflec ## Prerequisites -- [Node.js](https://nodejs.org) >= 20 +- [Bun](https://bun.sh) >= 1.2 - A [Langfuse Cloud](https://cloud.langfuse.com) account (or a [self-hosted](https://langfuse.com/self-hosting) instance) and API keys -No Python and no `pip install` — the hook ships as a single self-contained JavaScript bundle that runs on the Node.js already required by most dev environments. +No Python and no `pip install` — the hook ships as a single self-contained JavaScript bundle that Bun runs directly; no `node_modules`, no install step. ## Installation @@ -103,7 +103,7 @@ Instead of environment variables you can create `~/.claude/langfuse.json` (globa ## How it works -A `Stop` hook runs `node "${CLAUDE_PLUGIN_ROOT}/dist/index.mjs"` after every turn. The hook reads the session transcript **incrementally**: a small sidecar file next to the transcript (`.jsonl.langfuse`) records the byte offset already processed and the number of turns emitted, so each turn is uploaded exactly once even though the hook fires repeatedly over the life of a session. +A `Stop` hook runs `bun "${CLAUDE_PLUGIN_ROOT}/dist/index.mjs"` after every turn. The hook reads the session transcript **incrementally**: a small sidecar file next to the transcript (`.jsonl.langfuse`) records the byte offset already processed and the number of turns emitted, so each turn is uploaded exactly once even though the hook fires repeatedly over the life of a session. Spans are sent via the [Langfuse TypeScript SDK](https://langfuse.com/docs/sdk/typescript) on top of OpenTelemetry, batched, and flushed once at the end of the hook (capped by the hook's 30s timeout). The hook **fails open**: any error is swallowed (logged in debug mode) so a tracing problem never blocks your Claude Code session. @@ -112,13 +112,13 @@ Spans are sent via the [Langfuse TypeScript SDK](https://langfuse.com/docs/sdk/t The hook ships as a committed, pre-bundled `dist/index.mjs` so it runs without an install step. To work on it: ```bash -pnpm install -pnpm run build # bundle src/ → dist/index.mjs (tsdown) -pnpm run test # vitest -pnpm run lint # prettier + tsc --noEmit + verify dist is up to date +bun install +bun run build # bundle src/ → dist/index.mjs (bun build) +bun run test # bun test +bun run lint # prettier + tsc --noEmit + verify dist is up to date ``` -All runtime dependencies (Langfuse SDK, OpenTelemetry, zod) are bundled into the single `dist/index.mjs`; only Node.js built-ins stay external. Rebuild and commit `dist/index.mjs` after any change to `src/`. +All runtime dependencies (Langfuse SDK, OpenTelemetry, zod) are bundled into the single `dist/index.mjs`; only Node.js built-ins (which Bun provides) stay external. Rebuild and commit `dist/index.mjs` after any change to `src/`. ## Troubleshooting diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..e07ad32 --- /dev/null +++ b/bun.lock @@ -0,0 +1,114 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "name": "@langfuse/claude-observability-plugin", + "dependencies": { + "@langfuse/otel": "^5.4.1", + "@langfuse/tracing": "^5.4.1", + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/core": "^2.0.1", + "@opentelemetry/exporter-trace-otlp-http": "^0.205.0", + "@opentelemetry/sdk-trace-base": "^2.0.1", + "@opentelemetry/sdk-trace-node": "^2.0.1", + "zod": "^4.1.13", + }, + "devDependencies": { + "@types/bun": "^1.3.14", + "@types/node": "^22.10.0", + "prettier": "^3.4.2", + "typescript": "^5.7.2", + }, + }, + }, + "packages": { + "@langfuse/core": ["@langfuse/core@5.4.1", "", { "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-TjaRTr9fGqaWuyYKFSezKxN4DWAaK/lq//hRMw8rQKFkZUs6vTgUODxqZTFTR6np5VnLVw+eZLlnHROPKbXqdg=="], + + "@langfuse/otel": ["@langfuse/otel@5.4.1", "", { "dependencies": { "@langfuse/core": "5.4.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1", "@opentelemetry/core": "2.7.1", "@opentelemetry/exporter-trace-otlp-http": "0.205.0", "@opentelemetry/sdk-trace-base": "2.7.1" } }, "sha512-w69aVC2fTmd7hyCTaX8zhhivHlsGVgZ551XOf6yMSOi3k8tlDML4dinnjJUP/6qTvdH54NYcmAIp5KZRbkouxg=="], + + "@langfuse/tracing": ["@langfuse/tracing@5.4.1", "", { "dependencies": { "@langfuse/core": "5.4.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-nPyoPXXNMaJgaUZgIE0haWI/hrT7l4r/irp0o/FGaBYR2V07EFNvSKFcqOsX1pQvVvB6HyfNlYQm7AoQJj+fqQ=="], + + "@opentelemetry/api": ["@opentelemetry/api@1.9.1", "", {}, "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q=="], + + "@opentelemetry/api-logs": ["@opentelemetry/api-logs@0.205.0", "", { "dependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-wBlPk1nFB37Hsm+3Qy73yQSobVn28F4isnWIBvKpd5IUH/eat8bwcL02H9yzmHyyPmukeccSl2mbN5sDQZYnPg=="], + + "@opentelemetry/context-async-hooks": ["@opentelemetry/context-async-hooks@2.7.1", "", { "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-OPFBYuXEn1E4ja3Y6eeA7O+ZnLBNcXTV5Cgsn1VaqBZ6hC5FnpZPLBNme1LJY8ZtF4aOujPKFoeWN4ik487KuQ=="], + + "@opentelemetry/core": ["@opentelemetry/core@2.7.1", "", { "dependencies": { "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-QAqIj32AtK6+pEVNG7EOVxHdE06RP+FM5qpiEJ4RtDcFIqKUZHYhl7/7UY5efhwmwNAg7j8QbJVBLxMerc0+gw=="], + + "@opentelemetry/exporter-trace-otlp-http": ["@opentelemetry/exporter-trace-otlp-http@0.205.0", "", { "dependencies": { "@opentelemetry/core": "2.1.0", "@opentelemetry/otlp-exporter-base": "0.205.0", "@opentelemetry/otlp-transformer": "0.205.0", "@opentelemetry/resources": "2.1.0", "@opentelemetry/sdk-trace-base": "2.1.0" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-vr2bwwPCSc9u7rbKc74jR+DXFvyMFQo9o5zs+H/fgbK672Whw/1izUKVf+xfWOdJOvuwTnfWxy+VAY+4TSo74Q=="], + + "@opentelemetry/otlp-exporter-base": ["@opentelemetry/otlp-exporter-base@0.205.0", "", { "dependencies": { "@opentelemetry/core": "2.1.0", "@opentelemetry/otlp-transformer": "0.205.0" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-2MN0C1IiKyo34M6NZzD6P9Nv9Dfuz3OJ3rkZwzFmF6xzjDfqqCTatc9v1EpNfaP55iDOCLHFyYNCgs61FFgtUQ=="], + + "@opentelemetry/otlp-transformer": ["@opentelemetry/otlp-transformer@0.205.0", "", { "dependencies": { "@opentelemetry/api-logs": "0.205.0", "@opentelemetry/core": "2.1.0", "@opentelemetry/resources": "2.1.0", "@opentelemetry/sdk-logs": "0.205.0", "@opentelemetry/sdk-metrics": "2.1.0", "@opentelemetry/sdk-trace-base": "2.1.0", "protobufjs": "7.6.2" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-KmObgqPtk9k/XTlWPJHdMbGCylRAmMJNXIRh6VYJmvlRDMfe+DonH41G7eenG8t4FXn3fxOGh14o/WiMRR6vPg=="], + + "@opentelemetry/resources": ["@opentelemetry/resources@2.1.0", "", { "dependencies": { "@opentelemetry/core": "2.1.0", "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-1CJjf3LCvoefUOgegxi8h6r4B/wLSzInyhGP2UmIBYNlo4Qk5CZ73e1eEyWmfXvFtm1ybkmfb2DqWvspsYLrWw=="], + + "@opentelemetry/sdk-logs": ["@opentelemetry/sdk-logs@0.205.0", "", { "dependencies": { "@opentelemetry/api-logs": "0.205.0", "@opentelemetry/core": "2.1.0", "@opentelemetry/resources": "2.1.0" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-nyqhNQ6eEzPWQU60Nc7+A5LIq8fz3UeIzdEVBQYefB4+msJZ2vuVtRuk9KxPMw1uHoHDtYEwkr2Ct0iG29jU8w=="], + + "@opentelemetry/sdk-metrics": ["@opentelemetry/sdk-metrics@2.1.0", "", { "dependencies": { "@opentelemetry/core": "2.1.0", "@opentelemetry/resources": "2.1.0" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-J9QX459mzqHLL9Y6FZ4wQPRZG4TOpMCyPOh6mkr/humxE1W2S3Bvf4i75yiMW9uyed2Kf5rxmLhTm/UK8vNkAw=="], + + "@opentelemetry/sdk-trace-base": ["@opentelemetry/sdk-trace-base@2.7.1", "", { "dependencies": { "@opentelemetry/core": "2.7.1", "@opentelemetry/resources": "2.7.1", "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-NAYIlsF8MPUsKqJMiDQJTMPOmlbawC1Iz/omMLygZ1C9am8fTKYjTaI+OZM+WTY3t3Glo0wnOg/6/pac6RGPPw=="], + + "@opentelemetry/sdk-trace-node": ["@opentelemetry/sdk-trace-node@2.7.1", "", { "dependencies": { "@opentelemetry/context-async-hooks": "2.7.1", "@opentelemetry/core": "2.7.1", "@opentelemetry/sdk-trace-base": "2.7.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-pCpQxU68lV+I9s9svqMyVu5iHdDDUnqUpSxqwyCU8A9ejEsSnMPCbearwsUO4yk08ZJzAIUCFuReMdVQvHrdvg=="], + + "@opentelemetry/semantic-conventions": ["@opentelemetry/semantic-conventions@1.41.1", "", {}, "sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA=="], + + "@protobufjs/aspromise": ["@protobufjs/aspromise@1.1.2", "", {}, "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="], + + "@protobufjs/base64": ["@protobufjs/base64@1.1.2", "", {}, "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="], + + "@protobufjs/codegen": ["@protobufjs/codegen@2.0.5", "", {}, "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g=="], + + "@protobufjs/eventemitter": ["@protobufjs/eventemitter@1.1.1", "", {}, "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg=="], + + "@protobufjs/fetch": ["@protobufjs/fetch@1.1.1", "", { "dependencies": { "@protobufjs/aspromise": "1.1.2" } }, "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw=="], + + "@protobufjs/float": ["@protobufjs/float@1.0.2", "", {}, "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="], + + "@protobufjs/inquire": ["@protobufjs/inquire@1.1.2", "", {}, "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw=="], + + "@protobufjs/path": ["@protobufjs/path@1.1.2", "", {}, "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="], + + "@protobufjs/pool": ["@protobufjs/pool@1.1.0", "", {}, "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="], + + "@protobufjs/utf8": ["@protobufjs/utf8@1.1.1", "", {}, "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg=="], + + "@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="], + + "@types/node": ["@types/node@22.19.20", "", { "dependencies": { "undici-types": "6.21.0" } }, "sha512-6tELRwSDYWW9EdZhbeZmYGZ1/7Djkt+Ah3/ScEYT9cDord7UJzasR/4D3VONg9tQI5CDp+/CZC1AXj2pCFOvpw=="], + + "bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="], + + "long": ["long@5.3.2", "", {}, "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA=="], + + "prettier": ["prettier@3.8.3", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw=="], + + "protobufjs": ["protobufjs@7.6.2", "", { "dependencies": { "@protobufjs/aspromise": "1.1.2", "@protobufjs/base64": "1.1.2", "@protobufjs/codegen": "2.0.5", "@protobufjs/eventemitter": "1.1.1", "@protobufjs/fetch": "1.1.1", "@protobufjs/float": "1.0.2", "@protobufjs/inquire": "1.1.2", "@protobufjs/path": "1.1.2", "@protobufjs/pool": "1.1.0", "@protobufjs/utf8": "1.1.1", "@types/node": "22.19.20", "long": "5.3.2" } }, "sha512-N9EiLovGEQOJSPF26Ij7qUGvahfEnq0eeYZ02aigIedkmz1qZSwjnP9SBITHJuF/6MYbIW4HDN8zdYjsjqJKXQ=="], + + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + + "undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + + "zod": ["zod@4.4.3", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="], + + "@opentelemetry/exporter-trace-otlp-http/@opentelemetry/core": ["@opentelemetry/core@2.1.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ=="], + + "@opentelemetry/exporter-trace-otlp-http/@opentelemetry/sdk-trace-base": ["@opentelemetry/sdk-trace-base@2.1.0", "", { "dependencies": { "@opentelemetry/core": "2.1.0", "@opentelemetry/resources": "2.1.0", "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-uTX9FBlVQm4S2gVQO1sb5qyBLq/FPjbp+tmGoxu4tIgtYGmBYB44+KX/725RFDe30yBSaA9Ml9fqphe1hbUyLQ=="], + + "@opentelemetry/otlp-exporter-base/@opentelemetry/core": ["@opentelemetry/core@2.1.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ=="], + + "@opentelemetry/otlp-transformer/@opentelemetry/core": ["@opentelemetry/core@2.1.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ=="], + + "@opentelemetry/otlp-transformer/@opentelemetry/sdk-trace-base": ["@opentelemetry/sdk-trace-base@2.1.0", "", { "dependencies": { "@opentelemetry/core": "2.1.0", "@opentelemetry/resources": "2.1.0", "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-uTX9FBlVQm4S2gVQO1sb5qyBLq/FPjbp+tmGoxu4tIgtYGmBYB44+KX/725RFDe30yBSaA9Ml9fqphe1hbUyLQ=="], + + "@opentelemetry/resources/@opentelemetry/core": ["@opentelemetry/core@2.1.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ=="], + + "@opentelemetry/sdk-logs/@opentelemetry/core": ["@opentelemetry/core@2.1.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ=="], + + "@opentelemetry/sdk-metrics/@opentelemetry/core": ["@opentelemetry/core@2.1.0", "", { "dependencies": { "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ=="], + + "@opentelemetry/sdk-trace-base/@opentelemetry/resources": ["@opentelemetry/resources@2.7.1", "", { "dependencies": { "@opentelemetry/core": "2.7.1", "@opentelemetry/semantic-conventions": "1.41.1" }, "peerDependencies": { "@opentelemetry/api": "1.9.1" } }, "sha512-DeT6KKolmC4e/dRQvMQ/RwlnzhaqeiFOXY5ngoOPJ07GgVVKxZOg9EcrNZb5aTzUn+iCrJldAgOfQm1O/QfPAQ=="], + } +} diff --git a/dist/index.mjs b/dist/index.mjs index 25c70e9..3c9a260 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,47153 +1,52172 @@ import { createRequire } from "node:module"; -import * as fs from "node:fs/promises"; -import * as os$2 from "node:os"; -import * as path from "node:path"; -import * as zlib from "zlib"; -import { Readable } from "stream"; - -//#region rolldown:runtime var __create = Object.create; -var __defProp$1 = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; +var __defProp = Object.defineProperty; +var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); -var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); -var __exportAll = (all, symbols) => { - let target = {}; - for (var name in all) { - __defProp$1(target, name, { - get: all[name], - enumerable: true - }); - } - if (symbols) { - __defProp$1(target, Symbol.toStringTag, { value: "Module" }); - } - return target; +function __accessProp(key) { + return this[key]; +} +var __toESMCache_node; +var __toESMCache_esm; +var __toESM = (mod, isNodeMode, target) => { + var canCache = mod != null && typeof mod === "object"; + if (canCache) { + var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap; + var cached = cache.get(mod); + if (cached) + return cached; + } + target = mod != null ? __create(__getProtoOf(mod)) : {}; + const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target; + for (let key of __getOwnPropNames(mod)) + if (!__hasOwnProp.call(to, key)) + __defProp(to, key, { + get: __accessProp.bind(mod, key), + enumerable: true + }); + if (canCache) + cache.set(mod, to); + return to; +}; +var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); +var __returnValue = (v) => v; +function __exportSetter(name, newValue) { + this[name] = __returnValue.bind(null, newValue); +} +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { + get: all[name], + enumerable: true, + configurable: true, + set: __exportSetter.bind(all, name) + }); +}; +var __require = /* @__PURE__ */ createRequire(import.meta.url); + +// node_modules/@opentelemetry/api/build/src/version.js +var require_version = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "1.9.1"; +}); + +// node_modules/@opentelemetry/api/build/src/internal/semver.js +var require_semver = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isCompatible = exports._makeCompatibilityCheck = undefined; + var version_1 = require_version(); + var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; + function _makeCompatibilityCheck(ownVersion) { + const acceptedVersions = new Set([ownVersion]); + const rejectedVersions = new Set; + const myVersionMatch = ownVersion.match(re); + if (!myVersionMatch) { + return () => false; + } + const ownVersionParsed = { + major: +myVersionMatch[1], + minor: +myVersionMatch[2], + patch: +myVersionMatch[3], + prerelease: myVersionMatch[4] + }; + if (ownVersionParsed.prerelease != null) { + return function isExactmatch(globalVersion) { + return globalVersion === ownVersion; + }; + } + function _reject(v) { + rejectedVersions.add(v); + return false; + } + function _accept(v) { + acceptedVersions.add(v); + return true; + } + return function isCompatible(globalVersion) { + if (acceptedVersions.has(globalVersion)) { + return true; + } + if (rejectedVersions.has(globalVersion)) { + return false; + } + const globalVersionMatch = globalVersion.match(re); + if (!globalVersionMatch) { + return _reject(globalVersion); + } + const globalVersionParsed = { + major: +globalVersionMatch[1], + minor: +globalVersionMatch[2], + patch: +globalVersionMatch[3], + prerelease: globalVersionMatch[4] + }; + if (globalVersionParsed.prerelease != null) { + return _reject(globalVersion); + } + if (ownVersionParsed.major !== globalVersionParsed.major) { + return _reject(globalVersion); + } + if (ownVersionParsed.major === 0) { + if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) { + return _accept(globalVersion); + } + return _reject(globalVersion); + } + if (ownVersionParsed.minor <= globalVersionParsed.minor) { + return _accept(globalVersion); + } + return _reject(globalVersion); + }; + } + exports._makeCompatibilityCheck = _makeCompatibilityCheck; + exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); +}); + +// node_modules/@opentelemetry/api/build/src/internal/global-utils.js +var require_global_utils = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = undefined; + var version_1 = require_version(); + var semver_1 = require_semver(); + var major = version_1.VERSION.split(".")[0]; + var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); + var _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {}; + function registerGlobal(type, instance, diag, allowOverride = false) { + var _a3; + const api2 = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a3 !== undefined ? _a3 : { + version: version_1.VERSION + }; + if (!allowOverride && api2[type]) { + const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); + diag.error(err.stack || err.message); + return false; + } + if (api2.version !== version_1.VERSION) { + const err = new Error(`@opentelemetry/api: Registration of version v${api2.version} for ${type} does not match previously registered API v${version_1.VERSION}`); + diag.error(err.stack || err.message); + return false; + } + api2[type] = instance; + diag.debug(`@opentelemetry/api: Registered a global for ${type} v${version_1.VERSION}.`); + return true; + } + exports.registerGlobal = registerGlobal; + function getGlobal(type) { + var _a3, _b; + const globalVersion = (_a3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a3 === undefined ? undefined : _a3.version; + if (!globalVersion || !(0, semver_1.isCompatible)(globalVersion)) { + return; + } + return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === undefined ? undefined : _b[type]; + } + exports.getGlobal = getGlobal; + function unregisterGlobal(type, diag) { + diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${version_1.VERSION}.`); + const api2 = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (api2) { + delete api2[type]; + } + } + exports.unregisterGlobal = unregisterGlobal; +}); + +// node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js +var require_ComponentLogger = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DiagComponentLogger = undefined; + var global_utils_1 = require_global_utils(); + + class DiagComponentLogger { + constructor(props) { + this._namespace = props.namespace || "DiagComponentLogger"; + } + debug(...args) { + return logProxy("debug", this._namespace, args); + } + error(...args) { + return logProxy("error", this._namespace, args); + } + info(...args) { + return logProxy("info", this._namespace, args); + } + warn(...args) { + return logProxy("warn", this._namespace, args); + } + verbose(...args) { + return logProxy("verbose", this._namespace, args); + } + } + exports.DiagComponentLogger = DiagComponentLogger; + function logProxy(funcName, namespace, args) { + const logger = (0, global_utils_1.getGlobal)("diag"); + if (!logger) { + return; + } + return logger[funcName](namespace, ...args); + } +}); + +// node_modules/@opentelemetry/api/build/src/diag/types.js +var require_types = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DiagLogLevel = undefined; + var DiagLogLevel; + (function(DiagLogLevel2) { + DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE"; + DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR"; + DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN"; + DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO"; + DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG"; + DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE"; + DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL"; + })(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); +}); + +// node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js +var require_logLevelLogger = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createLogLevelDiagLogger = undefined; + var types_1 = require_types(); + function createLogLevelDiagLogger(maxLevel, logger) { + if (maxLevel < types_1.DiagLogLevel.NONE) { + maxLevel = types_1.DiagLogLevel.NONE; + } else if (maxLevel > types_1.DiagLogLevel.ALL) { + maxLevel = types_1.DiagLogLevel.ALL; + } + logger = logger || {}; + function _filterFunc(funcName, theLevel) { + const theFunc = logger[funcName]; + if (typeof theFunc === "function" && maxLevel >= theLevel) { + return theFunc.bind(logger); + } + return function() {}; + } + return { + error: _filterFunc("error", types_1.DiagLogLevel.ERROR), + warn: _filterFunc("warn", types_1.DiagLogLevel.WARN), + info: _filterFunc("info", types_1.DiagLogLevel.INFO), + debug: _filterFunc("debug", types_1.DiagLogLevel.DEBUG), + verbose: _filterFunc("verbose", types_1.DiagLogLevel.VERBOSE) + }; + } + exports.createLogLevelDiagLogger = createLogLevelDiagLogger; +}); + +// node_modules/@opentelemetry/api/build/src/api/diag.js +var require_diag = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DiagAPI = undefined; + var ComponentLogger_1 = require_ComponentLogger(); + var logLevelLogger_1 = require_logLevelLogger(); + var types_1 = require_types(); + var global_utils_1 = require_global_utils(); + var API_NAME = "diag"; + + class DiagAPI { + static instance() { + if (!this._instance) { + this._instance = new DiagAPI; + } + return this._instance; + } + constructor() { + function _logProxy(funcName) { + return function(...args) { + const logger = (0, global_utils_1.getGlobal)("diag"); + if (!logger) + return; + return logger[funcName](...args); + }; + } + const self2 = this; + const setLogger = (logger, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => { + var _a3, _b, _c; + if (logger === self2) { + const err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); + self2.error((_a3 = err.stack) !== null && _a3 !== undefined ? _a3 : err.message); + return false; + } + if (typeof optionsOrLogLevel === "number") { + optionsOrLogLevel = { + logLevel: optionsOrLogLevel + }; + } + const oldLogger = (0, global_utils_1.getGlobal)("diag"); + const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b = optionsOrLogLevel.logLevel) !== null && _b !== undefined ? _b : types_1.DiagLogLevel.INFO, logger); + if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { + const stack = (_c = new Error().stack) !== null && _c !== undefined ? _c : ""; + oldLogger.warn(`Current logger will be overwritten from ${stack}`); + newLogger.warn(`Current logger will overwrite one already registered from ${stack}`); + } + return (0, global_utils_1.registerGlobal)("diag", newLogger, self2, true); + }; + self2.setLogger = setLogger; + self2.disable = () => { + (0, global_utils_1.unregisterGlobal)(API_NAME, self2); + }; + self2.createComponentLogger = (options) => { + return new ComponentLogger_1.DiagComponentLogger(options); + }; + self2.verbose = _logProxy("verbose"); + self2.debug = _logProxy("debug"); + self2.info = _logProxy("info"); + self2.warn = _logProxy("warn"); + self2.error = _logProxy("error"); + } + } + exports.DiagAPI = DiagAPI; +}); + +// node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js +var require_baggage_impl = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BaggageImpl = undefined; + + class BaggageImpl { + constructor(entries) { + this._entries = entries ? new Map(entries) : new Map; + } + getEntry(key) { + const entry = this._entries.get(key); + if (!entry) { + return; + } + return Object.assign({}, entry); + } + getAllEntries() { + return Array.from(this._entries.entries()); + } + setEntry(key, entry) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.set(key, entry); + return newBaggage; + } + removeEntry(key) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.delete(key); + return newBaggage; + } + removeEntries(...keys) { + const newBaggage = new BaggageImpl(this._entries); + for (const key of keys) { + newBaggage._entries.delete(key); + } + return newBaggage; + } + clear() { + return new BaggageImpl; + } + } + exports.BaggageImpl = BaggageImpl; +}); + +// node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js +var require_symbol = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.baggageEntryMetadataSymbol = undefined; + exports.baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata"); +}); + +// node_modules/@opentelemetry/api/build/src/baggage/utils.js +var require_utils = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.baggageEntryMetadataFromString = exports.createBaggage = undefined; + var diag_1 = require_diag(); + var baggage_impl_1 = require_baggage_impl(); + var symbol_1 = require_symbol(); + var diag = diag_1.DiagAPI.instance(); + function createBaggage(entries = {}) { + return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries))); + } + exports.createBaggage = createBaggage; + function baggageEntryMetadataFromString(str) { + if (typeof str !== "string") { + diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`); + str = ""; + } + return { + __TYPE__: symbol_1.baggageEntryMetadataSymbol, + toString() { + return str; + } + }; + } + exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; +}); + +// node_modules/@opentelemetry/api/build/src/context/context.js +var require_context = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ROOT_CONTEXT = exports.createContextKey = undefined; + function createContextKey(description) { + return Symbol.for(description); + } + exports.createContextKey = createContextKey; + + class BaseContext { + constructor(parentContext) { + const self2 = this; + self2._currentContext = parentContext ? new Map(parentContext) : new Map; + self2.getValue = (key) => self2._currentContext.get(key); + self2.setValue = (key, value) => { + const context = new BaseContext(self2._currentContext); + context._currentContext.set(key, value); + return context; + }; + self2.deleteValue = (key) => { + const context = new BaseContext(self2._currentContext); + context._currentContext.delete(key); + return context; + }; + } + } + exports.ROOT_CONTEXT = new BaseContext; +}); + +// node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js +var require_consoleLogger = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DiagConsoleLogger = exports._originalConsoleMethods = undefined; + var consoleMap = [ + { n: "error", c: "error" }, + { n: "warn", c: "warn" }, + { n: "info", c: "info" }, + { n: "debug", c: "debug" }, + { n: "verbose", c: "trace" } + ]; + exports._originalConsoleMethods = {}; + if (typeof console !== "undefined") { + const keys = [ + "error", + "warn", + "info", + "debug", + "trace", + "log" + ]; + for (const key of keys) { + if (typeof console[key] === "function") { + exports._originalConsoleMethods[key] = console[key]; + } + } + } + + class DiagConsoleLogger { + constructor() { + function _consoleFunc(funcName) { + return function(...args) { + let theFunc = exports._originalConsoleMethods[funcName]; + if (typeof theFunc !== "function") { + theFunc = exports._originalConsoleMethods["log"]; + } + if (typeof theFunc !== "function" && console) { + theFunc = console[funcName]; + if (typeof theFunc !== "function") { + theFunc = console.log; + } + } + if (typeof theFunc === "function") { + return theFunc.apply(console, args); + } + }; + } + for (let i = 0;i < consoleMap.length; i++) { + this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); + } + } + } + exports.DiagConsoleLogger = DiagConsoleLogger; +}); + +// node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js +var require_NoopMeter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_GAUGE_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopGaugeMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = undefined; + + class NoopMeter { + constructor() {} + createGauge(_name, _options) { + return exports.NOOP_GAUGE_METRIC; + } + createHistogram(_name, _options) { + return exports.NOOP_HISTOGRAM_METRIC; + } + createCounter(_name, _options) { + return exports.NOOP_COUNTER_METRIC; + } + createUpDownCounter(_name, _options) { + return exports.NOOP_UP_DOWN_COUNTER_METRIC; + } + createObservableGauge(_name, _options) { + return exports.NOOP_OBSERVABLE_GAUGE_METRIC; + } + createObservableCounter(_name, _options) { + return exports.NOOP_OBSERVABLE_COUNTER_METRIC; + } + createObservableUpDownCounter(_name, _options) { + return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; + } + addBatchObservableCallback(_callback, _observables) {} + removeBatchObservableCallback(_callback) {} + } + exports.NoopMeter = NoopMeter; + + class NoopMetric { + } + exports.NoopMetric = NoopMetric; + + class NoopCounterMetric extends NoopMetric { + add(_value, _attributes) {} + } + exports.NoopCounterMetric = NoopCounterMetric; + + class NoopUpDownCounterMetric extends NoopMetric { + add(_value, _attributes) {} + } + exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric; + + class NoopGaugeMetric extends NoopMetric { + record(_value, _attributes) {} + } + exports.NoopGaugeMetric = NoopGaugeMetric; + + class NoopHistogramMetric extends NoopMetric { + record(_value, _attributes) {} + } + exports.NoopHistogramMetric = NoopHistogramMetric; + + class NoopObservableMetric { + addCallback(_callback) {} + removeCallback(_callback) {} + } + exports.NoopObservableMetric = NoopObservableMetric; + + class NoopObservableCounterMetric extends NoopObservableMetric { + } + exports.NoopObservableCounterMetric = NoopObservableCounterMetric; + + class NoopObservableGaugeMetric extends NoopObservableMetric { + } + exports.NoopObservableGaugeMetric = NoopObservableGaugeMetric; + + class NoopObservableUpDownCounterMetric extends NoopObservableMetric { + } + exports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric; + exports.NOOP_METER = new NoopMeter; + exports.NOOP_COUNTER_METRIC = new NoopCounterMetric; + exports.NOOP_GAUGE_METRIC = new NoopGaugeMetric; + exports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric; + exports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric; + exports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric; + exports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric; + exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric; + function createNoopMeter() { + return exports.NOOP_METER; + } + exports.createNoopMeter = createNoopMeter; +}); + +// node_modules/@opentelemetry/api/build/src/metrics/Metric.js +var require_Metric = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ValueType = undefined; + var ValueType; + (function(ValueType2) { + ValueType2[ValueType2["INT"] = 0] = "INT"; + ValueType2[ValueType2["DOUBLE"] = 1] = "DOUBLE"; + })(ValueType = exports.ValueType || (exports.ValueType = {})); +}); + +// node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js +var require_TextMapPropagator = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultTextMapSetter = exports.defaultTextMapGetter = undefined; + exports.defaultTextMapGetter = { + get(carrier, key) { + if (carrier == null) { + return; + } + return carrier[key]; + }, + keys(carrier) { + if (carrier == null) { + return []; + } + return Object.keys(carrier); + } + }; + exports.defaultTextMapSetter = { + set(carrier, key, value) { + if (carrier == null) { + return; + } + carrier[key] = value; + } + }; +}); + +// node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js +var require_NoopContextManager = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NoopContextManager = undefined; + var context_1 = require_context(); + + class NoopContextManager { + active() { + return context_1.ROOT_CONTEXT; + } + with(_context, fn, thisArg, ...args) { + return fn.call(thisArg, ...args); + } + bind(_context, target) { + return target; + } + enable() { + return this; + } + disable() { + return this; + } + } + exports.NoopContextManager = NoopContextManager; +}); + +// node_modules/@opentelemetry/api/build/src/api/context.js +var require_context2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ContextAPI = undefined; + var NoopContextManager_1 = require_NoopContextManager(); + var global_utils_1 = require_global_utils(); + var diag_1 = require_diag(); + var API_NAME = "context"; + var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager; + + class ContextAPI { + constructor() {} + static getInstance() { + if (!this._instance) { + this._instance = new ContextAPI; + } + return this._instance; + } + setGlobalContextManager(contextManager) { + return (0, global_utils_1.registerGlobal)(API_NAME, contextManager, diag_1.DiagAPI.instance()); + } + active() { + return this._getContextManager().active(); + } + with(context, fn, thisArg, ...args) { + return this._getContextManager().with(context, fn, thisArg, ...args); + } + bind(context, target) { + return this._getContextManager().bind(context, target); + } + _getContextManager() { + return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_CONTEXT_MANAGER; + } + disable() { + this._getContextManager().disable(); + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + } + } + exports.ContextAPI = ContextAPI; +}); + +// node_modules/@opentelemetry/api/build/src/trace/trace_flags.js +var require_trace_flags = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceFlags = undefined; + var TraceFlags; + (function(TraceFlags2) { + TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE"; + TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED"; + })(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); +}); + +// node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js +var require_invalid_span_constants = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = undefined; + var trace_flags_1 = require_trace_flags(); + exports.INVALID_SPANID = "0000000000000000"; + exports.INVALID_TRACEID = "00000000000000000000000000000000"; + exports.INVALID_SPAN_CONTEXT = { + traceId: exports.INVALID_TRACEID, + spanId: exports.INVALID_SPANID, + traceFlags: trace_flags_1.TraceFlags.NONE + }; +}); + +// node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js +var require_NonRecordingSpan = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NonRecordingSpan = undefined; + var invalid_span_constants_1 = require_invalid_span_constants(); + + class NonRecordingSpan { + constructor(spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) { + this._spanContext = spanContext; + } + spanContext() { + return this._spanContext; + } + setAttribute(_key, _value) { + return this; + } + setAttributes(_attributes) { + return this; + } + addEvent(_name, _attributes) { + return this; + } + addLink(_link) { + return this; + } + addLinks(_links) { + return this; + } + setStatus(_status) { + return this; + } + updateName(_name) { + return this; + } + end(_endTime) {} + isRecording() { + return false; + } + recordException(_exception, _time) {} + } + exports.NonRecordingSpan = NonRecordingSpan; +}); + +// node_modules/@opentelemetry/api/build/src/trace/context-utils.js +var require_context_utils = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getActiveSpan = exports.getSpan = undefined; + var context_1 = require_context(); + var NonRecordingSpan_1 = require_NonRecordingSpan(); + var context_2 = require_context2(); + var SPAN_KEY = (0, context_1.createContextKey)("OpenTelemetry Context Key SPAN"); + function getSpan(context) { + return context.getValue(SPAN_KEY) || undefined; + } + exports.getSpan = getSpan; + function getActiveSpan() { + return getSpan(context_2.ContextAPI.getInstance().active()); + } + exports.getActiveSpan = getActiveSpan; + function setSpan(context, span) { + return context.setValue(SPAN_KEY, span); + } + exports.setSpan = setSpan; + function deleteSpan(context) { + return context.deleteValue(SPAN_KEY); + } + exports.deleteSpan = deleteSpan; + function setSpanContext(context, spanContext) { + return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext)); + } + exports.setSpanContext = setSpanContext; + function getSpanContext(context) { + var _a3; + return (_a3 = getSpan(context)) === null || _a3 === undefined ? undefined : _a3.spanContext(); + } + exports.getSpanContext = getSpanContext; +}); + +// node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js +var require_spancontext_utils = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = undefined; + var invalid_span_constants_1 = require_invalid_span_constants(); + var NonRecordingSpan_1 = require_NonRecordingSpan(); + var isHex = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1 + ]); + function isValidHex(id, length) { + if (typeof id !== "string" || id.length !== length) + return false; + let r = 0; + for (let i = 0;i < id.length; i += 4) { + r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0); + } + return r === length; + } + function isValidTraceId(traceId) { + return isValidHex(traceId, 32) && traceId !== invalid_span_constants_1.INVALID_TRACEID; + } + exports.isValidTraceId = isValidTraceId; + function isValidSpanId(spanId) { + return isValidHex(spanId, 16) && spanId !== invalid_span_constants_1.INVALID_SPANID; + } + exports.isValidSpanId = isValidSpanId; + function isSpanContextValid(spanContext) { + return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId); + } + exports.isSpanContextValid = isSpanContextValid; + function wrapSpanContext(spanContext) { + return new NonRecordingSpan_1.NonRecordingSpan(spanContext); + } + exports.wrapSpanContext = wrapSpanContext; +}); + +// node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js +var require_NoopTracer = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NoopTracer = undefined; + var context_1 = require_context2(); + var context_utils_1 = require_context_utils(); + var NonRecordingSpan_1 = require_NonRecordingSpan(); + var spancontext_utils_1 = require_spancontext_utils(); + var contextApi = context_1.ContextAPI.getInstance(); + + class NoopTracer { + startSpan(name, options, context = contextApi.active()) { + const root = Boolean(options === null || options === undefined ? undefined : options.root); + if (root) { + return new NonRecordingSpan_1.NonRecordingSpan; + } + const parentFromContext = context && (0, context_utils_1.getSpanContext)(context); + if (isSpanContext(parentFromContext) && (0, spancontext_utils_1.isSpanContextValid)(parentFromContext)) { + return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext); + } else { + return new NonRecordingSpan_1.NonRecordingSpan; + } + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) { + return; + } else if (arguments.length === 2) { + fn = arg2; + } else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx !== null && ctx !== undefined ? ctx : contextApi.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = (0, context_utils_1.setSpan)(parentContext, span); + return contextApi.with(contextWithSpanSet, fn, undefined, span); + } + } + exports.NoopTracer = NoopTracer; + function isSpanContext(spanContext) { + return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number"; + } +}); + +// node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js +var require_ProxyTracer = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProxyTracer = undefined; + var NoopTracer_1 = require_NoopTracer(); + var NOOP_TRACER = new NoopTracer_1.NoopTracer; + + class ProxyTracer { + constructor(provider, name, version2, options) { + this._provider = provider; + this.name = name; + this.version = version2; + this.options = options; + } + startSpan(name, options, context) { + return this._getTracer().startSpan(name, options, context); + } + startActiveSpan(_name, _options, _context, _fn) { + const tracer = this._getTracer(); + return Reflect.apply(tracer.startActiveSpan, tracer, arguments); + } + _getTracer() { + if (this._delegate) { + return this._delegate; + } + const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); + if (!tracer) { + return NOOP_TRACER; + } + this._delegate = tracer; + return this._delegate; + } + } + exports.ProxyTracer = ProxyTracer; +}); + +// node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js +var require_NoopTracerProvider = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NoopTracerProvider = undefined; + var NoopTracer_1 = require_NoopTracer(); + + class NoopTracerProvider { + getTracer(_name, _version, _options) { + return new NoopTracer_1.NoopTracer; + } + } + exports.NoopTracerProvider = NoopTracerProvider; +}); + +// node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js +var require_ProxyTracerProvider = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProxyTracerProvider = undefined; + var ProxyTracer_1 = require_ProxyTracer(); + var NoopTracerProvider_1 = require_NoopTracerProvider(); + var NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider; + + class ProxyTracerProvider { + getTracer(name, version2, options) { + var _a3; + return (_a3 = this.getDelegateTracer(name, version2, options)) !== null && _a3 !== undefined ? _a3 : new ProxyTracer_1.ProxyTracer(this, name, version2, options); + } + getDelegate() { + var _a3; + return (_a3 = this._delegate) !== null && _a3 !== undefined ? _a3 : NOOP_TRACER_PROVIDER; + } + setDelegate(delegate) { + this._delegate = delegate; + } + getDelegateTracer(name, version2, options) { + var _a3; + return (_a3 = this._delegate) === null || _a3 === undefined ? undefined : _a3.getTracer(name, version2, options); + } + } + exports.ProxyTracerProvider = ProxyTracerProvider; +}); + +// node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js +var require_SamplingResult = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SamplingDecision = undefined; + var SamplingDecision; + (function(SamplingDecision2) { + SamplingDecision2[SamplingDecision2["NOT_RECORD"] = 0] = "NOT_RECORD"; + SamplingDecision2[SamplingDecision2["RECORD"] = 1] = "RECORD"; + SamplingDecision2[SamplingDecision2["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; + })(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +}); + +// node_modules/@opentelemetry/api/build/src/trace/span_kind.js +var require_span_kind = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SpanKind = undefined; + var SpanKind; + (function(SpanKind2) { + SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL"; + SpanKind2[SpanKind2["SERVER"] = 1] = "SERVER"; + SpanKind2[SpanKind2["CLIENT"] = 2] = "CLIENT"; + SpanKind2[SpanKind2["PRODUCER"] = 3] = "PRODUCER"; + SpanKind2[SpanKind2["CONSUMER"] = 4] = "CONSUMER"; + })(SpanKind = exports.SpanKind || (exports.SpanKind = {})); +}); + +// node_modules/@opentelemetry/api/build/src/trace/status.js +var require_status = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SpanStatusCode = undefined; + var SpanStatusCode; + (function(SpanStatusCode2) { + SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET"; + SpanStatusCode2[SpanStatusCode2["OK"] = 1] = "OK"; + SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR"; + })(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); +}); + +// node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js +var require_tracestate_validators = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js +var require_tracestate_impl = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceStateImpl = undefined; + var tracestate_validators_1 = require_tracestate_validators(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceStateImpl { + constructor(rawTraceState) { + this._internalState = new Map; + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return Array.from(this._internalState.keys()).reduceRight((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reduceRight((agg, part) => { + const listMember = part.trim(); + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) { + agg.set(key, value); + } else {} + } + return agg; + }, new Map); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceStateImpl; + traceState._internalState = new Map(this._internalState); + return traceState; + } + } + exports.TraceStateImpl = TraceStateImpl; +}); + +// node_modules/@opentelemetry/api/build/src/trace/internal/utils.js +var require_utils2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createTraceState = undefined; + var tracestate_impl_1 = require_tracestate_impl(); + function createTraceState(rawTraceState) { + return new tracestate_impl_1.TraceStateImpl(rawTraceState); + } + exports.createTraceState = createTraceState; +}); + +// node_modules/@opentelemetry/api/build/src/context-api.js +var require_context_api = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.context = undefined; + var context_1 = require_context2(); + exports.context = context_1.ContextAPI.getInstance(); +}); + +// node_modules/@opentelemetry/api/build/src/diag-api.js +var require_diag_api = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diag = undefined; + var diag_1 = require_diag(); + exports.diag = diag_1.DiagAPI.instance(); +}); + +// node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js +var require_NoopMeterProvider = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = undefined; + var NoopMeter_1 = require_NoopMeter(); + + class NoopMeterProvider { + getMeter(_name, _version, _options) { + return NoopMeter_1.NOOP_METER; + } + } + exports.NoopMeterProvider = NoopMeterProvider; + exports.NOOP_METER_PROVIDER = new NoopMeterProvider; +}); + +// node_modules/@opentelemetry/api/build/src/api/metrics.js +var require_metrics = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricsAPI = undefined; + var NoopMeterProvider_1 = require_NoopMeterProvider(); + var global_utils_1 = require_global_utils(); + var diag_1 = require_diag(); + var API_NAME = "metrics"; + + class MetricsAPI { + constructor() {} + static getInstance() { + if (!this._instance) { + this._instance = new MetricsAPI; + } + return this._instance; + } + setGlobalMeterProvider(provider) { + return (0, global_utils_1.registerGlobal)(API_NAME, provider, diag_1.DiagAPI.instance()); + } + getMeterProvider() { + return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER; + } + getMeter(name, version2, options) { + return this.getMeterProvider().getMeter(name, version2, options); + } + disable() { + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + } + } + exports.MetricsAPI = MetricsAPI; +}); + +// node_modules/@opentelemetry/api/build/src/metrics-api.js +var require_metrics_api = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.metrics = undefined; + var metrics_1 = require_metrics(); + exports.metrics = metrics_1.MetricsAPI.getInstance(); +}); + +// node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js +var require_NoopTextMapPropagator = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NoopTextMapPropagator = undefined; + + class NoopTextMapPropagator { + inject(_context, _carrier) {} + extract(context, _carrier) { + return context; + } + fields() { + return []; + } + } + exports.NoopTextMapPropagator = NoopTextMapPropagator; +}); + +// node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js +var require_context_helpers = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = undefined; + var context_1 = require_context2(); + var context_2 = require_context(); + var BAGGAGE_KEY = (0, context_2.createContextKey)("OpenTelemetry Baggage Key"); + function getBaggage(context) { + return context.getValue(BAGGAGE_KEY) || undefined; + } + exports.getBaggage = getBaggage; + function getActiveBaggage() { + return getBaggage(context_1.ContextAPI.getInstance().active()); + } + exports.getActiveBaggage = getActiveBaggage; + function setBaggage(context, baggage) { + return context.setValue(BAGGAGE_KEY, baggage); + } + exports.setBaggage = setBaggage; + function deleteBaggage(context) { + return context.deleteValue(BAGGAGE_KEY); + } + exports.deleteBaggage = deleteBaggage; +}); + +// node_modules/@opentelemetry/api/build/src/api/propagation.js +var require_propagation = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PropagationAPI = undefined; + var global_utils_1 = require_global_utils(); + var NoopTextMapPropagator_1 = require_NoopTextMapPropagator(); + var TextMapPropagator_1 = require_TextMapPropagator(); + var context_helpers_1 = require_context_helpers(); + var utils_1 = require_utils(); + var diag_1 = require_diag(); + var API_NAME = "propagation"; + var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator; + + class PropagationAPI { + constructor() { + this.createBaggage = utils_1.createBaggage; + this.getBaggage = context_helpers_1.getBaggage; + this.getActiveBaggage = context_helpers_1.getActiveBaggage; + this.setBaggage = context_helpers_1.setBaggage; + this.deleteBaggage = context_helpers_1.deleteBaggage; + } + static getInstance() { + if (!this._instance) { + this._instance = new PropagationAPI; + } + return this._instance; + } + setGlobalPropagator(propagator) { + return (0, global_utils_1.registerGlobal)(API_NAME, propagator, diag_1.DiagAPI.instance()); + } + inject(context, carrier, setter = TextMapPropagator_1.defaultTextMapSetter) { + return this._getGlobalPropagator().inject(context, carrier, setter); + } + extract(context, carrier, getter = TextMapPropagator_1.defaultTextMapGetter) { + return this._getGlobalPropagator().extract(context, carrier, getter); + } + fields() { + return this._getGlobalPropagator().fields(); + } + disable() { + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + } + _getGlobalPropagator() { + return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR; + } + } + exports.PropagationAPI = PropagationAPI; +}); + +// node_modules/@opentelemetry/api/build/src/propagation-api.js +var require_propagation_api = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.propagation = undefined; + var propagation_1 = require_propagation(); + exports.propagation = propagation_1.PropagationAPI.getInstance(); +}); + +// node_modules/@opentelemetry/api/build/src/api/trace.js +var require_trace = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceAPI = undefined; + var global_utils_1 = require_global_utils(); + var ProxyTracerProvider_1 = require_ProxyTracerProvider(); + var spancontext_utils_1 = require_spancontext_utils(); + var context_utils_1 = require_context_utils(); + var diag_1 = require_diag(); + var API_NAME = "trace"; + + class TraceAPI { + constructor() { + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider; + this.wrapSpanContext = spancontext_utils_1.wrapSpanContext; + this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; + this.deleteSpan = context_utils_1.deleteSpan; + this.getSpan = context_utils_1.getSpan; + this.getActiveSpan = context_utils_1.getActiveSpan; + this.getSpanContext = context_utils_1.getSpanContext; + this.setSpan = context_utils_1.setSpan; + this.setSpanContext = context_utils_1.setSpanContext; + } + static getInstance() { + if (!this._instance) { + this._instance = new TraceAPI; + } + return this._instance; + } + setGlobalTracerProvider(provider) { + const success2 = (0, global_utils_1.registerGlobal)(API_NAME, this._proxyTracerProvider, diag_1.DiagAPI.instance()); + if (success2) { + this._proxyTracerProvider.setDelegate(provider); + } + return success2; + } + getTracerProvider() { + return (0, global_utils_1.getGlobal)(API_NAME) || this._proxyTracerProvider; + } + getTracer(name, version2) { + return this.getTracerProvider().getTracer(name, version2); + } + disable() { + (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider; + } + } + exports.TraceAPI = TraceAPI; +}); + +// node_modules/@opentelemetry/api/build/src/trace-api.js +var require_trace_api = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.trace = undefined; + var trace_1 = require_trace(); + exports.trace = trace_1.TraceAPI.getInstance(); +}); + +// node_modules/@opentelemetry/api/build/src/index.js +var require_src = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = undefined; + var utils_1 = require_utils(); + Object.defineProperty(exports, "baggageEntryMetadataFromString", { enumerable: true, get: function() { + return utils_1.baggageEntryMetadataFromString; + } }); + var context_1 = require_context(); + Object.defineProperty(exports, "createContextKey", { enumerable: true, get: function() { + return context_1.createContextKey; + } }); + Object.defineProperty(exports, "ROOT_CONTEXT", { enumerable: true, get: function() { + return context_1.ROOT_CONTEXT; + } }); + var consoleLogger_1 = require_consoleLogger(); + Object.defineProperty(exports, "DiagConsoleLogger", { enumerable: true, get: function() { + return consoleLogger_1.DiagConsoleLogger; + } }); + var types_1 = require_types(); + Object.defineProperty(exports, "DiagLogLevel", { enumerable: true, get: function() { + return types_1.DiagLogLevel; + } }); + var NoopMeter_1 = require_NoopMeter(); + Object.defineProperty(exports, "createNoopMeter", { enumerable: true, get: function() { + return NoopMeter_1.createNoopMeter; + } }); + var Metric_1 = require_Metric(); + Object.defineProperty(exports, "ValueType", { enumerable: true, get: function() { + return Metric_1.ValueType; + } }); + var TextMapPropagator_1 = require_TextMapPropagator(); + Object.defineProperty(exports, "defaultTextMapGetter", { enumerable: true, get: function() { + return TextMapPropagator_1.defaultTextMapGetter; + } }); + Object.defineProperty(exports, "defaultTextMapSetter", { enumerable: true, get: function() { + return TextMapPropagator_1.defaultTextMapSetter; + } }); + var ProxyTracer_1 = require_ProxyTracer(); + Object.defineProperty(exports, "ProxyTracer", { enumerable: true, get: function() { + return ProxyTracer_1.ProxyTracer; + } }); + var ProxyTracerProvider_1 = require_ProxyTracerProvider(); + Object.defineProperty(exports, "ProxyTracerProvider", { enumerable: true, get: function() { + return ProxyTracerProvider_1.ProxyTracerProvider; + } }); + var SamplingResult_1 = require_SamplingResult(); + Object.defineProperty(exports, "SamplingDecision", { enumerable: true, get: function() { + return SamplingResult_1.SamplingDecision; + } }); + var span_kind_1 = require_span_kind(); + Object.defineProperty(exports, "SpanKind", { enumerable: true, get: function() { + return span_kind_1.SpanKind; + } }); + var status_1 = require_status(); + Object.defineProperty(exports, "SpanStatusCode", { enumerable: true, get: function() { + return status_1.SpanStatusCode; + } }); + var trace_flags_1 = require_trace_flags(); + Object.defineProperty(exports, "TraceFlags", { enumerable: true, get: function() { + return trace_flags_1.TraceFlags; + } }); + var utils_2 = require_utils2(); + Object.defineProperty(exports, "createTraceState", { enumerable: true, get: function() { + return utils_2.createTraceState; + } }); + var spancontext_utils_1 = require_spancontext_utils(); + Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function() { + return spancontext_utils_1.isSpanContextValid; + } }); + Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function() { + return spancontext_utils_1.isValidTraceId; + } }); + Object.defineProperty(exports, "isValidSpanId", { enumerable: true, get: function() { + return spancontext_utils_1.isValidSpanId; + } }); + var invalid_span_constants_1 = require_invalid_span_constants(); + Object.defineProperty(exports, "INVALID_SPANID", { enumerable: true, get: function() { + return invalid_span_constants_1.INVALID_SPANID; + } }); + Object.defineProperty(exports, "INVALID_TRACEID", { enumerable: true, get: function() { + return invalid_span_constants_1.INVALID_TRACEID; + } }); + Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", { enumerable: true, get: function() { + return invalid_span_constants_1.INVALID_SPAN_CONTEXT; + } }); + var context_api_1 = require_context_api(); + Object.defineProperty(exports, "context", { enumerable: true, get: function() { + return context_api_1.context; + } }); + var diag_api_1 = require_diag_api(); + Object.defineProperty(exports, "diag", { enumerable: true, get: function() { + return diag_api_1.diag; + } }); + var metrics_api_1 = require_metrics_api(); + Object.defineProperty(exports, "metrics", { enumerable: true, get: function() { + return metrics_api_1.metrics; + } }); + var propagation_api_1 = require_propagation_api(); + Object.defineProperty(exports, "propagation", { enumerable: true, get: function() { + return propagation_api_1.propagation; + } }); + var trace_api_1 = require_trace_api(); + Object.defineProperty(exports, "trace", { enumerable: true, get: function() { + return trace_api_1.trace; + } }); + exports.default = { + context: context_api_1.context, + diag: diag_api_1.diag, + metrics: metrics_api_1.metrics, + propagation: propagation_api_1.propagation, + trace: trace_api_1.trace + }; +}); + +// node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; + var api_1 = require_src(); + var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +}); + +// node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +}); + +// node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; + var api_1 = require_src(); + var constants_1 = require_constants(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + if (!entry) + return; + const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex); + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const rawKey = keyPairPart.substring(0, separatorIndex).trim(); + const rawValue = keyPairPart.substring(separatorIndex + 1).trim(); + if (!rawKey || !rawValue) + return; + let key; + let value; + try { + key = decodeURIComponent(rawKey); + value = decodeURIComponent(rawValue); + } catch { + return; + } + let metadata; + if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) { + const metadataString = entry.substring(metadataSeparatorIndex + 1); + metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString); + } + return { key, value, metadata }; + } + exports.parsePairKeyValue = parsePairKeyValue; + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); + } + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +}); + +// node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing(); + var constants_1 = require_constants(); + var utils_1 = require_utils3(); + + class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach((entry) => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + } + exports.W3CBaggagePropagator = W3CBaggagePropagator; +}); + +// node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = undefined; + + class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + } + exports.AnchoredClock = AnchoredClock; +}); + +// node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; + var api_1 = require_src(); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; + } + for (const key in attributes) { + if (!Object.prototype.hasOwnProperty.call(attributes, key)) { + continue; + } + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + const val = attributes[key]; + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key !== ""; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValueType(typeof val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) + continue; + const elementType = typeof element; + if (elementType === type) { + continue; + } + if (!type) { + if (isValidPrimitiveAttributeValueType(elementType)) { + type = elementType; + continue; + } + return false; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValueType(valType) { + switch (valType) { + case "number": + case "boolean": + case "string": + return true; + } + return false; + } +}); + +// node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = undefined; + var api_1 = require_src(); + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); + } + } + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; + } +}); + +// node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; + var logging_error_handler_1 = require_logging_error_handler(); + var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +}); + +// node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = undefined; + var api_1 = require_src(); + var util_1 = __require("util"); + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") { + return false; + } + if (raw === "true") { + return true; + } else if (raw === "false") { + return false; + } else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +}); + +// node_modules/@opentelemetry/core/build/src/common/globalThis.js +var require_globalThis = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = undefined; + exports._globalThis = globalThis; +}); + +// node_modules/@opentelemetry/core/build/src/version.js +var require_version2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.7.1"; +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js +var require_utils4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createConstMap = undefined; + function createConstMap(values) { + let res = {}; + const len = values.length; + for (let lp = 0;lp < len; lp++) { + const val = values[lp]; + if (val) { + res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; + } + } + return res; + } + exports.createConstMap = createConstMap; +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js +var require_SemanticAttributes = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SEMATTRS_NET_HOST_CARRIER_ICC = exports.SEMATTRS_NET_HOST_CARRIER_MNC = exports.SEMATTRS_NET_HOST_CARRIER_MCC = exports.SEMATTRS_NET_HOST_CARRIER_NAME = exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = exports.SEMATTRS_NET_HOST_NAME = exports.SEMATTRS_NET_HOST_PORT = exports.SEMATTRS_NET_HOST_IP = exports.SEMATTRS_NET_PEER_NAME = exports.SEMATTRS_NET_PEER_PORT = exports.SEMATTRS_NET_PEER_IP = exports.SEMATTRS_NET_TRANSPORT = exports.SEMATTRS_FAAS_INVOKED_REGION = exports.SEMATTRS_FAAS_INVOKED_PROVIDER = exports.SEMATTRS_FAAS_INVOKED_NAME = exports.SEMATTRS_FAAS_COLDSTART = exports.SEMATTRS_FAAS_CRON = exports.SEMATTRS_FAAS_TIME = exports.SEMATTRS_FAAS_DOCUMENT_NAME = exports.SEMATTRS_FAAS_DOCUMENT_TIME = exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = exports.SEMATTRS_FAAS_EXECUTION = exports.SEMATTRS_FAAS_TRIGGER = exports.SEMATTRS_EXCEPTION_ESCAPED = exports.SEMATTRS_EXCEPTION_STACKTRACE = exports.SEMATTRS_EXCEPTION_MESSAGE = exports.SEMATTRS_EXCEPTION_TYPE = exports.SEMATTRS_DB_SQL_TABLE = exports.SEMATTRS_DB_MONGODB_COLLECTION = exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = exports.SEMATTRS_DB_HBASE_NAMESPACE = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = exports.SEMATTRS_DB_CASSANDRA_TABLE = exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = exports.SEMATTRS_DB_OPERATION = exports.SEMATTRS_DB_STATEMENT = exports.SEMATTRS_DB_NAME = exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = exports.SEMATTRS_DB_USER = exports.SEMATTRS_DB_CONNECTION_STRING = exports.SEMATTRS_DB_SYSTEM = exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = undefined; + exports.SEMATTRS_MESSAGING_DESTINATION_KIND = exports.SEMATTRS_MESSAGING_DESTINATION = exports.SEMATTRS_MESSAGING_SYSTEM = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = exports.SEMATTRS_AWS_DYNAMODB_COUNT = exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_SELECT = exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = exports.SEMATTRS_AWS_DYNAMODB_LIMIT = exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = exports.SEMATTRS_HTTP_CLIENT_IP = exports.SEMATTRS_HTTP_ROUTE = exports.SEMATTRS_HTTP_SERVER_NAME = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = exports.SEMATTRS_HTTP_USER_AGENT = exports.SEMATTRS_HTTP_FLAVOR = exports.SEMATTRS_HTTP_STATUS_CODE = exports.SEMATTRS_HTTP_SCHEME = exports.SEMATTRS_HTTP_HOST = exports.SEMATTRS_HTTP_TARGET = exports.SEMATTRS_HTTP_URL = exports.SEMATTRS_HTTP_METHOD = exports.SEMATTRS_CODE_LINENO = exports.SEMATTRS_CODE_FILEPATH = exports.SEMATTRS_CODE_NAMESPACE = exports.SEMATTRS_CODE_FUNCTION = exports.SEMATTRS_THREAD_NAME = exports.SEMATTRS_THREAD_ID = exports.SEMATTRS_ENDUSER_SCOPE = exports.SEMATTRS_ENDUSER_ROLE = exports.SEMATTRS_ENDUSER_ID = exports.SEMATTRS_PEER_SERVICE = undefined; + exports.DBSYSTEMVALUES_FILEMAKER = exports.DBSYSTEMVALUES_DERBY = exports.DBSYSTEMVALUES_FIREBIRD = exports.DBSYSTEMVALUES_ADABAS = exports.DBSYSTEMVALUES_CACHE = exports.DBSYSTEMVALUES_EDB = exports.DBSYSTEMVALUES_FIRSTSQL = exports.DBSYSTEMVALUES_INGRES = exports.DBSYSTEMVALUES_HANADB = exports.DBSYSTEMVALUES_MAXDB = exports.DBSYSTEMVALUES_PROGRESS = exports.DBSYSTEMVALUES_HSQLDB = exports.DBSYSTEMVALUES_CLOUDSCAPE = exports.DBSYSTEMVALUES_HIVE = exports.DBSYSTEMVALUES_REDSHIFT = exports.DBSYSTEMVALUES_POSTGRESQL = exports.DBSYSTEMVALUES_DB2 = exports.DBSYSTEMVALUES_ORACLE = exports.DBSYSTEMVALUES_MYSQL = exports.DBSYSTEMVALUES_MSSQL = exports.DBSYSTEMVALUES_OTHER_SQL = exports.SemanticAttributes = exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_ID = exports.SEMATTRS_MESSAGE_TYPE = exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = exports.SEMATTRS_RPC_JSONRPC_VERSION = exports.SEMATTRS_RPC_GRPC_STATUS_CODE = exports.SEMATTRS_RPC_METHOD = exports.SEMATTRS_RPC_SERVICE = exports.SEMATTRS_RPC_SYSTEM = exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = exports.SEMATTRS_MESSAGING_CONSUMER_ID = exports.SEMATTRS_MESSAGING_OPERATION = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = exports.SEMATTRS_MESSAGING_CONVERSATION_ID = exports.SEMATTRS_MESSAGING_MESSAGE_ID = exports.SEMATTRS_MESSAGING_URL = exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = exports.SEMATTRS_MESSAGING_PROTOCOL = exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = undefined; + exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = undefined; + exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = undefined; + exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = undefined; + var utils_1 = require_utils4(); + var TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; + var TMP_DB_SYSTEM = "db.system"; + var TMP_DB_CONNECTION_STRING = "db.connection_string"; + var TMP_DB_USER = "db.user"; + var TMP_DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname"; + var TMP_DB_NAME = "db.name"; + var TMP_DB_STATEMENT = "db.statement"; + var TMP_DB_OPERATION = "db.operation"; + var TMP_DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name"; + var TMP_DB_CASSANDRA_KEYSPACE = "db.cassandra.keyspace"; + var TMP_DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size"; + var TMP_DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level"; + var TMP_DB_CASSANDRA_TABLE = "db.cassandra.table"; + var TMP_DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence"; + var TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count"; + var TMP_DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id"; + var TMP_DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc"; + var TMP_DB_HBASE_NAMESPACE = "db.hbase.namespace"; + var TMP_DB_REDIS_DATABASE_INDEX = "db.redis.database_index"; + var TMP_DB_MONGODB_COLLECTION = "db.mongodb.collection"; + var TMP_DB_SQL_TABLE = "db.sql.table"; + var TMP_EXCEPTION_TYPE = "exception.type"; + var TMP_EXCEPTION_MESSAGE = "exception.message"; + var TMP_EXCEPTION_STACKTRACE = "exception.stacktrace"; + var TMP_EXCEPTION_ESCAPED = "exception.escaped"; + var TMP_FAAS_TRIGGER = "faas.trigger"; + var TMP_FAAS_EXECUTION = "faas.execution"; + var TMP_FAAS_DOCUMENT_COLLECTION = "faas.document.collection"; + var TMP_FAAS_DOCUMENT_OPERATION = "faas.document.operation"; + var TMP_FAAS_DOCUMENT_TIME = "faas.document.time"; + var TMP_FAAS_DOCUMENT_NAME = "faas.document.name"; + var TMP_FAAS_TIME = "faas.time"; + var TMP_FAAS_CRON = "faas.cron"; + var TMP_FAAS_COLDSTART = "faas.coldstart"; + var TMP_FAAS_INVOKED_NAME = "faas.invoked_name"; + var TMP_FAAS_INVOKED_PROVIDER = "faas.invoked_provider"; + var TMP_FAAS_INVOKED_REGION = "faas.invoked_region"; + var TMP_NET_TRANSPORT = "net.transport"; + var TMP_NET_PEER_IP = "net.peer.ip"; + var TMP_NET_PEER_PORT = "net.peer.port"; + var TMP_NET_PEER_NAME = "net.peer.name"; + var TMP_NET_HOST_IP = "net.host.ip"; + var TMP_NET_HOST_PORT = "net.host.port"; + var TMP_NET_HOST_NAME = "net.host.name"; + var TMP_NET_HOST_CONNECTION_TYPE = "net.host.connection.type"; + var TMP_NET_HOST_CONNECTION_SUBTYPE = "net.host.connection.subtype"; + var TMP_NET_HOST_CARRIER_NAME = "net.host.carrier.name"; + var TMP_NET_HOST_CARRIER_MCC = "net.host.carrier.mcc"; + var TMP_NET_HOST_CARRIER_MNC = "net.host.carrier.mnc"; + var TMP_NET_HOST_CARRIER_ICC = "net.host.carrier.icc"; + var TMP_PEER_SERVICE = "peer.service"; + var TMP_ENDUSER_ID = "enduser.id"; + var TMP_ENDUSER_ROLE = "enduser.role"; + var TMP_ENDUSER_SCOPE = "enduser.scope"; + var TMP_THREAD_ID = "thread.id"; + var TMP_THREAD_NAME = "thread.name"; + var TMP_CODE_FUNCTION = "code.function"; + var TMP_CODE_NAMESPACE = "code.namespace"; + var TMP_CODE_FILEPATH = "code.filepath"; + var TMP_CODE_LINENO = "code.lineno"; + var TMP_HTTP_METHOD = "http.method"; + var TMP_HTTP_URL = "http.url"; + var TMP_HTTP_TARGET = "http.target"; + var TMP_HTTP_HOST = "http.host"; + var TMP_HTTP_SCHEME = "http.scheme"; + var TMP_HTTP_STATUS_CODE = "http.status_code"; + var TMP_HTTP_FLAVOR = "http.flavor"; + var TMP_HTTP_USER_AGENT = "http.user_agent"; + var TMP_HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length"; + var TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = "http.request_content_length_uncompressed"; + var TMP_HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length"; + var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = "http.response_content_length_uncompressed"; + var TMP_HTTP_SERVER_NAME = "http.server_name"; + var TMP_HTTP_ROUTE = "http.route"; + var TMP_HTTP_CLIENT_IP = "http.client_ip"; + var TMP_AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names"; + var TMP_AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity"; + var TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics"; + var TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity"; + var TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity"; + var TMP_AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read"; + var TMP_AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection"; + var TMP_AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit"; + var TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get"; + var TMP_AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name"; + var TMP_AWS_DYNAMODB_SELECT = "aws.dynamodb.select"; + var TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes"; + var TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes"; + var TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table"; + var TMP_AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count"; + var TMP_AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward"; + var TMP_AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment"; + var TMP_AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments"; + var TMP_AWS_DYNAMODB_COUNT = "aws.dynamodb.count"; + var TMP_AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count"; + var TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions"; + var TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates"; + var TMP_MESSAGING_SYSTEM = "messaging.system"; + var TMP_MESSAGING_DESTINATION = "messaging.destination"; + var TMP_MESSAGING_DESTINATION_KIND = "messaging.destination_kind"; + var TMP_MESSAGING_TEMP_DESTINATION = "messaging.temp_destination"; + var TMP_MESSAGING_PROTOCOL = "messaging.protocol"; + var TMP_MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version"; + var TMP_MESSAGING_URL = "messaging.url"; + var TMP_MESSAGING_MESSAGE_ID = "messaging.message_id"; + var TMP_MESSAGING_CONVERSATION_ID = "messaging.conversation_id"; + var TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message_payload_size_bytes"; + var TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = "messaging.message_payload_compressed_size_bytes"; + var TMP_MESSAGING_OPERATION = "messaging.operation"; + var TMP_MESSAGING_CONSUMER_ID = "messaging.consumer_id"; + var TMP_MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key"; + var TMP_MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message_key"; + var TMP_MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer_group"; + var TMP_MESSAGING_KAFKA_CLIENT_ID = "messaging.kafka.client_id"; + var TMP_MESSAGING_KAFKA_PARTITION = "messaging.kafka.partition"; + var TMP_MESSAGING_KAFKA_TOMBSTONE = "messaging.kafka.tombstone"; + var TMP_RPC_SYSTEM = "rpc.system"; + var TMP_RPC_SERVICE = "rpc.service"; + var TMP_RPC_METHOD = "rpc.method"; + var TMP_RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code"; + var TMP_RPC_JSONRPC_VERSION = "rpc.jsonrpc.version"; + var TMP_RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id"; + var TMP_RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code"; + var TMP_RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message"; + var TMP_MESSAGE_TYPE = "message.type"; + var TMP_MESSAGE_ID = "message.id"; + var TMP_MESSAGE_COMPRESSED_SIZE = "message.compressed_size"; + var TMP_MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size"; + exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = TMP_AWS_LAMBDA_INVOKED_ARN; + exports.SEMATTRS_DB_SYSTEM = TMP_DB_SYSTEM; + exports.SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; + exports.SEMATTRS_DB_USER = TMP_DB_USER; + exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = TMP_DB_JDBC_DRIVER_CLASSNAME; + exports.SEMATTRS_DB_NAME = TMP_DB_NAME; + exports.SEMATTRS_DB_STATEMENT = TMP_DB_STATEMENT; + exports.SEMATTRS_DB_OPERATION = TMP_DB_OPERATION; + exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = TMP_DB_MSSQL_INSTANCE_NAME; + exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = TMP_DB_CASSANDRA_KEYSPACE; + exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = TMP_DB_CASSANDRA_PAGE_SIZE; + exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = TMP_DB_CASSANDRA_CONSISTENCY_LEVEL; + exports.SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; + exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = TMP_DB_CASSANDRA_IDEMPOTENCE; + exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT; + exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = TMP_DB_CASSANDRA_COORDINATOR_ID; + exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = TMP_DB_CASSANDRA_COORDINATOR_DC; + exports.SEMATTRS_DB_HBASE_NAMESPACE = TMP_DB_HBASE_NAMESPACE; + exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = TMP_DB_REDIS_DATABASE_INDEX; + exports.SEMATTRS_DB_MONGODB_COLLECTION = TMP_DB_MONGODB_COLLECTION; + exports.SEMATTRS_DB_SQL_TABLE = TMP_DB_SQL_TABLE; + exports.SEMATTRS_EXCEPTION_TYPE = TMP_EXCEPTION_TYPE; + exports.SEMATTRS_EXCEPTION_MESSAGE = TMP_EXCEPTION_MESSAGE; + exports.SEMATTRS_EXCEPTION_STACKTRACE = TMP_EXCEPTION_STACKTRACE; + exports.SEMATTRS_EXCEPTION_ESCAPED = TMP_EXCEPTION_ESCAPED; + exports.SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; + exports.SEMATTRS_FAAS_EXECUTION = TMP_FAAS_EXECUTION; + exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = TMP_FAAS_DOCUMENT_COLLECTION; + exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = TMP_FAAS_DOCUMENT_OPERATION; + exports.SEMATTRS_FAAS_DOCUMENT_TIME = TMP_FAAS_DOCUMENT_TIME; + exports.SEMATTRS_FAAS_DOCUMENT_NAME = TMP_FAAS_DOCUMENT_NAME; + exports.SEMATTRS_FAAS_TIME = TMP_FAAS_TIME; + exports.SEMATTRS_FAAS_CRON = TMP_FAAS_CRON; + exports.SEMATTRS_FAAS_COLDSTART = TMP_FAAS_COLDSTART; + exports.SEMATTRS_FAAS_INVOKED_NAME = TMP_FAAS_INVOKED_NAME; + exports.SEMATTRS_FAAS_INVOKED_PROVIDER = TMP_FAAS_INVOKED_PROVIDER; + exports.SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; + exports.SEMATTRS_NET_TRANSPORT = TMP_NET_TRANSPORT; + exports.SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; + exports.SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; + exports.SEMATTRS_NET_PEER_NAME = TMP_NET_PEER_NAME; + exports.SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; + exports.SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; + exports.SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; + exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = TMP_NET_HOST_CONNECTION_TYPE; + exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; + exports.SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; + exports.SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; + exports.SEMATTRS_NET_HOST_CARRIER_MNC = TMP_NET_HOST_CARRIER_MNC; + exports.SEMATTRS_NET_HOST_CARRIER_ICC = TMP_NET_HOST_CARRIER_ICC; + exports.SEMATTRS_PEER_SERVICE = TMP_PEER_SERVICE; + exports.SEMATTRS_ENDUSER_ID = TMP_ENDUSER_ID; + exports.SEMATTRS_ENDUSER_ROLE = TMP_ENDUSER_ROLE; + exports.SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; + exports.SEMATTRS_THREAD_ID = TMP_THREAD_ID; + exports.SEMATTRS_THREAD_NAME = TMP_THREAD_NAME; + exports.SEMATTRS_CODE_FUNCTION = TMP_CODE_FUNCTION; + exports.SEMATTRS_CODE_NAMESPACE = TMP_CODE_NAMESPACE; + exports.SEMATTRS_CODE_FILEPATH = TMP_CODE_FILEPATH; + exports.SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; + exports.SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD; + exports.SEMATTRS_HTTP_URL = TMP_HTTP_URL; + exports.SEMATTRS_HTTP_TARGET = TMP_HTTP_TARGET; + exports.SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; + exports.SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME; + exports.SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE; + exports.SEMATTRS_HTTP_FLAVOR = TMP_HTTP_FLAVOR; + exports.SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT; + exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = TMP_HTTP_REQUEST_CONTENT_LENGTH; + exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED; + exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH; + exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED; + exports.SEMATTRS_HTTP_SERVER_NAME = TMP_HTTP_SERVER_NAME; + exports.SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE; + exports.SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; + exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = TMP_AWS_DYNAMODB_TABLE_NAMES; + exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = TMP_AWS_DYNAMODB_CONSUMED_CAPACITY; + exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS; + exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY; + exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY; + exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; + exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; + exports.SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; + exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET; + exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; + exports.SEMATTRS_AWS_DYNAMODB_SELECT = TMP_AWS_DYNAMODB_SELECT; + exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES; + exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES; + exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE; + exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = TMP_AWS_DYNAMODB_TABLE_COUNT; + exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; + exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; + exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; + exports.SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; + exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = TMP_AWS_DYNAMODB_SCANNED_COUNT; + exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS; + exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES; + exports.SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM; + exports.SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; + exports.SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; + exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; + exports.SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; + exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; + exports.SEMATTRS_MESSAGING_URL = TMP_MESSAGING_URL; + exports.SEMATTRS_MESSAGING_MESSAGE_ID = TMP_MESSAGING_MESSAGE_ID; + exports.SEMATTRS_MESSAGING_CONVERSATION_ID = TMP_MESSAGING_CONVERSATION_ID; + exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; + exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES; + exports.SEMATTRS_MESSAGING_OPERATION = TMP_MESSAGING_OPERATION; + exports.SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; + exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = TMP_MESSAGING_RABBITMQ_ROUTING_KEY; + exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = TMP_MESSAGING_KAFKA_MESSAGE_KEY; + exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = TMP_MESSAGING_KAFKA_CONSUMER_GROUP; + exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; + exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = TMP_MESSAGING_KAFKA_PARTITION; + exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; + exports.SEMATTRS_RPC_SYSTEM = TMP_RPC_SYSTEM; + exports.SEMATTRS_RPC_SERVICE = TMP_RPC_SERVICE; + exports.SEMATTRS_RPC_METHOD = TMP_RPC_METHOD; + exports.SEMATTRS_RPC_GRPC_STATUS_CODE = TMP_RPC_GRPC_STATUS_CODE; + exports.SEMATTRS_RPC_JSONRPC_VERSION = TMP_RPC_JSONRPC_VERSION; + exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = TMP_RPC_JSONRPC_REQUEST_ID; + exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = TMP_RPC_JSONRPC_ERROR_CODE; + exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; + exports.SEMATTRS_MESSAGE_TYPE = TMP_MESSAGE_TYPE; + exports.SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; + exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; + exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = TMP_MESSAGE_UNCOMPRESSED_SIZE; + exports.SemanticAttributes = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_AWS_LAMBDA_INVOKED_ARN, + TMP_DB_SYSTEM, + TMP_DB_CONNECTION_STRING, + TMP_DB_USER, + TMP_DB_JDBC_DRIVER_CLASSNAME, + TMP_DB_NAME, + TMP_DB_STATEMENT, + TMP_DB_OPERATION, + TMP_DB_MSSQL_INSTANCE_NAME, + TMP_DB_CASSANDRA_KEYSPACE, + TMP_DB_CASSANDRA_PAGE_SIZE, + TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, + TMP_DB_CASSANDRA_TABLE, + TMP_DB_CASSANDRA_IDEMPOTENCE, + TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, + TMP_DB_CASSANDRA_COORDINATOR_ID, + TMP_DB_CASSANDRA_COORDINATOR_DC, + TMP_DB_HBASE_NAMESPACE, + TMP_DB_REDIS_DATABASE_INDEX, + TMP_DB_MONGODB_COLLECTION, + TMP_DB_SQL_TABLE, + TMP_EXCEPTION_TYPE, + TMP_EXCEPTION_MESSAGE, + TMP_EXCEPTION_STACKTRACE, + TMP_EXCEPTION_ESCAPED, + TMP_FAAS_TRIGGER, + TMP_FAAS_EXECUTION, + TMP_FAAS_DOCUMENT_COLLECTION, + TMP_FAAS_DOCUMENT_OPERATION, + TMP_FAAS_DOCUMENT_TIME, + TMP_FAAS_DOCUMENT_NAME, + TMP_FAAS_TIME, + TMP_FAAS_CRON, + TMP_FAAS_COLDSTART, + TMP_FAAS_INVOKED_NAME, + TMP_FAAS_INVOKED_PROVIDER, + TMP_FAAS_INVOKED_REGION, + TMP_NET_TRANSPORT, + TMP_NET_PEER_IP, + TMP_NET_PEER_PORT, + TMP_NET_PEER_NAME, + TMP_NET_HOST_IP, + TMP_NET_HOST_PORT, + TMP_NET_HOST_NAME, + TMP_NET_HOST_CONNECTION_TYPE, + TMP_NET_HOST_CONNECTION_SUBTYPE, + TMP_NET_HOST_CARRIER_NAME, + TMP_NET_HOST_CARRIER_MCC, + TMP_NET_HOST_CARRIER_MNC, + TMP_NET_HOST_CARRIER_ICC, + TMP_PEER_SERVICE, + TMP_ENDUSER_ID, + TMP_ENDUSER_ROLE, + TMP_ENDUSER_SCOPE, + TMP_THREAD_ID, + TMP_THREAD_NAME, + TMP_CODE_FUNCTION, + TMP_CODE_NAMESPACE, + TMP_CODE_FILEPATH, + TMP_CODE_LINENO, + TMP_HTTP_METHOD, + TMP_HTTP_URL, + TMP_HTTP_TARGET, + TMP_HTTP_HOST, + TMP_HTTP_SCHEME, + TMP_HTTP_STATUS_CODE, + TMP_HTTP_FLAVOR, + TMP_HTTP_USER_AGENT, + TMP_HTTP_REQUEST_CONTENT_LENGTH, + TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_RESPONSE_CONTENT_LENGTH, + TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_SERVER_NAME, + TMP_HTTP_ROUTE, + TMP_HTTP_CLIENT_IP, + TMP_AWS_DYNAMODB_TABLE_NAMES, + TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, + TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, + TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, + TMP_AWS_DYNAMODB_CONSISTENT_READ, + TMP_AWS_DYNAMODB_PROJECTION, + TMP_AWS_DYNAMODB_LIMIT, + TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, + TMP_AWS_DYNAMODB_INDEX_NAME, + TMP_AWS_DYNAMODB_SELECT, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, + TMP_AWS_DYNAMODB_TABLE_COUNT, + TMP_AWS_DYNAMODB_SCAN_FORWARD, + TMP_AWS_DYNAMODB_SEGMENT, + TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, + TMP_AWS_DYNAMODB_COUNT, + TMP_AWS_DYNAMODB_SCANNED_COUNT, + TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, + TMP_MESSAGING_SYSTEM, + TMP_MESSAGING_DESTINATION, + TMP_MESSAGING_DESTINATION_KIND, + TMP_MESSAGING_TEMP_DESTINATION, + TMP_MESSAGING_PROTOCOL, + TMP_MESSAGING_PROTOCOL_VERSION, + TMP_MESSAGING_URL, + TMP_MESSAGING_MESSAGE_ID, + TMP_MESSAGING_CONVERSATION_ID, + TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, + TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, + TMP_MESSAGING_OPERATION, + TMP_MESSAGING_CONSUMER_ID, + TMP_MESSAGING_RABBITMQ_ROUTING_KEY, + TMP_MESSAGING_KAFKA_MESSAGE_KEY, + TMP_MESSAGING_KAFKA_CONSUMER_GROUP, + TMP_MESSAGING_KAFKA_CLIENT_ID, + TMP_MESSAGING_KAFKA_PARTITION, + TMP_MESSAGING_KAFKA_TOMBSTONE, + TMP_RPC_SYSTEM, + TMP_RPC_SERVICE, + TMP_RPC_METHOD, + TMP_RPC_GRPC_STATUS_CODE, + TMP_RPC_JSONRPC_VERSION, + TMP_RPC_JSONRPC_REQUEST_ID, + TMP_RPC_JSONRPC_ERROR_CODE, + TMP_RPC_JSONRPC_ERROR_MESSAGE, + TMP_MESSAGE_TYPE, + TMP_MESSAGE_ID, + TMP_MESSAGE_COMPRESSED_SIZE, + TMP_MESSAGE_UNCOMPRESSED_SIZE + ]); + var TMP_DBSYSTEMVALUES_OTHER_SQL = "other_sql"; + var TMP_DBSYSTEMVALUES_MSSQL = "mssql"; + var TMP_DBSYSTEMVALUES_MYSQL = "mysql"; + var TMP_DBSYSTEMVALUES_ORACLE = "oracle"; + var TMP_DBSYSTEMVALUES_DB2 = "db2"; + var TMP_DBSYSTEMVALUES_POSTGRESQL = "postgresql"; + var TMP_DBSYSTEMVALUES_REDSHIFT = "redshift"; + var TMP_DBSYSTEMVALUES_HIVE = "hive"; + var TMP_DBSYSTEMVALUES_CLOUDSCAPE = "cloudscape"; + var TMP_DBSYSTEMVALUES_HSQLDB = "hsqldb"; + var TMP_DBSYSTEMVALUES_PROGRESS = "progress"; + var TMP_DBSYSTEMVALUES_MAXDB = "maxdb"; + var TMP_DBSYSTEMVALUES_HANADB = "hanadb"; + var TMP_DBSYSTEMVALUES_INGRES = "ingres"; + var TMP_DBSYSTEMVALUES_FIRSTSQL = "firstsql"; + var TMP_DBSYSTEMVALUES_EDB = "edb"; + var TMP_DBSYSTEMVALUES_CACHE = "cache"; + var TMP_DBSYSTEMVALUES_ADABAS = "adabas"; + var TMP_DBSYSTEMVALUES_FIREBIRD = "firebird"; + var TMP_DBSYSTEMVALUES_DERBY = "derby"; + var TMP_DBSYSTEMVALUES_FILEMAKER = "filemaker"; + var TMP_DBSYSTEMVALUES_INFORMIX = "informix"; + var TMP_DBSYSTEMVALUES_INSTANTDB = "instantdb"; + var TMP_DBSYSTEMVALUES_INTERBASE = "interbase"; + var TMP_DBSYSTEMVALUES_MARIADB = "mariadb"; + var TMP_DBSYSTEMVALUES_NETEZZA = "netezza"; + var TMP_DBSYSTEMVALUES_PERVASIVE = "pervasive"; + var TMP_DBSYSTEMVALUES_POINTBASE = "pointbase"; + var TMP_DBSYSTEMVALUES_SQLITE = "sqlite"; + var TMP_DBSYSTEMVALUES_SYBASE = "sybase"; + var TMP_DBSYSTEMVALUES_TERADATA = "teradata"; + var TMP_DBSYSTEMVALUES_VERTICA = "vertica"; + var TMP_DBSYSTEMVALUES_H2 = "h2"; + var TMP_DBSYSTEMVALUES_COLDFUSION = "coldfusion"; + var TMP_DBSYSTEMVALUES_CASSANDRA = "cassandra"; + var TMP_DBSYSTEMVALUES_HBASE = "hbase"; + var TMP_DBSYSTEMVALUES_MONGODB = "mongodb"; + var TMP_DBSYSTEMVALUES_REDIS = "redis"; + var TMP_DBSYSTEMVALUES_COUCHBASE = "couchbase"; + var TMP_DBSYSTEMVALUES_COUCHDB = "couchdb"; + var TMP_DBSYSTEMVALUES_COSMOSDB = "cosmosdb"; + var TMP_DBSYSTEMVALUES_DYNAMODB = "dynamodb"; + var TMP_DBSYSTEMVALUES_NEO4J = "neo4j"; + var TMP_DBSYSTEMVALUES_GEODE = "geode"; + var TMP_DBSYSTEMVALUES_ELASTICSEARCH = "elasticsearch"; + var TMP_DBSYSTEMVALUES_MEMCACHED = "memcached"; + var TMP_DBSYSTEMVALUES_COCKROACHDB = "cockroachdb"; + exports.DBSYSTEMVALUES_OTHER_SQL = TMP_DBSYSTEMVALUES_OTHER_SQL; + exports.DBSYSTEMVALUES_MSSQL = TMP_DBSYSTEMVALUES_MSSQL; + exports.DBSYSTEMVALUES_MYSQL = TMP_DBSYSTEMVALUES_MYSQL; + exports.DBSYSTEMVALUES_ORACLE = TMP_DBSYSTEMVALUES_ORACLE; + exports.DBSYSTEMVALUES_DB2 = TMP_DBSYSTEMVALUES_DB2; + exports.DBSYSTEMVALUES_POSTGRESQL = TMP_DBSYSTEMVALUES_POSTGRESQL; + exports.DBSYSTEMVALUES_REDSHIFT = TMP_DBSYSTEMVALUES_REDSHIFT; + exports.DBSYSTEMVALUES_HIVE = TMP_DBSYSTEMVALUES_HIVE; + exports.DBSYSTEMVALUES_CLOUDSCAPE = TMP_DBSYSTEMVALUES_CLOUDSCAPE; + exports.DBSYSTEMVALUES_HSQLDB = TMP_DBSYSTEMVALUES_HSQLDB; + exports.DBSYSTEMVALUES_PROGRESS = TMP_DBSYSTEMVALUES_PROGRESS; + exports.DBSYSTEMVALUES_MAXDB = TMP_DBSYSTEMVALUES_MAXDB; + exports.DBSYSTEMVALUES_HANADB = TMP_DBSYSTEMVALUES_HANADB; + exports.DBSYSTEMVALUES_INGRES = TMP_DBSYSTEMVALUES_INGRES; + exports.DBSYSTEMVALUES_FIRSTSQL = TMP_DBSYSTEMVALUES_FIRSTSQL; + exports.DBSYSTEMVALUES_EDB = TMP_DBSYSTEMVALUES_EDB; + exports.DBSYSTEMVALUES_CACHE = TMP_DBSYSTEMVALUES_CACHE; + exports.DBSYSTEMVALUES_ADABAS = TMP_DBSYSTEMVALUES_ADABAS; + exports.DBSYSTEMVALUES_FIREBIRD = TMP_DBSYSTEMVALUES_FIREBIRD; + exports.DBSYSTEMVALUES_DERBY = TMP_DBSYSTEMVALUES_DERBY; + exports.DBSYSTEMVALUES_FILEMAKER = TMP_DBSYSTEMVALUES_FILEMAKER; + exports.DBSYSTEMVALUES_INFORMIX = TMP_DBSYSTEMVALUES_INFORMIX; + exports.DBSYSTEMVALUES_INSTANTDB = TMP_DBSYSTEMVALUES_INSTANTDB; + exports.DBSYSTEMVALUES_INTERBASE = TMP_DBSYSTEMVALUES_INTERBASE; + exports.DBSYSTEMVALUES_MARIADB = TMP_DBSYSTEMVALUES_MARIADB; + exports.DBSYSTEMVALUES_NETEZZA = TMP_DBSYSTEMVALUES_NETEZZA; + exports.DBSYSTEMVALUES_PERVASIVE = TMP_DBSYSTEMVALUES_PERVASIVE; + exports.DBSYSTEMVALUES_POINTBASE = TMP_DBSYSTEMVALUES_POINTBASE; + exports.DBSYSTEMVALUES_SQLITE = TMP_DBSYSTEMVALUES_SQLITE; + exports.DBSYSTEMVALUES_SYBASE = TMP_DBSYSTEMVALUES_SYBASE; + exports.DBSYSTEMVALUES_TERADATA = TMP_DBSYSTEMVALUES_TERADATA; + exports.DBSYSTEMVALUES_VERTICA = TMP_DBSYSTEMVALUES_VERTICA; + exports.DBSYSTEMVALUES_H2 = TMP_DBSYSTEMVALUES_H2; + exports.DBSYSTEMVALUES_COLDFUSION = TMP_DBSYSTEMVALUES_COLDFUSION; + exports.DBSYSTEMVALUES_CASSANDRA = TMP_DBSYSTEMVALUES_CASSANDRA; + exports.DBSYSTEMVALUES_HBASE = TMP_DBSYSTEMVALUES_HBASE; + exports.DBSYSTEMVALUES_MONGODB = TMP_DBSYSTEMVALUES_MONGODB; + exports.DBSYSTEMVALUES_REDIS = TMP_DBSYSTEMVALUES_REDIS; + exports.DBSYSTEMVALUES_COUCHBASE = TMP_DBSYSTEMVALUES_COUCHBASE; + exports.DBSYSTEMVALUES_COUCHDB = TMP_DBSYSTEMVALUES_COUCHDB; + exports.DBSYSTEMVALUES_COSMOSDB = TMP_DBSYSTEMVALUES_COSMOSDB; + exports.DBSYSTEMVALUES_DYNAMODB = TMP_DBSYSTEMVALUES_DYNAMODB; + exports.DBSYSTEMVALUES_NEO4J = TMP_DBSYSTEMVALUES_NEO4J; + exports.DBSYSTEMVALUES_GEODE = TMP_DBSYSTEMVALUES_GEODE; + exports.DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; + exports.DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; + exports.DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; + exports.DbSystemValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_DBSYSTEMVALUES_OTHER_SQL, + TMP_DBSYSTEMVALUES_MSSQL, + TMP_DBSYSTEMVALUES_MYSQL, + TMP_DBSYSTEMVALUES_ORACLE, + TMP_DBSYSTEMVALUES_DB2, + TMP_DBSYSTEMVALUES_POSTGRESQL, + TMP_DBSYSTEMVALUES_REDSHIFT, + TMP_DBSYSTEMVALUES_HIVE, + TMP_DBSYSTEMVALUES_CLOUDSCAPE, + TMP_DBSYSTEMVALUES_HSQLDB, + TMP_DBSYSTEMVALUES_PROGRESS, + TMP_DBSYSTEMVALUES_MAXDB, + TMP_DBSYSTEMVALUES_HANADB, + TMP_DBSYSTEMVALUES_INGRES, + TMP_DBSYSTEMVALUES_FIRSTSQL, + TMP_DBSYSTEMVALUES_EDB, + TMP_DBSYSTEMVALUES_CACHE, + TMP_DBSYSTEMVALUES_ADABAS, + TMP_DBSYSTEMVALUES_FIREBIRD, + TMP_DBSYSTEMVALUES_DERBY, + TMP_DBSYSTEMVALUES_FILEMAKER, + TMP_DBSYSTEMVALUES_INFORMIX, + TMP_DBSYSTEMVALUES_INSTANTDB, + TMP_DBSYSTEMVALUES_INTERBASE, + TMP_DBSYSTEMVALUES_MARIADB, + TMP_DBSYSTEMVALUES_NETEZZA, + TMP_DBSYSTEMVALUES_PERVASIVE, + TMP_DBSYSTEMVALUES_POINTBASE, + TMP_DBSYSTEMVALUES_SQLITE, + TMP_DBSYSTEMVALUES_SYBASE, + TMP_DBSYSTEMVALUES_TERADATA, + TMP_DBSYSTEMVALUES_VERTICA, + TMP_DBSYSTEMVALUES_H2, + TMP_DBSYSTEMVALUES_COLDFUSION, + TMP_DBSYSTEMVALUES_CASSANDRA, + TMP_DBSYSTEMVALUES_HBASE, + TMP_DBSYSTEMVALUES_MONGODB, + TMP_DBSYSTEMVALUES_REDIS, + TMP_DBSYSTEMVALUES_COUCHBASE, + TMP_DBSYSTEMVALUES_COUCHDB, + TMP_DBSYSTEMVALUES_COSMOSDB, + TMP_DBSYSTEMVALUES_DYNAMODB, + TMP_DBSYSTEMVALUES_NEO4J, + TMP_DBSYSTEMVALUES_GEODE, + TMP_DBSYSTEMVALUES_ELASTICSEARCH, + TMP_DBSYSTEMVALUES_MEMCACHED, + TMP_DBSYSTEMVALUES_COCKROACHDB + ]); + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL = "all"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = "each_quorum"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = "quorum"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = "local_quorum"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE = "one"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO = "two"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE = "three"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = "local_one"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY = "any"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = "serial"; + var TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = "local_serial"; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; + exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; + exports.DbCassandraConsistencyLevelValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL + ]); + var TMP_FAASTRIGGERVALUES_DATASOURCE = "datasource"; + var TMP_FAASTRIGGERVALUES_HTTP = "http"; + var TMP_FAASTRIGGERVALUES_PUBSUB = "pubsub"; + var TMP_FAASTRIGGERVALUES_TIMER = "timer"; + var TMP_FAASTRIGGERVALUES_OTHER = "other"; + exports.FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; + exports.FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; + exports.FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; + exports.FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; + exports.FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; + exports.FaasTriggerValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_FAASTRIGGERVALUES_DATASOURCE, + TMP_FAASTRIGGERVALUES_HTTP, + TMP_FAASTRIGGERVALUES_PUBSUB, + TMP_FAASTRIGGERVALUES_TIMER, + TMP_FAASTRIGGERVALUES_OTHER + ]); + var TMP_FAASDOCUMENTOPERATIONVALUES_INSERT = "insert"; + var TMP_FAASDOCUMENTOPERATIONVALUES_EDIT = "edit"; + var TMP_FAASDOCUMENTOPERATIONVALUES_DELETE = "delete"; + exports.FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; + exports.FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; + exports.FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; + exports.FaasDocumentOperationValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, + TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, + TMP_FAASDOCUMENTOPERATIONVALUES_DELETE + ]); + var TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; + var TMP_FAASINVOKEDPROVIDERVALUES_AWS = "aws"; + var TMP_FAASINVOKEDPROVIDERVALUES_AZURE = "azure"; + var TMP_FAASINVOKEDPROVIDERVALUES_GCP = "gcp"; + exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD; + exports.FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; + exports.FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; + exports.FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; + exports.FaasInvokedProviderValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_FAASINVOKEDPROVIDERVALUES_AWS, + TMP_FAASINVOKEDPROVIDERVALUES_AZURE, + TMP_FAASINVOKEDPROVIDERVALUES_GCP + ]); + var TMP_NETTRANSPORTVALUES_IP_TCP = "ip_tcp"; + var TMP_NETTRANSPORTVALUES_IP_UDP = "ip_udp"; + var TMP_NETTRANSPORTVALUES_IP = "ip"; + var TMP_NETTRANSPORTVALUES_UNIX = "unix"; + var TMP_NETTRANSPORTVALUES_PIPE = "pipe"; + var TMP_NETTRANSPORTVALUES_INPROC = "inproc"; + var TMP_NETTRANSPORTVALUES_OTHER = "other"; + exports.NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; + exports.NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; + exports.NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; + exports.NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; + exports.NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; + exports.NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; + exports.NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; + exports.NetTransportValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_NETTRANSPORTVALUES_IP_TCP, + TMP_NETTRANSPORTVALUES_IP_UDP, + TMP_NETTRANSPORTVALUES_IP, + TMP_NETTRANSPORTVALUES_UNIX, + TMP_NETTRANSPORTVALUES_PIPE, + TMP_NETTRANSPORTVALUES_INPROC, + TMP_NETTRANSPORTVALUES_OTHER + ]); + var TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI = "wifi"; + var TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED = "wired"; + var TMP_NETHOSTCONNECTIONTYPEVALUES_CELL = "cell"; + var TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = "unavailable"; + var TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = "unknown"; + exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; + exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; + exports.NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; + exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; + exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; + exports.NetHostConnectionTypeValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, + TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, + TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN + ]); + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = "gprs"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = "edge"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = "umts"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = "cdma"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = "evdo_0"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = "evdo_a"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = "cdma2000_1xrtt"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = "hsdpa"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = "hsupa"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = "hspa"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = "iden"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = "evdo_b"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE = "lte"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = "ehrpd"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = "hspap"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM = "gsm"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = "td_scdma"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = "iwlan"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR = "nr"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = "nrnsa"; + var TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = "lte_ca"; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; + exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; + exports.NetHostConnectionSubtypeValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA + ]); + var TMP_HTTPFLAVORVALUES_HTTP_1_0 = "1.0"; + var TMP_HTTPFLAVORVALUES_HTTP_1_1 = "1.1"; + var TMP_HTTPFLAVORVALUES_HTTP_2_0 = "2.0"; + var TMP_HTTPFLAVORVALUES_SPDY = "SPDY"; + var TMP_HTTPFLAVORVALUES_QUIC = "QUIC"; + exports.HTTPFLAVORVALUES_HTTP_1_0 = TMP_HTTPFLAVORVALUES_HTTP_1_0; + exports.HTTPFLAVORVALUES_HTTP_1_1 = TMP_HTTPFLAVORVALUES_HTTP_1_1; + exports.HTTPFLAVORVALUES_HTTP_2_0 = TMP_HTTPFLAVORVALUES_HTTP_2_0; + exports.HTTPFLAVORVALUES_SPDY = TMP_HTTPFLAVORVALUES_SPDY; + exports.HTTPFLAVORVALUES_QUIC = TMP_HTTPFLAVORVALUES_QUIC; + exports.HttpFlavorValues = { + HTTP_1_0: TMP_HTTPFLAVORVALUES_HTTP_1_0, + HTTP_1_1: TMP_HTTPFLAVORVALUES_HTTP_1_1, + HTTP_2_0: TMP_HTTPFLAVORVALUES_HTTP_2_0, + SPDY: TMP_HTTPFLAVORVALUES_SPDY, + QUIC: TMP_HTTPFLAVORVALUES_QUIC + }; + var TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE = "queue"; + var TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = "topic"; + exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; + exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC; + exports.MessagingDestinationKindValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, + TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC + ]); + var TMP_MESSAGINGOPERATIONVALUES_RECEIVE = "receive"; + var TMP_MESSAGINGOPERATIONVALUES_PROCESS = "process"; + exports.MESSAGINGOPERATIONVALUES_RECEIVE = TMP_MESSAGINGOPERATIONVALUES_RECEIVE; + exports.MESSAGINGOPERATIONVALUES_PROCESS = TMP_MESSAGINGOPERATIONVALUES_PROCESS; + exports.MessagingOperationValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_MESSAGINGOPERATIONVALUES_RECEIVE, + TMP_MESSAGINGOPERATIONVALUES_PROCESS + ]); + var TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; + var TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; + var TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; + var TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = 3; + var TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = 4; + var TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND = 5; + var TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = 6; + var TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = 7; + var TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = 8; + var TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = 9; + var TMP_RPCGRPCSTATUSCODEVALUES_ABORTED = 10; + var TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = 11; + var TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = 12; + var TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL = 13; + var TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = 14; + var TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS = 15; + var TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = 16; + exports.RPCGRPCSTATUSCODEVALUES_OK = TMP_RPCGRPCSTATUSCODEVALUES_OK; + exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED; + exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN; + exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT; + exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED; + exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND; + exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS; + exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED; + exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED; + exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION; + exports.RPCGRPCSTATUSCODEVALUES_ABORTED = TMP_RPCGRPCSTATUSCODEVALUES_ABORTED; + exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE; + exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED; + exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL; + exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE; + exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS; + exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED; + exports.RpcGrpcStatusCodeValues = { + OK: TMP_RPCGRPCSTATUSCODEVALUES_OK, + CANCELLED: TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, + UNKNOWN: TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, + INVALID_ARGUMENT: TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, + DEADLINE_EXCEEDED: TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, + NOT_FOUND: TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, + ALREADY_EXISTS: TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, + PERMISSION_DENIED: TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, + RESOURCE_EXHAUSTED: TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, + FAILED_PRECONDITION: TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, + ABORTED: TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, + OUT_OF_RANGE: TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, + UNIMPLEMENTED: TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, + INTERNAL: TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, + UNAVAILABLE: TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, + DATA_LOSS: TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, + UNAUTHENTICATED: TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED + }; + var TMP_MESSAGETYPEVALUES_SENT = "SENT"; + var TMP_MESSAGETYPEVALUES_RECEIVED = "RECEIVED"; + exports.MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; + exports.MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; + exports.MessageTypeValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_MESSAGETYPEVALUES_SENT, + TMP_MESSAGETYPEVALUES_RECEIVED + ]); +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js +var require_trace2 = __commonJS((exports) => { + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) + k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) + k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) + __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar(require_SemanticAttributes(), exports); +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js +var require_SemanticResourceAttributes = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = undefined; + exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = undefined; + exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = undefined; + var utils_1 = require_utils4(); + var TMP_CLOUD_PROVIDER = "cloud.provider"; + var TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; + var TMP_CLOUD_REGION = "cloud.region"; + var TMP_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + var TMP_CLOUD_PLATFORM = "cloud.platform"; + var TMP_AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn"; + var TMP_AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn"; + var TMP_AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype"; + var TMP_AWS_ECS_TASK_ARN = "aws.ecs.task.arn"; + var TMP_AWS_ECS_TASK_FAMILY = "aws.ecs.task.family"; + var TMP_AWS_ECS_TASK_REVISION = "aws.ecs.task.revision"; + var TMP_AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn"; + var TMP_AWS_LOG_GROUP_NAMES = "aws.log.group.names"; + var TMP_AWS_LOG_GROUP_ARNS = "aws.log.group.arns"; + var TMP_AWS_LOG_STREAM_NAMES = "aws.log.stream.names"; + var TMP_AWS_LOG_STREAM_ARNS = "aws.log.stream.arns"; + var TMP_CONTAINER_NAME = "container.name"; + var TMP_CONTAINER_ID = "container.id"; + var TMP_CONTAINER_RUNTIME = "container.runtime"; + var TMP_CONTAINER_IMAGE_NAME = "container.image.name"; + var TMP_CONTAINER_IMAGE_TAG = "container.image.tag"; + var TMP_DEPLOYMENT_ENVIRONMENT = "deployment.environment"; + var TMP_DEVICE_ID = "device.id"; + var TMP_DEVICE_MODEL_IDENTIFIER = "device.model.identifier"; + var TMP_DEVICE_MODEL_NAME = "device.model.name"; + var TMP_FAAS_NAME = "faas.name"; + var TMP_FAAS_ID = "faas.id"; + var TMP_FAAS_VERSION = "faas.version"; + var TMP_FAAS_INSTANCE = "faas.instance"; + var TMP_FAAS_MAX_MEMORY = "faas.max_memory"; + var TMP_HOST_ID = "host.id"; + var TMP_HOST_NAME = "host.name"; + var TMP_HOST_TYPE = "host.type"; + var TMP_HOST_ARCH = "host.arch"; + var TMP_HOST_IMAGE_NAME = "host.image.name"; + var TMP_HOST_IMAGE_ID = "host.image.id"; + var TMP_HOST_IMAGE_VERSION = "host.image.version"; + var TMP_K8S_CLUSTER_NAME = "k8s.cluster.name"; + var TMP_K8S_NODE_NAME = "k8s.node.name"; + var TMP_K8S_NODE_UID = "k8s.node.uid"; + var TMP_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + var TMP_K8S_POD_UID = "k8s.pod.uid"; + var TMP_K8S_POD_NAME = "k8s.pod.name"; + var TMP_K8S_CONTAINER_NAME = "k8s.container.name"; + var TMP_K8S_REPLICASET_UID = "k8s.replicaset.uid"; + var TMP_K8S_REPLICASET_NAME = "k8s.replicaset.name"; + var TMP_K8S_DEPLOYMENT_UID = "k8s.deployment.uid"; + var TMP_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + var TMP_K8S_STATEFULSET_UID = "k8s.statefulset.uid"; + var TMP_K8S_STATEFULSET_NAME = "k8s.statefulset.name"; + var TMP_K8S_DAEMONSET_UID = "k8s.daemonset.uid"; + var TMP_K8S_DAEMONSET_NAME = "k8s.daemonset.name"; + var TMP_K8S_JOB_UID = "k8s.job.uid"; + var TMP_K8S_JOB_NAME = "k8s.job.name"; + var TMP_K8S_CRONJOB_UID = "k8s.cronjob.uid"; + var TMP_K8S_CRONJOB_NAME = "k8s.cronjob.name"; + var TMP_OS_TYPE = "os.type"; + var TMP_OS_DESCRIPTION = "os.description"; + var TMP_OS_NAME = "os.name"; + var TMP_OS_VERSION = "os.version"; + var TMP_PROCESS_PID = "process.pid"; + var TMP_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + var TMP_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + var TMP_PROCESS_COMMAND = "process.command"; + var TMP_PROCESS_COMMAND_LINE = "process.command_line"; + var TMP_PROCESS_COMMAND_ARGS = "process.command_args"; + var TMP_PROCESS_OWNER = "process.owner"; + var TMP_PROCESS_RUNTIME_NAME = "process.runtime.name"; + var TMP_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + var TMP_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + var TMP_SERVICE_NAME = "service.name"; + var TMP_SERVICE_NAMESPACE = "service.namespace"; + var TMP_SERVICE_INSTANCE_ID = "service.instance.id"; + var TMP_SERVICE_VERSION = "service.version"; + var TMP_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; + var TMP_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; + var TMP_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; + var TMP_TELEMETRY_AUTO_VERSION = "telemetry.auto.version"; + var TMP_WEBENGINE_NAME = "webengine.name"; + var TMP_WEBENGINE_VERSION = "webengine.version"; + var TMP_WEBENGINE_DESCRIPTION = "webengine.description"; + exports.SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; + exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = TMP_CLOUD_ACCOUNT_ID; + exports.SEMRESATTRS_CLOUD_REGION = TMP_CLOUD_REGION; + exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = TMP_CLOUD_AVAILABILITY_ZONE; + exports.SEMRESATTRS_CLOUD_PLATFORM = TMP_CLOUD_PLATFORM; + exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = TMP_AWS_ECS_CONTAINER_ARN; + exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = TMP_AWS_ECS_CLUSTER_ARN; + exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = TMP_AWS_ECS_LAUNCHTYPE; + exports.SEMRESATTRS_AWS_ECS_TASK_ARN = TMP_AWS_ECS_TASK_ARN; + exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; + exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; + exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = TMP_AWS_EKS_CLUSTER_ARN; + exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = TMP_AWS_LOG_GROUP_NAMES; + exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = TMP_AWS_LOG_GROUP_ARNS; + exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = TMP_AWS_LOG_STREAM_NAMES; + exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; + exports.SEMRESATTRS_CONTAINER_NAME = TMP_CONTAINER_NAME; + exports.SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; + exports.SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; + exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; + exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = TMP_CONTAINER_IMAGE_TAG; + exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = TMP_DEPLOYMENT_ENVIRONMENT; + exports.SEMRESATTRS_DEVICE_ID = TMP_DEVICE_ID; + exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = TMP_DEVICE_MODEL_IDENTIFIER; + exports.SEMRESATTRS_DEVICE_MODEL_NAME = TMP_DEVICE_MODEL_NAME; + exports.SEMRESATTRS_FAAS_NAME = TMP_FAAS_NAME; + exports.SEMRESATTRS_FAAS_ID = TMP_FAAS_ID; + exports.SEMRESATTRS_FAAS_VERSION = TMP_FAAS_VERSION; + exports.SEMRESATTRS_FAAS_INSTANCE = TMP_FAAS_INSTANCE; + exports.SEMRESATTRS_FAAS_MAX_MEMORY = TMP_FAAS_MAX_MEMORY; + exports.SEMRESATTRS_HOST_ID = TMP_HOST_ID; + exports.SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; + exports.SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; + exports.SEMRESATTRS_HOST_ARCH = TMP_HOST_ARCH; + exports.SEMRESATTRS_HOST_IMAGE_NAME = TMP_HOST_IMAGE_NAME; + exports.SEMRESATTRS_HOST_IMAGE_ID = TMP_HOST_IMAGE_ID; + exports.SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; + exports.SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; + exports.SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; + exports.SEMRESATTRS_K8S_NODE_UID = TMP_K8S_NODE_UID; + exports.SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; + exports.SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; + exports.SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; + exports.SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; + exports.SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; + exports.SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; + exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; + exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; + exports.SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; + exports.SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; + exports.SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; + exports.SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; + exports.SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; + exports.SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; + exports.SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; + exports.SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; + exports.SEMRESATTRS_OS_TYPE = TMP_OS_TYPE; + exports.SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; + exports.SEMRESATTRS_OS_NAME = TMP_OS_NAME; + exports.SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; + exports.SEMRESATTRS_PROCESS_PID = TMP_PROCESS_PID; + exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = TMP_PROCESS_EXECUTABLE_NAME; + exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = TMP_PROCESS_EXECUTABLE_PATH; + exports.SEMRESATTRS_PROCESS_COMMAND = TMP_PROCESS_COMMAND; + exports.SEMRESATTRS_PROCESS_COMMAND_LINE = TMP_PROCESS_COMMAND_LINE; + exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; + exports.SEMRESATTRS_PROCESS_OWNER = TMP_PROCESS_OWNER; + exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = TMP_PROCESS_RUNTIME_NAME; + exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = TMP_PROCESS_RUNTIME_VERSION; + exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = TMP_PROCESS_RUNTIME_DESCRIPTION; + exports.SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME; + exports.SEMRESATTRS_SERVICE_NAMESPACE = TMP_SERVICE_NAMESPACE; + exports.SEMRESATTRS_SERVICE_INSTANCE_ID = TMP_SERVICE_INSTANCE_ID; + exports.SEMRESATTRS_SERVICE_VERSION = TMP_SERVICE_VERSION; + exports.SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME; + exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE; + exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION; + exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; + exports.SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; + exports.SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; + exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; + exports.SemanticResourceAttributes = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_CLOUD_PROVIDER, + TMP_CLOUD_ACCOUNT_ID, + TMP_CLOUD_REGION, + TMP_CLOUD_AVAILABILITY_ZONE, + TMP_CLOUD_PLATFORM, + TMP_AWS_ECS_CONTAINER_ARN, + TMP_AWS_ECS_CLUSTER_ARN, + TMP_AWS_ECS_LAUNCHTYPE, + TMP_AWS_ECS_TASK_ARN, + TMP_AWS_ECS_TASK_FAMILY, + TMP_AWS_ECS_TASK_REVISION, + TMP_AWS_EKS_CLUSTER_ARN, + TMP_AWS_LOG_GROUP_NAMES, + TMP_AWS_LOG_GROUP_ARNS, + TMP_AWS_LOG_STREAM_NAMES, + TMP_AWS_LOG_STREAM_ARNS, + TMP_CONTAINER_NAME, + TMP_CONTAINER_ID, + TMP_CONTAINER_RUNTIME, + TMP_CONTAINER_IMAGE_NAME, + TMP_CONTAINER_IMAGE_TAG, + TMP_DEPLOYMENT_ENVIRONMENT, + TMP_DEVICE_ID, + TMP_DEVICE_MODEL_IDENTIFIER, + TMP_DEVICE_MODEL_NAME, + TMP_FAAS_NAME, + TMP_FAAS_ID, + TMP_FAAS_VERSION, + TMP_FAAS_INSTANCE, + TMP_FAAS_MAX_MEMORY, + TMP_HOST_ID, + TMP_HOST_NAME, + TMP_HOST_TYPE, + TMP_HOST_ARCH, + TMP_HOST_IMAGE_NAME, + TMP_HOST_IMAGE_ID, + TMP_HOST_IMAGE_VERSION, + TMP_K8S_CLUSTER_NAME, + TMP_K8S_NODE_NAME, + TMP_K8S_NODE_UID, + TMP_K8S_NAMESPACE_NAME, + TMP_K8S_POD_UID, + TMP_K8S_POD_NAME, + TMP_K8S_CONTAINER_NAME, + TMP_K8S_REPLICASET_UID, + TMP_K8S_REPLICASET_NAME, + TMP_K8S_DEPLOYMENT_UID, + TMP_K8S_DEPLOYMENT_NAME, + TMP_K8S_STATEFULSET_UID, + TMP_K8S_STATEFULSET_NAME, + TMP_K8S_DAEMONSET_UID, + TMP_K8S_DAEMONSET_NAME, + TMP_K8S_JOB_UID, + TMP_K8S_JOB_NAME, + TMP_K8S_CRONJOB_UID, + TMP_K8S_CRONJOB_NAME, + TMP_OS_TYPE, + TMP_OS_DESCRIPTION, + TMP_OS_NAME, + TMP_OS_VERSION, + TMP_PROCESS_PID, + TMP_PROCESS_EXECUTABLE_NAME, + TMP_PROCESS_EXECUTABLE_PATH, + TMP_PROCESS_COMMAND, + TMP_PROCESS_COMMAND_LINE, + TMP_PROCESS_COMMAND_ARGS, + TMP_PROCESS_OWNER, + TMP_PROCESS_RUNTIME_NAME, + TMP_PROCESS_RUNTIME_VERSION, + TMP_PROCESS_RUNTIME_DESCRIPTION, + TMP_SERVICE_NAME, + TMP_SERVICE_NAMESPACE, + TMP_SERVICE_INSTANCE_ID, + TMP_SERVICE_VERSION, + TMP_TELEMETRY_SDK_NAME, + TMP_TELEMETRY_SDK_LANGUAGE, + TMP_TELEMETRY_SDK_VERSION, + TMP_TELEMETRY_AUTO_VERSION, + TMP_WEBENGINE_NAME, + TMP_WEBENGINE_VERSION, + TMP_WEBENGINE_DESCRIPTION + ]); + var TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; + var TMP_CLOUDPROVIDERVALUES_AWS = "aws"; + var TMP_CLOUDPROVIDERVALUES_AZURE = "azure"; + var TMP_CLOUDPROVIDERVALUES_GCP = "gcp"; + exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; + exports.CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; + exports.CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; + exports.CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; + exports.CloudProviderValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_CLOUDPROVIDERVALUES_AWS, + TMP_CLOUDPROVIDERVALUES_AZURE, + TMP_CLOUDPROVIDERVALUES_GCP + ]); + var TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"; + var TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = "alibaba_cloud_fc"; + var TMP_CLOUDPLATFORMVALUES_AWS_EC2 = "aws_ec2"; + var TMP_CLOUDPLATFORMVALUES_AWS_ECS = "aws_ecs"; + var TMP_CLOUDPLATFORMVALUES_AWS_EKS = "aws_eks"; + var TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA = "aws_lambda"; + var TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"; + var TMP_CLOUDPLATFORMVALUES_AZURE_VM = "azure_vm"; + var TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = "azure_container_instances"; + var TMP_CLOUDPLATFORMVALUES_AZURE_AKS = "azure_aks"; + var TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = "azure_functions"; + var TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = "azure_app_service"; + var TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = "gcp_compute_engine"; + var TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = "gcp_cloud_run"; + var TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine"; + var TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions"; + var TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE = "gcp_app_engine"; + exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS; + exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC; + exports.CLOUDPLATFORMVALUES_AWS_EC2 = TMP_CLOUDPLATFORMVALUES_AWS_EC2; + exports.CLOUDPLATFORMVALUES_AWS_ECS = TMP_CLOUDPLATFORMVALUES_AWS_ECS; + exports.CLOUDPLATFORMVALUES_AWS_EKS = TMP_CLOUDPLATFORMVALUES_AWS_EKS; + exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA; + exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK; + exports.CLOUDPLATFORMVALUES_AZURE_VM = TMP_CLOUDPLATFORMVALUES_AZURE_VM; + exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES; + exports.CLOUDPLATFORMVALUES_AZURE_AKS = TMP_CLOUDPLATFORMVALUES_AZURE_AKS; + exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS; + exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE; + exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE; + exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN; + exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE; + exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS; + exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE; + exports.CloudPlatformValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, + TMP_CLOUDPLATFORMVALUES_AWS_EC2, + TMP_CLOUDPLATFORMVALUES_AWS_ECS, + TMP_CLOUDPLATFORMVALUES_AWS_EKS, + TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, + TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, + TMP_CLOUDPLATFORMVALUES_AZURE_VM, + TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, + TMP_CLOUDPLATFORMVALUES_AZURE_AKS, + TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, + TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, + TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE + ]); + var TMP_AWSECSLAUNCHTYPEVALUES_EC2 = "ec2"; + var TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = "fargate"; + exports.AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; + exports.AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; + exports.AwsEcsLaunchtypeValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_AWSECSLAUNCHTYPEVALUES_EC2, + TMP_AWSECSLAUNCHTYPEVALUES_FARGATE + ]); + var TMP_HOSTARCHVALUES_AMD64 = "amd64"; + var TMP_HOSTARCHVALUES_ARM32 = "arm32"; + var TMP_HOSTARCHVALUES_ARM64 = "arm64"; + var TMP_HOSTARCHVALUES_IA64 = "ia64"; + var TMP_HOSTARCHVALUES_PPC32 = "ppc32"; + var TMP_HOSTARCHVALUES_PPC64 = "ppc64"; + var TMP_HOSTARCHVALUES_X86 = "x86"; + exports.HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; + exports.HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; + exports.HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; + exports.HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; + exports.HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; + exports.HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; + exports.HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; + exports.HostArchValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_HOSTARCHVALUES_AMD64, + TMP_HOSTARCHVALUES_ARM32, + TMP_HOSTARCHVALUES_ARM64, + TMP_HOSTARCHVALUES_IA64, + TMP_HOSTARCHVALUES_PPC32, + TMP_HOSTARCHVALUES_PPC64, + TMP_HOSTARCHVALUES_X86 + ]); + var TMP_OSTYPEVALUES_WINDOWS = "windows"; + var TMP_OSTYPEVALUES_LINUX = "linux"; + var TMP_OSTYPEVALUES_DARWIN = "darwin"; + var TMP_OSTYPEVALUES_FREEBSD = "freebsd"; + var TMP_OSTYPEVALUES_NETBSD = "netbsd"; + var TMP_OSTYPEVALUES_OPENBSD = "openbsd"; + var TMP_OSTYPEVALUES_DRAGONFLYBSD = "dragonflybsd"; + var TMP_OSTYPEVALUES_HPUX = "hpux"; + var TMP_OSTYPEVALUES_AIX = "aix"; + var TMP_OSTYPEVALUES_SOLARIS = "solaris"; + var TMP_OSTYPEVALUES_Z_OS = "z_os"; + exports.OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; + exports.OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; + exports.OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; + exports.OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; + exports.OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; + exports.OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; + exports.OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; + exports.OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; + exports.OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; + exports.OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; + exports.OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; + exports.OsTypeValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_OSTYPEVALUES_WINDOWS, + TMP_OSTYPEVALUES_LINUX, + TMP_OSTYPEVALUES_DARWIN, + TMP_OSTYPEVALUES_FREEBSD, + TMP_OSTYPEVALUES_NETBSD, + TMP_OSTYPEVALUES_OPENBSD, + TMP_OSTYPEVALUES_DRAGONFLYBSD, + TMP_OSTYPEVALUES_HPUX, + TMP_OSTYPEVALUES_AIX, + TMP_OSTYPEVALUES_SOLARIS, + TMP_OSTYPEVALUES_Z_OS + ]); + var TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = "cpp"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = "dotnet"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = "erlang"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_GO = "go"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = "java"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = "nodejs"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = "php"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = "python"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = "ruby"; + var TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = "webjs"; + exports.TELEMETRYSDKLANGUAGEVALUES_CPP = TMP_TELEMETRYSDKLANGUAGEVALUES_CPP; + exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET; + exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG; + exports.TELEMETRYSDKLANGUAGEVALUES_GO = TMP_TELEMETRYSDKLANGUAGEVALUES_GO; + exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA; + exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS; + exports.TELEMETRYSDKLANGUAGEVALUES_PHP = TMP_TELEMETRYSDKLANGUAGEVALUES_PHP; + exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; + exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; + exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; + exports.TelemetrySdkLanguageValues = /* @__PURE__ */ (0, utils_1.createConstMap)([ + TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, + TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, + TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, + TMP_TELEMETRYSDKLANGUAGEVALUES_GO, + TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, + TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, + TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, + TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, + TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, + TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS + ]); +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js +var require_resource = __commonJS((exports) => { + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) + k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) + k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) + __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar(require_SemanticResourceAttributes(), exports); +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +var require_stable_attributes = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_ERROR_TYPE = exports.DOTNET_GC_HEAP_GENERATION_VALUE_POH = exports.DOTNET_GC_HEAP_GENERATION_VALUE_LOH = exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = exports.ATTR_DOTNET_GC_HEAP_GENERATION = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = exports.DB_SYSTEM_NAME_VALUE_POSTGRESQL = exports.DB_SYSTEM_NAME_VALUE_MYSQL = exports.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = exports.DB_SYSTEM_NAME_VALUE_MARIADB = exports.ATTR_DB_SYSTEM_NAME = exports.ATTR_DB_STORED_PROCEDURE_NAME = exports.ATTR_DB_RESPONSE_STATUS_CODE = exports.ATTR_DB_QUERY_TEXT = exports.ATTR_DB_QUERY_SUMMARY = exports.ATTR_DB_OPERATION_NAME = exports.ATTR_DB_OPERATION_BATCH_SIZE = exports.ATTR_DB_NAMESPACE = exports.ATTR_DB_COLLECTION_NAME = exports.ATTR_CODE_STACKTRACE = exports.ATTR_CODE_LINE_NUMBER = exports.ATTR_CODE_FUNCTION_NAME = exports.ATTR_CODE_FILE_PATH = exports.ATTR_CODE_COLUMN_NUMBER = exports.ATTR_CLIENT_PORT = exports.ATTR_CLIENT_ADDRESS = exports.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = undefined; + exports.NETWORK_TYPE_VALUE_IPV4 = exports.ATTR_NETWORK_TYPE = exports.NETWORK_TRANSPORT_VALUE_UNIX = exports.NETWORK_TRANSPORT_VALUE_UDP = exports.NETWORK_TRANSPORT_VALUE_TCP = exports.NETWORK_TRANSPORT_VALUE_QUIC = exports.NETWORK_TRANSPORT_VALUE_PIPE = exports.ATTR_NETWORK_TRANSPORT = exports.ATTR_NETWORK_PROTOCOL_VERSION = exports.ATTR_NETWORK_PROTOCOL_NAME = exports.ATTR_NETWORK_PEER_PORT = exports.ATTR_NETWORK_PEER_ADDRESS = exports.ATTR_NETWORK_LOCAL_PORT = exports.ATTR_NETWORK_LOCAL_ADDRESS = exports.JVM_THREAD_STATE_VALUE_WAITING = exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = exports.JVM_THREAD_STATE_VALUE_TERMINATED = exports.JVM_THREAD_STATE_VALUE_RUNNABLE = exports.JVM_THREAD_STATE_VALUE_NEW = exports.JVM_THREAD_STATE_VALUE_BLOCKED = exports.ATTR_JVM_THREAD_STATE = exports.ATTR_JVM_THREAD_DAEMON = exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = exports.JVM_MEMORY_TYPE_VALUE_HEAP = exports.ATTR_JVM_MEMORY_TYPE = exports.ATTR_JVM_MEMORY_POOL_NAME = exports.ATTR_JVM_GC_NAME = exports.ATTR_JVM_GC_ACTION = exports.ATTR_HTTP_ROUTE = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = exports.ATTR_HTTP_RESPONSE_HEADER = exports.ATTR_HTTP_REQUEST_RESEND_COUNT = exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = exports.HTTP_REQUEST_METHOD_VALUE_TRACE = exports.HTTP_REQUEST_METHOD_VALUE_PUT = exports.HTTP_REQUEST_METHOD_VALUE_POST = exports.HTTP_REQUEST_METHOD_VALUE_PATCH = exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = exports.HTTP_REQUEST_METHOD_VALUE_HEAD = exports.HTTP_REQUEST_METHOD_VALUE_GET = exports.HTTP_REQUEST_METHOD_VALUE_DELETE = exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = exports.HTTP_REQUEST_METHOD_VALUE_OTHER = exports.ATTR_HTTP_REQUEST_METHOD = exports.ATTR_HTTP_REQUEST_HEADER = exports.ATTR_EXCEPTION_TYPE = exports.ATTR_EXCEPTION_STACKTRACE = exports.ATTR_EXCEPTION_MESSAGE = exports.ATTR_EXCEPTION_ESCAPED = exports.ERROR_TYPE_VALUE_OTHER = undefined; + exports.ATTR_USER_AGENT_ORIGINAL = exports.ATTR_URL_SCHEME = exports.ATTR_URL_QUERY = exports.ATTR_URL_PATH = exports.ATTR_URL_FULL = exports.ATTR_URL_FRAGMENT = exports.ATTR_TELEMETRY_SDK_VERSION = exports.ATTR_TELEMETRY_SDK_NAME = exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports.ATTR_TELEMETRY_SDK_LANGUAGE = exports.ATTR_TELEMETRY_DISTRO_VERSION = exports.ATTR_TELEMETRY_DISTRO_NAME = exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports.ATTR_SIGNALR_TRANSPORT = exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports.ATTR_SIGNALR_CONNECTION_STATUS = exports.ATTR_SERVICE_VERSION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_NAME = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_STATUS_DESCRIPTION = exports.OTEL_STATUS_CODE_VALUE_OK = exports.OTEL_STATUS_CODE_VALUE_ERROR = exports.ATTR_OTEL_STATUS_CODE = exports.ATTR_OTEL_SCOPE_VERSION = exports.ATTR_OTEL_SCOPE_NAME = exports.ATTR_OTEL_EVENT_NAME = exports.NETWORK_TYPE_VALUE_IPV6 = undefined; + exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result"; + exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; + exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; + exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; + exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; + exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type"; + exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy"; + exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result"; + exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; + exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; + exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; + exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; + exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled"; + exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback"; + exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status"; + exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; + exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; + exports.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = "aspnetcore.user.is_authenticated"; + exports.ATTR_CLIENT_ADDRESS = "client.address"; + exports.ATTR_CLIENT_PORT = "client.port"; + exports.ATTR_CODE_COLUMN_NUMBER = "code.column.number"; + exports.ATTR_CODE_FILE_PATH = "code.file.path"; + exports.ATTR_CODE_FUNCTION_NAME = "code.function.name"; + exports.ATTR_CODE_LINE_NUMBER = "code.line.number"; + exports.ATTR_CODE_STACKTRACE = "code.stacktrace"; + exports.ATTR_DB_COLLECTION_NAME = "db.collection.name"; + exports.ATTR_DB_NAMESPACE = "db.namespace"; + exports.ATTR_DB_OPERATION_BATCH_SIZE = "db.operation.batch.size"; + exports.ATTR_DB_OPERATION_NAME = "db.operation.name"; + exports.ATTR_DB_QUERY_SUMMARY = "db.query.summary"; + exports.ATTR_DB_QUERY_TEXT = "db.query.text"; + exports.ATTR_DB_RESPONSE_STATUS_CODE = "db.response.status_code"; + exports.ATTR_DB_STORED_PROCEDURE_NAME = "db.stored_procedure.name"; + exports.ATTR_DB_SYSTEM_NAME = "db.system.name"; + exports.DB_SYSTEM_NAME_VALUE_MARIADB = "mariadb"; + exports.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = "microsoft.sql_server"; + exports.DB_SYSTEM_NAME_VALUE_MYSQL = "mysql"; + exports.DB_SYSTEM_NAME_VALUE_POSTGRESQL = "postgresql"; + exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = "deployment.environment.name"; + exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = "development"; + exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = "production"; + exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = "staging"; + exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = "test"; + exports.ATTR_DOTNET_GC_HEAP_GENERATION = "dotnet.gc.heap.generation"; + exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = "gen0"; + exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = "gen1"; + exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = "gen2"; + exports.DOTNET_GC_HEAP_GENERATION_VALUE_LOH = "loh"; + exports.DOTNET_GC_HEAP_GENERATION_VALUE_POH = "poh"; + exports.ATTR_ERROR_TYPE = "error.type"; + exports.ERROR_TYPE_VALUE_OTHER = "_OTHER"; + exports.ATTR_EXCEPTION_ESCAPED = "exception.escaped"; + exports.ATTR_EXCEPTION_MESSAGE = "exception.message"; + exports.ATTR_EXCEPTION_STACKTRACE = "exception.stacktrace"; + exports.ATTR_EXCEPTION_TYPE = "exception.type"; + var ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; + exports.ATTR_HTTP_REQUEST_HEADER = ATTR_HTTP_REQUEST_HEADER; + exports.ATTR_HTTP_REQUEST_METHOD = "http.request.method"; + exports.HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; + exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; + exports.HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; + exports.HTTP_REQUEST_METHOD_VALUE_GET = "GET"; + exports.HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; + exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; + exports.HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; + exports.HTTP_REQUEST_METHOD_VALUE_POST = "POST"; + exports.HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; + exports.HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; + exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original"; + exports.ATTR_HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count"; + var ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; + exports.ATTR_HTTP_RESPONSE_HEADER = ATTR_HTTP_RESPONSE_HEADER; + exports.ATTR_HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; + exports.ATTR_HTTP_ROUTE = "http.route"; + exports.ATTR_JVM_GC_ACTION = "jvm.gc.action"; + exports.ATTR_JVM_GC_NAME = "jvm.gc.name"; + exports.ATTR_JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name"; + exports.ATTR_JVM_MEMORY_TYPE = "jvm.memory.type"; + exports.JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; + exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; + exports.ATTR_JVM_THREAD_DAEMON = "jvm.thread.daemon"; + exports.ATTR_JVM_THREAD_STATE = "jvm.thread.state"; + exports.JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; + exports.JVM_THREAD_STATE_VALUE_NEW = "new"; + exports.JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; + exports.JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; + exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; + exports.JVM_THREAD_STATE_VALUE_WAITING = "waiting"; + exports.ATTR_NETWORK_LOCAL_ADDRESS = "network.local.address"; + exports.ATTR_NETWORK_LOCAL_PORT = "network.local.port"; + exports.ATTR_NETWORK_PEER_ADDRESS = "network.peer.address"; + exports.ATTR_NETWORK_PEER_PORT = "network.peer.port"; + exports.ATTR_NETWORK_PROTOCOL_NAME = "network.protocol.name"; + exports.ATTR_NETWORK_PROTOCOL_VERSION = "network.protocol.version"; + exports.ATTR_NETWORK_TRANSPORT = "network.transport"; + exports.NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; + exports.NETWORK_TRANSPORT_VALUE_QUIC = "quic"; + exports.NETWORK_TRANSPORT_VALUE_TCP = "tcp"; + exports.NETWORK_TRANSPORT_VALUE_UDP = "udp"; + exports.NETWORK_TRANSPORT_VALUE_UNIX = "unix"; + exports.ATTR_NETWORK_TYPE = "network.type"; + exports.NETWORK_TYPE_VALUE_IPV4 = "ipv4"; + exports.NETWORK_TYPE_VALUE_IPV6 = "ipv6"; + exports.ATTR_OTEL_EVENT_NAME = "otel.event.name"; + exports.ATTR_OTEL_SCOPE_NAME = "otel.scope.name"; + exports.ATTR_OTEL_SCOPE_VERSION = "otel.scope.version"; + exports.ATTR_OTEL_STATUS_CODE = "otel.status_code"; + exports.OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; + exports.OTEL_STATUS_CODE_VALUE_OK = "OK"; + exports.ATTR_OTEL_STATUS_DESCRIPTION = "otel.status_description"; + exports.ATTR_SERVER_ADDRESS = "server.address"; + exports.ATTR_SERVER_PORT = "server.port"; + exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + exports.ATTR_SERVICE_NAME = "service.name"; + exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; + exports.ATTR_SERVICE_VERSION = "service.version"; + exports.ATTR_SIGNALR_CONNECTION_STATUS = "signalr.connection.status"; + exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; + exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; + exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; + exports.ATTR_SIGNALR_TRANSPORT = "signalr.transport"; + exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; + exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; + exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; + exports.ATTR_TELEMETRY_DISTRO_NAME = "telemetry.distro.name"; + exports.ATTR_TELEMETRY_DISTRO_VERSION = "telemetry.distro.version"; + exports.ATTR_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; + exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; + exports.ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; + exports.ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; + exports.ATTR_URL_FRAGMENT = "url.fragment"; + exports.ATTR_URL_FULL = "url.full"; + exports.ATTR_URL_PATH = "url.path"; + exports.ATTR_URL_QUERY = "url.query"; + exports.ATTR_URL_SCHEME = "url.scheme"; + exports.ATTR_USER_AGENT_ORIGINAL = "user_agent.original"; +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js +var require_stable_metrics = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = exports.METRIC_KESTREL_REJECTED_CONNECTIONS = exports.METRIC_KESTREL_QUEUED_REQUESTS = exports.METRIC_KESTREL_QUEUED_CONNECTIONS = exports.METRIC_KESTREL_CONNECTION_DURATION = exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = exports.METRIC_JVM_THREAD_COUNT = exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = exports.METRIC_JVM_MEMORY_USED = exports.METRIC_JVM_MEMORY_LIMIT = exports.METRIC_JVM_MEMORY_COMMITTED = exports.METRIC_JVM_GC_DURATION = exports.METRIC_JVM_CPU_TIME = exports.METRIC_JVM_CPU_RECENT_UTILIZATION = exports.METRIC_JVM_CPU_COUNT = exports.METRIC_JVM_CLASS_UNLOADED = exports.METRIC_JVM_CLASS_LOADED = exports.METRIC_JVM_CLASS_COUNT = exports.METRIC_HTTP_SERVER_REQUEST_DURATION = exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = exports.METRIC_DOTNET_TIMER_COUNT = exports.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = exports.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = exports.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = exports.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = exports.METRIC_DOTNET_PROCESS_CPU_TIME = exports.METRIC_DOTNET_PROCESS_CPU_COUNT = exports.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = exports.METRIC_DOTNET_JIT_COMPILED_METHODS = exports.METRIC_DOTNET_JIT_COMPILED_IL_SIZE = exports.METRIC_DOTNET_JIT_COMPILATION_TIME = exports.METRIC_DOTNET_GC_PAUSE_TIME = exports.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = exports.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = exports.METRIC_DOTNET_GC_COLLECTIONS = exports.METRIC_DOTNET_EXCEPTIONS = exports.METRIC_DOTNET_ASSEMBLY_COUNT = exports.METRIC_DB_CLIENT_OPERATION_DURATION = exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = undefined; + exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = undefined; + exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = "aspnetcore.diagnostics.exceptions"; + exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = "aspnetcore.rate_limiting.active_request_leases"; + exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = "aspnetcore.rate_limiting.queued_requests"; + exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = "aspnetcore.rate_limiting.request.time_in_queue"; + exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = "aspnetcore.rate_limiting.request_lease.duration"; + exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = "aspnetcore.rate_limiting.requests"; + exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = "aspnetcore.routing.match_attempts"; + exports.METRIC_DB_CLIENT_OPERATION_DURATION = "db.client.operation.duration"; + exports.METRIC_DOTNET_ASSEMBLY_COUNT = "dotnet.assembly.count"; + exports.METRIC_DOTNET_EXCEPTIONS = "dotnet.exceptions"; + exports.METRIC_DOTNET_GC_COLLECTIONS = "dotnet.gc.collections"; + exports.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = "dotnet.gc.heap.total_allocated"; + exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = "dotnet.gc.last_collection.heap.fragmentation.size"; + exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = "dotnet.gc.last_collection.heap.size"; + exports.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = "dotnet.gc.last_collection.memory.committed_size"; + exports.METRIC_DOTNET_GC_PAUSE_TIME = "dotnet.gc.pause.time"; + exports.METRIC_DOTNET_JIT_COMPILATION_TIME = "dotnet.jit.compilation.time"; + exports.METRIC_DOTNET_JIT_COMPILED_IL_SIZE = "dotnet.jit.compiled_il.size"; + exports.METRIC_DOTNET_JIT_COMPILED_METHODS = "dotnet.jit.compiled_methods"; + exports.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = "dotnet.monitor.lock_contentions"; + exports.METRIC_DOTNET_PROCESS_CPU_COUNT = "dotnet.process.cpu.count"; + exports.METRIC_DOTNET_PROCESS_CPU_TIME = "dotnet.process.cpu.time"; + exports.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = "dotnet.process.memory.working_set"; + exports.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = "dotnet.thread_pool.queue.length"; + exports.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = "dotnet.thread_pool.thread.count"; + exports.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = "dotnet.thread_pool.work_item.count"; + exports.METRIC_DOTNET_TIMER_COUNT = "dotnet.timer.count"; + exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration"; + exports.METRIC_HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration"; + exports.METRIC_JVM_CLASS_COUNT = "jvm.class.count"; + exports.METRIC_JVM_CLASS_LOADED = "jvm.class.loaded"; + exports.METRIC_JVM_CLASS_UNLOADED = "jvm.class.unloaded"; + exports.METRIC_JVM_CPU_COUNT = "jvm.cpu.count"; + exports.METRIC_JVM_CPU_RECENT_UTILIZATION = "jvm.cpu.recent_utilization"; + exports.METRIC_JVM_CPU_TIME = "jvm.cpu.time"; + exports.METRIC_JVM_GC_DURATION = "jvm.gc.duration"; + exports.METRIC_JVM_MEMORY_COMMITTED = "jvm.memory.committed"; + exports.METRIC_JVM_MEMORY_LIMIT = "jvm.memory.limit"; + exports.METRIC_JVM_MEMORY_USED = "jvm.memory.used"; + exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = "jvm.memory.used_after_last_gc"; + exports.METRIC_JVM_THREAD_COUNT = "jvm.thread.count"; + exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = "kestrel.active_connections"; + exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = "kestrel.active_tls_handshakes"; + exports.METRIC_KESTREL_CONNECTION_DURATION = "kestrel.connection.duration"; + exports.METRIC_KESTREL_QUEUED_CONNECTIONS = "kestrel.queued_connections"; + exports.METRIC_KESTREL_QUEUED_REQUESTS = "kestrel.queued_requests"; + exports.METRIC_KESTREL_REJECTED_CONNECTIONS = "kestrel.rejected_connections"; + exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = "kestrel.tls_handshake.duration"; + exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = "kestrel.upgraded_connections"; + exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = "signalr.server.active_connections"; + exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = "signalr.server.connection.duration"; +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +var require_stable_events = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EVENT_EXCEPTION = undefined; + exports.EVENT_EXCEPTION = "exception"; +}); + +// node_modules/@opentelemetry/semantic-conventions/build/src/index.js +var require_src2 = __commonJS((exports) => { + var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === undefined) + k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + } : function(o, m, k, k2) { + if (k2 === undefined) + k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports && exports.__exportStar || function(m, exports2) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) + __createBinding(exports2, m, p); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar(require_trace2(), exports); + __exportStar(require_resource(), exports); + __exportStar(require_stable_attributes(), exports); + __exportStar(require_stable_metrics(), exports); + __exportStar(require_stable_events(), exports); +}); + +// node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = undefined; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +}); + +// node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = undefined; + var version_1 = require_version2(); + var semantic_conventions_1 = require_src2(); + var semconv_1 = require_semconv(); + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +}); + +// node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined; + var environment_1 = require_environment(); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return environment_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return environment_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return environment_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return environment_1.getStringListFromEnv; + } }); + var globalThis_1 = require_globalThis(); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return globalThis_1._globalThis; + } }); + var sdk_info_1 = require_sdk_info(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return sdk_info_1.SDK_INFO; + } }); + exports.otperformance = performance; +}); + +// node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined; + var node_1 = require_node(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return node_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return node_1._globalThis; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return node_1.otperformance; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return node_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return node_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return node_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return node_1.getStringListFromEnv; + } }); +}); + +// node_modules/@opentelemetry/core/build/src/common/time.js +var require_time = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = undefined; + var platform_1 = require_platform(); + var NANOSECOND_DIGITS = 9; + var NANOSECOND_DIGITS_IN_MILLIS = 6; + var MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); + var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + const seconds = Math.trunc(epochSeconds); + const nanos = Math.round(epochMillis % 1000 * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + return platform_1.otperformance.timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(platform_1.otperformance.timeOrigin); + const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); + } + exports.hrTime = hrTime; + function timeInputToHrTime(time3) { + if (isTimeInputHrTime(time3)) { + return time3; + } else if (typeof time3 === "number") { + if (time3 < platform_1.otperformance.timeOrigin) { + return hrTime(time3); + } else { + return millisToHrTime(time3); + } + } else if (time3 instanceof Date) { + return millisToHrTime(time3.getTime()); + } else { + throw TypeError("Invalid input type"); + } + } + exports.timeInputToHrTime = timeInputToHrTime; + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + function hrTimeToTimeStamp(time3) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time3[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date5 = new Date(time3[0] * 1000).toISOString(); + return date5.replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + function hrTimeToNanoseconds(time3) { + return time3[0] * SECOND_TO_NANOSECONDS + time3[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + function hrTimeToMilliseconds(time3) { + return time3[0] * 1000 + time3[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + function hrTimeToMicroseconds(time3) { + return time3[0] * 1e6 + time3[1] / 1000; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + function addHrTimes(time1, time22) { + const out = [time1[0] + time22[0], time1[1] + time22[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +}); + +// node_modules/@opentelemetry/core/build/src/common/timer-util.js +var require_timer_util = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = undefined; + function unrefTimer(timer) { + if (typeof timer !== "number") { + timer.unref(); + } + } + exports.unrefTimer = unrefTimer; +}); + +// node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = undefined; + var ExportResultCode; + (function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; + })(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +}); + +// node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = undefined; + var api_1 = require_src(); + + class CompositePropagator { + _propagators; + _fields; + constructor(config2 = {}) { + this._propagators = config2.propagators ?? []; + const fields = new Set; + for (const propagator of this._propagators) { + const propagatorFields = typeof propagator.fields === "function" ? propagator.fields() : []; + for (const field of propagatorFields) { + fields.add(field); + } + } + this._fields = Array.from(fields); + } + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + return this._fields.slice(); + } + } + exports.CompositePropagator = CompositePropagator; +}); + +// node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = undefined; + var validators_1 = require_validators(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceState { + _length; + _rawTraceState; + _internalState; + constructor(rawTraceState) { + this._rawTraceState = typeof rawTraceState === "string" ? rawTraceState : ""; + this._length = this._rawTraceState.length; + } + set(key, value) { + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { + return this; + } + const currState = this._getState(); + const currValue = currState.get(key); + let newLength = this._length; + if (typeof currValue === "string") { + newLength += value.length - currValue.length; + } else { + newLength += key.length + value.length + (currState.size > 0 ? 2 : 1); + } + if (newLength > MAX_TRACE_STATE_LEN) { + return this; + } + const newState = new Map(currState); + newState.delete(key); + newState.set(key, value); + return this._fromState(newState, newLength); + } + unset(key) { + const currState = this._getState(); + const currValue = currState.get(key); + if (typeof currValue !== "string") { + return this; + } + let newLength = this._length - (key.length + currValue.length + 1); + if (currState.size > 1) { + newLength = newLength - 1; + } + const newState = new Map(currState); + newState.delete(key); + return this._fromState(newState, newLength); + } + get(key) { + const currState = this._getState(); + return currState.get(key); + } + serialize() { + let serialized = ""; + let index = 0; + for (const entry of this._getState()) { + if (index > 0) { + serialized = LIST_MEMBERS_SEPARATOR + serialized; + } + serialized = `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; + index++; + } + return serialized; + } + _getState() { + if (this._internalState) { + return this._internalState; + } + const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR); + const vendorEntries = new Map; + let currentLength = 0; + for (const member of vendorMembers) { + const m = member.trim(); + const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (idx === -1) { + continue; + } + const key = m.slice(0, idx); + const value = m.slice(idx + 1); + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { + continue; + } + const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0); + if (futureLength > MAX_TRACE_STATE_LEN) { + continue; + } + vendorEntries.set(key, value); + currentLength = futureLength; + if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) { + break; + } + } + this._length = currentLength; + this._internalState = new Map(Array.from(vendorEntries.entries()).reverse()); + return this._internalState; + } + _fromState(state, length) { + const traceState = Object.create(TraceState.prototype); + traceState._internalState = state; + traceState._length = length; + return traceState; + } + } + exports.TraceState = TraceState; +}); + +// node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing(); + var TraceState_1 = require_TraceState(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + var VERSION = "00"; + var VERSION_PART = "(?!ff)[\\da-f]{2}"; + var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; + var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; + var FLAGS_PART = "[\\da-f]{2}"; + var TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + + class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + } + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +}); + +// node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; + var api_1 = require_src(); + var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; + (function(RPCType2) { + RPCType2["HTTP"] = "http"; + })(RPCType = exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context, meta3) { + return context.setValue(RPC_METADATA_KEY, meta3); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +}); + +// node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = undefined; + var objectTag = "[object Object]"; + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + var objectCtorString = funcToString.call(Object); + var getPrototypeOf = Object.getPrototypeOf; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeObjectToString = objectProto.toString; + function isPlainObject2(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject2; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + function objectToString(value) { + return nativeObjectToString.call(value); + } +}); + +// node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = undefined; + var lodash_merge_1 = require_lodash_merge(); + var MAX_LEVEL = 20; + function merge2(...args) { + let result = args.shift(); + const objects = new WeakMap; + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; + } + exports.merge = merge2; + function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; + } + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length;i < j; i++) { + result.push(takeValue(two[i])); + } + } else if (isObject2(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + continue; + } + result[key] = takeValue(two[key]); + } + } + } else if (isObject2(one)) { + if (isObject2(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + continue; + } + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject2(obj1) && isObject2(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; + } + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length;i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject2(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; + } +}); + +// node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = undefined; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise2, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise2, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +}); + +// node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = undefined; + function urlMatches(url2, urlToMatch) { + if (typeof urlToMatch === "string") { + return url2 === urlToMatch; + } else { + return !!url2.match(urlToMatch); + } + } + exports.urlMatches = urlMatches; + function isUrlIgnored(url2, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url2, ignoreUrl)) { + return true; + } + } + return false; + } + exports.isUrlIgnored = isUrlIgnored; +}); + +// node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = undefined; + + class Deferred { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + } + exports.Deferred = Deferred; +}); + +// node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = undefined; + var promise_1 = require_promise(); + + class BindOnceFuture { + _isCalled = false; + _deferred = new promise_1.Deferred; + _callback; + _that; + constructor(callback, that) { + this._callback = callback; + this._that = that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + } + exports.BindOnceFuture = BindOnceFuture; +}); + +// node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = undefined; + var api_1 = require_src(); + var logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + function diagLogLevelFromString(value) { + if (value == null) { + return; + } + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +}); + +// node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing(); + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, resolve); + }); + }); + } + exports._export = _export; +}); + +// node_modules/@opentelemetry/core/build/src/index.js +var require_src3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator(); + Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } }); + var anchored_clock_1 = require_anchored_clock(); + Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { + return anchored_clock_1.AnchoredClock; + } }); + var attributes_1 = require_attributes(); + Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { + return attributes_1.isAttributeValue; + } }); + Object.defineProperty(exports, "sanitizeAttributes", { enumerable: true, get: function() { + return attributes_1.sanitizeAttributes; + } }); + var global_error_handler_1 = require_global_error_handler(); + Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.globalErrorHandler; + } }); + Object.defineProperty(exports, "setGlobalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } }); + var logging_error_handler_1 = require_logging_error_handler(); + Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { + return logging_error_handler_1.loggingErrorHandler; + } }); + var time_1 = require_time(); + Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { + return time_1.addHrTimes; + } }); + Object.defineProperty(exports, "getTimeOrigin", { enumerable: true, get: function() { + return time_1.getTimeOrigin; + } }); + Object.defineProperty(exports, "hrTime", { enumerable: true, get: function() { + return time_1.hrTime; + } }); + Object.defineProperty(exports, "hrTimeDuration", { enumerable: true, get: function() { + return time_1.hrTimeDuration; + } }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMicroseconds; + } }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMilliseconds; + } }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { enumerable: true, get: function() { + return time_1.hrTimeToNanoseconds; + } }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { + return time_1.hrTimeToTimeStamp; + } }); + Object.defineProperty(exports, "isTimeInput", { enumerable: true, get: function() { + return time_1.isTimeInput; + } }); + Object.defineProperty(exports, "isTimeInputHrTime", { enumerable: true, get: function() { + return time_1.isTimeInputHrTime; + } }); + Object.defineProperty(exports, "millisToHrTime", { enumerable: true, get: function() { + return time_1.millisToHrTime; + } }); + Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() { + return time_1.timeInputToHrTime; + } }); + var timer_util_1 = require_timer_util(); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return timer_util_1.unrefTimer; + } }); + var ExportResult_1 = require_ExportResult(); + Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { + return ExportResult_1.ExportResultCode; + } }); + var utils_1 = require_utils3(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { + return utils_1.parseKeyPairsIntoRecord; + } }); + var platform_1 = require_platform(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return platform_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return platform_1._globalThis; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return platform_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return platform_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return platform_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return platform_1.getStringListFromEnv; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return platform_1.otperformance; + } }); + var composite_1 = require_composite(); + Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { + return composite_1.CompositePropagator; + } }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } }); + Object.defineProperty(exports, "parseTraceParent", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } }); + var rpc_metadata_1 = require_rpc_metadata(); + Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { + return rpc_metadata_1.RPCType; + } }); + Object.defineProperty(exports, "deleteRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } }); + Object.defineProperty(exports, "getRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.getRPCMetadata; + } }); + Object.defineProperty(exports, "setRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.setRPCMetadata; + } }); + var suppress_tracing_1 = require_suppress_tracing(); + Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { + return suppress_tracing_1.isTracingSuppressed; + } }); + Object.defineProperty(exports, "suppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.suppressTracing; + } }); + Object.defineProperty(exports, "unsuppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.unsuppressTracing; + } }); + var TraceState_1 = require_TraceState(); + Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { + return TraceState_1.TraceState; + } }); + var merge_1 = require_merge(); + Object.defineProperty(exports, "merge", { enumerable: true, get: function() { + return merge_1.merge; + } }); + var timeout_1 = require_timeout(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return timeout_1.TimeoutError; + } }); + Object.defineProperty(exports, "callWithTimeout", { enumerable: true, get: function() { + return timeout_1.callWithTimeout; + } }); + var url_1 = require_url(); + Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { + return url_1.isUrlIgnored; + } }); + Object.defineProperty(exports, "urlMatches", { enumerable: true, get: function() { + return url_1.urlMatches; + } }); + var callback_1 = require_callback(); + Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { + return callback_1.BindOnceFuture; + } }); + var configuration_1 = require_configuration(); + Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { + return configuration_1.diagLogLevelFromString; + } }); + var exporter_1 = require_exporter(); + exports.internal = { + _export: exporter_1._export + }; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/OTLPExporterBase.js +var require_OTLPExporterBase = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPExporterBase = undefined; + + class OTLPExporterBase { + _delegate; + constructor(_delegate) { + this._delegate = _delegate; + } + export(items, resultCallback) { + this._delegate.export(items, resultCallback); + } + forceFlush() { + return this._delegate.forceFlush(); + } + shutdown() { + return this._delegate.shutdown(); + } + } + exports.OTLPExporterBase = OTLPExporterBase; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/types.js +var require_types2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPExporterError = undefined; + + class OTLPExporterError extends Error { + code; + name = "OTLPExporterError"; + data; + constructor(message, code, data) { + super(message); + this.data = data; + this.code = code; + } + } + exports.OTLPExporterError = OTLPExporterError; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/shared-configuration.js +var require_shared_configuration = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSharedConfigurationDefaults = exports.mergeOtlpSharedConfigurationWithDefaults = exports.wrapStaticHeadersInFunction = exports.validateTimeoutMillis = undefined; + function validateTimeoutMillis(timeoutMillis) { + if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) { + return timeoutMillis; + } + throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`); + } + exports.validateTimeoutMillis = validateTimeoutMillis; + function wrapStaticHeadersInFunction(headers) { + if (headers == null) { + return; + } + return () => headers; + } + exports.wrapStaticHeadersInFunction = wrapStaticHeadersInFunction; + function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ?? fallbackConfiguration.timeoutMillis ?? defaultConfiguration.timeoutMillis), + concurrencyLimit: userProvidedConfiguration.concurrencyLimit ?? fallbackConfiguration.concurrencyLimit ?? defaultConfiguration.concurrencyLimit, + compression: userProvidedConfiguration.compression ?? fallbackConfiguration.compression ?? defaultConfiguration.compression + }; + } + exports.mergeOtlpSharedConfigurationWithDefaults = mergeOtlpSharedConfigurationWithDefaults; + function getSharedConfigurationDefaults() { + return { + timeoutMillis: 1e4, + concurrencyLimit: 30, + compression: "none" + }; + } + exports.getSharedConfigurationDefaults = getSharedConfigurationDefaults; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/legacy-node-configuration.js +var require_legacy_node_configuration = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompressionAlgorithm = undefined; + var CompressionAlgorithm; + (function(CompressionAlgorithm2) { + CompressionAlgorithm2["NONE"] = "none"; + CompressionAlgorithm2["GZIP"] = "gzip"; + })(CompressionAlgorithm = exports.CompressionAlgorithm || (exports.CompressionAlgorithm = {})); +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/bounded-queue-export-promise-handler.js +var require_bounded_queue_export_promise_handler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createBoundedQueueExportPromiseHandler = undefined; + + class BoundedQueueExportPromiseHandler { + _concurrencyLimit; + _sendingPromises = []; + constructor(concurrencyLimit) { + this._concurrencyLimit = concurrencyLimit; + } + pushPromise(promise2) { + if (this.hasReachedLimit()) { + throw new Error("Concurrency Limit reached"); + } + this._sendingPromises.push(promise2); + const popPromise = () => { + const index = this._sendingPromises.indexOf(promise2); + this._sendingPromises.splice(index, 1); + }; + promise2.then(popPromise, popPromise); + } + hasReachedLimit() { + return this._sendingPromises.length >= this._concurrencyLimit; + } + async awaitAll() { + await Promise.all(this._sendingPromises); + } + } + function createBoundedQueueExportPromiseHandler(options) { + return new BoundedQueueExportPromiseHandler(options.concurrencyLimit); + } + exports.createBoundedQueueExportPromiseHandler = createBoundedQueueExportPromiseHandler; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; + var api_1 = require_src(); + var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; + var api_1 = require_src(); + var constants_1 = require_constants2(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; + } + exports.parsePairKeyValue = parsePairKeyValue; + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); + } + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + var constants_1 = require_constants2(); + var utils_1 = require_utils5(); + + class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach((entry) => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + } + exports.W3CBaggagePropagator = W3CBaggagePropagator; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = undefined; + + class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + } + exports.AnchoredClock = AnchoredClock; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; + var api_1 = require_src(); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key.length > 0; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case "number": + case "boolean": + case "string": + return true; + } + return false; + } +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = undefined; + var api_1 = require_src(); + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); + } + } + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; + } +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; + var logging_error_handler_1 = require_logging_error_handler2(); + var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = undefined; + var api_1 = require_src(); + var util_1 = __require("util"); + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") { + return false; + } + if (raw === "true") { + return true; + } else if (raw === "false") { + return false; + } else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js +var require_globalThis2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = undefined; + exports._globalThis = typeof globalThis === "object" ? globalThis : global; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/platform/node/performance.js +var require_performance = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = undefined; + var perf_hooks_1 = __require("perf_hooks"); + exports.otperformance = perf_hooks_1.performance; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/version.js +var require_version3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.1.0"; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = undefined; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = undefined; + var version_1 = require_version3(); + var semantic_conventions_1 = require_src2(); + var semconv_1 = require_semconv2(); + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js +var require_timer_util2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = undefined; + function unrefTimer(timer) { + timer.unref(); + } + exports.unrefTimer = unrefTimer; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined; + var environment_1 = require_environment2(); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return environment_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return environment_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return environment_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return environment_1.getStringListFromEnv; + } }); + var globalThis_1 = require_globalThis2(); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return globalThis_1._globalThis; + } }); + var performance_1 = require_performance(); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return performance_1.otperformance; + } }); + var sdk_info_1 = require_sdk_info2(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return sdk_info_1.SDK_INFO; + } }); + var timer_util_1 = require_timer_util2(); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return timer_util_1.unrefTimer; + } }); +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined; + var node_1 = require_node2(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return node_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return node_1._globalThis; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return node_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return node_1.unrefTimer; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return node_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return node_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return node_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return node_1.getStringListFromEnv; + } }); +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = undefined; + var platform_1 = require_platform2(); + var NANOSECOND_DIGITS = 9; + var NANOSECOND_DIGITS_IN_MILLIS = 6; + var MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); + var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + const seconds = Math.trunc(epochSeconds); + const nanos = Math.round(epochMillis % 1000 * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== "number") { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); + } + exports.hrTime = hrTime; + function timeInputToHrTime(time3) { + if (isTimeInputHrTime(time3)) { + return time3; + } else if (typeof time3 === "number") { + if (time3 < getTimeOrigin()) { + return hrTime(time3); + } else { + return millisToHrTime(time3); + } + } else if (time3 instanceof Date) { + return millisToHrTime(time3.getTime()); + } else { + throw TypeError("Invalid input type"); + } + } + exports.timeInputToHrTime = timeInputToHrTime; + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + function hrTimeToTimeStamp(time3) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time3[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date5 = new Date(time3[0] * 1000).toISOString(); + return date5.replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + function hrTimeToNanoseconds(time3) { + return time3[0] * SECOND_TO_NANOSECONDS + time3[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + function hrTimeToMilliseconds(time3) { + return time3[0] * 1000 + time3[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + function hrTimeToMicroseconds(time3) { + return time3[0] * 1e6 + time3[1] / 1000; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + function addHrTimes(time1, time22) { + const out = [time1[0] + time22[0], time1[1] + time22[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = undefined; + var ExportResultCode; + (function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; + })(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = undefined; + var api_1 = require_src(); + + class CompositePropagator { + _propagators; + _fields; + constructor(config2 = {}) { + this._propagators = config2.propagators ?? []; + this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); + } + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + return this._fields.slice(); + } + } + exports.CompositePropagator = CompositePropagator; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = undefined; + var validators_1 = require_validators2(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceState { + _internalState = new Map; + constructor(rawTraceState) { + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys().reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => { + const listMember = part.trim(); + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } else {} + } + return agg; + }, new Map); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState; + traceState._internalState = new Map(this._internalState); + return traceState; + } + } + exports.TraceState = TraceState; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + var TraceState_1 = require_TraceState2(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + var VERSION = "00"; + var VERSION_PART = "(?!ff)[\\da-f]{2}"; + var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; + var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; + var FLAGS_PART = "[\\da-f]{2}"; + var TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + + class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + } + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; + var api_1 = require_src(); + var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; + (function(RPCType2) { + RPCType2["HTTP"] = "http"; + })(RPCType = exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context, meta3) { + return context.setValue(RPC_METADATA_KEY, meta3); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = undefined; + var objectTag = "[object Object]"; + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + var objectCtorString = funcToString.call(Object); + var getPrototypeOf = Object.getPrototypeOf; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeObjectToString = objectProto.toString; + function isPlainObject2(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject2; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + function objectToString(value) { + return nativeObjectToString.call(value); + } +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = undefined; + var lodash_merge_1 = require_lodash_merge2(); + var MAX_LEVEL = 20; + function merge2(...args) { + let result = args.shift(); + const objects = new WeakMap; + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; + } + exports.merge = merge2; + function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; + } + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length;i < j; i++) { + result.push(takeValue(two[i])); + } + } else if (isObject2(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } else if (isObject2(one)) { + if (isObject2(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject2(obj1) && isObject2(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; + } + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length;i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject2(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; + } +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = undefined; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise2, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise2, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = undefined; + function urlMatches(url2, urlToMatch) { + if (typeof urlToMatch === "string") { + return url2 === urlToMatch; + } else { + return !!url2.match(urlToMatch); + } + } + exports.urlMatches = urlMatches; + function isUrlIgnored(url2, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url2, ignoreUrl)) { + return true; + } + } + return false; + } + exports.isUrlIgnored = isUrlIgnored; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = undefined; + + class Deferred { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + } + exports.Deferred = Deferred; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = undefined; + var promise_1 = require_promise2(); + + class BindOnceFuture { + _callback; + _that; + _isCalled = false; + _deferred = new promise_1.Deferred; + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + } + exports.BindOnceFuture = BindOnceFuture; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = undefined; + var api_1 = require_src(); + var logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + function diagLogLevelFromString(value) { + if (value == null) { + return; + } + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing2(); + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); + } + exports._export = _export; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core/build/src/index.js +var require_src4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator2(); + Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } }); + var anchored_clock_1 = require_anchored_clock2(); + Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { + return anchored_clock_1.AnchoredClock; + } }); + var attributes_1 = require_attributes2(); + Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { + return attributes_1.isAttributeValue; + } }); + Object.defineProperty(exports, "sanitizeAttributes", { enumerable: true, get: function() { + return attributes_1.sanitizeAttributes; + } }); + var global_error_handler_1 = require_global_error_handler2(); + Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.globalErrorHandler; + } }); + Object.defineProperty(exports, "setGlobalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } }); + var logging_error_handler_1 = require_logging_error_handler2(); + Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { + return logging_error_handler_1.loggingErrorHandler; + } }); + var time_1 = require_time2(); + Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { + return time_1.addHrTimes; + } }); + Object.defineProperty(exports, "getTimeOrigin", { enumerable: true, get: function() { + return time_1.getTimeOrigin; + } }); + Object.defineProperty(exports, "hrTime", { enumerable: true, get: function() { + return time_1.hrTime; + } }); + Object.defineProperty(exports, "hrTimeDuration", { enumerable: true, get: function() { + return time_1.hrTimeDuration; + } }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMicroseconds; + } }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMilliseconds; + } }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { enumerable: true, get: function() { + return time_1.hrTimeToNanoseconds; + } }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { + return time_1.hrTimeToTimeStamp; + } }); + Object.defineProperty(exports, "isTimeInput", { enumerable: true, get: function() { + return time_1.isTimeInput; + } }); + Object.defineProperty(exports, "isTimeInputHrTime", { enumerable: true, get: function() { + return time_1.isTimeInputHrTime; + } }); + Object.defineProperty(exports, "millisToHrTime", { enumerable: true, get: function() { + return time_1.millisToHrTime; + } }); + Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() { + return time_1.timeInputToHrTime; + } }); + var ExportResult_1 = require_ExportResult2(); + Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { + return ExportResult_1.ExportResultCode; + } }); + var utils_1 = require_utils5(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { + return utils_1.parseKeyPairsIntoRecord; + } }); + var platform_1 = require_platform2(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return platform_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return platform_1._globalThis; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return platform_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return platform_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return platform_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return platform_1.getStringListFromEnv; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return platform_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return platform_1.unrefTimer; + } }); + var composite_1 = require_composite2(); + Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { + return composite_1.CompositePropagator; + } }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator2(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } }); + Object.defineProperty(exports, "parseTraceParent", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } }); + var rpc_metadata_1 = require_rpc_metadata2(); + Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { + return rpc_metadata_1.RPCType; + } }); + Object.defineProperty(exports, "deleteRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } }); + Object.defineProperty(exports, "getRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.getRPCMetadata; + } }); + Object.defineProperty(exports, "setRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.setRPCMetadata; + } }); + var suppress_tracing_1 = require_suppress_tracing2(); + Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { + return suppress_tracing_1.isTracingSuppressed; + } }); + Object.defineProperty(exports, "suppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.suppressTracing; + } }); + Object.defineProperty(exports, "unsuppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.unsuppressTracing; + } }); + var TraceState_1 = require_TraceState2(); + Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { + return TraceState_1.TraceState; + } }); + var merge_1 = require_merge2(); + Object.defineProperty(exports, "merge", { enumerable: true, get: function() { + return merge_1.merge; + } }); + var timeout_1 = require_timeout2(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return timeout_1.TimeoutError; + } }); + Object.defineProperty(exports, "callWithTimeout", { enumerable: true, get: function() { + return timeout_1.callWithTimeout; + } }); + var url_1 = require_url2(); + Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { + return url_1.isUrlIgnored; + } }); + Object.defineProperty(exports, "urlMatches", { enumerable: true, get: function() { + return url_1.urlMatches; + } }); + var callback_1 = require_callback2(); + Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { + return callback_1.BindOnceFuture; + } }); + var configuration_1 = require_configuration2(); + Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { + return configuration_1.diagLogLevelFromString; + } }); + var exporter_1 = require_exporter2(); + exports.internal = { + _export: exporter_1._export + }; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/logging-response-handler.js +var require_logging_response_handler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createLoggingPartialSuccessResponseHandler = undefined; + var api_1 = require_src(); + function isPartialSuccessResponse(response) { + return Object.prototype.hasOwnProperty.call(response, "partialSuccess"); + } + function createLoggingPartialSuccessResponseHandler() { + return { + handleResponse(response) { + if (response == null || !isPartialSuccessResponse(response) || response.partialSuccess == null || Object.keys(response.partialSuccess).length === 0) { + return; + } + api_1.diag.warn("Received Partial Success response:", JSON.stringify(response.partialSuccess)); + } + }; + } + exports.createLoggingPartialSuccessResponseHandler = createLoggingPartialSuccessResponseHandler; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-export-delegate.js +var require_otlp_export_delegate = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createOtlpExportDelegate = undefined; + var core_1 = require_src4(); + var types_1 = require_types2(); + var logging_response_handler_1 = require_logging_response_handler(); + var api_1 = require_src(); + + class OTLPExportDelegate { + _transport; + _serializer; + _responseHandler; + _promiseQueue; + _timeout; + _diagLogger; + constructor(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) { + this._transport = _transport; + this._serializer = _serializer; + this._responseHandler = _responseHandler; + this._promiseQueue = _promiseQueue; + this._timeout = _timeout; + this._diagLogger = api_1.diag.createComponentLogger({ + namespace: "OTLPExportDelegate" + }); + } + export(internalRepresentation, resultCallback) { + this._diagLogger.debug("items to be sent", internalRepresentation); + if (this._promiseQueue.hasReachedLimit()) { + resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error("Concurrent export limit reached") + }); + return; + } + const serializedRequest = this._serializer.serializeRequest(internalRepresentation); + if (serializedRequest == null) { + resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error("Nothing to send") + }); + return; + } + this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => { + if (response.status === "success") { + if (response.data != null) { + try { + this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data)); + } catch (e) { + this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e, response.data); + } + } + resultCallback({ + code: core_1.ExportResultCode.SUCCESS + }); + return; + } else if (response.status === "failure" && response.error) { + resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: response.error + }); + return; + } else if (response.status === "retryable") { + resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new types_1.OTLPExporterError("Export failed with retryable status") + }); + } else { + resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new types_1.OTLPExporterError("Export failed with unknown error") + }); + } + }, (reason) => resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: reason + }))); + } + forceFlush() { + return this._promiseQueue.awaitAll(); + } + async shutdown() { + this._diagLogger.debug("shutdown started"); + await this.forceFlush(); + this._transport.shutdown(); + } + } + function createOtlpExportDelegate(components, settings) { + return new OTLPExportDelegate(components.transport, components.serializer, (0, logging_response_handler_1.createLoggingPartialSuccessResponseHandler)(), components.promiseHandler, settings.timeout); + } + exports.createOtlpExportDelegate = createOtlpExportDelegate; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-network-export-delegate.js +var require_otlp_network_export_delegate = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createOtlpNetworkExportDelegate = undefined; + var bounded_queue_export_promise_handler_1 = require_bounded_queue_export_promise_handler(); + var otlp_export_delegate_1 = require_otlp_export_delegate(); + function createOtlpNetworkExportDelegate(options, serializer, transport) { + return (0, otlp_export_delegate_1.createOtlpExportDelegate)({ + transport, + serializer, + promiseHandler: (0, bounded_queue_export_promise_handler_1.createBoundedQueueExportPromiseHandler)(options) + }, { timeout: options.timeoutMillis }); + } + exports.createOtlpNetworkExportDelegate = createOtlpNetworkExportDelegate; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/index.js +var require_src5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createOtlpNetworkExportDelegate = exports.CompressionAlgorithm = exports.getSharedConfigurationDefaults = exports.mergeOtlpSharedConfigurationWithDefaults = exports.OTLPExporterError = exports.OTLPExporterBase = undefined; + var OTLPExporterBase_1 = require_OTLPExporterBase(); + Object.defineProperty(exports, "OTLPExporterBase", { enumerable: true, get: function() { + return OTLPExporterBase_1.OTLPExporterBase; + } }); + var types_1 = require_types2(); + Object.defineProperty(exports, "OTLPExporterError", { enumerable: true, get: function() { + return types_1.OTLPExporterError; + } }); + var shared_configuration_1 = require_shared_configuration(); + Object.defineProperty(exports, "mergeOtlpSharedConfigurationWithDefaults", { enumerable: true, get: function() { + return shared_configuration_1.mergeOtlpSharedConfigurationWithDefaults; + } }); + Object.defineProperty(exports, "getSharedConfigurationDefaults", { enumerable: true, get: function() { + return shared_configuration_1.getSharedConfigurationDefaults; + } }); + var legacy_node_configuration_1 = require_legacy_node_configuration(); + Object.defineProperty(exports, "CompressionAlgorithm", { enumerable: true, get: function() { + return legacy_node_configuration_1.CompressionAlgorithm; + } }); + var otlp_network_export_delegate_1 = require_otlp_network_export_delegate(); + Object.defineProperty(exports, "createOtlpNetworkExportDelegate", { enumerable: true, get: function() { + return otlp_network_export_delegate_1.createOtlpNetworkExportDelegate; + } }); +}); + +// node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/version.js +var require_version4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "0.205.0"; +}); + +// node_modules/@protobufjs/aspromise/index.js +var require_aspromise = __commonJS((exports, module) => { + module.exports = asPromise; + function asPromise(fn, ctx) { + var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; + while (index < arguments.length) + params[offset++] = arguments[index++]; + return new Promise(function executor(resolve, reject) { + params[offset] = function callback(err) { + if (pending) { + pending = false; + if (err) + reject(err); + else { + var params2 = new Array(arguments.length - 1), offset2 = 0; + while (offset2 < params2.length) + params2[offset2++] = arguments[offset2]; + resolve.apply(null, params2); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject(err); + } + } + }); + } +}); + +// node_modules/@protobufjs/base64/index.js +var require_base64 = __commonJS((exports) => { + var base643 = exports; + base643.length = function length(string4) { + var p = string4.length; + if (!p) + return 0; + var n = 0; + while (--p % 4 > 1 && string4.charAt(p) === "=") + ++n; + return Math.ceil(string4.length * 3) / 4 - n; + }; + var b64 = new Array(64); + var s64 = new Array(123); + for (i = 0;i < 64; ) + s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; + var i; + base643.encode = function encode3(buffer, start, end) { + var parts = null, chunk = []; + var i2 = 0, j = 0, t; + while (start < end) { + var b = buffer[start++]; + switch (j) { + case 0: + chunk[i2++] = b64[b >> 2]; + t = (b & 3) << 4; + j = 1; + break; + case 1: + chunk[i2++] = b64[t | b >> 4]; + t = (b & 15) << 2; + j = 2; + break; + case 2: + chunk[i2++] = b64[t | b >> 6]; + chunk[i2++] = b64[b & 63]; + j = 0; + break; + } + if (i2 > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); + i2 = 0; + } + } + if (j) { + chunk[i2++] = b64[t]; + chunk[i2++] = 61; + if (j === 1) + chunk[i2++] = 61; + } + if (parts) { + if (i2) + parts.push(String.fromCharCode.apply(String, chunk.slice(0, i2))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk.slice(0, i2)); + }; + var invalidEncoding = "invalid encoding"; + base643.decode = function decode3(string4, buffer, offset) { + var start = offset; + var j = 0, t; + for (var i2 = 0;i2 < string4.length; ) { + var c = string4.charCodeAt(i2++); + if (c === 61 && j > 1) + break; + if ((c = s64[c]) === undefined) + throw Error(invalidEncoding); + switch (j) { + case 0: + t = c; + j = 1; + break; + case 1: + buffer[offset++] = t << 2 | (c & 48) >> 4; + t = c; + j = 2; + break; + case 2: + buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; + t = c; + j = 3; + break; + case 3: + buffer[offset++] = (t & 3) << 6 | c; + j = 0; + break; + } + } + if (j === 1) + throw Error(invalidEncoding); + return offset - start; + }; + base643.test = function test(string4) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string4); + }; +}); + +// node_modules/@protobufjs/eventemitter/index.js +var require_eventemitter = __commonJS((exports, module) => { + module.exports = EventEmitter; + function EventEmitter() { + this._listeners = Object.create(null); + } + EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn, + ctx: ctx || this + }); + return this; + }; + EventEmitter.prototype.off = function off(evt, fn) { + if (evt === undefined) + this._listeners = Object.create(null); + else { + if (fn === undefined) + this._listeners[evt] = []; + else { + var listeners = this._listeners[evt]; + if (!listeners) + return this; + for (var i = 0;i < listeners.length; ) + if (listeners[i].fn === fn) + listeners.splice(i, 1); + else + ++i; + } + } + return this; + }; + EventEmitter.prototype.emit = function emit(evt) { + var listeners = this._listeners[evt]; + if (listeners) { + var args = [], i = 1; + for (;i < arguments.length; ) + args.push(arguments[i++]); + for (i = 0;i < listeners.length; ) + listeners[i].fn.apply(listeners[i++].ctx, args); + } + return this; + }; +}); + +// node_modules/@protobufjs/float/index.js +var require_float = __commonJS((exports, module) => { + module.exports = factory(factory); + function factory(exports2) { + if (typeof Float32Array !== "undefined") + (function() { + var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128; + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + exports2.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; + exports2.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + exports2.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; + exports2.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; + })(); + else + (function() { + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 340282346638528860000000000000000000000) + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 0.000000000000000000000000000000000000011754943508222875) + writeUint((sign << 31 | Math.round(val / 0.000000000000000000000000000000000000000000001401298464324817)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + exports2.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports2.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + function readFloat_ieee754(readUint, buf, pos) { + var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; + return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 0.000000000000000000000000000000000000000000001401298464324817 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + exports2.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports2.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + })(); + if (typeof Float64Array !== "undefined") + (function() { + var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128; + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + exports2.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; + exports2.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + exports2.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; + exports2.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; + })(); + else + (function() { + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) { + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014) { + mantissa = val / 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005; + writeUint(mantissa >>> 0, buf, pos + off0); + writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); + } else { + var exponent = Math.floor(Math.log(val) / Math.LN2); + if (exponent === 1024) + exponent = 1023; + mantissa = val * Math.pow(2, -exponent); + writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); + writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + exports2.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports2.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); + function readDouble_ieee754(readUint, off0, off1, buf, pos) { + var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); + var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + exports2.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports2.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + })(); + return exports2; + } + function writeUintLE(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + function writeUintBE(val, buf, pos) { + buf[pos] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; + } + function readUintLE(buf, pos) { + return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; + } + function readUintBE(buf, pos) { + return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; + } +}); + +// node_modules/@protobufjs/inquire/index.js +var require_inquire = __commonJS((exports, module) => { + module.exports = inquire; + function inquire(moduleName) { + try { + if (false) {} + var mod = __require(moduleName); + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + return null; + } catch (err) { + return null; + } + } +}); + +// node_modules/@protobufjs/utf8/index.js +var require_utf8 = __commonJS((exports) => { + var utf8 = exports; + var replacementChar = "�"; + utf8.length = function utf8_length(string4) { + var len = 0, c = 0; + for (var i = 0;i < string4.length; ++i) { + c = string4.charCodeAt(i); + if (c < 128) + len += 1; + else if (c < 2048) + len += 2; + else if ((c & 64512) === 55296 && (string4.charCodeAt(i + 1) & 64512) === 56320) { + ++i; + len += 4; + } else + len += 3; + } + return len; + }; + utf8.read = function utf8_read(buffer, start, end) { + if (end - start < 1) { + return ""; + } + var str = ""; + for (var i = start;i < end; ) { + var t = buffer[i++]; + if (t <= 127) { + str += String.fromCharCode(t); + } else if (t >= 192 && t < 224) { + var c2 = (t & 31) << 6 | buffer[i++] & 63; + str += c2 >= 128 ? String.fromCharCode(c2) : replacementChar; + } else if (t >= 224 && t < 240) { + var c3 = (t & 15) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; + str += c3 >= 2048 ? String.fromCharCode(c3) : replacementChar; + } else if (t >= 240) { + var t2 = (t & 7) << 18 | (buffer[i++] & 63) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; + if (t2 < 65536 || t2 > 1114111) + str += replacementChar; + else { + t2 -= 65536; + str += String.fromCharCode(55296 + (t2 >> 10)); + str += String.fromCharCode(56320 + (t2 & 1023)); + } + } + } + return str; + }; + utf8.write = function utf8_write(string4, buffer, offset) { + var start = offset, c1, c2; + for (var i = 0;i < string4.length; ++i) { + c1 = string4.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 64512) === 55296 && ((c2 = string4.charCodeAt(i + 1)) & 64512) === 56320) { + c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return offset - start; + }; +}); + +// node_modules/@protobufjs/pool/index.js +var require_pool = __commonJS((exports, module) => { + module.exports = pool; + function pool(alloc, slice, size) { + var SIZE = size || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = SIZE; + return function pool_alloc(size2) { + if (size2 < 1 || size2 > MAX) + return alloc(size2); + if (offset + size2 > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + var buf = slice.call(slab, offset, offset += size2); + if (offset & 7) + offset = (offset | 7) + 1; + return buf; + }; + } +}); + +// node_modules/protobufjs/src/util/longbits.js +var require_longbits = __commonJS((exports, module) => { + module.exports = LongBits; + var util = require_minimal(); + function LongBits(lo, hi) { + this.lo = lo >>> 0; + this.hi = hi >>> 0; + } + var zero = LongBits.zero = new LongBits(0, 0); + zero.toNumber = function() { + return 0; + }; + zero.zzEncode = zero.zzDecode = function() { + return this; + }; + zero.length = function() { + return 1; + }; + var zeroHash = LongBits.zeroHash = "\x00\x00\x00\x00\x00\x00\x00\x00"; + LongBits.fromNumber = function fromNumber(value) { + if (value === 0) + return zero; + var sign = value < 0; + if (sign) + value = -value; + var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); + }; + LongBits.from = function from(value) { + if (typeof value === "number") + return LongBits.fromNumber(value); + if (util.isString(value)) { + if (util.Long) + value = util.Long.fromString(value); + else + return LongBits.fromNumber(parseInt(value, 10)); + } + return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; + }; + LongBits.prototype.toNumber = function toNumber(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; + }; + LongBits.prototype.toLong = function toLong(unsigned) { + return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) }; + }; + var charCodeAt = String.prototype.charCodeAt; + LongBits.fromHash = function fromHash(hash2) { + if (hash2 === zeroHash) + return zero; + return new LongBits((charCodeAt.call(hash2, 0) | charCodeAt.call(hash2, 1) << 8 | charCodeAt.call(hash2, 2) << 16 | charCodeAt.call(hash2, 3) << 24) >>> 0, (charCodeAt.call(hash2, 4) | charCodeAt.call(hash2, 5) << 8 | charCodeAt.call(hash2, 6) << 16 | charCodeAt.call(hash2, 7) << 24) >>> 0); + }; + LongBits.prototype.toHash = function toHash() { + return String.fromCharCode(this.lo & 255, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, this.hi & 255, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24); + }; + LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = (this.lo << 1 ^ mask) >>> 0; + return this; + }; + LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = (this.hi >>> 1 ^ mask) >>> 0; + return this; + }; + LongBits.prototype.length = function length() { + var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; + return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; + }; +}); + +// node_modules/long/umd/index.js +var require_umd = __commonJS((exports, module) => { + (function(global2, factory) { + function preferDefault(exports2) { + return exports2.default || exports2; + } + if (typeof define === "function" && define.amd) { + define([], function() { + var exports2 = {}; + factory(exports2); + return preferDefault(exports2); + }); + } else if (typeof exports === "object") { + factory(exports); + if (typeof module === "object") + module.exports = preferDefault(exports); + } else { + (function() { + var exports2 = {}; + factory(exports2); + global2.Long = preferDefault(exports2); + })(); + } + })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : exports, function(_exports) { + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.default = undefined; + var wasm = null; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ + 0, + 97, + 115, + 109, + 1, + 0, + 0, + 0, + 1, + 13, + 2, + 96, + 0, + 1, + 127, + 96, + 4, + 127, + 127, + 127, + 127, + 1, + 127, + 3, + 7, + 6, + 0, + 1, + 1, + 1, + 1, + 1, + 6, + 6, + 1, + 127, + 1, + 65, + 0, + 11, + 7, + 50, + 6, + 3, + 109, + 117, + 108, + 0, + 1, + 5, + 100, + 105, + 118, + 95, + 115, + 0, + 2, + 5, + 100, + 105, + 118, + 95, + 117, + 0, + 3, + 5, + 114, + 101, + 109, + 95, + 115, + 0, + 4, + 5, + 114, + 101, + 109, + 95, + 117, + 0, + 5, + 8, + 103, + 101, + 116, + 95, + 104, + 105, + 103, + 104, + 0, + 0, + 10, + 191, + 1, + 6, + 4, + 0, + 35, + 0, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 126, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 127, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 128, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 129, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11, + 36, + 1, + 1, + 126, + 32, + 0, + 173, + 32, + 1, + 173, + 66, + 32, + 134, + 132, + 32, + 2, + 173, + 32, + 3, + 173, + 66, + 32, + 134, + 132, + 130, + 34, + 4, + 66, + 32, + 135, + 167, + 36, + 0, + 32, + 4, + 167, + 11 + ])), {}).exports; + } catch {} + function Long(low, high, unsigned) { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Long.prototype.__isLong__; + Object.defineProperty(Long.prototype, "__isLong__", { + value: true + }); + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + function ctz32(value) { + var c = Math.clz32(value & -value); + return value ? 31 - c : c; + } + Long.isLong = isLong; + var INT_CACHE = {}; + var UINT_CACHE = {}; + function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if (cache = 0 <= value && value < 256) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if (cache = -128 <= value && value < 128) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + } + Long.fromInt = fromInt; + function fromNumber(value, unsigned) { + if (isNaN(value)) + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } + if (value < 0) + return fromNumber(-value, unsigned).neg(); + return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); + } + Long.fromNumber = fromNumber; + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + Long.fromBits = fromBits; + var pow_dbl = Math.pow; + function fromString(str, unsigned, radix) { + if (str.length === 0) + throw Error("empty string"); + if (typeof unsigned === "number") { + radix = unsigned; + unsigned = false; + } else { + unsigned = !!unsigned; + } + if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") + return unsigned ? UZERO : ZERO; + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError("radix"); + var p; + if ((p = str.indexOf("-")) > 0) + throw Error("interior hyphen"); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + var radixToPower = fromNumber(pow_dbl(radix, 8)); + var result = ZERO; + for (var i = 0;i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + Long.fromString = fromString; + function fromValue(val, unsigned) { + if (typeof val === "number") + return fromNumber(val, unsigned); + if (typeof val === "string") + return fromString(val, unsigned); + return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); + } + Long.fromValue = fromValue; + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + var ZERO = fromInt(0); + Long.ZERO = ZERO; + var UZERO = fromInt(0, true); + Long.UZERO = UZERO; + var ONE = fromInt(1); + Long.ONE = ONE; + var UONE = fromInt(1, true); + Long.UONE = UONE; + var NEG_ONE = fromInt(-1); + Long.NEG_ONE = NEG_ONE; + var MAX_VALUE = fromBits(4294967295 | 0, 2147483647 | 0, false); + Long.MAX_VALUE = MAX_VALUE; + var MAX_UNSIGNED_VALUE = fromBits(4294967295 | 0, 4294967295 | 0, true); + Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + var MIN_VALUE = fromBits(0, 2147483648 | 0, false); + Long.MIN_VALUE = MIN_VALUE; + var LongPrototype = Long.prototype; + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError("radix"); + if (this.isZero()) + return "0"; + if (this.isNegative()) { + if (this.eq(MIN_VALUE)) { + var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else + return "-" + this.neg().toString(radix); + } + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; + var result = ""; + while (true) { + var remDiv = rem.div(radixToPower), intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) + return digits + result; + else { + while (digits.length < 6) + digits = "0" + digits; + result = "" + digits + result; + } + } + }; + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31;bit > 0; bit--) + if ((val & 1 << bit) != 0) + break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + LongPrototype.isSafeInteger = function isSafeInteger() { + var top11Bits = this.high >> 21; + if (!top11Bits) + return true; + if (this.unsigned) + return false; + return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); + }; + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + LongPrototype.eqz = LongPrototype.isZero; + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; + }; + LongPrototype.equals = function equals(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + LongPrototype.eq = LongPrototype.equals; + LongPrototype.notEquals = function notEquals(other) { + return !this.eq(other); + }; + LongPrototype.neq = LongPrototype.notEquals; + LongPrototype.ne = LongPrototype.notEquals; + LongPrototype.lessThan = function lessThan(other) { + return this.comp(other) < 0; + }; + LongPrototype.lt = LongPrototype.lessThan; + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(other) <= 0; + }; + LongPrototype.lte = LongPrototype.lessThanOrEqual; + LongPrototype.le = LongPrototype.lessThanOrEqual; + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(other) > 0; + }; + LongPrototype.gt = LongPrototype.greaterThan; + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(other) >= 0; + }; + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + LongPrototype.ge = LongPrototype.greaterThanOrEqual; + LongPrototype.compare = function compare(other) { + if (!isLong(other)) + other = fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; + }; + LongPrototype.comp = LongPrototype.compare; + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) + return MIN_VALUE; + return this.not().add(ONE); + }; + LongPrototype.neg = LongPrototype.negate; + LongPrototype.add = function add(addend) { + if (!isLong(addend)) + addend = fromValue(addend); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = addend.high >>> 16; + var b32 = addend.high & 65535; + var b16 = addend.low >>> 16; + var b00 = addend.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 + b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) + subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + LongPrototype.sub = LongPrototype.subtract; + LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) + return this; + if (!isLong(multiplier)) + multiplier = fromValue(multiplier); + if (wasm) { + var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + if (multiplier.isZero()) + return this.unsigned ? UZERO : ZERO; + if (this.eq(MIN_VALUE)) + return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) + return this.isOdd() ? MIN_VALUE : ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + var a48 = this.high >>> 16; + var a32 = this.high & 65535; + var a16 = this.low >>> 16; + var a00 = this.low & 65535; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 65535; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 65535; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 65535; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 65535; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 65535; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 65535; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 65535; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 65535; + return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); + }; + LongPrototype.mul = LongPrototype.multiply; + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (divisor.isZero()) + throw Error("division by zero"); + if (wasm) { + if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) { + return this; + } + var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])(this.low, this.high, divisor.low, divisor.high); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; + else if (divisor.eq(MIN_VALUE)) + return ONE; + else { + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) + return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return UZERO; + if (divisor.gt(this.shru(1))) + return UONE; + res = UZERO; + } + rem = this; + while (rem.gte(divisor)) { + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + if (approxRes.isZero()) + approxRes = ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + LongPrototype.div = LongPrototype.divide; + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) + divisor = fromValue(divisor); + if (wasm) { + var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + LongPrototype.mod = LongPrototype.modulo; + LongPrototype.rem = LongPrototype.modulo; + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + LongPrototype.countLeadingZeros = function countLeadingZeros() { + return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; + }; + LongPrototype.clz = LongPrototype.countLeadingZeros; + LongPrototype.countTrailingZeros = function countTrailingZeros() { + return this.low ? ctz32(this.low) : ctz32(this.high) + 32; + }; + LongPrototype.ctz = LongPrototype.countTrailingZeros; + LongPrototype.and = function and(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + LongPrototype.or = function or(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + LongPrototype.xor = function xor2(other) { + if (!isLong(other)) + other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned); + else + return fromBits(0, this.low << numBits - 32, this.unsigned); + }; + LongPrototype.shl = LongPrototype.shiftLeft; + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned); + else + return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); + }; + LongPrototype.shr = LongPrototype.shiftRight; + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + if (numBits < 32) + return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned); + if (numBits === 32) + return fromBits(this.high, 0, this.unsigned); + return fromBits(this.high >>> numBits - 32, 0, this.unsigned); + }; + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + LongPrototype.rotateLeft = function rotateLeft(numBits) { + var b; + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + if (numBits === 32) + return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned); + } + numBits -= 32; + b = 32 - numBits; + return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned); + }; + LongPrototype.rotl = LongPrototype.rotateLeft; + LongPrototype.rotateRight = function rotateRight(numBits) { + var b; + if (isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + if (numBits === 32) + return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned); + } + numBits -= 32; + b = 32 - numBits; + return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned); + }; + LongPrototype.rotr = LongPrototype.rotateRight; + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) + return this; + return fromBits(this.low, this.high, false); + }; + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) + return this; + return fromBits(this.low, this.high, true); + }; + LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, lo = this.low; + return [ + lo & 255, + lo >>> 8 & 255, + lo >>> 16 & 255, + lo >>> 24, + hi & 255, + hi >>> 8 & 255, + hi >>> 16 & 255, + hi >>> 24 + ]; + }; + LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + hi >>> 16 & 255, + hi >>> 8 & 255, + hi & 255, + lo >>> 24, + lo >>> 16 & 255, + lo >>> 8 & 255, + lo & 255 + ]; + }; + Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); + }; + Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); + }; + if (typeof BigInt === "function") { + Long.fromBigInt = function fromBigInt(value, unsigned) { + var lowBits = Number(BigInt.asIntN(32, value)); + var highBits = Number(BigInt.asIntN(32, value >> BigInt(32))); + return fromBits(lowBits, highBits, unsigned); + }; + Long.fromValue = function fromValueWithBigInt(value, unsigned) { + if (typeof value === "bigint") + return Long.fromBigInt(value, unsigned); + return fromValue(value, unsigned); + }; + LongPrototype.toBigInt = function toBigInt() { + var lowBigInt = BigInt(this.low >>> 0); + var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high); + return highBigInt << BigInt(32) | lowBigInt; + }; + } + var _default3 = _exports.default = Long; + }); +}); + +// node_modules/protobufjs/src/util/minimal.js +var require_minimal = __commonJS((exports) => { + var util = exports; + util.asPromise = require_aspromise(); + util.base64 = require_base64(); + util.EventEmitter = require_eventemitter(); + util.float = require_float(); + util.inquire = require_inquire(); + util.utf8 = require_utf8(); + util.pool = require_pool(); + util.LongBits = require_longbits(); + function isUnsafeProperty(key) { + return key === "__proto__" || key === "prototype" || key === "constructor"; + } + util.isUnsafeProperty = isUnsafeProperty; + util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node); + util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports; + util.emptyArray = Object.freeze ? Object.freeze([]) : []; + util.emptyObject = Object.freeze ? Object.freeze({}) : {}; + util.isInteger = Number.isInteger || function isInteger(value) { + return typeof value === "number" && isFinite(value) && Math.floor(value) === value; + }; + util.isString = function isString(value) { + return typeof value === "string" || value instanceof String; + }; + util.isObject = function isObject2(value) { + return value && typeof value === "object"; + }; + util.isset = util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && obj.hasOwnProperty(prop)) + return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; + }; + util.Buffer = function() { + try { + var Buffer2 = util.global.Buffer; + return Buffer2.prototype.utf8Write ? Buffer2 : null; + } catch (e) { + return null; + } + }(); + util._Buffer_from = null; + util._Buffer_allocUnsafe = null; + util.newBuffer = function newBuffer(sizeOrArray) { + return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); + }; + util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + util.Long = util.global.dcodeIO && util.global.dcodeIO.Long || util.global.Long || function() { + try { + var Long = require_umd(); + return Long && Long.isLong ? Long : null; + } catch (e) { + return null; + } + }(); + util.key2Re = /^true|false|0|1$/; + util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + util.longToHash = function longToHash(value) { + return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash; + }; + util.longFromHash = function longFromHash(hash2, unsigned) { + var bits = util.LongBits.fromHash(hash2); + if (util.Long) + return util.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); + }; + function merge2(dst) { + var ifNotSet = typeof arguments[arguments.length - 1] === "boolean", limit = ifNotSet ? arguments.length - 1 : arguments.length; + ifNotSet = ifNotSet && arguments[arguments.length - 1]; + for (var a = 1;a < limit; ++a) { + var src = arguments[a]; + if (!src) + continue; + for (var keys = Object.keys(src), i = 0;i < keys.length; ++i) + if (!isUnsafeProperty(keys[i]) && (dst[keys[i]] === undefined || !ifNotSet)) + dst[keys[i]] = src[keys[i]]; + } + return dst; + } + util.merge = merge2; + util.nestingLimit = 32; + util.recursionLimit = 100; + util.makeProp = function makeProp(obj, key) { + Object.defineProperty(obj, key, { + enumerable: true, + configurable: true, + writable: true + }); + }; + util.lcFirst = function lcFirst(str) { + return str.charAt(0).toLowerCase() + str.substring(1); + }; + function newError(name) { + function CustomError(message, properties) { + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + Object.defineProperty(this, "message", { get: function() { + return message; + } }); + if (Error.captureStackTrace) + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + if (properties) + merge2(this, properties); + } + CustomError.prototype = Object.create(Error.prototype, { + constructor: { + value: CustomError, + writable: true, + enumerable: false, + configurable: true + }, + name: { + get: function get() { + return name; + }, + set: undefined, + enumerable: false, + configurable: true + }, + toString: { + value: function value() { + return this.name + ": " + this.message; + }, + writable: true, + enumerable: false, + configurable: true + } + }); + return CustomError; + } + util.newError = newError; + util.ProtocolError = newError("ProtocolError"); + util.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i = 0;i < fieldNames.length; ++i) + fieldMap[fieldNames[i]] = 1; + return function() { + for (var keys = Object.keys(this), i2 = keys.length - 1;i2 > -1; --i2) + if (fieldMap[keys[i2]] === 1 && this[keys[i2]] !== undefined && this[keys[i2]] !== null) + return keys[i2]; + }; + }; + util.oneOfSetter = function setOneOf(fieldNames) { + return function(name) { + for (var i = 0;i < fieldNames.length; ++i) + if (fieldNames[i] !== name) + delete this[fieldNames[i]]; + }; + }; + util.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true + }; + util._configure = function() { + var Buffer2 = util.Buffer; + if (!Buffer2) { + util._Buffer_from = util._Buffer_allocUnsafe = null; + return; + } + util._Buffer_from = Buffer2.from !== Uint8Array.from && Buffer2.from || function Buffer_from(value, encoding) { + return new Buffer2(value, encoding); + }; + util._Buffer_allocUnsafe = Buffer2.allocUnsafe || function Buffer_allocUnsafe(size) { + return new Buffer2(size); + }; + }; +}); + +// node_modules/protobufjs/src/writer.js +var require_writer = __commonJS((exports, module) => { + module.exports = Writer; + var util = require_minimal(); + var BufferWriter; + var LongBits = util.LongBits; + var base643 = util.base64; + var utf8 = util.utf8; + function Op(fn, len, val) { + this.fn = fn; + this.len = len; + this.next = undefined; + this.val = val; + } + function noop() {} + function State(writer) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } + function Writer() { + this.len = 0; + this.head = new Op(noop, 0, 0); + this.tail = this.head; + this.states = null; + } + var create = function create2() { + return util.Buffer ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter; + })(); + } : function create_array() { + return new Writer; + }; + }; + Writer.create = create(); + Writer.alloc = function alloc(size) { + return new util.Array(size); + }; + if (util.Array !== Array) + Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); + Writer.prototype._push = function push(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + }; + function writeByte(val, buf, pos) { + buf[pos] = val & 255; + } + function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; + } + function VarintOp(len, val) { + this.len = len; + this.next = undefined; + this.val = val; + } + VarintOp.prototype = Object.create(Op.prototype); + VarintOp.prototype.fn = writeVarint32; + Writer.prototype.uint32 = function write_uint32(value) { + this.len += (this.tail = this.tail.next = new VarintOp((value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, value)).len; + return this; + }; + Writer.prototype.int32 = function write_int32(value) { + return (value |= 0) < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value); + }; + Writer.prototype.sint32 = function write_sint32(value) { + return this.uint32((value << 1 ^ value >> 31) >>> 0); + }; + function writeVarint64(val, buf, pos) { + var { lo, hi } = val; + while (hi) { + buf[pos++] = lo & 127 | 128; + lo = (lo >>> 7 | hi << 25) >>> 0; + hi >>>= 7; + } + while (lo > 127) { + buf[pos++] = lo & 127 | 128; + lo = lo >>> 7; + } + buf[pos++] = lo; + } + Writer.prototype.uint64 = function write_uint64(value) { + var bits = LongBits.from(value); + return this._push(writeVarint64, bits.length(), bits); + }; + Writer.prototype.int64 = Writer.prototype.uint64; + Writer.prototype.sint64 = function write_sint64(value) { + var bits = LongBits.from(value).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); + }; + Writer.prototype.bool = function write_bool(value) { + return this._push(writeByte, 1, value ? 1 : 0); + }; + function writeFixed32(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + Writer.prototype.fixed32 = function write_fixed32(value) { + return this._push(writeFixed32, 4, value >>> 0); + }; + Writer.prototype.sfixed32 = Writer.prototype.fixed32; + Writer.prototype.fixed64 = function write_fixed64(value) { + var bits = LongBits.from(value); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); + }; + Writer.prototype.sfixed64 = Writer.prototype.fixed64; + Writer.prototype.float = function write_float(value) { + return this._push(util.float.writeFloatLE, 4, value); + }; + Writer.prototype.double = function write_double(value) { + return this._push(util.float.writeDoubleLE, 8, value); + }; + var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); + } : function writeBytes_for(val, buf, pos) { + for (var i = 0;i < val.length; ++i) + buf[pos + i] = val[i]; + }; + Writer.prototype.bytes = function write_bytes(value) { + var len = value.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util.isString(value)) { + var buf = Writer.alloc(len = base643.length(value)); + base643.decode(value, buf, 0); + value = buf; + } + return this.uint32(len)._push(writeBytes, len, value); + }; + Writer.prototype.string = function write_string(value) { + var len = utf8.length(value); + return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0); + }; + Writer.prototype.fork = function fork() { + this.states = new State(this); + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + return this; + }; + Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop, 0, 0); + this.len = 0; + } + return this; + }; + Writer.prototype.ldelim = function ldelim() { + var head = this.head, tail = this.tail, len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; + this.tail = tail; + this.len += len; + } + return this; + }; + Writer.prototype.finish = function finish() { + var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0; + while (head) { + head.fn(head.val, buf, pos); + pos += head.len; + head = head.next; + } + return buf; + }; + Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); + }; +}); + +// node_modules/protobufjs/src/writer_buffer.js +var require_writer_buffer = __commonJS((exports, module) => { + module.exports = BufferWriter; + var Writer = require_writer(); + (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + var util = require_minimal(); + function BufferWriter() { + Writer.call(this); + } + BufferWriter._configure = function() { + BufferWriter.alloc = util._Buffer_allocUnsafe; + BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { + buf.set(val, pos); + } : function writeBytesBuffer_copy(val, buf, pos) { + if (val.copy) + val.copy(buf, pos, 0, val.length); + else + for (var i = 0;i < val.length; ) + buf[pos++] = val[i++]; + }; + }; + BufferWriter.prototype.bytes = function write_bytes_buffer(value) { + if (util.isString(value)) + value = util._Buffer_from(value, "base64"); + var len = value.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value); + return this; + }; + function writeStringBuffer(val, buf, pos) { + if (val.length < 40) + util.utf8.write(val, buf, pos); + else if (buf.utf8Write) + buf.utf8Write(val, pos); + else + buf.write(val, pos); + } + BufferWriter.prototype.string = function write_string_buffer(value) { + var len = util.Buffer.byteLength(value); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value); + return this; + }; + BufferWriter._configure(); +}); + +// node_modules/protobufjs/src/reader.js +var require_reader = __commonJS((exports, module) => { + module.exports = Reader; + var util = require_minimal(); + var BufferReader; + var LongBits = util.LongBits; + var utf8 = util.utf8; + function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); + } + function Reader(buffer) { + this.buf = buffer; + this.pos = 0; + this.len = buffer.length; + } + var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) { + if (buffer instanceof Uint8Array || Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + } : function create_array2(buffer) { + if (Array.isArray(buffer)) + return new Reader(buffer); + throw Error("illegal buffer"); + }; + var create = function create2() { + return util.Buffer ? function create_buffer_setup(buffer) { + return (Reader.create = function create_buffer(buffer2) { + return util.Buffer.isBuffer(buffer2) ? new BufferReader(buffer2) : create_array(buffer2); + })(buffer); + } : create_array; + }; + Reader.create = create(); + Reader.prototype._slice = util.Array.prototype.subarray || util.Array.prototype.slice; + Reader.prototype.uint32 = function read_uint32_setup() { + var value = 4294967295; + return function read_uint32() { + value = (this.buf[this.pos] & 127) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; + if (this.buf[this.pos++] < 128) + return value; + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value; + }; + }(); + Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; + }; + Reader.prototype.sint32 = function read_sint32() { + var value = this.uint32(); + return value >>> 1 ^ -(value & 1) | 0; + }; + function readLongVarint() { + var bits = new LongBits(0, 0); + var i = 0; + if (this.len - this.pos > 4) { + for (;i < 4; ++i) { + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i = 0; + } else { + for (;i < 3; ++i) { + if (this.pos >= this.len) + throw indexOutOfRange(this); + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { + for (;i < 5; ++i) { + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (;i < 5; ++i) { + if (this.pos >= this.len) + throw indexOutOfRange(this); + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + throw Error("invalid varint encoding"); + } + Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; + }; + function readFixed32_end(buf, end) { + return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; + } + Reader.prototype.fixed32 = function read_fixed32() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4); + }; + Reader.prototype.sfixed32 = function read_sfixed32() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4) | 0; + }; + function readFixed64() { + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); + } + Reader.prototype.float = function read_float() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + var value = util.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value; + }; + Reader.prototype.double = function read_double() { + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + var value = util.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value; + }; + Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), start = this.pos, end = this.pos + length; + if (end > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + if (Array.isArray(this.buf)) + return this.buf.slice(start, end); + if (start === end) { + var nativeBuffer = util.Buffer; + return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); + } + return this._slice.call(this.buf, start, end); + }; + Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); + }; + Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + }; + Reader.recursionLimit = util.recursionLimit; + Reader.prototype.skipType = function(wireType, depth) { + if (depth === undefined) + depth = 0; + if (depth > Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType, depth + 1); + } + break; + case 5: + this.skip(4); + break; + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + }; + Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create(); + BufferReader._configure(); + var fn = util.Long ? "toLong" : "toNumber"; + util.merge(Reader.prototype, { + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + }); + }; +}); + +// node_modules/protobufjs/src/reader_buffer.js +var require_reader_buffer = __commonJS((exports, module) => { + module.exports = BufferReader; + var Reader = require_reader(); + (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + var util = require_minimal(); + function BufferReader(buffer) { + Reader.call(this, buffer); + } + BufferReader._configure = function() { + if (util.Buffer) + BufferReader.prototype._slice = util.Buffer.prototype.slice; + }; + BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); + return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); + }; + BufferReader._configure(); +}); + +// node_modules/protobufjs/src/rpc/service.js +var require_service = __commonJS((exports, module) => { + module.exports = Service; + var util = require_minimal(); + (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; + function Service(rpcImpl, requestDelimited, responseDelimited) { + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + util.EventEmitter.call(this); + this.rpcImpl = rpcImpl; + this.requestDelimited = Boolean(requestDelimited); + this.responseDelimited = Boolean(responseDelimited); + } + Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { + if (!request) + throw TypeError("request must be specified"); + var self2 = this; + if (!callback) + return util.asPromise(rpcCall, self2, method, requestCtor, responseCtor, request); + if (!self2.rpcImpl) { + setTimeout(function() { + callback(Error("already ended")); + }, 0); + return; + } + try { + return self2.rpcImpl(method, requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err, response) { + if (err) { + self2.emit("error", err, method); + return callback(err); + } + if (response === null) { + self2.end(true); + return; + } + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self2.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err2) { + self2.emit("error", err2, method); + return callback(err2); + } + } + self2.emit("data", response, method); + return callback(null, response); + }); + } catch (err) { + self2.emit("error", err, method); + setTimeout(function() { + callback(err); + }, 0); + return; + } + }; + Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; + }; +}); + +// node_modules/protobufjs/src/rpc.js +var require_rpc = __commonJS((exports) => { + var rpc = exports; + rpc.Service = require_service(); +}); + +// node_modules/protobufjs/src/roots.js +var require_roots = __commonJS((exports, module) => { + module.exports = Object.create(null); +}); + +// node_modules/protobufjs/src/index-minimal.js +var require_index_minimal = __commonJS((exports) => { + var protobuf = exports; + protobuf.build = "minimal"; + protobuf.Writer = require_writer(); + protobuf.BufferWriter = require_writer_buffer(); + protobuf.Reader = require_reader(); + protobuf.BufferReader = require_reader_buffer(); + protobuf.util = require_minimal(); + protobuf.rpc = require_rpc(); + protobuf.roots = require_roots(); + protobuf.configure = configure; + function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); + } + configure(); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +var require_root = __commonJS((exports, module) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var $protobuf = require_index_minimal(); + var $Reader = $protobuf.Reader; + var $Writer = $protobuf.Writer; + var $util = $protobuf.util; + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + $root.opentelemetry = function() { + var opentelemetry = {}; + opentelemetry.proto = function() { + var proto = {}; + proto.common = function() { + var common = {}; + common.v1 = function() { + var v1 = {}; + v1.AnyValue = function() { + function AnyValue(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + AnyValue.prototype.stringValue = null; + AnyValue.prototype.boolValue = null; + AnyValue.prototype.intValue = null; + AnyValue.prototype.doubleValue = null; + AnyValue.prototype.arrayValue = null; + AnyValue.prototype.kvlistValue = null; + AnyValue.prototype.bytesValue = null; + var $oneOfFields; + Object.defineProperty(AnyValue.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["stringValue", "boolValue", "intValue", "doubleValue", "arrayValue", "kvlistValue", "bytesValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + AnyValue.create = function create(properties) { + return new AnyValue(properties); + }; + AnyValue.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(10).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(16).bool(message.boolValue); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(24).int64(message.intValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(33).double(message.doubleValue); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.opentelemetry.proto.common.v1.ArrayValue.encode(message.arrayValue, writer.uint32(42).fork()).ldelim(); + if (message.kvlistValue != null && Object.hasOwnProperty.call(message, "kvlistValue")) + $root.opentelemetry.proto.common.v1.KeyValueList.encode(message.kvlistValue, writer.uint32(50).fork()).ldelim(); + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) + writer.uint32(58).bytes(message.bytesValue); + return writer; + }; + AnyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + AnyValue.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.AnyValue; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.stringValue = reader.string(); + break; + } + case 2: { + message.boolValue = reader.bool(); + break; + } + case 3: { + message.intValue = reader.int64(); + break; + } + case 4: { + message.doubleValue = reader.double(); + break; + } + case 5: { + message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.decode(reader, reader.uint32()); + break; + } + case 6: { + message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.decode(reader, reader.uint32()); + break; + } + case 7: { + message.bytesValue = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + AnyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + AnyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error51 = $root.opentelemetry.proto.common.v1.ArrayValue.verify(message.arrayValue); + if (error51) + return "arrayValue." + error51; + } + } + if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error51 = $root.opentelemetry.proto.common.v1.KeyValueList.verify(message.kvlistValue); + if (error51) + return "kvlistValue." + error51; + } + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) + return "bytesValue: buffer expected"; + } + return null; + }; + AnyValue.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.common.v1.AnyValue) + return object2; + var message = new $root.opentelemetry.proto.common.v1.AnyValue; + if (object2.stringValue != null) + message.stringValue = String(object2.stringValue); + if (object2.boolValue != null) + message.boolValue = Boolean(object2.boolValue); + if (object2.intValue != null) { + if ($util.Long) + (message.intValue = $util.Long.fromValue(object2.intValue)).unsigned = false; + else if (typeof object2.intValue === "string") + message.intValue = parseInt(object2.intValue, 10); + else if (typeof object2.intValue === "number") + message.intValue = object2.intValue; + else if (typeof object2.intValue === "object") + message.intValue = new $util.LongBits(object2.intValue.low >>> 0, object2.intValue.high >>> 0).toNumber(); + } + if (object2.doubleValue != null) + message.doubleValue = Number(object2.doubleValue); + if (object2.arrayValue != null) { + if (typeof object2.arrayValue !== "object") + throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected"); + message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.fromObject(object2.arrayValue); + } + if (object2.kvlistValue != null) { + if (typeof object2.kvlistValue !== "object") + throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected"); + message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.fromObject(object2.kvlistValue); + } + if (object2.bytesValue != null) { + if (typeof object2.bytesValue === "string") + $util.base64.decode(object2.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object2.bytesValue)), 0); + else if (object2.bytesValue.length >= 0) + message.bytesValue = object2.bytesValue; + } + return message; + }; + AnyValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object2.stringValue = message.stringValue; + if (options.oneofs) + object2.value = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object2.boolValue = message.boolValue; + if (options.oneofs) + object2.value = "boolValue"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object2.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object2.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object2.value = "intValue"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object2.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) + object2.value = "doubleValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object2.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) + object2.value = "arrayValue"; + } + if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { + object2.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.toObject(message.kvlistValue, options); + if (options.oneofs) + object2.value = "kvlistValue"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object2.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; + if (options.oneofs) + object2.value = "bytesValue"; + } + return object2; + }; + AnyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + AnyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.common.v1.AnyValue"; + }; + return AnyValue; + }(); + v1.ArrayValue = function() { + function ArrayValue(properties) { + this.values = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ArrayValue.prototype.values = $util.emptyArray; + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); + }; + ArrayValue.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0;i < message.values.length; ++i) + $root.opentelemetry.proto.common.v1.AnyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ArrayValue.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.ArrayValue; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ArrayValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ArrayValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0;i < message.values.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.values[i]); + if (error51) + return "values." + error51; + } + } + return null; + }; + ArrayValue.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.common.v1.ArrayValue) + return object2; + var message = new $root.opentelemetry.proto.common.v1.ArrayValue; + if (object2.values) { + if (!Array.isArray(object2.values)) + throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0;i < object2.values.length; ++i) { + if (typeof object2.values[i] !== "object") + throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected"); + message.values[i] = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object2.values[i]); + } + } + return message; + }; + ArrayValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.values = []; + if (message.values && message.values.length) { + object2.values = []; + for (var j = 0;j < message.values.length; ++j) + object2.values[j] = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.values[j], options); + } + return object2; + }; + ArrayValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.common.v1.ArrayValue"; + }; + return ArrayValue; + }(); + v1.KeyValueList = function() { + function KeyValueList(properties) { + this.values = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + KeyValueList.prototype.values = $util.emptyArray; + KeyValueList.create = function create(properties) { + return new KeyValueList(properties); + }; + KeyValueList.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0;i < message.values.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + KeyValueList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + KeyValueList.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValueList; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + KeyValueList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + KeyValueList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0;i < message.values.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.values[i]); + if (error51) + return "values." + error51; + } + } + return null; + }; + KeyValueList.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.common.v1.KeyValueList) + return object2; + var message = new $root.opentelemetry.proto.common.v1.KeyValueList; + if (object2.values) { + if (!Array.isArray(object2.values)) + throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected"); + message.values = []; + for (var i = 0;i < object2.values.length; ++i) { + if (typeof object2.values[i] !== "object") + throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected"); + message.values[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.values[i]); + } + } + return message; + }; + KeyValueList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.values = []; + if (message.values && message.values.length) { + object2.values = []; + for (var j = 0;j < message.values.length; ++j) + object2.values[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.values[j], options); + } + return object2; + }; + KeyValueList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + KeyValueList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValueList"; + }; + return KeyValueList; + }(); + v1.KeyValue = function() { + function KeyValue(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + KeyValue.prototype.key = null; + KeyValue.prototype.value = null; + KeyValue.create = function create(properties) { + return new KeyValue(properties); + }; + KeyValue.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.opentelemetry.proto.common.v1.AnyValue.encode(message.value, writer.uint32(18).fork()).ldelim(); + return writer; + }; + KeyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + KeyValue.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValue; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + KeyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + KeyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error51 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.value); + if (error51) + return "value." + error51; + } + return null; + }; + KeyValue.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.common.v1.KeyValue) + return object2; + var message = new $root.opentelemetry.proto.common.v1.KeyValue; + if (object2.key != null) + message.key = String(object2.key); + if (object2.value != null) { + if (typeof object2.value !== "object") + throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected"); + message.value = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object2.value); + } + return message; + }; + KeyValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) { + object2.key = ""; + object2.value = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object2.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object2.value = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.value, options); + return object2; + }; + KeyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + KeyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValue"; + }; + return KeyValue; + }(); + v1.InstrumentationScope = function() { + function InstrumentationScope(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + InstrumentationScope.prototype.name = null; + InstrumentationScope.prototype.version = null; + InstrumentationScope.prototype.attributes = $util.emptyArray; + InstrumentationScope.prototype.droppedAttributesCount = null; + InstrumentationScope.create = function create(properties) { + return new InstrumentationScope(properties); + }; + InstrumentationScope.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(18).string(message.version); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) + writer.uint32(32).uint32(message.droppedAttributesCount); + return writer; + }; + InstrumentationScope.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + InstrumentationScope.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.InstrumentationScope; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 4: { + message.droppedAttributesCount = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + InstrumentationScope.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + InstrumentationScope.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.version != null && message.hasOwnProperty("version")) { + if (!$util.isString(message.version)) + return "version: string expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) + return "droppedAttributesCount: integer expected"; + } + return null; + }; + InstrumentationScope.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.common.v1.InstrumentationScope) + return object2; + var message = new $root.opentelemetry.proto.common.v1.InstrumentationScope; + if (object2.name != null) + message.name = String(object2.name); + if (object2.version != null) + message.version = String(object2.version); + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.droppedAttributesCount != null) + message.droppedAttributesCount = object2.droppedAttributesCount >>> 0; + return message; + }; + InstrumentationScope.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.attributes = []; + if (options.defaults) { + object2.name = ""; + object2.version = ""; + object2.droppedAttributesCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object2.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object2.version = message.version; + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) + object2.droppedAttributesCount = message.droppedAttributesCount; + return object2; + }; + InstrumentationScope.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + InstrumentationScope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.common.v1.InstrumentationScope"; + }; + return InstrumentationScope; + }(); + v1.EntityRef = function() { + function EntityRef(properties) { + this.idKeys = []; + this.descriptionKeys = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + EntityRef.prototype.schemaUrl = null; + EntityRef.prototype.type = null; + EntityRef.prototype.idKeys = $util.emptyArray; + EntityRef.prototype.descriptionKeys = $util.emptyArray; + EntityRef.create = function create(properties) { + return new EntityRef(properties); + }; + EntityRef.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) + writer.uint32(10).string(message.schemaUrl); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(18).string(message.type); + if (message.idKeys != null && message.idKeys.length) + for (var i = 0;i < message.idKeys.length; ++i) + writer.uint32(26).string(message.idKeys[i]); + if (message.descriptionKeys != null && message.descriptionKeys.length) + for (var i = 0;i < message.descriptionKeys.length; ++i) + writer.uint32(34).string(message.descriptionKeys[i]); + return writer; + }; + EntityRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + EntityRef.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.EntityRef; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.schemaUrl = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + if (!(message.idKeys && message.idKeys.length)) + message.idKeys = []; + message.idKeys.push(reader.string()); + break; + } + case 4: { + if (!(message.descriptionKeys && message.descriptionKeys.length)) + message.descriptionKeys = []; + message.descriptionKeys.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + EntityRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + EntityRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) + return "schemaUrl: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + if (!$util.isString(message.type)) + return "type: string expected"; + } + if (message.idKeys != null && message.hasOwnProperty("idKeys")) { + if (!Array.isArray(message.idKeys)) + return "idKeys: array expected"; + for (var i = 0;i < message.idKeys.length; ++i) + if (!$util.isString(message.idKeys[i])) + return "idKeys: string[] expected"; + } + if (message.descriptionKeys != null && message.hasOwnProperty("descriptionKeys")) { + if (!Array.isArray(message.descriptionKeys)) + return "descriptionKeys: array expected"; + for (var i = 0;i < message.descriptionKeys.length; ++i) + if (!$util.isString(message.descriptionKeys[i])) + return "descriptionKeys: string[] expected"; + } + return null; + }; + EntityRef.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.common.v1.EntityRef) + return object2; + var message = new $root.opentelemetry.proto.common.v1.EntityRef; + if (object2.schemaUrl != null) + message.schemaUrl = String(object2.schemaUrl); + if (object2.type != null) + message.type = String(object2.type); + if (object2.idKeys) { + if (!Array.isArray(object2.idKeys)) + throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected"); + message.idKeys = []; + for (var i = 0;i < object2.idKeys.length; ++i) + message.idKeys[i] = String(object2.idKeys[i]); + } + if (object2.descriptionKeys) { + if (!Array.isArray(object2.descriptionKeys)) + throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected"); + message.descriptionKeys = []; + for (var i = 0;i < object2.descriptionKeys.length; ++i) + message.descriptionKeys[i] = String(object2.descriptionKeys[i]); + } + return message; + }; + EntityRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) { + object2.idKeys = []; + object2.descriptionKeys = []; + } + if (options.defaults) { + object2.schemaUrl = ""; + object2.type = ""; + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) + object2.schemaUrl = message.schemaUrl; + if (message.type != null && message.hasOwnProperty("type")) + object2.type = message.type; + if (message.idKeys && message.idKeys.length) { + object2.idKeys = []; + for (var j = 0;j < message.idKeys.length; ++j) + object2.idKeys[j] = message.idKeys[j]; + } + if (message.descriptionKeys && message.descriptionKeys.length) { + object2.descriptionKeys = []; + for (var j = 0;j < message.descriptionKeys.length; ++j) + object2.descriptionKeys[j] = message.descriptionKeys[j]; + } + return object2; + }; + EntityRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + EntityRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.common.v1.EntityRef"; + }; + return EntityRef; + }(); + return v1; + }(); + return common; + }(); + proto.resource = function() { + var resource = {}; + resource.v1 = function() { + var v1 = {}; + v1.Resource = function() { + function Resource(properties) { + this.attributes = []; + this.entityRefs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Resource.prototype.attributes = $util.emptyArray; + Resource.prototype.droppedAttributesCount = null; + Resource.prototype.entityRefs = $util.emptyArray; + Resource.create = function create(properties) { + return new Resource(properties); + }; + Resource.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) + writer.uint32(16).uint32(message.droppedAttributesCount); + if (message.entityRefs != null && message.entityRefs.length) + for (var i = 0;i < message.entityRefs.length; ++i) + $root.opentelemetry.proto.common.v1.EntityRef.encode(message.entityRefs[i], writer.uint32(26).fork()).ldelim(); + return writer; + }; + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Resource.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.resource.v1.Resource; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.droppedAttributesCount = reader.uint32(); + break; + } + case 3: { + if (!(message.entityRefs && message.entityRefs.length)) + message.entityRefs = []; + message.entityRefs.push($root.opentelemetry.proto.common.v1.EntityRef.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) + return "droppedAttributesCount: integer expected"; + } + if (message.entityRefs != null && message.hasOwnProperty("entityRefs")) { + if (!Array.isArray(message.entityRefs)) + return "entityRefs: array expected"; + for (var i = 0;i < message.entityRefs.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.EntityRef.verify(message.entityRefs[i]); + if (error51) + return "entityRefs." + error51; + } + } + return null; + }; + Resource.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.resource.v1.Resource) + return object2; + var message = new $root.opentelemetry.proto.resource.v1.Resource; + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.droppedAttributesCount != null) + message.droppedAttributesCount = object2.droppedAttributesCount >>> 0; + if (object2.entityRefs) { + if (!Array.isArray(object2.entityRefs)) + throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected"); + message.entityRefs = []; + for (var i = 0;i < object2.entityRefs.length; ++i) { + if (typeof object2.entityRefs[i] !== "object") + throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected"); + message.entityRefs[i] = $root.opentelemetry.proto.common.v1.EntityRef.fromObject(object2.entityRefs[i]); + } + } + return message; + }; + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) { + object2.attributes = []; + object2.entityRefs = []; + } + if (options.defaults) + object2.droppedAttributesCount = 0; + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) + object2.droppedAttributesCount = message.droppedAttributesCount; + if (message.entityRefs && message.entityRefs.length) { + object2.entityRefs = []; + for (var j = 0;j < message.entityRefs.length; ++j) + object2.entityRefs[j] = $root.opentelemetry.proto.common.v1.EntityRef.toObject(message.entityRefs[j], options); + } + return object2; + }; + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.resource.v1.Resource"; + }; + return Resource; + }(); + return v1; + }(); + return resource; + }(); + proto.trace = function() { + var trace = {}; + trace.v1 = function() { + var v1 = {}; + v1.TracesData = function() { + function TracesData(properties) { + this.resourceSpans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + TracesData.prototype.resourceSpans = $util.emptyArray; + TracesData.create = function create(properties) { + return new TracesData(properties); + }; + TracesData.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceSpans != null && message.resourceSpans.length) + for (var i = 0;i < message.resourceSpans.length; ++i) + $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + TracesData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + TracesData.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.TracesData; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceSpans && message.resourceSpans.length)) + message.resourceSpans = []; + message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + TracesData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + TracesData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { + if (!Array.isArray(message.resourceSpans)) + return "resourceSpans: array expected"; + for (var i = 0;i < message.resourceSpans.length; ++i) { + var error51 = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); + if (error51) + return "resourceSpans." + error51; + } + } + return null; + }; + TracesData.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.trace.v1.TracesData) + return object2; + var message = new $root.opentelemetry.proto.trace.v1.TracesData; + if (object2.resourceSpans) { + if (!Array.isArray(object2.resourceSpans)) + throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected"); + message.resourceSpans = []; + for (var i = 0;i < object2.resourceSpans.length; ++i) { + if (typeof object2.resourceSpans[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected"); + message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object2.resourceSpans[i]); + } + } + return message; + }; + TracesData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.resourceSpans = []; + if (message.resourceSpans && message.resourceSpans.length) { + object2.resourceSpans = []; + for (var j = 0;j < message.resourceSpans.length; ++j) + object2.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); + } + return object2; + }; + TracesData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + TracesData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.TracesData"; + }; + return TracesData; + }(); + v1.ResourceSpans = function() { + function ResourceSpans(properties) { + this.scopeSpans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ResourceSpans.prototype.resource = null; + ResourceSpans.prototype.scopeSpans = $util.emptyArray; + ResourceSpans.prototype.schemaUrl = null; + ResourceSpans.create = function create(properties) { + return new ResourceSpans(properties); + }; + ResourceSpans.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + if (message.scopeSpans != null && message.scopeSpans.length) + for (var i = 0;i < message.scopeSpans.length; ++i) + $root.opentelemetry.proto.trace.v1.ScopeSpans.encode(message.scopeSpans[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) + writer.uint32(26).string(message.schemaUrl); + return writer; + }; + ResourceSpans.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ResourceSpans.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ResourceSpans; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.scopeSpans && message.scopeSpans.length)) + message.scopeSpans = []; + message.scopeSpans.push($root.opentelemetry.proto.trace.v1.ScopeSpans.decode(reader, reader.uint32())); + break; + } + case 3: { + message.schemaUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ResourceSpans.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ResourceSpans.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error51 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error51) + return "resource." + error51; + } + if (message.scopeSpans != null && message.hasOwnProperty("scopeSpans")) { + if (!Array.isArray(message.scopeSpans)) + return "scopeSpans: array expected"; + for (var i = 0;i < message.scopeSpans.length; ++i) { + var error51 = $root.opentelemetry.proto.trace.v1.ScopeSpans.verify(message.scopeSpans[i]); + if (error51) + return "scopeSpans." + error51; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) + return "schemaUrl: string expected"; + } + return null; + }; + ResourceSpans.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.trace.v1.ResourceSpans) + return object2; + var message = new $root.opentelemetry.proto.trace.v1.ResourceSpans; + if (object2.resource != null) { + if (typeof object2.resource !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object2.resource); + } + if (object2.scopeSpans) { + if (!Array.isArray(object2.scopeSpans)) + throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected"); + message.scopeSpans = []; + for (var i = 0;i < object2.scopeSpans.length; ++i) { + if (typeof object2.scopeSpans[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected"); + message.scopeSpans[i] = $root.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(object2.scopeSpans[i]); + } + } + if (object2.schemaUrl != null) + message.schemaUrl = String(object2.schemaUrl); + return message; + }; + ResourceSpans.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.scopeSpans = []; + if (options.defaults) { + object2.resource = null; + object2.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object2.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeSpans && message.scopeSpans.length) { + object2.scopeSpans = []; + for (var j = 0;j < message.scopeSpans.length; ++j) + object2.scopeSpans[j] = $root.opentelemetry.proto.trace.v1.ScopeSpans.toObject(message.scopeSpans[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) + object2.schemaUrl = message.schemaUrl; + return object2; + }; + ResourceSpans.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ResourceSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ResourceSpans"; + }; + return ResourceSpans; + }(); + v1.ScopeSpans = function() { + function ScopeSpans(properties) { + this.spans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ScopeSpans.prototype.scope = null; + ScopeSpans.prototype.spans = $util.emptyArray; + ScopeSpans.prototype.schemaUrl = null; + ScopeSpans.create = function create(properties) { + return new ScopeSpans(properties); + }; + ScopeSpans.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); + if (message.spans != null && message.spans.length) + for (var i = 0;i < message.spans.length; ++i) + $root.opentelemetry.proto.trace.v1.Span.encode(message.spans[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) + writer.uint32(26).string(message.schemaUrl); + return writer; + }; + ScopeSpans.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ScopeSpans.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ScopeSpans; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.spans && message.spans.length)) + message.spans = []; + message.spans.push($root.opentelemetry.proto.trace.v1.Span.decode(reader, reader.uint32())); + break; + } + case 3: { + message.schemaUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ScopeSpans.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ScopeSpans.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) { + var error51 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error51) + return "scope." + error51; + } + if (message.spans != null && message.hasOwnProperty("spans")) { + if (!Array.isArray(message.spans)) + return "spans: array expected"; + for (var i = 0;i < message.spans.length; ++i) { + var error51 = $root.opentelemetry.proto.trace.v1.Span.verify(message.spans[i]); + if (error51) + return "spans." + error51; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) + return "schemaUrl: string expected"; + } + return null; + }; + ScopeSpans.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.trace.v1.ScopeSpans) + return object2; + var message = new $root.opentelemetry.proto.trace.v1.ScopeSpans; + if (object2.scope != null) { + if (typeof object2.scope !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object2.scope); + } + if (object2.spans) { + if (!Array.isArray(object2.spans)) + throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected"); + message.spans = []; + for (var i = 0;i < object2.spans.length; ++i) { + if (typeof object2.spans[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected"); + message.spans[i] = $root.opentelemetry.proto.trace.v1.Span.fromObject(object2.spans[i]); + } + } + if (object2.schemaUrl != null) + message.schemaUrl = String(object2.schemaUrl); + return message; + }; + ScopeSpans.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.spans = []; + if (options.defaults) { + object2.scope = null; + object2.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object2.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.spans && message.spans.length) { + object2.spans = []; + for (var j = 0;j < message.spans.length; ++j) + object2.spans[j] = $root.opentelemetry.proto.trace.v1.Span.toObject(message.spans[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) + object2.schemaUrl = message.schemaUrl; + return object2; + }; + ScopeSpans.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ScopeSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ScopeSpans"; + }; + return ScopeSpans; + }(); + v1.Span = function() { + function Span(properties) { + this.attributes = []; + this.events = []; + this.links = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Span.prototype.traceId = null; + Span.prototype.spanId = null; + Span.prototype.traceState = null; + Span.prototype.parentSpanId = null; + Span.prototype.flags = null; + Span.prototype.name = null; + Span.prototype.kind = null; + Span.prototype.startTimeUnixNano = null; + Span.prototype.endTimeUnixNano = null; + Span.prototype.attributes = $util.emptyArray; + Span.prototype.droppedAttributesCount = null; + Span.prototype.events = $util.emptyArray; + Span.prototype.droppedEventsCount = null; + Span.prototype.links = $util.emptyArray; + Span.prototype.droppedLinksCount = null; + Span.prototype.status = null; + Span.create = function create(properties) { + return new Span(properties); + }; + Span.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(10).bytes(message.traceId); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) + writer.uint32(18).bytes(message.spanId); + if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) + writer.uint32(26).string(message.traceState); + if (message.parentSpanId != null && Object.hasOwnProperty.call(message, "parentSpanId")) + writer.uint32(34).bytes(message.parentSpanId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(42).string(message.name); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(48).int32(message.kind); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) + writer.uint32(57).fixed64(message.startTimeUnixNano); + if (message.endTimeUnixNano != null && Object.hasOwnProperty.call(message, "endTimeUnixNano")) + writer.uint32(65).fixed64(message.endTimeUnixNano); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) + writer.uint32(80).uint32(message.droppedAttributesCount); + if (message.events != null && message.events.length) + for (var i = 0;i < message.events.length; ++i) + $root.opentelemetry.proto.trace.v1.Span.Event.encode(message.events[i], writer.uint32(90).fork()).ldelim(); + if (message.droppedEventsCount != null && Object.hasOwnProperty.call(message, "droppedEventsCount")) + writer.uint32(96).uint32(message.droppedEventsCount); + if (message.links != null && message.links.length) + for (var i = 0;i < message.links.length; ++i) + $root.opentelemetry.proto.trace.v1.Span.Link.encode(message.links[i], writer.uint32(106).fork()).ldelim(); + if (message.droppedLinksCount != null && Object.hasOwnProperty.call(message, "droppedLinksCount")) + writer.uint32(112).uint32(message.droppedLinksCount); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.opentelemetry.proto.trace.v1.Status.encode(message.status, writer.uint32(122).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(133).fixed32(message.flags); + return writer; + }; + Span.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Span.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.traceId = reader.bytes(); + break; + } + case 2: { + message.spanId = reader.bytes(); + break; + } + case 3: { + message.traceState = reader.string(); + break; + } + case 4: { + message.parentSpanId = reader.bytes(); + break; + } + case 16: { + message.flags = reader.fixed32(); + break; + } + case 5: { + message.name = reader.string(); + break; + } + case 6: { + message.kind = reader.int32(); + break; + } + case 7: { + message.startTimeUnixNano = reader.fixed64(); + break; + } + case 8: { + message.endTimeUnixNano = reader.fixed64(); + break; + } + case 9: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 10: { + message.droppedAttributesCount = reader.uint32(); + break; + } + case 11: { + if (!(message.events && message.events.length)) + message.events = []; + message.events.push($root.opentelemetry.proto.trace.v1.Span.Event.decode(reader, reader.uint32())); + break; + } + case 12: { + message.droppedEventsCount = reader.uint32(); + break; + } + case 13: { + if (!(message.links && message.links.length)) + message.links = []; + message.links.push($root.opentelemetry.proto.trace.v1.Span.Link.decode(reader, reader.uint32())); + break; + } + case 14: { + message.droppedLinksCount = reader.uint32(); + break; + } + case 15: { + message.status = $root.opentelemetry.proto.trace.v1.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Span.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Span.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) + return "traceId: buffer expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) + return "spanId: buffer expected"; + } + if (message.traceState != null && message.hasOwnProperty("traceState")) { + if (!$util.isString(message.traceState)) + return "traceState: string expected"; + } + if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) { + if (!(message.parentSpanId && typeof message.parentSpanId.length === "number" || $util.isString(message.parentSpanId))) + return "parentSpanId: buffer expected"; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) + return "startTimeUnixNano: integer|Long expected"; + } + if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) { + if (!$util.isInteger(message.endTimeUnixNano) && !(message.endTimeUnixNano && $util.isInteger(message.endTimeUnixNano.low) && $util.isInteger(message.endTimeUnixNano.high))) + return "endTimeUnixNano: integer|Long expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) + return "droppedAttributesCount: integer expected"; + } + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0;i < message.events.length; ++i) { + var error51 = $root.opentelemetry.proto.trace.v1.Span.Event.verify(message.events[i]); + if (error51) + return "events." + error51; + } + } + if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) { + if (!$util.isInteger(message.droppedEventsCount)) + return "droppedEventsCount: integer expected"; + } + if (message.links != null && message.hasOwnProperty("links")) { + if (!Array.isArray(message.links)) + return "links: array expected"; + for (var i = 0;i < message.links.length; ++i) { + var error51 = $root.opentelemetry.proto.trace.v1.Span.Link.verify(message.links[i]); + if (error51) + return "links." + error51; + } + } + if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) { + if (!$util.isInteger(message.droppedLinksCount)) + return "droppedLinksCount: integer expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error51 = $root.opentelemetry.proto.trace.v1.Status.verify(message.status); + if (error51) + return "status." + error51; + } + return null; + }; + Span.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.trace.v1.Span) + return object2; + var message = new $root.opentelemetry.proto.trace.v1.Span; + if (object2.traceId != null) { + if (typeof object2.traceId === "string") + $util.base64.decode(object2.traceId, message.traceId = $util.newBuffer($util.base64.length(object2.traceId)), 0); + else if (object2.traceId.length >= 0) + message.traceId = object2.traceId; + } + if (object2.spanId != null) { + if (typeof object2.spanId === "string") + $util.base64.decode(object2.spanId, message.spanId = $util.newBuffer($util.base64.length(object2.spanId)), 0); + else if (object2.spanId.length >= 0) + message.spanId = object2.spanId; + } + if (object2.traceState != null) + message.traceState = String(object2.traceState); + if (object2.parentSpanId != null) { + if (typeof object2.parentSpanId === "string") + $util.base64.decode(object2.parentSpanId, message.parentSpanId = $util.newBuffer($util.base64.length(object2.parentSpanId)), 0); + else if (object2.parentSpanId.length >= 0) + message.parentSpanId = object2.parentSpanId; + } + if (object2.flags != null) + message.flags = object2.flags >>> 0; + if (object2.name != null) + message.name = String(object2.name); + switch (object2.kind) { + default: + if (typeof object2.kind === "number") { + message.kind = object2.kind; + break; + } + break; + case "SPAN_KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "SPAN_KIND_INTERNAL": + case 1: + message.kind = 1; + break; + case "SPAN_KIND_SERVER": + case 2: + message.kind = 2; + break; + case "SPAN_KIND_CLIENT": + case 3: + message.kind = 3; + break; + case "SPAN_KIND_PRODUCER": + case 4: + message.kind = 4; + break; + case "SPAN_KIND_CONSUMER": + case 5: + message.kind = 5; + break; + } + if (object2.startTimeUnixNano != null) { + if ($util.Long) + (message.startTimeUnixNano = $util.Long.fromValue(object2.startTimeUnixNano)).unsigned = false; + else if (typeof object2.startTimeUnixNano === "string") + message.startTimeUnixNano = parseInt(object2.startTimeUnixNano, 10); + else if (typeof object2.startTimeUnixNano === "number") + message.startTimeUnixNano = object2.startTimeUnixNano; + else if (typeof object2.startTimeUnixNano === "object") + message.startTimeUnixNano = new $util.LongBits(object2.startTimeUnixNano.low >>> 0, object2.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object2.endTimeUnixNano != null) { + if ($util.Long) + (message.endTimeUnixNano = $util.Long.fromValue(object2.endTimeUnixNano)).unsigned = false; + else if (typeof object2.endTimeUnixNano === "string") + message.endTimeUnixNano = parseInt(object2.endTimeUnixNano, 10); + else if (typeof object2.endTimeUnixNano === "number") + message.endTimeUnixNano = object2.endTimeUnixNano; + else if (typeof object2.endTimeUnixNano === "object") + message.endTimeUnixNano = new $util.LongBits(object2.endTimeUnixNano.low >>> 0, object2.endTimeUnixNano.high >>> 0).toNumber(); + } + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.droppedAttributesCount != null) + message.droppedAttributesCount = object2.droppedAttributesCount >>> 0; + if (object2.events) { + if (!Array.isArray(object2.events)) + throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected"); + message.events = []; + for (var i = 0;i < object2.events.length; ++i) { + if (typeof object2.events[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected"); + message.events[i] = $root.opentelemetry.proto.trace.v1.Span.Event.fromObject(object2.events[i]); + } + } + if (object2.droppedEventsCount != null) + message.droppedEventsCount = object2.droppedEventsCount >>> 0; + if (object2.links) { + if (!Array.isArray(object2.links)) + throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected"); + message.links = []; + for (var i = 0;i < object2.links.length; ++i) { + if (typeof object2.links[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected"); + message.links[i] = $root.opentelemetry.proto.trace.v1.Span.Link.fromObject(object2.links[i]); + } + } + if (object2.droppedLinksCount != null) + message.droppedLinksCount = object2.droppedLinksCount >>> 0; + if (object2.status != null) { + if (typeof object2.status !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected"); + message.status = $root.opentelemetry.proto.trace.v1.Status.fromObject(object2.status); + } + return message; + }; + Span.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) { + object2.attributes = []; + object2.events = []; + object2.links = []; + } + if (options.defaults) { + if (options.bytes === String) + object2.traceId = ""; + else { + object2.traceId = []; + if (options.bytes !== Array) + object2.traceId = $util.newBuffer(object2.traceId); + } + if (options.bytes === String) + object2.spanId = ""; + else { + object2.spanId = []; + if (options.bytes !== Array) + object2.spanId = $util.newBuffer(object2.spanId); + } + object2.traceState = ""; + if (options.bytes === String) + object2.parentSpanId = ""; + else { + object2.parentSpanId = []; + if (options.bytes !== Array) + object2.parentSpanId = $util.newBuffer(object2.parentSpanId); + } + object2.name = ""; + object2.kind = options.enums === String ? "SPAN_KIND_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.endTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.endTimeUnixNano = options.longs === String ? "0" : 0; + object2.droppedAttributesCount = 0; + object2.droppedEventsCount = 0; + object2.droppedLinksCount = 0; + object2.status = null; + object2.flags = 0; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) + object2.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.spanId != null && message.hasOwnProperty("spanId")) + object2.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.traceState != null && message.hasOwnProperty("traceState")) + object2.traceState = message.traceState; + if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) + object2.parentSpanId = options.bytes === String ? $util.base64.encode(message.parentSpanId, 0, message.parentSpanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.parentSpanId) : message.parentSpanId; + if (message.name != null && message.hasOwnProperty("name")) + object2.name = message.name; + if (message.kind != null && message.hasOwnProperty("kind")) + object2.kind = options.enums === String ? $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] === undefined ? message.kind : $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] : message.kind; + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) + if (typeof message.startTimeUnixNano === "number") + object2.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else + object2.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) + if (typeof message.endTimeUnixNano === "number") + object2.endTimeUnixNano = options.longs === String ? String(message.endTimeUnixNano) : message.endTimeUnixNano; + else + object2.endTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.endTimeUnixNano.low >>> 0, message.endTimeUnixNano.high >>> 0).toNumber() : message.endTimeUnixNano; + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) + object2.droppedAttributesCount = message.droppedAttributesCount; + if (message.events && message.events.length) { + object2.events = []; + for (var j = 0;j < message.events.length; ++j) + object2.events[j] = $root.opentelemetry.proto.trace.v1.Span.Event.toObject(message.events[j], options); + } + if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) + object2.droppedEventsCount = message.droppedEventsCount; + if (message.links && message.links.length) { + object2.links = []; + for (var j = 0;j < message.links.length; ++j) + object2.links[j] = $root.opentelemetry.proto.trace.v1.Span.Link.toObject(message.links[j], options); + } + if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) + object2.droppedLinksCount = message.droppedLinksCount; + if (message.status != null && message.hasOwnProperty("status")) + object2.status = $root.opentelemetry.proto.trace.v1.Status.toObject(message.status, options); + if (message.flags != null && message.hasOwnProperty("flags")) + object2.flags = message.flags; + return object2; + }; + Span.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span"; + }; + Span.SpanKind = function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPAN_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "SPAN_KIND_INTERNAL"] = 1; + values[valuesById[2] = "SPAN_KIND_SERVER"] = 2; + values[valuesById[3] = "SPAN_KIND_CLIENT"] = 3; + values[valuesById[4] = "SPAN_KIND_PRODUCER"] = 4; + values[valuesById[5] = "SPAN_KIND_CONSUMER"] = 5; + return values; + }(); + Span.Event = function() { + function Event(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Event.prototype.timeUnixNano = null; + Event.prototype.name = null; + Event.prototype.attributes = $util.emptyArray; + Event.prototype.droppedAttributesCount = null; + Event.create = function create(properties) { + return new Event(properties); + }; + Event.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) + writer.uint32(9).fixed64(message.timeUnixNano); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(18).string(message.name); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) + writer.uint32(32).uint32(message.droppedAttributesCount); + return writer; + }; + Event.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Event.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Event; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.timeUnixNano = reader.fixed64(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 4: { + message.droppedAttributesCount = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Event.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Event.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) + return "timeUnixNano: integer|Long expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) + return "droppedAttributesCount: integer expected"; + } + return null; + }; + Event.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.trace.v1.Span.Event) + return object2; + var message = new $root.opentelemetry.proto.trace.v1.Span.Event; + if (object2.timeUnixNano != null) { + if ($util.Long) + (message.timeUnixNano = $util.Long.fromValue(object2.timeUnixNano)).unsigned = false; + else if (typeof object2.timeUnixNano === "string") + message.timeUnixNano = parseInt(object2.timeUnixNano, 10); + else if (typeof object2.timeUnixNano === "number") + message.timeUnixNano = object2.timeUnixNano; + else if (typeof object2.timeUnixNano === "object") + message.timeUnixNano = new $util.LongBits(object2.timeUnixNano.low >>> 0, object2.timeUnixNano.high >>> 0).toNumber(); + } + if (object2.name != null) + message.name = String(object2.name); + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.droppedAttributesCount != null) + message.droppedAttributesCount = object2.droppedAttributesCount >>> 0; + return message; + }; + Event.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.attributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.timeUnixNano = options.longs === String ? "0" : 0; + object2.name = ""; + object2.droppedAttributesCount = 0; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) + if (typeof message.timeUnixNano === "number") + object2.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else + object2.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.name != null && message.hasOwnProperty("name")) + object2.name = message.name; + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) + object2.droppedAttributesCount = message.droppedAttributesCount; + return object2; + }; + Event.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Event"; + }; + return Event; + }(); + Span.Link = function() { + function Link(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Link.prototype.traceId = null; + Link.prototype.spanId = null; + Link.prototype.traceState = null; + Link.prototype.attributes = $util.emptyArray; + Link.prototype.droppedAttributesCount = null; + Link.prototype.flags = null; + Link.create = function create(properties) { + return new Link(properties); + }; + Link.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(10).bytes(message.traceId); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) + writer.uint32(18).bytes(message.spanId); + if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) + writer.uint32(26).string(message.traceState); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(34).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) + writer.uint32(40).uint32(message.droppedAttributesCount); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(53).fixed32(message.flags); + return writer; + }; + Link.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Link.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Link; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.traceId = reader.bytes(); + break; + } + case 2: { + message.spanId = reader.bytes(); + break; + } + case 3: { + message.traceState = reader.string(); + break; + } + case 4: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 5: { + message.droppedAttributesCount = reader.uint32(); + break; + } + case 6: { + message.flags = reader.fixed32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Link.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Link.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) + return "traceId: buffer expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) + return "spanId: buffer expected"; + } + if (message.traceState != null && message.hasOwnProperty("traceState")) { + if (!$util.isString(message.traceState)) + return "traceState: string expected"; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) + return "droppedAttributesCount: integer expected"; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + } + return null; + }; + Link.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.trace.v1.Span.Link) + return object2; + var message = new $root.opentelemetry.proto.trace.v1.Span.Link; + if (object2.traceId != null) { + if (typeof object2.traceId === "string") + $util.base64.decode(object2.traceId, message.traceId = $util.newBuffer($util.base64.length(object2.traceId)), 0); + else if (object2.traceId.length >= 0) + message.traceId = object2.traceId; + } + if (object2.spanId != null) { + if (typeof object2.spanId === "string") + $util.base64.decode(object2.spanId, message.spanId = $util.newBuffer($util.base64.length(object2.spanId)), 0); + else if (object2.spanId.length >= 0) + message.spanId = object2.spanId; + } + if (object2.traceState != null) + message.traceState = String(object2.traceState); + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.droppedAttributesCount != null) + message.droppedAttributesCount = object2.droppedAttributesCount >>> 0; + if (object2.flags != null) + message.flags = object2.flags >>> 0; + return message; + }; + Link.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.attributes = []; + if (options.defaults) { + if (options.bytes === String) + object2.traceId = ""; + else { + object2.traceId = []; + if (options.bytes !== Array) + object2.traceId = $util.newBuffer(object2.traceId); + } + if (options.bytes === String) + object2.spanId = ""; + else { + object2.spanId = []; + if (options.bytes !== Array) + object2.spanId = $util.newBuffer(object2.spanId); + } + object2.traceState = ""; + object2.droppedAttributesCount = 0; + object2.flags = 0; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) + object2.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.spanId != null && message.hasOwnProperty("spanId")) + object2.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.traceState != null && message.hasOwnProperty("traceState")) + object2.traceState = message.traceState; + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) + object2.droppedAttributesCount = message.droppedAttributesCount; + if (message.flags != null && message.hasOwnProperty("flags")) + object2.flags = message.flags; + return object2; + }; + Link.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Link.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Link"; + }; + return Link; + }(); + return Span; + }(); + v1.Status = function() { + function Status(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Status.prototype.message = null; + Status.prototype.code = null; + Status.create = function create(properties) { + return new Status(properties); + }; + Status.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(18).string(message.message); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(24).int32(message.code); + return writer; + }; + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Status.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Status; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.code = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + if (!$util.isString(message.message)) + return "message: string expected"; + } + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + Status.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.trace.v1.Status) + return object2; + var message = new $root.opentelemetry.proto.trace.v1.Status; + if (object2.message != null) + message.message = String(object2.message); + switch (object2.code) { + default: + if (typeof object2.code === "number") { + message.code = object2.code; + break; + } + break; + case "STATUS_CODE_UNSET": + case 0: + message.code = 0; + break; + case "STATUS_CODE_OK": + case 1: + message.code = 1; + break; + case "STATUS_CODE_ERROR": + case 2: + message.code = 2; + break; + } + return message; + }; + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) { + object2.message = ""; + object2.code = options.enums === String ? "STATUS_CODE_UNSET" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object2.message = message.message; + if (message.code != null && message.hasOwnProperty("code")) + object2.code = options.enums === String ? $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] === undefined ? message.code : $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] : message.code; + return object2; + }; + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Status"; + }; + Status.StatusCode = function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_CODE_UNSET"] = 0; + values[valuesById[1] = "STATUS_CODE_OK"] = 1; + values[valuesById[2] = "STATUS_CODE_ERROR"] = 2; + return values; + }(); + return Status; + }(); + v1.SpanFlags = function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPAN_FLAGS_DO_NOT_USE"] = 0; + values[valuesById[255] = "SPAN_FLAGS_TRACE_FLAGS_MASK"] = 255; + values[valuesById[256] = "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"] = 256; + values[valuesById[512] = "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"] = 512; + return values; + }(); + return v1; + }(); + return trace; + }(); + proto.collector = function() { + var collector = {}; + collector.trace = function() { + var trace = {}; + trace.v1 = function() { + var v1 = {}; + v1.TraceService = function() { + function TraceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + (TraceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TraceService; + TraceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + Object.defineProperty(TraceService.prototype["export"] = function export_(request, callback) { + return this.rpcCall(export_, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse, request, callback); + }, "name", { value: "Export" }); + return TraceService; + }(); + v1.ExportTraceServiceRequest = function() { + function ExportTraceServiceRequest(properties) { + this.resourceSpans = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportTraceServiceRequest.prototype.resourceSpans = $util.emptyArray; + ExportTraceServiceRequest.create = function create(properties) { + return new ExportTraceServiceRequest(properties); + }; + ExportTraceServiceRequest.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceSpans != null && message.resourceSpans.length) + for (var i = 0;i < message.resourceSpans.length; ++i) + $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + ExportTraceServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportTraceServiceRequest.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceSpans && message.resourceSpans.length)) + message.resourceSpans = []; + message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportTraceServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportTraceServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { + if (!Array.isArray(message.resourceSpans)) + return "resourceSpans: array expected"; + for (var i = 0;i < message.resourceSpans.length; ++i) { + var error51 = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); + if (error51) + return "resourceSpans." + error51; + } + } + return null; + }; + ExportTraceServiceRequest.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) + return object2; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; + if (object2.resourceSpans) { + if (!Array.isArray(object2.resourceSpans)) + throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected"); + message.resourceSpans = []; + for (var i = 0;i < object2.resourceSpans.length; ++i) { + if (typeof object2.resourceSpans[i] !== "object") + throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected"); + message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object2.resourceSpans[i]); + } + } + return message; + }; + ExportTraceServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.resourceSpans = []; + if (message.resourceSpans && message.resourceSpans.length) { + object2.resourceSpans = []; + for (var j = 0;j < message.resourceSpans.length; ++j) + object2.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); + } + return object2; + }; + ExportTraceServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportTraceServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"; + }; + return ExportTraceServiceRequest; + }(); + v1.ExportTraceServiceResponse = function() { + function ExportTraceServiceResponse(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportTraceServiceResponse.prototype.partialSuccess = null; + ExportTraceServiceResponse.create = function create(properties) { + return new ExportTraceServiceResponse(properties); + }; + ExportTraceServiceResponse.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) + $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); + return writer; + }; + ExportTraceServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportTraceServiceResponse.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportTraceServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportTraceServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { + var error51 = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(message.partialSuccess); + if (error51) + return "partialSuccess." + error51; + } + return null; + }; + ExportTraceServiceResponse.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse) + return object2; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; + if (object2.partialSuccess != null) { + if (typeof object2.partialSuccess !== "object") + throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(object2.partialSuccess); + } + return message; + }; + ExportTraceServiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) + object2.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) + object2.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(message.partialSuccess, options); + return object2; + }; + ExportTraceServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportTraceServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"; + }; + return ExportTraceServiceResponse; + }(); + v1.ExportTracePartialSuccess = function() { + function ExportTracePartialSuccess(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportTracePartialSuccess.prototype.rejectedSpans = null; + ExportTracePartialSuccess.prototype.errorMessage = null; + ExportTracePartialSuccess.create = function create(properties) { + return new ExportTracePartialSuccess(properties); + }; + ExportTracePartialSuccess.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rejectedSpans != null && Object.hasOwnProperty.call(message, "rejectedSpans")) + writer.uint32(8).int64(message.rejectedSpans); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(18).string(message.errorMessage); + return writer; + }; + ExportTracePartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportTracePartialSuccess.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.rejectedSpans = reader.int64(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportTracePartialSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportTracePartialSuccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) { + if (!$util.isInteger(message.rejectedSpans) && !(message.rejectedSpans && $util.isInteger(message.rejectedSpans.low) && $util.isInteger(message.rejectedSpans.high))) + return "rejectedSpans: integer|Long expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + } + return null; + }; + ExportTracePartialSuccess.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess) + return object2; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess; + if (object2.rejectedSpans != null) { + if ($util.Long) + (message.rejectedSpans = $util.Long.fromValue(object2.rejectedSpans)).unsigned = false; + else if (typeof object2.rejectedSpans === "string") + message.rejectedSpans = parseInt(object2.rejectedSpans, 10); + else if (typeof object2.rejectedSpans === "number") + message.rejectedSpans = object2.rejectedSpans; + else if (typeof object2.rejectedSpans === "object") + message.rejectedSpans = new $util.LongBits(object2.rejectedSpans.low >>> 0, object2.rejectedSpans.high >>> 0).toNumber(); + } + if (object2.errorMessage != null) + message.errorMessage = String(object2.errorMessage); + return message; + }; + ExportTracePartialSuccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.rejectedSpans = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.rejectedSpans = options.longs === String ? "0" : 0; + object2.errorMessage = ""; + } + if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) + if (typeof message.rejectedSpans === "number") + object2.rejectedSpans = options.longs === String ? String(message.rejectedSpans) : message.rejectedSpans; + else + object2.rejectedSpans = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedSpans) : options.longs === Number ? new $util.LongBits(message.rejectedSpans.low >>> 0, message.rejectedSpans.high >>> 0).toNumber() : message.rejectedSpans; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object2.errorMessage = message.errorMessage; + return object2; + }; + ExportTracePartialSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportTracePartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"; + }; + return ExportTracePartialSuccess; + }(); + return v1; + }(); + return trace; + }(); + collector.metrics = function() { + var metrics = {}; + metrics.v1 = function() { + var v1 = {}; + v1.MetricsService = function() { + function MetricsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + (MetricsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsService; + MetricsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + Object.defineProperty(MetricsService.prototype["export"] = function export_(request, callback) { + return this.rpcCall(export_, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse, request, callback); + }, "name", { value: "Export" }); + return MetricsService; + }(); + v1.ExportMetricsServiceRequest = function() { + function ExportMetricsServiceRequest(properties) { + this.resourceMetrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportMetricsServiceRequest.prototype.resourceMetrics = $util.emptyArray; + ExportMetricsServiceRequest.create = function create(properties) { + return new ExportMetricsServiceRequest(properties); + }; + ExportMetricsServiceRequest.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceMetrics != null && message.resourceMetrics.length) + for (var i = 0;i < message.resourceMetrics.length; ++i) + $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + ExportMetricsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportMetricsServiceRequest.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceMetrics && message.resourceMetrics.length)) + message.resourceMetrics = []; + message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportMetricsServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportMetricsServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { + if (!Array.isArray(message.resourceMetrics)) + return "resourceMetrics: array expected"; + for (var i = 0;i < message.resourceMetrics.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); + if (error51) + return "resourceMetrics." + error51; + } + } + return null; + }; + ExportMetricsServiceRequest.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) + return object2; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; + if (object2.resourceMetrics) { + if (!Array.isArray(object2.resourceMetrics)) + throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected"); + message.resourceMetrics = []; + for (var i = 0;i < object2.resourceMetrics.length; ++i) { + if (typeof object2.resourceMetrics[i] !== "object") + throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected"); + message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object2.resourceMetrics[i]); + } + } + return message; + }; + ExportMetricsServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.resourceMetrics = []; + if (message.resourceMetrics && message.resourceMetrics.length) { + object2.resourceMetrics = []; + for (var j = 0;j < message.resourceMetrics.length; ++j) + object2.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); + } + return object2; + }; + ExportMetricsServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportMetricsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"; + }; + return ExportMetricsServiceRequest; + }(); + v1.ExportMetricsServiceResponse = function() { + function ExportMetricsServiceResponse(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportMetricsServiceResponse.prototype.partialSuccess = null; + ExportMetricsServiceResponse.create = function create(properties) { + return new ExportMetricsServiceResponse(properties); + }; + ExportMetricsServiceResponse.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) + $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); + return writer; + }; + ExportMetricsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportMetricsServiceResponse.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportMetricsServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportMetricsServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { + var error51 = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(message.partialSuccess); + if (error51) + return "partialSuccess." + error51; + } + return null; + }; + ExportMetricsServiceResponse.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse) + return object2; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; + if (object2.partialSuccess != null) { + if (typeof object2.partialSuccess !== "object") + throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(object2.partialSuccess); + } + return message; + }; + ExportMetricsServiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) + object2.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) + object2.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(message.partialSuccess, options); + return object2; + }; + ExportMetricsServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportMetricsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"; + }; + return ExportMetricsServiceResponse; + }(); + v1.ExportMetricsPartialSuccess = function() { + function ExportMetricsPartialSuccess(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportMetricsPartialSuccess.prototype.rejectedDataPoints = null; + ExportMetricsPartialSuccess.prototype.errorMessage = null; + ExportMetricsPartialSuccess.create = function create(properties) { + return new ExportMetricsPartialSuccess(properties); + }; + ExportMetricsPartialSuccess.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rejectedDataPoints != null && Object.hasOwnProperty.call(message, "rejectedDataPoints")) + writer.uint32(8).int64(message.rejectedDataPoints); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(18).string(message.errorMessage); + return writer; + }; + ExportMetricsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportMetricsPartialSuccess.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.rejectedDataPoints = reader.int64(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportMetricsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportMetricsPartialSuccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) { + if (!$util.isInteger(message.rejectedDataPoints) && !(message.rejectedDataPoints && $util.isInteger(message.rejectedDataPoints.low) && $util.isInteger(message.rejectedDataPoints.high))) + return "rejectedDataPoints: integer|Long expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + } + return null; + }; + ExportMetricsPartialSuccess.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess) + return object2; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess; + if (object2.rejectedDataPoints != null) { + if ($util.Long) + (message.rejectedDataPoints = $util.Long.fromValue(object2.rejectedDataPoints)).unsigned = false; + else if (typeof object2.rejectedDataPoints === "string") + message.rejectedDataPoints = parseInt(object2.rejectedDataPoints, 10); + else if (typeof object2.rejectedDataPoints === "number") + message.rejectedDataPoints = object2.rejectedDataPoints; + else if (typeof object2.rejectedDataPoints === "object") + message.rejectedDataPoints = new $util.LongBits(object2.rejectedDataPoints.low >>> 0, object2.rejectedDataPoints.high >>> 0).toNumber(); + } + if (object2.errorMessage != null) + message.errorMessage = String(object2.errorMessage); + return message; + }; + ExportMetricsPartialSuccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.rejectedDataPoints = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.rejectedDataPoints = options.longs === String ? "0" : 0; + object2.errorMessage = ""; + } + if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) + if (typeof message.rejectedDataPoints === "number") + object2.rejectedDataPoints = options.longs === String ? String(message.rejectedDataPoints) : message.rejectedDataPoints; + else + object2.rejectedDataPoints = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedDataPoints) : options.longs === Number ? new $util.LongBits(message.rejectedDataPoints.low >>> 0, message.rejectedDataPoints.high >>> 0).toNumber() : message.rejectedDataPoints; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object2.errorMessage = message.errorMessage; + return object2; + }; + ExportMetricsPartialSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportMetricsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"; + }; + return ExportMetricsPartialSuccess; + }(); + return v1; + }(); + return metrics; + }(); + collector.logs = function() { + var logs = {}; + logs.v1 = function() { + var v1 = {}; + v1.LogsService = function() { + function LogsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + (LogsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LogsService; + LogsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + Object.defineProperty(LogsService.prototype["export"] = function export_(request, callback) { + return this.rpcCall(export_, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse, request, callback); + }, "name", { value: "Export" }); + return LogsService; + }(); + v1.ExportLogsServiceRequest = function() { + function ExportLogsServiceRequest(properties) { + this.resourceLogs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportLogsServiceRequest.prototype.resourceLogs = $util.emptyArray; + ExportLogsServiceRequest.create = function create(properties) { + return new ExportLogsServiceRequest(properties); + }; + ExportLogsServiceRequest.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceLogs != null && message.resourceLogs.length) + for (var i = 0;i < message.resourceLogs.length; ++i) + $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + ExportLogsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportLogsServiceRequest.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceLogs && message.resourceLogs.length)) + message.resourceLogs = []; + message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportLogsServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportLogsServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { + if (!Array.isArray(message.resourceLogs)) + return "resourceLogs: array expected"; + for (var i = 0;i < message.resourceLogs.length; ++i) { + var error51 = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); + if (error51) + return "resourceLogs." + error51; + } + } + return null; + }; + ExportLogsServiceRequest.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) + return object2; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; + if (object2.resourceLogs) { + if (!Array.isArray(object2.resourceLogs)) + throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected"); + message.resourceLogs = []; + for (var i = 0;i < object2.resourceLogs.length; ++i) { + if (typeof object2.resourceLogs[i] !== "object") + throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected"); + message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object2.resourceLogs[i]); + } + } + return message; + }; + ExportLogsServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.resourceLogs = []; + if (message.resourceLogs && message.resourceLogs.length) { + object2.resourceLogs = []; + for (var j = 0;j < message.resourceLogs.length; ++j) + object2.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); + } + return object2; + }; + ExportLogsServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportLogsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"; + }; + return ExportLogsServiceRequest; + }(); + v1.ExportLogsServiceResponse = function() { + function ExportLogsServiceResponse(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportLogsServiceResponse.prototype.partialSuccess = null; + ExportLogsServiceResponse.create = function create(properties) { + return new ExportLogsServiceResponse(properties); + }; + ExportLogsServiceResponse.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) + $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); + return writer; + }; + ExportLogsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportLogsServiceResponse.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportLogsServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportLogsServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { + var error51 = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(message.partialSuccess); + if (error51) + return "partialSuccess." + error51; + } + return null; + }; + ExportLogsServiceResponse.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse) + return object2; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; + if (object2.partialSuccess != null) { + if (typeof object2.partialSuccess !== "object") + throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(object2.partialSuccess); + } + return message; + }; + ExportLogsServiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) + object2.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) + object2.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(message.partialSuccess, options); + return object2; + }; + ExportLogsServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportLogsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"; + }; + return ExportLogsServiceResponse; + }(); + v1.ExportLogsPartialSuccess = function() { + function ExportLogsPartialSuccess(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExportLogsPartialSuccess.prototype.rejectedLogRecords = null; + ExportLogsPartialSuccess.prototype.errorMessage = null; + ExportLogsPartialSuccess.create = function create(properties) { + return new ExportLogsPartialSuccess(properties); + }; + ExportLogsPartialSuccess.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rejectedLogRecords != null && Object.hasOwnProperty.call(message, "rejectedLogRecords")) + writer.uint32(8).int64(message.rejectedLogRecords); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(18).string(message.errorMessage); + return writer; + }; + ExportLogsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExportLogsPartialSuccess.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.rejectedLogRecords = reader.int64(); + break; + } + case 2: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExportLogsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExportLogsPartialSuccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) { + if (!$util.isInteger(message.rejectedLogRecords) && !(message.rejectedLogRecords && $util.isInteger(message.rejectedLogRecords.low) && $util.isInteger(message.rejectedLogRecords.high))) + return "rejectedLogRecords: integer|Long expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + } + return null; + }; + ExportLogsPartialSuccess.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess) + return object2; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess; + if (object2.rejectedLogRecords != null) { + if ($util.Long) + (message.rejectedLogRecords = $util.Long.fromValue(object2.rejectedLogRecords)).unsigned = false; + else if (typeof object2.rejectedLogRecords === "string") + message.rejectedLogRecords = parseInt(object2.rejectedLogRecords, 10); + else if (typeof object2.rejectedLogRecords === "number") + message.rejectedLogRecords = object2.rejectedLogRecords; + else if (typeof object2.rejectedLogRecords === "object") + message.rejectedLogRecords = new $util.LongBits(object2.rejectedLogRecords.low >>> 0, object2.rejectedLogRecords.high >>> 0).toNumber(); + } + if (object2.errorMessage != null) + message.errorMessage = String(object2.errorMessage); + return message; + }; + ExportLogsPartialSuccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.rejectedLogRecords = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.rejectedLogRecords = options.longs === String ? "0" : 0; + object2.errorMessage = ""; + } + if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) + if (typeof message.rejectedLogRecords === "number") + object2.rejectedLogRecords = options.longs === String ? String(message.rejectedLogRecords) : message.rejectedLogRecords; + else + object2.rejectedLogRecords = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedLogRecords) : options.longs === Number ? new $util.LongBits(message.rejectedLogRecords.low >>> 0, message.rejectedLogRecords.high >>> 0).toNumber() : message.rejectedLogRecords; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object2.errorMessage = message.errorMessage; + return object2; + }; + ExportLogsPartialSuccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExportLogsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"; + }; + return ExportLogsPartialSuccess; + }(); + return v1; + }(); + return logs; + }(); + return collector; + }(); + proto.metrics = function() { + var metrics = {}; + metrics.v1 = function() { + var v1 = {}; + v1.MetricsData = function() { + function MetricsData(properties) { + this.resourceMetrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + MetricsData.prototype.resourceMetrics = $util.emptyArray; + MetricsData.create = function create(properties) { + return new MetricsData(properties); + }; + MetricsData.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceMetrics != null && message.resourceMetrics.length) + for (var i = 0;i < message.resourceMetrics.length; ++i) + $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + MetricsData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + MetricsData.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.MetricsData; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceMetrics && message.resourceMetrics.length)) + message.resourceMetrics = []; + message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + MetricsData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + MetricsData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { + if (!Array.isArray(message.resourceMetrics)) + return "resourceMetrics: array expected"; + for (var i = 0;i < message.resourceMetrics.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); + if (error51) + return "resourceMetrics." + error51; + } + } + return null; + }; + MetricsData.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.MetricsData) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.MetricsData; + if (object2.resourceMetrics) { + if (!Array.isArray(object2.resourceMetrics)) + throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected"); + message.resourceMetrics = []; + for (var i = 0;i < object2.resourceMetrics.length; ++i) { + if (typeof object2.resourceMetrics[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected"); + message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object2.resourceMetrics[i]); + } + } + return message; + }; + MetricsData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.resourceMetrics = []; + if (message.resourceMetrics && message.resourceMetrics.length) { + object2.resourceMetrics = []; + for (var j = 0;j < message.resourceMetrics.length; ++j) + object2.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); + } + return object2; + }; + MetricsData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + MetricsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.MetricsData"; + }; + return MetricsData; + }(); + v1.ResourceMetrics = function() { + function ResourceMetrics(properties) { + this.scopeMetrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ResourceMetrics.prototype.resource = null; + ResourceMetrics.prototype.scopeMetrics = $util.emptyArray; + ResourceMetrics.prototype.schemaUrl = null; + ResourceMetrics.create = function create(properties) { + return new ResourceMetrics(properties); + }; + ResourceMetrics.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + if (message.scopeMetrics != null && message.scopeMetrics.length) + for (var i = 0;i < message.scopeMetrics.length; ++i) + $root.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(message.scopeMetrics[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) + writer.uint32(26).string(message.schemaUrl); + return writer; + }; + ResourceMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ResourceMetrics.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.scopeMetrics && message.scopeMetrics.length)) + message.scopeMetrics = []; + message.scopeMetrics.push($root.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(reader, reader.uint32())); + break; + } + case 3: { + message.schemaUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ResourceMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ResourceMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error51 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error51) + return "resource." + error51; + } + if (message.scopeMetrics != null && message.hasOwnProperty("scopeMetrics")) { + if (!Array.isArray(message.scopeMetrics)) + return "scopeMetrics: array expected"; + for (var i = 0;i < message.scopeMetrics.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(message.scopeMetrics[i]); + if (error51) + return "scopeMetrics." + error51; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) + return "schemaUrl: string expected"; + } + return null; + }; + ResourceMetrics.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.ResourceMetrics) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics; + if (object2.resource != null) { + if (typeof object2.resource !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object2.resource); + } + if (object2.scopeMetrics) { + if (!Array.isArray(object2.scopeMetrics)) + throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected"); + message.scopeMetrics = []; + for (var i = 0;i < object2.scopeMetrics.length; ++i) { + if (typeof object2.scopeMetrics[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected"); + message.scopeMetrics[i] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(object2.scopeMetrics[i]); + } + } + if (object2.schemaUrl != null) + message.schemaUrl = String(object2.schemaUrl); + return message; + }; + ResourceMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.scopeMetrics = []; + if (options.defaults) { + object2.resource = null; + object2.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object2.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeMetrics && message.scopeMetrics.length) { + object2.scopeMetrics = []; + for (var j = 0;j < message.scopeMetrics.length; ++j) + object2.scopeMetrics[j] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(message.scopeMetrics[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) + object2.schemaUrl = message.schemaUrl; + return object2; + }; + ResourceMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ResourceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ResourceMetrics"; + }; + return ResourceMetrics; + }(); + v1.ScopeMetrics = function() { + function ScopeMetrics(properties) { + this.metrics = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ScopeMetrics.prototype.scope = null; + ScopeMetrics.prototype.metrics = $util.emptyArray; + ScopeMetrics.prototype.schemaUrl = null; + ScopeMetrics.create = function create(properties) { + return new ScopeMetrics(properties); + }; + ScopeMetrics.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0;i < message.metrics.length; ++i) + $root.opentelemetry.proto.metrics.v1.Metric.encode(message.metrics[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) + writer.uint32(26).string(message.schemaUrl); + return writer; + }; + ScopeMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ScopeMetrics.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.opentelemetry.proto.metrics.v1.Metric.decode(reader, reader.uint32())); + break; + } + case 3: { + message.schemaUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ScopeMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ScopeMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) { + var error51 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error51) + return "scope." + error51; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0;i < message.metrics.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.Metric.verify(message.metrics[i]); + if (error51) + return "metrics." + error51; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) + return "schemaUrl: string expected"; + } + return null; + }; + ScopeMetrics.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.ScopeMetrics) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics; + if (object2.scope != null) { + if (typeof object2.scope !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object2.scope); + } + if (object2.metrics) { + if (!Array.isArray(object2.metrics)) + throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected"); + message.metrics = []; + for (var i = 0;i < object2.metrics.length; ++i) { + if (typeof object2.metrics[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected"); + message.metrics[i] = $root.opentelemetry.proto.metrics.v1.Metric.fromObject(object2.metrics[i]); + } + } + if (object2.schemaUrl != null) + message.schemaUrl = String(object2.schemaUrl); + return message; + }; + ScopeMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.metrics = []; + if (options.defaults) { + object2.scope = null; + object2.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object2.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.metrics && message.metrics.length) { + object2.metrics = []; + for (var j = 0;j < message.metrics.length; ++j) + object2.metrics[j] = $root.opentelemetry.proto.metrics.v1.Metric.toObject(message.metrics[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) + object2.schemaUrl = message.schemaUrl; + return object2; + }; + ScopeMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ScopeMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ScopeMetrics"; + }; + return ScopeMetrics; + }(); + v1.Metric = function() { + function Metric(properties) { + this.metadata = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Metric.prototype.name = null; + Metric.prototype.description = null; + Metric.prototype.unit = null; + Metric.prototype.gauge = null; + Metric.prototype.sum = null; + Metric.prototype.histogram = null; + Metric.prototype.exponentialHistogram = null; + Metric.prototype.summary = null; + Metric.prototype.metadata = $util.emptyArray; + var $oneOfFields; + Object.defineProperty(Metric.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["gauge", "sum", "histogram", "exponentialHistogram", "summary"]), + set: $util.oneOfSetter($oneOfFields) + }); + Metric.create = function create(properties) { + return new Metric(properties); + }; + Metric.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(18).string(message.description); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(26).string(message.unit); + if (message.gauge != null && Object.hasOwnProperty.call(message, "gauge")) + $root.opentelemetry.proto.metrics.v1.Gauge.encode(message.gauge, writer.uint32(42).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.opentelemetry.proto.metrics.v1.Sum.encode(message.sum, writer.uint32(58).fork()).ldelim(); + if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) + $root.opentelemetry.proto.metrics.v1.Histogram.encode(message.histogram, writer.uint32(74).fork()).ldelim(); + if (message.exponentialHistogram != null && Object.hasOwnProperty.call(message, "exponentialHistogram")) + $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(message.exponentialHistogram, writer.uint32(82).fork()).ldelim(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + $root.opentelemetry.proto.metrics.v1.Summary.encode(message.summary, writer.uint32(90).fork()).ldelim(); + if (message.metadata != null && message.metadata.length) + for (var i = 0;i < message.metadata.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.metadata[i], writer.uint32(98).fork()).ldelim(); + return writer; + }; + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Metric.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Metric; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.unit = reader.string(); + break; + } + case 5: { + message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.decode(reader, reader.uint32()); + break; + } + case 7: { + message.sum = $root.opentelemetry.proto.metrics.v1.Sum.decode(reader, reader.uint32()); + break; + } + case 9: { + message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.decode(reader, reader.uint32()); + break; + } + case 10: { + message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(reader, reader.uint32()); + break; + } + case 11: { + message.summary = $root.opentelemetry.proto.metrics.v1.Summary.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.metadata && message.metadata.length)) + message.metadata = []; + message.metadata.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Metric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.unit != null && message.hasOwnProperty("unit")) { + if (!$util.isString(message.unit)) + return "unit: string expected"; + } + if (message.gauge != null && message.hasOwnProperty("gauge")) { + properties.data = 1; + { + var error51 = $root.opentelemetry.proto.metrics.v1.Gauge.verify(message.gauge); + if (error51) + return "gauge." + error51; + } + } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error51 = $root.opentelemetry.proto.metrics.v1.Sum.verify(message.sum); + if (error51) + return "sum." + error51; + } + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error51 = $root.opentelemetry.proto.metrics.v1.Histogram.verify(message.histogram); + if (error51) + return "histogram." + error51; + } + } + if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error51 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(message.exponentialHistogram); + if (error51) + return "exponentialHistogram." + error51; + } + } + if (message.summary != null && message.hasOwnProperty("summary")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error51 = $root.opentelemetry.proto.metrics.v1.Summary.verify(message.summary); + if (error51) + return "summary." + error51; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!Array.isArray(message.metadata)) + return "metadata: array expected"; + for (var i = 0;i < message.metadata.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.metadata[i]); + if (error51) + return "metadata." + error51; + } + } + return null; + }; + Metric.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.Metric) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.Metric; + if (object2.name != null) + message.name = String(object2.name); + if (object2.description != null) + message.description = String(object2.description); + if (object2.unit != null) + message.unit = String(object2.unit); + if (object2.gauge != null) { + if (typeof object2.gauge !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected"); + message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.fromObject(object2.gauge); + } + if (object2.sum != null) { + if (typeof object2.sum !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected"); + message.sum = $root.opentelemetry.proto.metrics.v1.Sum.fromObject(object2.sum); + } + if (object2.histogram != null) { + if (typeof object2.histogram !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected"); + message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.fromObject(object2.histogram); + } + if (object2.exponentialHistogram != null) { + if (typeof object2.exponentialHistogram !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected"); + message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(object2.exponentialHistogram); + } + if (object2.summary != null) { + if (typeof object2.summary !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected"); + message.summary = $root.opentelemetry.proto.metrics.v1.Summary.fromObject(object2.summary); + } + if (object2.metadata) { + if (!Array.isArray(object2.metadata)) + throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected"); + message.metadata = []; + for (var i = 0;i < object2.metadata.length; ++i) { + if (typeof object2.metadata[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected"); + message.metadata[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.metadata[i]); + } + } + return message; + }; + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.metadata = []; + if (options.defaults) { + object2.name = ""; + object2.description = ""; + object2.unit = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object2.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object2.description = message.description; + if (message.unit != null && message.hasOwnProperty("unit")) + object2.unit = message.unit; + if (message.gauge != null && message.hasOwnProperty("gauge")) { + object2.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.toObject(message.gauge, options); + if (options.oneofs) + object2.data = "gauge"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + object2.sum = $root.opentelemetry.proto.metrics.v1.Sum.toObject(message.sum, options); + if (options.oneofs) + object2.data = "sum"; + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + object2.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.toObject(message.histogram, options); + if (options.oneofs) + object2.data = "histogram"; + } + if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { + object2.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(message.exponentialHistogram, options); + if (options.oneofs) + object2.data = "exponentialHistogram"; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + object2.summary = $root.opentelemetry.proto.metrics.v1.Summary.toObject(message.summary, options); + if (options.oneofs) + object2.data = "summary"; + } + if (message.metadata && message.metadata.length) { + object2.metadata = []; + for (var j = 0;j < message.metadata.length; ++j) + object2.metadata[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.metadata[j], options); + } + return object2; + }; + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Metric"; + }; + return Metric; + }(); + v1.Gauge = function() { + function Gauge(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Gauge.prototype.dataPoints = $util.emptyArray; + Gauge.create = function create(properties) { + return new Gauge(properties); + }; + Gauge.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0;i < message.dataPoints.length; ++i) + $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + Gauge.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Gauge.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Gauge; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Gauge.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Gauge.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0;i < message.dataPoints.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); + if (error51) + return "dataPoints." + error51; + } + } + return null; + }; + Gauge.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.Gauge) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.Gauge; + if (object2.dataPoints) { + if (!Array.isArray(object2.dataPoints)) + throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0;i < object2.dataPoints.length; ++i) { + if (typeof object2.dataPoints[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object2.dataPoints[i]); + } + } + return message; + }; + Gauge.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object2.dataPoints = []; + for (var j = 0;j < message.dataPoints.length; ++j) + object2.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); + } + return object2; + }; + Gauge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Gauge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Gauge"; + }; + return Gauge; + }(); + v1.Sum = function() { + function Sum(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Sum.prototype.dataPoints = $util.emptyArray; + Sum.prototype.aggregationTemporality = null; + Sum.prototype.isMonotonic = null; + Sum.create = function create(properties) { + return new Sum(properties); + }; + Sum.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0;i < message.dataPoints.length; ++i) + $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) + writer.uint32(16).int32(message.aggregationTemporality); + if (message.isMonotonic != null && Object.hasOwnProperty.call(message, "isMonotonic")) + writer.uint32(24).bool(message.isMonotonic); + return writer; + }; + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Sum.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Sum; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.aggregationTemporality = reader.int32(); + break; + } + case 3: { + message.isMonotonic = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0;i < message.dataPoints.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); + if (error51) + return "dataPoints." + error51; + } + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) + switch (message.aggregationTemporality) { + default: + return "aggregationTemporality: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) { + if (typeof message.isMonotonic !== "boolean") + return "isMonotonic: boolean expected"; + } + return null; + }; + Sum.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.Sum) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.Sum; + if (object2.dataPoints) { + if (!Array.isArray(object2.dataPoints)) + throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0;i < object2.dataPoints.length; ++i) { + if (typeof object2.dataPoints[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object2.dataPoints[i]); + } + } + switch (object2.aggregationTemporality) { + default: + if (typeof object2.aggregationTemporality === "number") { + message.aggregationTemporality = object2.aggregationTemporality; + break; + } + break; + case "AGGREGATION_TEMPORALITY_UNSPECIFIED": + case 0: + message.aggregationTemporality = 0; + break; + case "AGGREGATION_TEMPORALITY_DELTA": + case 1: + message.aggregationTemporality = 1; + break; + case "AGGREGATION_TEMPORALITY_CUMULATIVE": + case 2: + message.aggregationTemporality = 2; + break; + } + if (object2.isMonotonic != null) + message.isMonotonic = Boolean(object2.isMonotonic); + return message; + }; + Sum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.dataPoints = []; + if (options.defaults) { + object2.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + object2.isMonotonic = false; + } + if (message.dataPoints && message.dataPoints.length) { + object2.dataPoints = []; + for (var j = 0;j < message.dataPoints.length; ++j) + object2.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) + object2.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === undefined ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; + if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) + object2.isMonotonic = message.isMonotonic; + return object2; + }; + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Sum"; + }; + return Sum; + }(); + v1.Histogram = function() { + function Histogram(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Histogram.prototype.dataPoints = $util.emptyArray; + Histogram.prototype.aggregationTemporality = null; + Histogram.create = function create(properties) { + return new Histogram(properties); + }; + Histogram.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0;i < message.dataPoints.length; ++i) + $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) + writer.uint32(16).int32(message.aggregationTemporality); + return writer; + }; + Histogram.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Histogram.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Histogram; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.aggregationTemporality = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Histogram.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Histogram.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0;i < message.dataPoints.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(message.dataPoints[i]); + if (error51) + return "dataPoints." + error51; + } + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) + switch (message.aggregationTemporality) { + default: + return "aggregationTemporality: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + Histogram.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.Histogram) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.Histogram; + if (object2.dataPoints) { + if (!Array.isArray(object2.dataPoints)) + throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0;i < object2.dataPoints.length; ++i) { + if (typeof object2.dataPoints[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(object2.dataPoints[i]); + } + } + switch (object2.aggregationTemporality) { + default: + if (typeof object2.aggregationTemporality === "number") { + message.aggregationTemporality = object2.aggregationTemporality; + break; + } + break; + case "AGGREGATION_TEMPORALITY_UNSPECIFIED": + case 0: + message.aggregationTemporality = 0; + break; + case "AGGREGATION_TEMPORALITY_DELTA": + case 1: + message.aggregationTemporality = 1; + break; + case "AGGREGATION_TEMPORALITY_CUMULATIVE": + case 2: + message.aggregationTemporality = 2; + break; + } + return message; + }; + Histogram.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.dataPoints = []; + if (options.defaults) + object2.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + if (message.dataPoints && message.dataPoints.length) { + object2.dataPoints = []; + for (var j = 0;j < message.dataPoints.length; ++j) + object2.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) + object2.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === undefined ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; + return object2; + }; + Histogram.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Histogram"; + }; + return Histogram; + }(); + v1.ExponentialHistogram = function() { + function ExponentialHistogram(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExponentialHistogram.prototype.dataPoints = $util.emptyArray; + ExponentialHistogram.prototype.aggregationTemporality = null; + ExponentialHistogram.create = function create(properties) { + return new ExponentialHistogram(properties); + }; + ExponentialHistogram.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0;i < message.dataPoints.length; ++i) + $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) + writer.uint32(16).int32(message.aggregationTemporality); + return writer; + }; + ExponentialHistogram.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExponentialHistogram.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.aggregationTemporality = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExponentialHistogram.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExponentialHistogram.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0;i < message.dataPoints.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(message.dataPoints[i]); + if (error51) + return "dataPoints." + error51; + } + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) + switch (message.aggregationTemporality) { + default: + return "aggregationTemporality: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + ExponentialHistogram.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogram) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram; + if (object2.dataPoints) { + if (!Array.isArray(object2.dataPoints)) + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0;i < object2.dataPoints.length; ++i) { + if (typeof object2.dataPoints[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(object2.dataPoints[i]); + } + } + switch (object2.aggregationTemporality) { + default: + if (typeof object2.aggregationTemporality === "number") { + message.aggregationTemporality = object2.aggregationTemporality; + break; + } + break; + case "AGGREGATION_TEMPORALITY_UNSPECIFIED": + case 0: + message.aggregationTemporality = 0; + break; + case "AGGREGATION_TEMPORALITY_DELTA": + case 1: + message.aggregationTemporality = 1; + break; + case "AGGREGATION_TEMPORALITY_CUMULATIVE": + case 2: + message.aggregationTemporality = 2; + break; + } + return message; + }; + ExponentialHistogram.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.dataPoints = []; + if (options.defaults) + object2.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + if (message.dataPoints && message.dataPoints.length) { + object2.dataPoints = []; + for (var j = 0;j < message.dataPoints.length; ++j) + object2.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) + object2.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === undefined ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; + return object2; + }; + ExponentialHistogram.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExponentialHistogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogram"; + }; + return ExponentialHistogram; + }(); + v1.Summary = function() { + function Summary(properties) { + this.dataPoints = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Summary.prototype.dataPoints = $util.emptyArray; + Summary.create = function create(properties) { + return new Summary(properties); + }; + Summary.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0;i < message.dataPoints.length; ++i) + $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + Summary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Summary.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Summary; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Summary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Summary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0;i < message.dataPoints.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(message.dataPoints[i]); + if (error51) + return "dataPoints." + error51; + } + } + return null; + }; + Summary.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.Summary) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.Summary; + if (object2.dataPoints) { + if (!Array.isArray(object2.dataPoints)) + throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0;i < object2.dataPoints.length; ++i) { + if (typeof object2.dataPoints[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(object2.dataPoints[i]); + } + } + return message; + }; + Summary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object2.dataPoints = []; + for (var j = 0;j < message.dataPoints.length; ++j) + object2.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(message.dataPoints[j], options); + } + return object2; + }; + Summary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Summary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Summary"; + }; + return Summary; + }(); + v1.AggregationTemporality = function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGGREGATION_TEMPORALITY_DELTA"] = 1; + values[valuesById[2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2; + return values; + }(); + v1.DataPointFlags = function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_POINT_FLAGS_DO_NOT_USE"] = 0; + values[valuesById[1] = "DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"] = 1; + return values; + }(); + v1.NumberDataPoint = function() { + function NumberDataPoint(properties) { + this.attributes = []; + this.exemplars = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + NumberDataPoint.prototype.attributes = $util.emptyArray; + NumberDataPoint.prototype.startTimeUnixNano = null; + NumberDataPoint.prototype.timeUnixNano = null; + NumberDataPoint.prototype.asDouble = null; + NumberDataPoint.prototype.asInt = null; + NumberDataPoint.prototype.exemplars = $util.emptyArray; + NumberDataPoint.prototype.flags = null; + var $oneOfFields; + Object.defineProperty(NumberDataPoint.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), + set: $util.oneOfSetter($oneOfFields) + }); + NumberDataPoint.create = function create(properties) { + return new NumberDataPoint(properties); + }; + NumberDataPoint.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) + writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) + writer.uint32(25).fixed64(message.timeUnixNano); + if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) + writer.uint32(33).double(message.asDouble); + if (message.exemplars != null && message.exemplars.length) + for (var i = 0;i < message.exemplars.length; ++i) + $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(42).fork()).ldelim(); + if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) + writer.uint32(49).sfixed64(message.asInt); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(64).uint32(message.flags); + return writer; + }; + NumberDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + NumberDataPoint.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 7: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.startTimeUnixNano = reader.fixed64(); + break; + } + case 3: { + message.timeUnixNano = reader.fixed64(); + break; + } + case 4: { + message.asDouble = reader.double(); + break; + } + case 6: { + message.asInt = reader.sfixed64(); + break; + } + case 5: { + if (!(message.exemplars && message.exemplars.length)) + message.exemplars = []; + message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); + break; + } + case 8: { + message.flags = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + NumberDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + NumberDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) + return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) + return "timeUnixNano: integer|Long expected"; + } + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + properties.value = 1; + if (typeof message.asDouble !== "number") + return "asDouble: number expected"; + } + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) + return "asInt: integer|Long expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) + return "exemplars: array expected"; + for (var i = 0;i < message.exemplars.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); + if (error51) + return "exemplars." + error51; + } + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + } + return null; + }; + NumberDataPoint.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.NumberDataPoint) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint; + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.startTimeUnixNano != null) { + if ($util.Long) + (message.startTimeUnixNano = $util.Long.fromValue(object2.startTimeUnixNano)).unsigned = false; + else if (typeof object2.startTimeUnixNano === "string") + message.startTimeUnixNano = parseInt(object2.startTimeUnixNano, 10); + else if (typeof object2.startTimeUnixNano === "number") + message.startTimeUnixNano = object2.startTimeUnixNano; + else if (typeof object2.startTimeUnixNano === "object") + message.startTimeUnixNano = new $util.LongBits(object2.startTimeUnixNano.low >>> 0, object2.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object2.timeUnixNano != null) { + if ($util.Long) + (message.timeUnixNano = $util.Long.fromValue(object2.timeUnixNano)).unsigned = false; + else if (typeof object2.timeUnixNano === "string") + message.timeUnixNano = parseInt(object2.timeUnixNano, 10); + else if (typeof object2.timeUnixNano === "number") + message.timeUnixNano = object2.timeUnixNano; + else if (typeof object2.timeUnixNano === "object") + message.timeUnixNano = new $util.LongBits(object2.timeUnixNano.low >>> 0, object2.timeUnixNano.high >>> 0).toNumber(); + } + if (object2.asDouble != null) + message.asDouble = Number(object2.asDouble); + if (object2.asInt != null) { + if ($util.Long) + (message.asInt = $util.Long.fromValue(object2.asInt)).unsigned = false; + else if (typeof object2.asInt === "string") + message.asInt = parseInt(object2.asInt, 10); + else if (typeof object2.asInt === "number") + message.asInt = object2.asInt; + else if (typeof object2.asInt === "object") + message.asInt = new $util.LongBits(object2.asInt.low >>> 0, object2.asInt.high >>> 0).toNumber(); + } + if (object2.exemplars) { + if (!Array.isArray(object2.exemplars)) + throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0;i < object2.exemplars.length; ++i) { + if (typeof object2.exemplars[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object2.exemplars[i]); + } + } + if (object2.flags != null) + message.flags = object2.flags >>> 0; + return message; + }; + NumberDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) { + object2.exemplars = []; + object2.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.timeUnixNano = options.longs === String ? "0" : 0; + object2.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) + if (typeof message.startTimeUnixNano === "number") + object2.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else + object2.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) + if (typeof message.timeUnixNano === "number") + object2.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else + object2.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + object2.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; + if (options.oneofs) + object2.value = "asDouble"; + } + if (message.exemplars && message.exemplars.length) { + object2.exemplars = []; + for (var j = 0;j < message.exemplars.length; ++j) + object2.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (typeof message.asInt === "number") + object2.asInt = options.longs === String ? String(message.asInt) : message.asInt; + else + object2.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; + if (options.oneofs) + object2.value = "asInt"; + } + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) + object2.flags = message.flags; + return object2; + }; + NumberDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + NumberDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.NumberDataPoint"; + }; + return NumberDataPoint; + }(); + v1.HistogramDataPoint = function() { + function HistogramDataPoint(properties) { + this.attributes = []; + this.bucketCounts = []; + this.explicitBounds = []; + this.exemplars = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + HistogramDataPoint.prototype.attributes = $util.emptyArray; + HistogramDataPoint.prototype.startTimeUnixNano = null; + HistogramDataPoint.prototype.timeUnixNano = null; + HistogramDataPoint.prototype.count = null; + HistogramDataPoint.prototype.sum = null; + HistogramDataPoint.prototype.bucketCounts = $util.emptyArray; + HistogramDataPoint.prototype.explicitBounds = $util.emptyArray; + HistogramDataPoint.prototype.exemplars = $util.emptyArray; + HistogramDataPoint.prototype.flags = null; + HistogramDataPoint.prototype.min = null; + HistogramDataPoint.prototype.max = null; + var $oneOfFields; + Object.defineProperty(HistogramDataPoint.prototype, "_sum", { + get: $util.oneOfGetter($oneOfFields = ["sum"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(HistogramDataPoint.prototype, "_min", { + get: $util.oneOfGetter($oneOfFields = ["min"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(HistogramDataPoint.prototype, "_max", { + get: $util.oneOfGetter($oneOfFields = ["max"]), + set: $util.oneOfSetter($oneOfFields) + }); + HistogramDataPoint.create = function create(properties) { + return new HistogramDataPoint(properties); + }; + HistogramDataPoint.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) + writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) + writer.uint32(25).fixed64(message.timeUnixNano); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(33).fixed64(message.count); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + writer.uint32(41).double(message.sum); + if (message.bucketCounts != null && message.bucketCounts.length) { + writer.uint32(50).fork(); + for (var i = 0;i < message.bucketCounts.length; ++i) + writer.fixed64(message.bucketCounts[i]); + writer.ldelim(); + } + if (message.explicitBounds != null && message.explicitBounds.length) { + writer.uint32(58).fork(); + for (var i = 0;i < message.explicitBounds.length; ++i) + writer.double(message.explicitBounds[i]); + writer.ldelim(); + } + if (message.exemplars != null && message.exemplars.length) + for (var i = 0;i < message.exemplars.length; ++i) + $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(66).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(80).uint32(message.flags); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(89).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(97).double(message.max); + return writer; + }; + HistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + HistogramDataPoint.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 9: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.startTimeUnixNano = reader.fixed64(); + break; + } + case 3: { + message.timeUnixNano = reader.fixed64(); + break; + } + case 4: { + message.count = reader.fixed64(); + break; + } + case 5: { + message.sum = reader.double(); + break; + } + case 6: { + if (!(message.bucketCounts && message.bucketCounts.length)) + message.bucketCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.bucketCounts.push(reader.fixed64()); + } else + message.bucketCounts.push(reader.fixed64()); + break; + } + case 7: { + if (!(message.explicitBounds && message.explicitBounds.length)) + message.explicitBounds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.explicitBounds.push(reader.double()); + } else + message.explicitBounds.push(reader.double()); + break; + } + case 8: { + if (!(message.exemplars && message.exemplars.length)) + message.exemplars = []; + message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); + break; + } + case 10: { + message.flags = reader.uint32(); + break; + } + case 11: { + message.min = reader.double(); + break; + } + case 12: { + message.max = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + HistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + HistogramDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) + return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) + return "timeUnixNano: integer|Long expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties._sum = 1; + if (typeof message.sum !== "number") + return "sum: number expected"; + } + if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { + if (!Array.isArray(message.bucketCounts)) + return "bucketCounts: array expected"; + for (var i = 0;i < message.bucketCounts.length; ++i) + if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) + return "bucketCounts: integer|Long[] expected"; + } + if (message.explicitBounds != null && message.hasOwnProperty("explicitBounds")) { + if (!Array.isArray(message.explicitBounds)) + return "explicitBounds: array expected"; + for (var i = 0;i < message.explicitBounds.length; ++i) + if (typeof message.explicitBounds[i] !== "number") + return "explicitBounds: number[] expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) + return "exemplars: array expected"; + for (var i = 0;i < message.exemplars.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); + if (error51) + return "exemplars." + error51; + } + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + } + if (message.min != null && message.hasOwnProperty("min")) { + properties._min = 1; + if (typeof message.min !== "number") + return "min: number expected"; + } + if (message.max != null && message.hasOwnProperty("max")) { + properties._max = 1; + if (typeof message.max !== "number") + return "max: number expected"; + } + return null; + }; + HistogramDataPoint.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.HistogramDataPoint) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint; + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.startTimeUnixNano != null) { + if ($util.Long) + (message.startTimeUnixNano = $util.Long.fromValue(object2.startTimeUnixNano)).unsigned = false; + else if (typeof object2.startTimeUnixNano === "string") + message.startTimeUnixNano = parseInt(object2.startTimeUnixNano, 10); + else if (typeof object2.startTimeUnixNano === "number") + message.startTimeUnixNano = object2.startTimeUnixNano; + else if (typeof object2.startTimeUnixNano === "object") + message.startTimeUnixNano = new $util.LongBits(object2.startTimeUnixNano.low >>> 0, object2.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object2.timeUnixNano != null) { + if ($util.Long) + (message.timeUnixNano = $util.Long.fromValue(object2.timeUnixNano)).unsigned = false; + else if (typeof object2.timeUnixNano === "string") + message.timeUnixNano = parseInt(object2.timeUnixNano, 10); + else if (typeof object2.timeUnixNano === "number") + message.timeUnixNano = object2.timeUnixNano; + else if (typeof object2.timeUnixNano === "object") + message.timeUnixNano = new $util.LongBits(object2.timeUnixNano.low >>> 0, object2.timeUnixNano.high >>> 0).toNumber(); + } + if (object2.count != null) { + if ($util.Long) + (message.count = $util.Long.fromValue(object2.count)).unsigned = false; + else if (typeof object2.count === "string") + message.count = parseInt(object2.count, 10); + else if (typeof object2.count === "number") + message.count = object2.count; + else if (typeof object2.count === "object") + message.count = new $util.LongBits(object2.count.low >>> 0, object2.count.high >>> 0).toNumber(); + } + if (object2.sum != null) + message.sum = Number(object2.sum); + if (object2.bucketCounts) { + if (!Array.isArray(object2.bucketCounts)) + throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0;i < object2.bucketCounts.length; ++i) + if ($util.Long) + (message.bucketCounts[i] = $util.Long.fromValue(object2.bucketCounts[i])).unsigned = false; + else if (typeof object2.bucketCounts[i] === "string") + message.bucketCounts[i] = parseInt(object2.bucketCounts[i], 10); + else if (typeof object2.bucketCounts[i] === "number") + message.bucketCounts[i] = object2.bucketCounts[i]; + else if (typeof object2.bucketCounts[i] === "object") + message.bucketCounts[i] = new $util.LongBits(object2.bucketCounts[i].low >>> 0, object2.bucketCounts[i].high >>> 0).toNumber(); + } + if (object2.explicitBounds) { + if (!Array.isArray(object2.explicitBounds)) + throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected"); + message.explicitBounds = []; + for (var i = 0;i < object2.explicitBounds.length; ++i) + message.explicitBounds[i] = Number(object2.explicitBounds[i]); + } + if (object2.exemplars) { + if (!Array.isArray(object2.exemplars)) + throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0;i < object2.exemplars.length; ++i) { + if (typeof object2.exemplars[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object2.exemplars[i]); + } + } + if (object2.flags != null) + message.flags = object2.flags >>> 0; + if (object2.min != null) + message.min = Number(object2.min); + if (object2.max != null) + message.max = Number(object2.max); + return message; + }; + HistogramDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) { + object2.bucketCounts = []; + object2.explicitBounds = []; + object2.exemplars = []; + object2.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.count = options.longs === String ? "0" : 0; + object2.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) + if (typeof message.startTimeUnixNano === "number") + object2.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else + object2.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) + if (typeof message.timeUnixNano === "number") + object2.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else + object2.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object2.count = options.longs === String ? String(message.count) : message.count; + else + object2.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.sum != null && message.hasOwnProperty("sum")) { + object2.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (options.oneofs) + object2._sum = "sum"; + } + if (message.bucketCounts && message.bucketCounts.length) { + object2.bucketCounts = []; + for (var j = 0;j < message.bucketCounts.length; ++j) + if (typeof message.bucketCounts[j] === "number") + object2.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else + object2.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; + } + if (message.explicitBounds && message.explicitBounds.length) { + object2.explicitBounds = []; + for (var j = 0;j < message.explicitBounds.length; ++j) + object2.explicitBounds[j] = options.json && !isFinite(message.explicitBounds[j]) ? String(message.explicitBounds[j]) : message.explicitBounds[j]; + } + if (message.exemplars && message.exemplars.length) { + object2.exemplars = []; + for (var j = 0;j < message.exemplars.length; ++j) + object2.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) + object2.flags = message.flags; + if (message.min != null && message.hasOwnProperty("min")) { + object2.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (options.oneofs) + object2._min = "min"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object2.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (options.oneofs) + object2._max = "max"; + } + return object2; + }; + HistogramDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + HistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.HistogramDataPoint"; + }; + return HistogramDataPoint; + }(); + v1.ExponentialHistogramDataPoint = function() { + function ExponentialHistogramDataPoint(properties) { + this.attributes = []; + this.exemplars = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ExponentialHistogramDataPoint.prototype.attributes = $util.emptyArray; + ExponentialHistogramDataPoint.prototype.startTimeUnixNano = null; + ExponentialHistogramDataPoint.prototype.timeUnixNano = null; + ExponentialHistogramDataPoint.prototype.count = null; + ExponentialHistogramDataPoint.prototype.sum = null; + ExponentialHistogramDataPoint.prototype.scale = null; + ExponentialHistogramDataPoint.prototype.zeroCount = null; + ExponentialHistogramDataPoint.prototype.positive = null; + ExponentialHistogramDataPoint.prototype.negative = null; + ExponentialHistogramDataPoint.prototype.flags = null; + ExponentialHistogramDataPoint.prototype.exemplars = $util.emptyArray; + ExponentialHistogramDataPoint.prototype.min = null; + ExponentialHistogramDataPoint.prototype.max = null; + ExponentialHistogramDataPoint.prototype.zeroThreshold = null; + var $oneOfFields; + Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_sum", { + get: $util.oneOfGetter($oneOfFields = ["sum"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_min", { + get: $util.oneOfGetter($oneOfFields = ["min"]), + set: $util.oneOfSetter($oneOfFields) + }); + Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_max", { + get: $util.oneOfGetter($oneOfFields = ["max"]), + set: $util.oneOfSetter($oneOfFields) + }); + ExponentialHistogramDataPoint.create = function create(properties) { + return new ExponentialHistogramDataPoint(properties); + }; + ExponentialHistogramDataPoint.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) + writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) + writer.uint32(25).fixed64(message.timeUnixNano); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(33).fixed64(message.count); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + writer.uint32(41).double(message.sum); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + writer.uint32(48).sint32(message.scale); + if (message.zeroCount != null && Object.hasOwnProperty.call(message, "zeroCount")) + writer.uint32(57).fixed64(message.zeroCount); + if (message.positive != null && Object.hasOwnProperty.call(message, "positive")) + $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.positive, writer.uint32(66).fork()).ldelim(); + if (message.negative != null && Object.hasOwnProperty.call(message, "negative")) + $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.negative, writer.uint32(74).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(80).uint32(message.flags); + if (message.exemplars != null && message.exemplars.length) + for (var i = 0;i < message.exemplars.length; ++i) + $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(90).fork()).ldelim(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(97).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(105).double(message.max); + if (message.zeroThreshold != null && Object.hasOwnProperty.call(message, "zeroThreshold")) + writer.uint32(113).double(message.zeroThreshold); + return writer; + }; + ExponentialHistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ExponentialHistogramDataPoint.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.startTimeUnixNano = reader.fixed64(); + break; + } + case 3: { + message.timeUnixNano = reader.fixed64(); + break; + } + case 4: { + message.count = reader.fixed64(); + break; + } + case 5: { + message.sum = reader.double(); + break; + } + case 6: { + message.scale = reader.sint32(); + break; + } + case 7: { + message.zeroCount = reader.fixed64(); + break; + } + case 8: { + message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); + break; + } + case 9: { + message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); + break; + } + case 10: { + message.flags = reader.uint32(); + break; + } + case 11: { + if (!(message.exemplars && message.exemplars.length)) + message.exemplars = []; + message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); + break; + } + case 12: { + message.min = reader.double(); + break; + } + case 13: { + message.max = reader.double(); + break; + } + case 14: { + message.zeroThreshold = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ExponentialHistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ExponentialHistogramDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) + return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) + return "timeUnixNano: integer|Long expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + properties._sum = 1; + if (typeof message.sum !== "number") + return "sum: number expected"; + } + if (message.scale != null && message.hasOwnProperty("scale")) { + if (!$util.isInteger(message.scale)) + return "scale: integer expected"; + } + if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) { + if (!$util.isInteger(message.zeroCount) && !(message.zeroCount && $util.isInteger(message.zeroCount.low) && $util.isInteger(message.zeroCount.high))) + return "zeroCount: integer|Long expected"; + } + if (message.positive != null && message.hasOwnProperty("positive")) { + var error51 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.positive); + if (error51) + return "positive." + error51; + } + if (message.negative != null && message.hasOwnProperty("negative")) { + var error51 = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.negative); + if (error51) + return "negative." + error51; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + } + if (message.exemplars != null && message.hasOwnProperty("exemplars")) { + if (!Array.isArray(message.exemplars)) + return "exemplars: array expected"; + for (var i = 0;i < message.exemplars.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); + if (error51) + return "exemplars." + error51; + } + } + if (message.min != null && message.hasOwnProperty("min")) { + properties._min = 1; + if (typeof message.min !== "number") + return "min: number expected"; + } + if (message.max != null && message.hasOwnProperty("max")) { + properties._max = 1; + if (typeof message.max !== "number") + return "max: number expected"; + } + if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) { + if (typeof message.zeroThreshold !== "number") + return "zeroThreshold: number expected"; + } + return null; + }; + ExponentialHistogramDataPoint.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint; + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.startTimeUnixNano != null) { + if ($util.Long) + (message.startTimeUnixNano = $util.Long.fromValue(object2.startTimeUnixNano)).unsigned = false; + else if (typeof object2.startTimeUnixNano === "string") + message.startTimeUnixNano = parseInt(object2.startTimeUnixNano, 10); + else if (typeof object2.startTimeUnixNano === "number") + message.startTimeUnixNano = object2.startTimeUnixNano; + else if (typeof object2.startTimeUnixNano === "object") + message.startTimeUnixNano = new $util.LongBits(object2.startTimeUnixNano.low >>> 0, object2.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object2.timeUnixNano != null) { + if ($util.Long) + (message.timeUnixNano = $util.Long.fromValue(object2.timeUnixNano)).unsigned = false; + else if (typeof object2.timeUnixNano === "string") + message.timeUnixNano = parseInt(object2.timeUnixNano, 10); + else if (typeof object2.timeUnixNano === "number") + message.timeUnixNano = object2.timeUnixNano; + else if (typeof object2.timeUnixNano === "object") + message.timeUnixNano = new $util.LongBits(object2.timeUnixNano.low >>> 0, object2.timeUnixNano.high >>> 0).toNumber(); + } + if (object2.count != null) { + if ($util.Long) + (message.count = $util.Long.fromValue(object2.count)).unsigned = false; + else if (typeof object2.count === "string") + message.count = parseInt(object2.count, 10); + else if (typeof object2.count === "number") + message.count = object2.count; + else if (typeof object2.count === "object") + message.count = new $util.LongBits(object2.count.low >>> 0, object2.count.high >>> 0).toNumber(); + } + if (object2.sum != null) + message.sum = Number(object2.sum); + if (object2.scale != null) + message.scale = object2.scale | 0; + if (object2.zeroCount != null) { + if ($util.Long) + (message.zeroCount = $util.Long.fromValue(object2.zeroCount)).unsigned = false; + else if (typeof object2.zeroCount === "string") + message.zeroCount = parseInt(object2.zeroCount, 10); + else if (typeof object2.zeroCount === "number") + message.zeroCount = object2.zeroCount; + else if (typeof object2.zeroCount === "object") + message.zeroCount = new $util.LongBits(object2.zeroCount.low >>> 0, object2.zeroCount.high >>> 0).toNumber(); + } + if (object2.positive != null) { + if (typeof object2.positive !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected"); + message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object2.positive); + } + if (object2.negative != null) { + if (typeof object2.negative !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected"); + message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object2.negative); + } + if (object2.flags != null) + message.flags = object2.flags >>> 0; + if (object2.exemplars) { + if (!Array.isArray(object2.exemplars)) + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0;i < object2.exemplars.length; ++i) { + if (typeof object2.exemplars[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object2.exemplars[i]); + } + } + if (object2.min != null) + message.min = Number(object2.min); + if (object2.max != null) + message.max = Number(object2.max); + if (object2.zeroThreshold != null) + message.zeroThreshold = Number(object2.zeroThreshold); + return message; + }; + ExponentialHistogramDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) { + object2.attributes = []; + object2.exemplars = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.count = options.longs === String ? "0" : 0; + object2.scale = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.zeroCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.zeroCount = options.longs === String ? "0" : 0; + object2.positive = null; + object2.negative = null; + object2.flags = 0; + object2.zeroThreshold = 0; + } + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) + if (typeof message.startTimeUnixNano === "number") + object2.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else + object2.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) + if (typeof message.timeUnixNano === "number") + object2.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else + object2.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object2.count = options.longs === String ? String(message.count) : message.count; + else + object2.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.sum != null && message.hasOwnProperty("sum")) { + object2.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (options.oneofs) + object2._sum = "sum"; + } + if (message.scale != null && message.hasOwnProperty("scale")) + object2.scale = message.scale; + if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) + if (typeof message.zeroCount === "number") + object2.zeroCount = options.longs === String ? String(message.zeroCount) : message.zeroCount; + else + object2.zeroCount = options.longs === String ? $util.Long.prototype.toString.call(message.zeroCount) : options.longs === Number ? new $util.LongBits(message.zeroCount.low >>> 0, message.zeroCount.high >>> 0).toNumber() : message.zeroCount; + if (message.positive != null && message.hasOwnProperty("positive")) + object2.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.positive, options); + if (message.negative != null && message.hasOwnProperty("negative")) + object2.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.negative, options); + if (message.flags != null && message.hasOwnProperty("flags")) + object2.flags = message.flags; + if (message.exemplars && message.exemplars.length) { + object2.exemplars = []; + for (var j = 0;j < message.exemplars.length; ++j) + object2.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.min != null && message.hasOwnProperty("min")) { + object2.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (options.oneofs) + object2._min = "min"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object2.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (options.oneofs) + object2._max = "max"; + } + if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) + object2.zeroThreshold = options.json && !isFinite(message.zeroThreshold) ? String(message.zeroThreshold) : message.zeroThreshold; + return object2; + }; + ExponentialHistogramDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ExponentialHistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"; + }; + ExponentialHistogramDataPoint.Buckets = function() { + function Buckets(properties) { + this.bucketCounts = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Buckets.prototype.offset = null; + Buckets.prototype.bucketCounts = $util.emptyArray; + Buckets.create = function create(properties) { + return new Buckets(properties); + }; + Buckets.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(8).sint32(message.offset); + if (message.bucketCounts != null && message.bucketCounts.length) { + writer.uint32(18).fork(); + for (var i = 0;i < message.bucketCounts.length; ++i) + writer.uint64(message.bucketCounts[i]); + writer.ldelim(); + } + return writer; + }; + Buckets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Buckets.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.offset = reader.sint32(); + break; + } + case 2: { + if (!(message.bucketCounts && message.bucketCounts.length)) + message.bucketCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.bucketCounts.push(reader.uint64()); + } else + message.bucketCounts.push(reader.uint64()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Buckets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Buckets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offset != null && message.hasOwnProperty("offset")) { + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + } + if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { + if (!Array.isArray(message.bucketCounts)) + return "bucketCounts: array expected"; + for (var i = 0;i < message.bucketCounts.length; ++i) + if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) + return "bucketCounts: integer|Long[] expected"; + } + return null; + }; + Buckets.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets; + if (object2.offset != null) + message.offset = object2.offset | 0; + if (object2.bucketCounts) { + if (!Array.isArray(object2.bucketCounts)) + throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0;i < object2.bucketCounts.length; ++i) + if ($util.Long) + (message.bucketCounts[i] = $util.Long.fromValue(object2.bucketCounts[i])).unsigned = true; + else if (typeof object2.bucketCounts[i] === "string") + message.bucketCounts[i] = parseInt(object2.bucketCounts[i], 10); + else if (typeof object2.bucketCounts[i] === "number") + message.bucketCounts[i] = object2.bucketCounts[i]; + else if (typeof object2.bucketCounts[i] === "object") + message.bucketCounts[i] = new $util.LongBits(object2.bucketCounts[i].low >>> 0, object2.bucketCounts[i].high >>> 0).toNumber(true); + } + return message; + }; + Buckets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.bucketCounts = []; + if (options.defaults) + object2.offset = 0; + if (message.offset != null && message.hasOwnProperty("offset")) + object2.offset = message.offset; + if (message.bucketCounts && message.bucketCounts.length) { + object2.bucketCounts = []; + for (var j = 0;j < message.bucketCounts.length; ++j) + if (typeof message.bucketCounts[j] === "number") + object2.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else + object2.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber(true) : message.bucketCounts[j]; + } + return object2; + }; + Buckets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Buckets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"; + }; + return Buckets; + }(); + return ExponentialHistogramDataPoint; + }(); + v1.SummaryDataPoint = function() { + function SummaryDataPoint(properties) { + this.attributes = []; + this.quantileValues = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + SummaryDataPoint.prototype.attributes = $util.emptyArray; + SummaryDataPoint.prototype.startTimeUnixNano = null; + SummaryDataPoint.prototype.timeUnixNano = null; + SummaryDataPoint.prototype.count = null; + SummaryDataPoint.prototype.sum = null; + SummaryDataPoint.prototype.quantileValues = $util.emptyArray; + SummaryDataPoint.prototype.flags = null; + SummaryDataPoint.create = function create(properties) { + return new SummaryDataPoint(properties); + }; + SummaryDataPoint.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) + writer.uint32(17).fixed64(message.startTimeUnixNano); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) + writer.uint32(25).fixed64(message.timeUnixNano); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(33).fixed64(message.count); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + writer.uint32(41).double(message.sum); + if (message.quantileValues != null && message.quantileValues.length) + for (var i = 0;i < message.quantileValues.length; ++i) + $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(message.quantileValues[i], writer.uint32(50).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(64).uint32(message.flags); + return writer; + }; + SummaryDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + SummaryDataPoint.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 7: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.startTimeUnixNano = reader.fixed64(); + break; + } + case 3: { + message.timeUnixNano = reader.fixed64(); + break; + } + case 4: { + message.count = reader.fixed64(); + break; + } + case 5: { + message.sum = reader.double(); + break; + } + case 6: { + if (!(message.quantileValues && message.quantileValues.length)) + message.quantileValues = []; + message.quantileValues.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(reader, reader.uint32())); + break; + } + case 8: { + message.flags = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + SummaryDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + SummaryDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { + if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) + return "startTimeUnixNano: integer|Long expected"; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) + return "timeUnixNano: integer|Long expected"; + } + if (message.count != null && message.hasOwnProperty("count")) { + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (typeof message.sum !== "number") + return "sum: number expected"; + } + if (message.quantileValues != null && message.hasOwnProperty("quantileValues")) { + if (!Array.isArray(message.quantileValues)) + return "quantileValues: array expected"; + for (var i = 0;i < message.quantileValues.length; ++i) { + var error51 = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(message.quantileValues[i]); + if (error51) + return "quantileValues." + error51; + } + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + } + return null; + }; + SummaryDataPoint.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint; + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.startTimeUnixNano != null) { + if ($util.Long) + (message.startTimeUnixNano = $util.Long.fromValue(object2.startTimeUnixNano)).unsigned = false; + else if (typeof object2.startTimeUnixNano === "string") + message.startTimeUnixNano = parseInt(object2.startTimeUnixNano, 10); + else if (typeof object2.startTimeUnixNano === "number") + message.startTimeUnixNano = object2.startTimeUnixNano; + else if (typeof object2.startTimeUnixNano === "object") + message.startTimeUnixNano = new $util.LongBits(object2.startTimeUnixNano.low >>> 0, object2.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object2.timeUnixNano != null) { + if ($util.Long) + (message.timeUnixNano = $util.Long.fromValue(object2.timeUnixNano)).unsigned = false; + else if (typeof object2.timeUnixNano === "string") + message.timeUnixNano = parseInt(object2.timeUnixNano, 10); + else if (typeof object2.timeUnixNano === "number") + message.timeUnixNano = object2.timeUnixNano; + else if (typeof object2.timeUnixNano === "object") + message.timeUnixNano = new $util.LongBits(object2.timeUnixNano.low >>> 0, object2.timeUnixNano.high >>> 0).toNumber(); + } + if (object2.count != null) { + if ($util.Long) + (message.count = $util.Long.fromValue(object2.count)).unsigned = false; + else if (typeof object2.count === "string") + message.count = parseInt(object2.count, 10); + else if (typeof object2.count === "number") + message.count = object2.count; + else if (typeof object2.count === "object") + message.count = new $util.LongBits(object2.count.low >>> 0, object2.count.high >>> 0).toNumber(); + } + if (object2.sum != null) + message.sum = Number(object2.sum); + if (object2.quantileValues) { + if (!Array.isArray(object2.quantileValues)) + throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected"); + message.quantileValues = []; + for (var i = 0;i < object2.quantileValues.length; ++i) { + if (typeof object2.quantileValues[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected"); + message.quantileValues[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(object2.quantileValues[i]); + } + } + if (object2.flags != null) + message.flags = object2.flags >>> 0; + return message; + }; + SummaryDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) { + object2.quantileValues = []; + object2.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.count = options.longs === String ? "0" : 0; + object2.sum = 0; + object2.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) + if (typeof message.startTimeUnixNano === "number") + object2.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else + object2.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) + if (typeof message.timeUnixNano === "number") + object2.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else + object2.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object2.count = options.longs === String ? String(message.count) : message.count; + else + object2.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (message.sum != null && message.hasOwnProperty("sum")) + object2.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (message.quantileValues && message.quantileValues.length) { + object2.quantileValues = []; + for (var j = 0;j < message.quantileValues.length; ++j) + object2.quantileValues[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(message.quantileValues[j], options); + } + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) + object2.flags = message.flags; + return object2; + }; + SummaryDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + SummaryDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint"; + }; + SummaryDataPoint.ValueAtQuantile = function() { + function ValueAtQuantile(properties) { + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ValueAtQuantile.prototype.quantile = null; + ValueAtQuantile.prototype.value = null; + ValueAtQuantile.create = function create(properties) { + return new ValueAtQuantile(properties); + }; + ValueAtQuantile.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quantile != null && Object.hasOwnProperty.call(message, "quantile")) + writer.uint32(9).double(message.quantile); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(17).double(message.value); + return writer; + }; + ValueAtQuantile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ValueAtQuantile.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.quantile = reader.double(); + break; + } + case 2: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ValueAtQuantile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ValueAtQuantile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quantile != null && message.hasOwnProperty("quantile")) { + if (typeof message.quantile !== "number") + return "quantile: number expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + if (typeof message.value !== "number") + return "value: number expected"; + } + return null; + }; + ValueAtQuantile.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile; + if (object2.quantile != null) + message.quantile = Number(object2.quantile); + if (object2.value != null) + message.value = Number(object2.value); + return message; + }; + ValueAtQuantile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.defaults) { + object2.quantile = 0; + object2.value = 0; + } + if (message.quantile != null && message.hasOwnProperty("quantile")) + object2.quantile = options.json && !isFinite(message.quantile) ? String(message.quantile) : message.quantile; + if (message.value != null && message.hasOwnProperty("value")) + object2.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object2; + }; + ValueAtQuantile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ValueAtQuantile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"; + }; + return ValueAtQuantile; + }(); + return SummaryDataPoint; + }(); + v1.Exemplar = function() { + function Exemplar(properties) { + this.filteredAttributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + Exemplar.prototype.filteredAttributes = $util.emptyArray; + Exemplar.prototype.timeUnixNano = null; + Exemplar.prototype.asDouble = null; + Exemplar.prototype.asInt = null; + Exemplar.prototype.spanId = null; + Exemplar.prototype.traceId = null; + var $oneOfFields; + Object.defineProperty(Exemplar.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), + set: $util.oneOfSetter($oneOfFields) + }); + Exemplar.create = function create(properties) { + return new Exemplar(properties); + }; + Exemplar.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) + writer.uint32(17).fixed64(message.timeUnixNano); + if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) + writer.uint32(25).double(message.asDouble); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) + writer.uint32(34).bytes(message.spanId); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(42).bytes(message.traceId); + if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) + writer.uint32(49).sfixed64(message.asInt); + if (message.filteredAttributes != null && message.filteredAttributes.length) + for (var i = 0;i < message.filteredAttributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.filteredAttributes[i], writer.uint32(58).fork()).ldelim(); + return writer; + }; + Exemplar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + Exemplar.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Exemplar; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 7: { + if (!(message.filteredAttributes && message.filteredAttributes.length)) + message.filteredAttributes = []; + message.filteredAttributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.timeUnixNano = reader.fixed64(); + break; + } + case 3: { + message.asDouble = reader.double(); + break; + } + case 6: { + message.asInt = reader.sfixed64(); + break; + } + case 4: { + message.spanId = reader.bytes(); + break; + } + case 5: { + message.traceId = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + Exemplar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + Exemplar.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filteredAttributes != null && message.hasOwnProperty("filteredAttributes")) { + if (!Array.isArray(message.filteredAttributes)) + return "filteredAttributes: array expected"; + for (var i = 0;i < message.filteredAttributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.filteredAttributes[i]); + if (error51) + return "filteredAttributes." + error51; + } + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) + return "timeUnixNano: integer|Long expected"; + } + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + properties.value = 1; + if (typeof message.asDouble !== "number") + return "asDouble: number expected"; + } + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) + return "asInt: integer|Long expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) + return "spanId: buffer expected"; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) + return "traceId: buffer expected"; + } + return null; + }; + Exemplar.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.metrics.v1.Exemplar) + return object2; + var message = new $root.opentelemetry.proto.metrics.v1.Exemplar; + if (object2.filteredAttributes) { + if (!Array.isArray(object2.filteredAttributes)) + throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected"); + message.filteredAttributes = []; + for (var i = 0;i < object2.filteredAttributes.length; ++i) { + if (typeof object2.filteredAttributes[i] !== "object") + throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected"); + message.filteredAttributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.filteredAttributes[i]); + } + } + if (object2.timeUnixNano != null) { + if ($util.Long) + (message.timeUnixNano = $util.Long.fromValue(object2.timeUnixNano)).unsigned = false; + else if (typeof object2.timeUnixNano === "string") + message.timeUnixNano = parseInt(object2.timeUnixNano, 10); + else if (typeof object2.timeUnixNano === "number") + message.timeUnixNano = object2.timeUnixNano; + else if (typeof object2.timeUnixNano === "object") + message.timeUnixNano = new $util.LongBits(object2.timeUnixNano.low >>> 0, object2.timeUnixNano.high >>> 0).toNumber(); + } + if (object2.asDouble != null) + message.asDouble = Number(object2.asDouble); + if (object2.asInt != null) { + if ($util.Long) + (message.asInt = $util.Long.fromValue(object2.asInt)).unsigned = false; + else if (typeof object2.asInt === "string") + message.asInt = parseInt(object2.asInt, 10); + else if (typeof object2.asInt === "number") + message.asInt = object2.asInt; + else if (typeof object2.asInt === "object") + message.asInt = new $util.LongBits(object2.asInt.low >>> 0, object2.asInt.high >>> 0).toNumber(); + } + if (object2.spanId != null) { + if (typeof object2.spanId === "string") + $util.base64.decode(object2.spanId, message.spanId = $util.newBuffer($util.base64.length(object2.spanId)), 0); + else if (object2.spanId.length >= 0) + message.spanId = object2.spanId; + } + if (object2.traceId != null) { + if (typeof object2.traceId === "string") + $util.base64.decode(object2.traceId, message.traceId = $util.newBuffer($util.base64.length(object2.traceId)), 0); + else if (object2.traceId.length >= 0) + message.traceId = object2.traceId; + } + return message; + }; + Exemplar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.filteredAttributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.timeUnixNano = options.longs === String ? "0" : 0; + if (options.bytes === String) + object2.spanId = ""; + else { + object2.spanId = []; + if (options.bytes !== Array) + object2.spanId = $util.newBuffer(object2.spanId); + } + if (options.bytes === String) + object2.traceId = ""; + else { + object2.traceId = []; + if (options.bytes !== Array) + object2.traceId = $util.newBuffer(object2.traceId); + } + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) + if (typeof message.timeUnixNano === "number") + object2.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else + object2.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.asDouble != null && message.hasOwnProperty("asDouble")) { + object2.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; + if (options.oneofs) + object2.value = "asDouble"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) + object2.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.traceId != null && message.hasOwnProperty("traceId")) + object2.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.asInt != null && message.hasOwnProperty("asInt")) { + if (typeof message.asInt === "number") + object2.asInt = options.longs === String ? String(message.asInt) : message.asInt; + else + object2.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; + if (options.oneofs) + object2.value = "asInt"; + } + if (message.filteredAttributes && message.filteredAttributes.length) { + object2.filteredAttributes = []; + for (var j = 0;j < message.filteredAttributes.length; ++j) + object2.filteredAttributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.filteredAttributes[j], options); + } + return object2; + }; + Exemplar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + Exemplar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Exemplar"; + }; + return Exemplar; + }(); + return v1; + }(); + return metrics; + }(); + proto.logs = function() { + var logs = {}; + logs.v1 = function() { + var v1 = {}; + v1.LogsData = function() { + function LogsData(properties) { + this.resourceLogs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + LogsData.prototype.resourceLogs = $util.emptyArray; + LogsData.create = function create(properties) { + return new LogsData(properties); + }; + LogsData.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceLogs != null && message.resourceLogs.length) + for (var i = 0;i < message.resourceLogs.length; ++i) + $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); + return writer; + }; + LogsData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + LogsData.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogsData; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceLogs && message.resourceLogs.length)) + message.resourceLogs = []; + message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + LogsData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + LogsData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { + if (!Array.isArray(message.resourceLogs)) + return "resourceLogs: array expected"; + for (var i = 0;i < message.resourceLogs.length; ++i) { + var error51 = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); + if (error51) + return "resourceLogs." + error51; + } + } + return null; + }; + LogsData.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.logs.v1.LogsData) + return object2; + var message = new $root.opentelemetry.proto.logs.v1.LogsData; + if (object2.resourceLogs) { + if (!Array.isArray(object2.resourceLogs)) + throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected"); + message.resourceLogs = []; + for (var i = 0;i < object2.resourceLogs.length; ++i) { + if (typeof object2.resourceLogs[i] !== "object") + throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected"); + message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object2.resourceLogs[i]); + } + } + return message; + }; + LogsData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.resourceLogs = []; + if (message.resourceLogs && message.resourceLogs.length) { + object2.resourceLogs = []; + for (var j = 0;j < message.resourceLogs.length; ++j) + object2.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); + } + return object2; + }; + LogsData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LogsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogsData"; + }; + return LogsData; + }(); + v1.ResourceLogs = function() { + function ResourceLogs(properties) { + this.scopeLogs = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ResourceLogs.prototype.resource = null; + ResourceLogs.prototype.scopeLogs = $util.emptyArray; + ResourceLogs.prototype.schemaUrl = null; + ResourceLogs.create = function create(properties) { + return new ResourceLogs(properties); + }; + ResourceLogs.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + if (message.scopeLogs != null && message.scopeLogs.length) + for (var i = 0;i < message.scopeLogs.length; ++i) + $root.opentelemetry.proto.logs.v1.ScopeLogs.encode(message.scopeLogs[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) + writer.uint32(26).string(message.schemaUrl); + return writer; + }; + ResourceLogs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ResourceLogs.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ResourceLogs; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.scopeLogs && message.scopeLogs.length)) + message.scopeLogs = []; + message.scopeLogs.push($root.opentelemetry.proto.logs.v1.ScopeLogs.decode(reader, reader.uint32())); + break; + } + case 3: { + message.schemaUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ResourceLogs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ResourceLogs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error51 = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); + if (error51) + return "resource." + error51; + } + if (message.scopeLogs != null && message.hasOwnProperty("scopeLogs")) { + if (!Array.isArray(message.scopeLogs)) + return "scopeLogs: array expected"; + for (var i = 0;i < message.scopeLogs.length; ++i) { + var error51 = $root.opentelemetry.proto.logs.v1.ScopeLogs.verify(message.scopeLogs[i]); + if (error51) + return "scopeLogs." + error51; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) + return "schemaUrl: string expected"; + } + return null; + }; + ResourceLogs.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.logs.v1.ResourceLogs) + return object2; + var message = new $root.opentelemetry.proto.logs.v1.ResourceLogs; + if (object2.resource != null) { + if (typeof object2.resource !== "object") + throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object2.resource); + } + if (object2.scopeLogs) { + if (!Array.isArray(object2.scopeLogs)) + throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected"); + message.scopeLogs = []; + for (var i = 0;i < object2.scopeLogs.length; ++i) { + if (typeof object2.scopeLogs[i] !== "object") + throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected"); + message.scopeLogs[i] = $root.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(object2.scopeLogs[i]); + } + } + if (object2.schemaUrl != null) + message.schemaUrl = String(object2.schemaUrl); + return message; + }; + ResourceLogs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.scopeLogs = []; + if (options.defaults) { + object2.resource = null; + object2.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object2.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeLogs && message.scopeLogs.length) { + object2.scopeLogs = []; + for (var j = 0;j < message.scopeLogs.length; ++j) + object2.scopeLogs[j] = $root.opentelemetry.proto.logs.v1.ScopeLogs.toObject(message.scopeLogs[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) + object2.schemaUrl = message.schemaUrl; + return object2; + }; + ResourceLogs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ResourceLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ResourceLogs"; + }; + return ResourceLogs; + }(); + v1.ScopeLogs = function() { + function ScopeLogs(properties) { + this.logRecords = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + ScopeLogs.prototype.scope = null; + ScopeLogs.prototype.logRecords = $util.emptyArray; + ScopeLogs.prototype.schemaUrl = null; + ScopeLogs.create = function create(properties) { + return new ScopeLogs(properties); + }; + ScopeLogs.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); + if (message.logRecords != null && message.logRecords.length) + for (var i = 0;i < message.logRecords.length; ++i) + $root.opentelemetry.proto.logs.v1.LogRecord.encode(message.logRecords[i], writer.uint32(18).fork()).ldelim(); + if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) + writer.uint32(26).string(message.schemaUrl); + return writer; + }; + ScopeLogs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + ScopeLogs.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ScopeLogs; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.logRecords && message.logRecords.length)) + message.logRecords = []; + message.logRecords.push($root.opentelemetry.proto.logs.v1.LogRecord.decode(reader, reader.uint32())); + break; + } + case 3: { + message.schemaUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + ScopeLogs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + ScopeLogs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) { + var error51 = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); + if (error51) + return "scope." + error51; + } + if (message.logRecords != null && message.hasOwnProperty("logRecords")) { + if (!Array.isArray(message.logRecords)) + return "logRecords: array expected"; + for (var i = 0;i < message.logRecords.length; ++i) { + var error51 = $root.opentelemetry.proto.logs.v1.LogRecord.verify(message.logRecords[i]); + if (error51) + return "logRecords." + error51; + } + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { + if (!$util.isString(message.schemaUrl)) + return "schemaUrl: string expected"; + } + return null; + }; + ScopeLogs.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.logs.v1.ScopeLogs) + return object2; + var message = new $root.opentelemetry.proto.logs.v1.ScopeLogs; + if (object2.scope != null) { + if (typeof object2.scope !== "object") + throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object2.scope); + } + if (object2.logRecords) { + if (!Array.isArray(object2.logRecords)) + throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected"); + message.logRecords = []; + for (var i = 0;i < object2.logRecords.length; ++i) { + if (typeof object2.logRecords[i] !== "object") + throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected"); + message.logRecords[i] = $root.opentelemetry.proto.logs.v1.LogRecord.fromObject(object2.logRecords[i]); + } + } + if (object2.schemaUrl != null) + message.schemaUrl = String(object2.schemaUrl); + return message; + }; + ScopeLogs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.logRecords = []; + if (options.defaults) { + object2.scope = null; + object2.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object2.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.logRecords && message.logRecords.length) { + object2.logRecords = []; + for (var j = 0;j < message.logRecords.length; ++j) + object2.logRecords[j] = $root.opentelemetry.proto.logs.v1.LogRecord.toObject(message.logRecords[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) + object2.schemaUrl = message.schemaUrl; + return object2; + }; + ScopeLogs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + ScopeLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ScopeLogs"; + }; + return ScopeLogs; + }(); + v1.SeverityNumber = function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_NUMBER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SEVERITY_NUMBER_TRACE"] = 1; + values[valuesById[2] = "SEVERITY_NUMBER_TRACE2"] = 2; + values[valuesById[3] = "SEVERITY_NUMBER_TRACE3"] = 3; + values[valuesById[4] = "SEVERITY_NUMBER_TRACE4"] = 4; + values[valuesById[5] = "SEVERITY_NUMBER_DEBUG"] = 5; + values[valuesById[6] = "SEVERITY_NUMBER_DEBUG2"] = 6; + values[valuesById[7] = "SEVERITY_NUMBER_DEBUG3"] = 7; + values[valuesById[8] = "SEVERITY_NUMBER_DEBUG4"] = 8; + values[valuesById[9] = "SEVERITY_NUMBER_INFO"] = 9; + values[valuesById[10] = "SEVERITY_NUMBER_INFO2"] = 10; + values[valuesById[11] = "SEVERITY_NUMBER_INFO3"] = 11; + values[valuesById[12] = "SEVERITY_NUMBER_INFO4"] = 12; + values[valuesById[13] = "SEVERITY_NUMBER_WARN"] = 13; + values[valuesById[14] = "SEVERITY_NUMBER_WARN2"] = 14; + values[valuesById[15] = "SEVERITY_NUMBER_WARN3"] = 15; + values[valuesById[16] = "SEVERITY_NUMBER_WARN4"] = 16; + values[valuesById[17] = "SEVERITY_NUMBER_ERROR"] = 17; + values[valuesById[18] = "SEVERITY_NUMBER_ERROR2"] = 18; + values[valuesById[19] = "SEVERITY_NUMBER_ERROR3"] = 19; + values[valuesById[20] = "SEVERITY_NUMBER_ERROR4"] = 20; + values[valuesById[21] = "SEVERITY_NUMBER_FATAL"] = 21; + values[valuesById[22] = "SEVERITY_NUMBER_FATAL2"] = 22; + values[valuesById[23] = "SEVERITY_NUMBER_FATAL3"] = 23; + values[valuesById[24] = "SEVERITY_NUMBER_FATAL4"] = 24; + return values; + }(); + v1.LogRecordFlags = function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_RECORD_FLAGS_DO_NOT_USE"] = 0; + values[valuesById[255] = "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"] = 255; + return values; + }(); + v1.LogRecord = function() { + function LogRecord(properties) { + this.attributes = []; + if (properties) { + for (var keys = Object.keys(properties), i = 0;i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + } + LogRecord.prototype.timeUnixNano = null; + LogRecord.prototype.observedTimeUnixNano = null; + LogRecord.prototype.severityNumber = null; + LogRecord.prototype.severityText = null; + LogRecord.prototype.body = null; + LogRecord.prototype.attributes = $util.emptyArray; + LogRecord.prototype.droppedAttributesCount = null; + LogRecord.prototype.flags = null; + LogRecord.prototype.traceId = null; + LogRecord.prototype.spanId = null; + LogRecord.prototype.eventName = null; + LogRecord.create = function create(properties) { + return new LogRecord(properties); + }; + LogRecord.encode = function encode3(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) + writer.uint32(9).fixed64(message.timeUnixNano); + if (message.severityNumber != null && Object.hasOwnProperty.call(message, "severityNumber")) + writer.uint32(16).int32(message.severityNumber); + if (message.severityText != null && Object.hasOwnProperty.call(message, "severityText")) + writer.uint32(26).string(message.severityText); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.opentelemetry.proto.common.v1.AnyValue.encode(message.body, writer.uint32(42).fork()).ldelim(); + if (message.attributes != null && message.attributes.length) + for (var i = 0;i < message.attributes.length; ++i) + $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(50).fork()).ldelim(); + if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) + writer.uint32(56).uint32(message.droppedAttributesCount); + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) + writer.uint32(69).fixed32(message.flags); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(74).bytes(message.traceId); + if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) + writer.uint32(82).bytes(message.spanId); + if (message.observedTimeUnixNano != null && Object.hasOwnProperty.call(message, "observedTimeUnixNano")) + writer.uint32(89).fixed64(message.observedTimeUnixNano); + if (message.eventName != null && Object.hasOwnProperty.call(message, "eventName")) + writer.uint32(98).string(message.eventName); + return writer; + }; + LogRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + LogRecord.decode = function decode3(reader, length, error51) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogRecord; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error51) + break; + switch (tag >>> 3) { + case 1: { + message.timeUnixNano = reader.fixed64(); + break; + } + case 11: { + message.observedTimeUnixNano = reader.fixed64(); + break; + } + case 2: { + message.severityNumber = reader.int32(); + break; + } + case 3: { + message.severityText = reader.string(); + break; + } + case 5: { + message.body = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.attributes && message.attributes.length)) + message.attributes = []; + message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); + break; + } + case 7: { + message.droppedAttributesCount = reader.uint32(); + break; + } + case 8: { + message.flags = reader.fixed32(); + break; + } + case 9: { + message.traceId = reader.bytes(); + break; + } + case 10: { + message.spanId = reader.bytes(); + break; + } + case 12: { + message.eventName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + LogRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + LogRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { + if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) + return "timeUnixNano: integer|Long expected"; + } + if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) { + if (!$util.isInteger(message.observedTimeUnixNano) && !(message.observedTimeUnixNano && $util.isInteger(message.observedTimeUnixNano.low) && $util.isInteger(message.observedTimeUnixNano.high))) + return "observedTimeUnixNano: integer|Long expected"; + } + if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) + switch (message.severityNumber) { + default: + return "severityNumber: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + break; + } + if (message.severityText != null && message.hasOwnProperty("severityText")) { + if (!$util.isString(message.severityText)) + return "severityText: string expected"; + } + if (message.body != null && message.hasOwnProperty("body")) { + var error51 = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.body); + if (error51) + return "body." + error51; + } + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!Array.isArray(message.attributes)) + return "attributes: array expected"; + for (var i = 0;i < message.attributes.length; ++i) { + var error51 = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); + if (error51) + return "attributes." + error51; + } + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { + if (!$util.isInteger(message.droppedAttributesCount)) + return "droppedAttributesCount: integer expected"; + } + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!$util.isInteger(message.flags)) + return "flags: integer expected"; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) { + if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) + return "traceId: buffer expected"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) { + if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) + return "spanId: buffer expected"; + } + if (message.eventName != null && message.hasOwnProperty("eventName")) { + if (!$util.isString(message.eventName)) + return "eventName: string expected"; + } + return null; + }; + LogRecord.fromObject = function fromObject(object2) { + if (object2 instanceof $root.opentelemetry.proto.logs.v1.LogRecord) + return object2; + var message = new $root.opentelemetry.proto.logs.v1.LogRecord; + if (object2.timeUnixNano != null) { + if ($util.Long) + (message.timeUnixNano = $util.Long.fromValue(object2.timeUnixNano)).unsigned = false; + else if (typeof object2.timeUnixNano === "string") + message.timeUnixNano = parseInt(object2.timeUnixNano, 10); + else if (typeof object2.timeUnixNano === "number") + message.timeUnixNano = object2.timeUnixNano; + else if (typeof object2.timeUnixNano === "object") + message.timeUnixNano = new $util.LongBits(object2.timeUnixNano.low >>> 0, object2.timeUnixNano.high >>> 0).toNumber(); + } + if (object2.observedTimeUnixNano != null) { + if ($util.Long) + (message.observedTimeUnixNano = $util.Long.fromValue(object2.observedTimeUnixNano)).unsigned = false; + else if (typeof object2.observedTimeUnixNano === "string") + message.observedTimeUnixNano = parseInt(object2.observedTimeUnixNano, 10); + else if (typeof object2.observedTimeUnixNano === "number") + message.observedTimeUnixNano = object2.observedTimeUnixNano; + else if (typeof object2.observedTimeUnixNano === "object") + message.observedTimeUnixNano = new $util.LongBits(object2.observedTimeUnixNano.low >>> 0, object2.observedTimeUnixNano.high >>> 0).toNumber(); + } + switch (object2.severityNumber) { + default: + if (typeof object2.severityNumber === "number") { + message.severityNumber = object2.severityNumber; + break; + } + break; + case "SEVERITY_NUMBER_UNSPECIFIED": + case 0: + message.severityNumber = 0; + break; + case "SEVERITY_NUMBER_TRACE": + case 1: + message.severityNumber = 1; + break; + case "SEVERITY_NUMBER_TRACE2": + case 2: + message.severityNumber = 2; + break; + case "SEVERITY_NUMBER_TRACE3": + case 3: + message.severityNumber = 3; + break; + case "SEVERITY_NUMBER_TRACE4": + case 4: + message.severityNumber = 4; + break; + case "SEVERITY_NUMBER_DEBUG": + case 5: + message.severityNumber = 5; + break; + case "SEVERITY_NUMBER_DEBUG2": + case 6: + message.severityNumber = 6; + break; + case "SEVERITY_NUMBER_DEBUG3": + case 7: + message.severityNumber = 7; + break; + case "SEVERITY_NUMBER_DEBUG4": + case 8: + message.severityNumber = 8; + break; + case "SEVERITY_NUMBER_INFO": + case 9: + message.severityNumber = 9; + break; + case "SEVERITY_NUMBER_INFO2": + case 10: + message.severityNumber = 10; + break; + case "SEVERITY_NUMBER_INFO3": + case 11: + message.severityNumber = 11; + break; + case "SEVERITY_NUMBER_INFO4": + case 12: + message.severityNumber = 12; + break; + case "SEVERITY_NUMBER_WARN": + case 13: + message.severityNumber = 13; + break; + case "SEVERITY_NUMBER_WARN2": + case 14: + message.severityNumber = 14; + break; + case "SEVERITY_NUMBER_WARN3": + case 15: + message.severityNumber = 15; + break; + case "SEVERITY_NUMBER_WARN4": + case 16: + message.severityNumber = 16; + break; + case "SEVERITY_NUMBER_ERROR": + case 17: + message.severityNumber = 17; + break; + case "SEVERITY_NUMBER_ERROR2": + case 18: + message.severityNumber = 18; + break; + case "SEVERITY_NUMBER_ERROR3": + case 19: + message.severityNumber = 19; + break; + case "SEVERITY_NUMBER_ERROR4": + case 20: + message.severityNumber = 20; + break; + case "SEVERITY_NUMBER_FATAL": + case 21: + message.severityNumber = 21; + break; + case "SEVERITY_NUMBER_FATAL2": + case 22: + message.severityNumber = 22; + break; + case "SEVERITY_NUMBER_FATAL3": + case 23: + message.severityNumber = 23; + break; + case "SEVERITY_NUMBER_FATAL4": + case 24: + message.severityNumber = 24; + break; + } + if (object2.severityText != null) + message.severityText = String(object2.severityText); + if (object2.body != null) { + if (typeof object2.body !== "object") + throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected"); + message.body = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object2.body); + } + if (object2.attributes) { + if (!Array.isArray(object2.attributes)) + throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected"); + message.attributes = []; + for (var i = 0;i < object2.attributes.length; ++i) { + if (typeof object2.attributes[i] !== "object") + throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object2.attributes[i]); + } + } + if (object2.droppedAttributesCount != null) + message.droppedAttributesCount = object2.droppedAttributesCount >>> 0; + if (object2.flags != null) + message.flags = object2.flags >>> 0; + if (object2.traceId != null) { + if (typeof object2.traceId === "string") + $util.base64.decode(object2.traceId, message.traceId = $util.newBuffer($util.base64.length(object2.traceId)), 0); + else if (object2.traceId.length >= 0) + message.traceId = object2.traceId; + } + if (object2.spanId != null) { + if (typeof object2.spanId === "string") + $util.base64.decode(object2.spanId, message.spanId = $util.newBuffer($util.base64.length(object2.spanId)), 0); + else if (object2.spanId.length >= 0) + message.spanId = object2.spanId; + } + if (object2.eventName != null) + message.eventName = String(object2.eventName); + return message; + }; + LogRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object2 = {}; + if (options.arrays || options.defaults) + object2.attributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.timeUnixNano = options.longs === String ? "0" : 0; + object2.severityNumber = options.enums === String ? "SEVERITY_NUMBER_UNSPECIFIED" : 0; + object2.severityText = ""; + object2.body = null; + object2.droppedAttributesCount = 0; + object2.flags = 0; + if (options.bytes === String) + object2.traceId = ""; + else { + object2.traceId = []; + if (options.bytes !== Array) + object2.traceId = $util.newBuffer(object2.traceId); + } + if (options.bytes === String) + object2.spanId = ""; + else { + object2.spanId = []; + if (options.bytes !== Array) + object2.spanId = $util.newBuffer(object2.spanId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object2.observedTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object2.observedTimeUnixNano = options.longs === String ? "0" : 0; + object2.eventName = ""; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) + if (typeof message.timeUnixNano === "number") + object2.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else + object2.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; + if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) + object2.severityNumber = options.enums === String ? $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] === undefined ? message.severityNumber : $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] : message.severityNumber; + if (message.severityText != null && message.hasOwnProperty("severityText")) + object2.severityText = message.severityText; + if (message.body != null && message.hasOwnProperty("body")) + object2.body = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.body, options); + if (message.attributes && message.attributes.length) { + object2.attributes = []; + for (var j = 0;j < message.attributes.length; ++j) + object2.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) + object2.droppedAttributesCount = message.droppedAttributesCount; + if (message.flags != null && message.hasOwnProperty("flags")) + object2.flags = message.flags; + if (message.traceId != null && message.hasOwnProperty("traceId")) + object2.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; + if (message.spanId != null && message.hasOwnProperty("spanId")) + object2.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; + if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) + if (typeof message.observedTimeUnixNano === "number") + object2.observedTimeUnixNano = options.longs === String ? String(message.observedTimeUnixNano) : message.observedTimeUnixNano; + else + object2.observedTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.observedTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.observedTimeUnixNano.low >>> 0, message.observedTimeUnixNano.high >>> 0).toNumber() : message.observedTimeUnixNano; + if (message.eventName != null && message.hasOwnProperty("eventName")) + object2.eventName = message.eventName; + return object2; + }; + LogRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + LogRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogRecord"; + }; + return LogRecord; + }(); + return v1; + }(); + return logs; + }(); + return proto; + }(); + return opentelemetry; + }(); + module.exports = $root; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; + var api_1 = require_src(); + var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils6 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; + var api_1 = require_src(); + var constants_1 = require_constants3(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; + } + exports.parsePairKeyValue = parsePairKeyValue; + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); + } + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing3(); + var constants_1 = require_constants3(); + var utils_1 = require_utils6(); + + class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach((entry) => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + } + exports.W3CBaggagePropagator = W3CBaggagePropagator; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = undefined; + + class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + } + exports.AnchoredClock = AnchoredClock; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; + var api_1 = require_src(); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key.length > 0; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case "number": + case "boolean": + case "string": + return true; + } + return false; + } +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = undefined; + var api_1 = require_src(); + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); + } + } + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; + } +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; + var logging_error_handler_1 = require_logging_error_handler3(); + var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = undefined; + var api_1 = require_src(); + var util_1 = __require("util"); + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") { + return false; + } + if (raw === "true") { + return true; + } else if (raw === "false") { + return false; + } else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js +var require_globalThis3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = undefined; + exports._globalThis = typeof globalThis === "object" ? globalThis : global; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/platform/node/performance.js +var require_performance2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = undefined; + var perf_hooks_1 = __require("perf_hooks"); + exports.otperformance = perf_hooks_1.performance; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/version.js +var require_version5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.1.0"; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = undefined; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = undefined; + var version_1 = require_version5(); + var semantic_conventions_1 = require_src2(); + var semconv_1 = require_semconv3(); + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js +var require_timer_util3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = undefined; + function unrefTimer(timer) { + timer.unref(); + } + exports.unrefTimer = unrefTimer; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined; + var environment_1 = require_environment3(); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return environment_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return environment_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return environment_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return environment_1.getStringListFromEnv; + } }); + var globalThis_1 = require_globalThis3(); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return globalThis_1._globalThis; + } }); + var performance_1 = require_performance2(); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return performance_1.otperformance; + } }); + var sdk_info_1 = require_sdk_info3(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return sdk_info_1.SDK_INFO; + } }); + var timer_util_1 = require_timer_util3(); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return timer_util_1.unrefTimer; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined; + var node_1 = require_node3(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return node_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return node_1._globalThis; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return node_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return node_1.unrefTimer; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return node_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return node_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return node_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return node_1.getStringListFromEnv; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = undefined; + var platform_1 = require_platform3(); + var NANOSECOND_DIGITS = 9; + var NANOSECOND_DIGITS_IN_MILLIS = 6; + var MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); + var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + const seconds = Math.trunc(epochSeconds); + const nanos = Math.round(epochMillis % 1000 * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== "number") { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); + } + exports.hrTime = hrTime; + function timeInputToHrTime(time3) { + if (isTimeInputHrTime(time3)) { + return time3; + } else if (typeof time3 === "number") { + if (time3 < getTimeOrigin()) { + return hrTime(time3); + } else { + return millisToHrTime(time3); + } + } else if (time3 instanceof Date) { + return millisToHrTime(time3.getTime()); + } else { + throw TypeError("Invalid input type"); + } + } + exports.timeInputToHrTime = timeInputToHrTime; + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + function hrTimeToTimeStamp(time3) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time3[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date5 = new Date(time3[0] * 1000).toISOString(); + return date5.replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + function hrTimeToNanoseconds(time3) { + return time3[0] * SECOND_TO_NANOSECONDS + time3[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + function hrTimeToMilliseconds(time3) { + return time3[0] * 1000 + time3[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + function hrTimeToMicroseconds(time3) { + return time3[0] * 1e6 + time3[1] / 1000; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + function addHrTimes(time1, time22) { + const out = [time1[0] + time22[0], time1[1] + time22[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = undefined; + var ExportResultCode; + (function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; + })(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = undefined; + var api_1 = require_src(); + + class CompositePropagator { + _propagators; + _fields; + constructor(config2 = {}) { + this._propagators = config2.propagators ?? []; + this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); + } + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + return this._fields.slice(); + } + } + exports.CompositePropagator = CompositePropagator; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = undefined; + var validators_1 = require_validators3(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceState { + _internalState = new Map; + constructor(rawTraceState) { + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys().reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => { + const listMember = part.trim(); + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } else {} + } + return agg; + }, new Map); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState; + traceState._internalState = new Map(this._internalState); + return traceState; + } + } + exports.TraceState = TraceState; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing3(); + var TraceState_1 = require_TraceState3(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + var VERSION = "00"; + var VERSION_PART = "(?!ff)[\\da-f]{2}"; + var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; + var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; + var FLAGS_PART = "[\\da-f]{2}"; + var TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + + class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + } + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; + var api_1 = require_src(); + var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; + (function(RPCType2) { + RPCType2["HTTP"] = "http"; + })(RPCType = exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context, meta3) { + return context.setValue(RPC_METADATA_KEY, meta3); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = undefined; + var objectTag = "[object Object]"; + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + var objectCtorString = funcToString.call(Object); + var getPrototypeOf = Object.getPrototypeOf; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeObjectToString = objectProto.toString; + function isPlainObject2(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject2; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + function objectToString(value) { + return nativeObjectToString.call(value); + } +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = undefined; + var lodash_merge_1 = require_lodash_merge3(); + var MAX_LEVEL = 20; + function merge2(...args) { + let result = args.shift(); + const objects = new WeakMap; + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; + } + exports.merge = merge2; + function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; + } + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length;i < j; i++) { + result.push(takeValue(two[i])); + } + } else if (isObject2(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } else if (isObject2(one)) { + if (isObject2(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject2(obj1) && isObject2(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; + } + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length;i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject2(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; + } +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = undefined; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise2, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise2, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = undefined; + function urlMatches(url2, urlToMatch) { + if (typeof urlToMatch === "string") { + return url2 === urlToMatch; + } else { + return !!url2.match(urlToMatch); + } + } + exports.urlMatches = urlMatches; + function isUrlIgnored(url2, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url2, ignoreUrl)) { + return true; + } + } + return false; + } + exports.isUrlIgnored = isUrlIgnored; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = undefined; + + class Deferred { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + } + exports.Deferred = Deferred; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = undefined; + var promise_1 = require_promise3(); + + class BindOnceFuture { + _callback; + _that; + _isCalled = false; + _deferred = new promise_1.Deferred; + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + } + exports.BindOnceFuture = BindOnceFuture; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = undefined; + var api_1 = require_src(); + var logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + function diagLogLevelFromString(value) { + if (value == null) { + return; + } + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing3(); + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); + } + exports._export = _export; +}); + +// node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core/build/src/index.js +var require_src6 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator3(); + Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } }); + var anchored_clock_1 = require_anchored_clock3(); + Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { + return anchored_clock_1.AnchoredClock; + } }); + var attributes_1 = require_attributes3(); + Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { + return attributes_1.isAttributeValue; + } }); + Object.defineProperty(exports, "sanitizeAttributes", { enumerable: true, get: function() { + return attributes_1.sanitizeAttributes; + } }); + var global_error_handler_1 = require_global_error_handler3(); + Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.globalErrorHandler; + } }); + Object.defineProperty(exports, "setGlobalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } }); + var logging_error_handler_1 = require_logging_error_handler3(); + Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { + return logging_error_handler_1.loggingErrorHandler; + } }); + var time_1 = require_time3(); + Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { + return time_1.addHrTimes; + } }); + Object.defineProperty(exports, "getTimeOrigin", { enumerable: true, get: function() { + return time_1.getTimeOrigin; + } }); + Object.defineProperty(exports, "hrTime", { enumerable: true, get: function() { + return time_1.hrTime; + } }); + Object.defineProperty(exports, "hrTimeDuration", { enumerable: true, get: function() { + return time_1.hrTimeDuration; + } }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMicroseconds; + } }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMilliseconds; + } }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { enumerable: true, get: function() { + return time_1.hrTimeToNanoseconds; + } }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { + return time_1.hrTimeToTimeStamp; + } }); + Object.defineProperty(exports, "isTimeInput", { enumerable: true, get: function() { + return time_1.isTimeInput; + } }); + Object.defineProperty(exports, "isTimeInputHrTime", { enumerable: true, get: function() { + return time_1.isTimeInputHrTime; + } }); + Object.defineProperty(exports, "millisToHrTime", { enumerable: true, get: function() { + return time_1.millisToHrTime; + } }); + Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() { + return time_1.timeInputToHrTime; + } }); + var ExportResult_1 = require_ExportResult3(); + Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { + return ExportResult_1.ExportResultCode; + } }); + var utils_1 = require_utils6(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { + return utils_1.parseKeyPairsIntoRecord; + } }); + var platform_1 = require_platform3(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return platform_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return platform_1._globalThis; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return platform_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return platform_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return platform_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return platform_1.getStringListFromEnv; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return platform_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return platform_1.unrefTimer; + } }); + var composite_1 = require_composite3(); + Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { + return composite_1.CompositePropagator; + } }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator3(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } }); + Object.defineProperty(exports, "parseTraceParent", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } }); + var rpc_metadata_1 = require_rpc_metadata3(); + Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { + return rpc_metadata_1.RPCType; + } }); + Object.defineProperty(exports, "deleteRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } }); + Object.defineProperty(exports, "getRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.getRPCMetadata; + } }); + Object.defineProperty(exports, "setRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.setRPCMetadata; + } }); + var suppress_tracing_1 = require_suppress_tracing3(); + Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { + return suppress_tracing_1.isTracingSuppressed; + } }); + Object.defineProperty(exports, "suppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.suppressTracing; + } }); + Object.defineProperty(exports, "unsuppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.unsuppressTracing; + } }); + var TraceState_1 = require_TraceState3(); + Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { + return TraceState_1.TraceState; + } }); + var merge_1 = require_merge3(); + Object.defineProperty(exports, "merge", { enumerable: true, get: function() { + return merge_1.merge; + } }); + var timeout_1 = require_timeout3(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return timeout_1.TimeoutError; + } }); + Object.defineProperty(exports, "callWithTimeout", { enumerable: true, get: function() { + return timeout_1.callWithTimeout; + } }); + var url_1 = require_url3(); + Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { + return url_1.isUrlIgnored; + } }); + Object.defineProperty(exports, "urlMatches", { enumerable: true, get: function() { + return url_1.urlMatches; + } }); + var callback_1 = require_callback3(); + Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { + return callback_1.BindOnceFuture; + } }); + var configuration_1 = require_configuration3(); + Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { + return configuration_1.diagLogLevelFromString; + } }); + var exporter_1 = require_exporter3(); + exports.internal = { + _export: exporter_1._export + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/common/hex-to-binary.js +var require_hex_to_binary = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hexToBinary = undefined; + function intValue(charCode) { + if (charCode >= 48 && charCode <= 57) { + return charCode - 48; + } + if (charCode >= 97 && charCode <= 102) { + return charCode - 87; + } + return charCode - 55; + } + function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0;i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = hi << 4 | lo; + } + return buf; + } + exports.hexToBinary = hexToBinary; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js +var require_utils7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getOtlpEncoder = exports.encodeAsString = exports.encodeAsLongBits = exports.toLongBits = exports.hrTimeToNanos = undefined; + var core_1 = require_src6(); + var hex_to_binary_1 = require_hex_to_binary(); + function hrTimeToNanos(hrTime) { + const NANOSECONDS = BigInt(1e9); + return BigInt(hrTime[0]) * NANOSECONDS + BigInt(hrTime[1]); + } + exports.hrTimeToNanos = hrTimeToNanos; + function toLongBits(value) { + const low = Number(BigInt.asUintN(32, value)); + const high = Number(BigInt.asUintN(32, value >> BigInt(32))); + return { low, high }; + } + exports.toLongBits = toLongBits; + function encodeAsLongBits(hrTime) { + const nanos = hrTimeToNanos(hrTime); + return toLongBits(nanos); + } + exports.encodeAsLongBits = encodeAsLongBits; + function encodeAsString(hrTime) { + const nanos = hrTimeToNanos(hrTime); + return nanos.toString(); + } + exports.encodeAsString = encodeAsString; + var encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : core_1.hrTimeToNanoseconds; + function identity(value) { + return value; + } + function optionalHexToBinary(str) { + if (str === undefined) + return; + return (0, hex_to_binary_1.hexToBinary)(str); + } + var DEFAULT_ENCODER = { + encodeHrTime: encodeAsLongBits, + encodeSpanContext: hex_to_binary_1.hexToBinary, + encodeOptionalSpanContext: optionalHexToBinary + }; + function getOtlpEncoder(options) { + if (options === undefined) { + return DEFAULT_ENCODER; + } + const useLongBits = options.useLongBits ?? true; + const useHex = options.useHex ?? false; + return { + encodeHrTime: useLongBits ? encodeAsLongBits : encodeTimestamp, + encodeSpanContext: useHex ? identity : hex_to_binary_1.hexToBinary, + encodeOptionalSpanContext: useHex ? identity : optionalHexToBinary + }; + } + exports.getOtlpEncoder = getOtlpEncoder; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/common/internal.js +var require_internal = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toAnyValue = exports.toKeyValue = exports.toAttributes = exports.createInstrumentationScope = exports.createResource = undefined; + function createResource(resource) { + const result = { + attributes: toAttributes(resource.attributes), + droppedAttributesCount: 0 + }; + const schemaUrl = resource.schemaUrl; + if (schemaUrl && schemaUrl !== "") + result.schemaUrl = schemaUrl; + return result; + } + exports.createResource = createResource; + function createInstrumentationScope(scope) { + return { + name: scope.name, + version: scope.version + }; + } + exports.createInstrumentationScope = createInstrumentationScope; + function toAttributes(attributes) { + return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key])); + } + exports.toAttributes = toAttributes; + function toKeyValue(key, value) { + return { + key, + value: toAnyValue(value) + }; + } + exports.toKeyValue = toKeyValue; + function toAnyValue(value) { + const t = typeof value; + if (t === "string") + return { stringValue: value }; + if (t === "number") { + if (!Number.isInteger(value)) + return { doubleValue: value }; + return { intValue: value }; + } + if (t === "boolean") + return { boolValue: value }; + if (value instanceof Uint8Array) + return { bytesValue: value }; + if (Array.isArray(value)) + return { arrayValue: { values: value.map(toAnyValue) } }; + if (t === "object" && value != null) + return { + kvlistValue: { + values: Object.entries(value).map(([k, v]) => toKeyValue(k, v)) + } + }; + return {}; + } + exports.toAnyValue = toAnyValue; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal.js +var require_internal2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toLogAttributes = exports.createExportLogsServiceRequest = undefined; + var utils_1 = require_utils7(); + var internal_1 = require_internal(); + function createExportLogsServiceRequest(logRecords, options) { + const encoder = (0, utils_1.getOtlpEncoder)(options); + return { + resourceLogs: logRecordsToResourceLogs(logRecords, encoder) + }; + } + exports.createExportLogsServiceRequest = createExportLogsServiceRequest; + function createResourceMap(logRecords) { + const resourceMap = new Map; + for (const record2 of logRecords) { + const { resource, instrumentationScope: { name, version: version2 = "", schemaUrl = "" } } = record2; + let ismMap = resourceMap.get(resource); + if (!ismMap) { + ismMap = new Map; + resourceMap.set(resource, ismMap); + } + const ismKey = `${name}@${version2}:${schemaUrl}`; + let records = ismMap.get(ismKey); + if (!records) { + records = []; + ismMap.set(ismKey, records); + } + records.push(record2); + } + return resourceMap; + } + function logRecordsToResourceLogs(logRecords, encoder) { + const resourceMap = createResourceMap(logRecords); + return Array.from(resourceMap, ([resource, ismMap]) => { + const processedResource = (0, internal_1.createResource)(resource); + return { + resource: processedResource, + scopeLogs: Array.from(ismMap, ([, scopeLogs]) => { + return { + scope: (0, internal_1.createInstrumentationScope)(scopeLogs[0].instrumentationScope), + logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)), + schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl + }; + }), + schemaUrl: processedResource.schemaUrl + }; + }); + } + function toLogRecord(log, encoder) { + return { + timeUnixNano: encoder.encodeHrTime(log.hrTime), + observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved), + severityNumber: toSeverityNumber(log.severityNumber), + severityText: log.severityText, + body: (0, internal_1.toAnyValue)(log.body), + eventName: log.eventName, + attributes: toLogAttributes(log.attributes), + droppedAttributesCount: log.droppedAttributesCount, + flags: log.spanContext?.traceFlags, + traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId), + spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId) + }; + } + function toSeverityNumber(severityNumber) { + return severityNumber; + } + function toLogAttributes(attributes) { + return Object.keys(attributes).map((key) => (0, internal_1.toKeyValue)(key, attributes[key])); + } + exports.toLogAttributes = toLogAttributes; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js +var require_logs = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufLogsSerializer = undefined; + var root = require_root(); + var internal_1 = require_internal2(); + var logsResponseType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; + var logsRequestType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; + exports.ProtobufLogsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportLogsServiceRequest)(arg); + return logsRequestType.encode(request).finish(); + }, + deserializeResponse: (arg) => { + return logsResponseType.decode(arg); + } + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/index.js +var require_protobuf = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufLogsSerializer = undefined; + var logs_1 = require_logs(); + Object.defineProperty(exports, "ProtobufLogsSerializer", { enumerable: true, get: function() { + return logs_1.ProtobufLogsSerializer; + } }); +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js +var require_AggregationTemporality = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AggregationTemporality = undefined; + var AggregationTemporality; + (function(AggregationTemporality2) { + AggregationTemporality2[AggregationTemporality2["DELTA"] = 0] = "DELTA"; + AggregationTemporality2[AggregationTemporality2["CUMULATIVE"] = 1] = "CUMULATIVE"; + })(AggregationTemporality = exports.AggregationTemporality || (exports.AggregationTemporality = {})); +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js +var require_MetricData = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DataPointType = exports.InstrumentType = undefined; + var InstrumentType; + (function(InstrumentType2) { + InstrumentType2["COUNTER"] = "COUNTER"; + InstrumentType2["GAUGE"] = "GAUGE"; + InstrumentType2["HISTOGRAM"] = "HISTOGRAM"; + InstrumentType2["UP_DOWN_COUNTER"] = "UP_DOWN_COUNTER"; + InstrumentType2["OBSERVABLE_COUNTER"] = "OBSERVABLE_COUNTER"; + InstrumentType2["OBSERVABLE_GAUGE"] = "OBSERVABLE_GAUGE"; + InstrumentType2["OBSERVABLE_UP_DOWN_COUNTER"] = "OBSERVABLE_UP_DOWN_COUNTER"; + })(InstrumentType = exports.InstrumentType || (exports.InstrumentType = {})); + var DataPointType; + (function(DataPointType2) { + DataPointType2[DataPointType2["HISTOGRAM"] = 0] = "HISTOGRAM"; + DataPointType2[DataPointType2["EXPONENTIAL_HISTOGRAM"] = 1] = "EXPONENTIAL_HISTOGRAM"; + DataPointType2[DataPointType2["GAUGE"] = 2] = "GAUGE"; + DataPointType2[DataPointType2["SUM"] = 3] = "SUM"; + })(DataPointType = exports.DataPointType || (exports.DataPointType = {})); +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/utils.js +var require_utils8 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.equalsCaseInsensitive = exports.binarySearchUB = exports.setEquals = exports.FlatMap = exports.isPromiseAllSettledRejectionResult = exports.PromiseAllSettled = exports.callWithTimeout = exports.TimeoutError = exports.instrumentationScopeId = exports.hashAttributes = exports.isNotNullish = undefined; + function isNotNullish(item) { + return item !== undefined && item !== null; + } + exports.isNotNullish = isNotNullish; + function hashAttributes(attributes) { + let keys = Object.keys(attributes); + if (keys.length === 0) + return ""; + keys = keys.sort(); + return JSON.stringify(keys.map((key) => [key, attributes[key]])); + } + exports.hashAttributes = hashAttributes; + function instrumentationScopeId(instrumentationScope) { + return `${instrumentationScope.name}:${instrumentationScope.version ?? ""}:${instrumentationScope.schemaUrl ?? ""}`; + } + exports.instrumentationScopeId = instrumentationScopeId; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise2, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise2, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; + async function PromiseAllSettled(promises) { + return Promise.all(promises.map(async (p) => { + try { + const ret = await p; + return { + status: "fulfilled", + value: ret + }; + } catch (e) { + return { + status: "rejected", + reason: e + }; + } + })); + } + exports.PromiseAllSettled = PromiseAllSettled; + function isPromiseAllSettledRejectionResult(it) { + return it.status === "rejected"; + } + exports.isPromiseAllSettledRejectionResult = isPromiseAllSettledRejectionResult; + function FlatMap(arr, fn) { + const result = []; + arr.forEach((it) => { + result.push(...fn(it)); + }); + return result; + } + exports.FlatMap = FlatMap; + function setEquals(lhs, rhs) { + if (lhs.size !== rhs.size) { + return false; + } + for (const item of lhs) { + if (!rhs.has(item)) { + return false; + } + } + return true; + } + exports.setEquals = setEquals; + function binarySearchUB(arr, value) { + let lo = 0; + let hi = arr.length - 1; + let ret = arr.length; + while (hi >= lo) { + const mid = lo + Math.trunc((hi - lo) / 2); + if (arr[mid] < value) { + lo = mid + 1; + } else { + ret = mid; + hi = mid - 1; + } + } + return ret; + } + exports.binarySearchUB = binarySearchUB; + function equalsCaseInsensitive(lhs, rhs) { + return lhs.toLowerCase() === rhs.toLowerCase(); + } + exports.equalsCaseInsensitive = equalsCaseInsensitive; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js +var require_types3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AggregatorKind = undefined; + var AggregatorKind; + (function(AggregatorKind2) { + AggregatorKind2[AggregatorKind2["DROP"] = 0] = "DROP"; + AggregatorKind2[AggregatorKind2["SUM"] = 1] = "SUM"; + AggregatorKind2[AggregatorKind2["LAST_VALUE"] = 2] = "LAST_VALUE"; + AggregatorKind2[AggregatorKind2["HISTOGRAM"] = 3] = "HISTOGRAM"; + AggregatorKind2[AggregatorKind2["EXPONENTIAL_HISTOGRAM"] = 4] = "EXPONENTIAL_HISTOGRAM"; + })(AggregatorKind = exports.AggregatorKind || (exports.AggregatorKind = {})); +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Drop.js +var require_Drop = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DropAggregator = undefined; + var types_1 = require_types3(); + + class DropAggregator { + kind = types_1.AggregatorKind.DROP; + createAccumulation() { + return; + } + merge(_previous, _delta) { + return; + } + diff(_previous, _current) { + return; + } + toMetricData(_descriptor, _aggregationTemporality, _accumulationByAttributes, _endTime) { + return; + } + } + exports.DropAggregator = DropAggregator; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Histogram.js +var require_Histogram = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.HistogramAggregator = exports.HistogramAccumulation = undefined; + var types_1 = require_types3(); + var MetricData_1 = require_MetricData(); + var utils_1 = require_utils8(); + function createNewEmptyCheckpoint(boundaries) { + const counts = boundaries.map(() => 0); + counts.push(0); + return { + buckets: { + boundaries, + counts + }, + sum: 0, + count: 0, + hasMinMax: false, + min: Infinity, + max: -Infinity + }; + } + + class HistogramAccumulation { + startTime; + _boundaries; + _recordMinMax; + _current; + constructor(startTime, _boundaries, _recordMinMax = true, _current = createNewEmptyCheckpoint(_boundaries)) { + this.startTime = startTime; + this._boundaries = _boundaries; + this._recordMinMax = _recordMinMax; + this._current = _current; + } + record(value) { + if (Number.isNaN(value)) { + return; + } + this._current.count += 1; + this._current.sum += value; + if (this._recordMinMax) { + this._current.min = Math.min(value, this._current.min); + this._current.max = Math.max(value, this._current.max); + this._current.hasMinMax = true; + } + const idx = (0, utils_1.binarySearchUB)(this._boundaries, value); + this._current.buckets.counts[idx] += 1; + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + } + exports.HistogramAccumulation = HistogramAccumulation; + + class HistogramAggregator { + _boundaries; + _recordMinMax; + kind = types_1.AggregatorKind.HISTOGRAM; + constructor(_boundaries, _recordMinMax) { + this._boundaries = _boundaries; + this._recordMinMax = _recordMinMax; + } + createAccumulation(startTime) { + return new HistogramAccumulation(startTime, this._boundaries, this._recordMinMax); + } + merge(previous, delta) { + const previousValue = previous.toPointValue(); + const deltaValue = delta.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const deltaCounts = deltaValue.buckets.counts; + const mergedCounts = new Array(previousCounts.length); + for (let idx = 0;idx < previousCounts.length; idx++) { + mergedCounts[idx] = previousCounts[idx] + deltaCounts[idx]; + } + let min = Infinity; + let max = -Infinity; + if (this._recordMinMax) { + if (previousValue.hasMinMax && deltaValue.hasMinMax) { + min = Math.min(previousValue.min, deltaValue.min); + max = Math.max(previousValue.max, deltaValue.max); + } else if (previousValue.hasMinMax) { + min = previousValue.min; + max = previousValue.max; + } else if (deltaValue.hasMinMax) { + min = deltaValue.min; + max = deltaValue.max; + } + } + return new HistogramAccumulation(previous.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: mergedCounts + }, + count: previousValue.count + deltaValue.count, + sum: previousValue.sum + deltaValue.sum, + hasMinMax: this._recordMinMax && (previousValue.hasMinMax || deltaValue.hasMinMax), + min, + max + }); + } + diff(previous, current) { + const previousValue = previous.toPointValue(); + const currentValue = current.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const currentCounts = currentValue.buckets.counts; + const diffedCounts = new Array(previousCounts.length); + for (let idx = 0;idx < previousCounts.length; idx++) { + diffedCounts[idx] = currentCounts[idx] - previousCounts[idx]; + } + return new HistogramAccumulation(current.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: diffedCounts + }, + count: currentValue.count - previousValue.count, + sum: currentValue.sum - previousValue.sum, + hasMinMax: false, + min: Infinity, + max: -Infinity + }); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.HISTOGRAM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + const pointValue = accumulation.toPointValue(); + const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: { + min: pointValue.hasMinMax ? pointValue.min : undefined, + max: pointValue.hasMinMax ? pointValue.max : undefined, + sum: !allowsNegativeValues ? pointValue.sum : undefined, + buckets: pointValue.buckets, + count: pointValue.count + } + }; + }) + }; + } + } + exports.HistogramAggregator = HistogramAggregator; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/Buckets.js +var require_Buckets = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Buckets = undefined; + + class Buckets { + backing; + indexBase; + indexStart; + indexEnd; + constructor(backing = new BucketsBacking, indexBase = 0, indexStart = 0, indexEnd = 0) { + this.backing = backing; + this.indexBase = indexBase; + this.indexStart = indexStart; + this.indexEnd = indexEnd; + } + get offset() { + return this.indexStart; + } + get length() { + if (this.backing.length === 0) { + return 0; + } + if (this.indexEnd === this.indexStart && this.at(0) === 0) { + return 0; + } + return this.indexEnd - this.indexStart + 1; + } + counts() { + return Array.from({ length: this.length }, (_, i) => this.at(i)); + } + at(position) { + const bias = this.indexBase - this.indexStart; + if (position < bias) { + position += this.backing.length; + } + position -= bias; + return this.backing.countAt(position); + } + incrementBucket(bucketIndex, increment) { + this.backing.increment(bucketIndex, increment); + } + decrementBucket(bucketIndex, decrement) { + this.backing.decrement(bucketIndex, decrement); + } + trim() { + for (let i = 0;i < this.length; i++) { + if (this.at(i) !== 0) { + this.indexStart += i; + break; + } else if (i === this.length - 1) { + this.indexStart = this.indexEnd = this.indexBase = 0; + return; + } + } + for (let i = this.length - 1;i >= 0; i--) { + if (this.at(i) !== 0) { + this.indexEnd -= this.length - i - 1; + break; + } + } + this._rotate(); + } + downscale(by) { + this._rotate(); + const size = 1 + this.indexEnd - this.indexStart; + const each = 1 << by; + let inpos = 0; + let outpos = 0; + for (let pos = this.indexStart;pos <= this.indexEnd; ) { + let mod = pos % each; + if (mod < 0) { + mod += each; + } + for (let i = mod;i < each && inpos < size; i++) { + this._relocateBucket(outpos, inpos); + inpos++; + pos++; + } + outpos++; + } + this.indexStart >>= by; + this.indexEnd >>= by; + this.indexBase = this.indexStart; + } + clone() { + return new Buckets(this.backing.clone(), this.indexBase, this.indexStart, this.indexEnd); + } + _rotate() { + const bias = this.indexBase - this.indexStart; + if (bias === 0) { + return; + } else if (bias > 0) { + this.backing.reverse(0, this.backing.length); + this.backing.reverse(0, bias); + this.backing.reverse(bias, this.backing.length); + } else { + this.backing.reverse(0, this.backing.length); + this.backing.reverse(0, this.backing.length + bias); + } + this.indexBase = this.indexStart; + } + _relocateBucket(dest, src) { + if (dest === src) { + return; + } + this.incrementBucket(dest, this.backing.emptyBucket(src)); + } + } + exports.Buckets = Buckets; + + class BucketsBacking { + _counts; + constructor(_counts = [0]) { + this._counts = _counts; + } + get length() { + return this._counts.length; + } + countAt(pos) { + return this._counts[pos]; + } + growTo(newSize, oldPositiveLimit, newPositiveLimit) { + const tmp = new Array(newSize).fill(0); + tmp.splice(newPositiveLimit, this._counts.length - oldPositiveLimit, ...this._counts.slice(oldPositiveLimit)); + tmp.splice(0, oldPositiveLimit, ...this._counts.slice(0, oldPositiveLimit)); + this._counts = tmp; + } + reverse(from, limit) { + const num = Math.floor((from + limit) / 2) - from; + for (let i = 0;i < num; i++) { + const tmp = this._counts[from + i]; + this._counts[from + i] = this._counts[limit - i - 1]; + this._counts[limit - i - 1] = tmp; + } + } + emptyBucket(src) { + const tmp = this._counts[src]; + this._counts[src] = 0; + return tmp; + } + increment(bucketIndex, increment) { + this._counts[bucketIndex] += increment; + } + decrement(bucketIndex, decrement) { + if (this._counts[bucketIndex] >= decrement) { + this._counts[bucketIndex] -= decrement; + } else { + this._counts[bucketIndex] = 0; + } + } + clone() { + return new BucketsBacking([...this._counts]); + } + } +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js +var require_ieee754 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSignificand = exports.getNormalBase2 = exports.MIN_VALUE = exports.MAX_NORMAL_EXPONENT = exports.MIN_NORMAL_EXPONENT = exports.SIGNIFICAND_WIDTH = undefined; + exports.SIGNIFICAND_WIDTH = 52; + var EXPONENT_MASK = 2146435072; + var SIGNIFICAND_MASK = 1048575; + var EXPONENT_BIAS = 1023; + exports.MIN_NORMAL_EXPONENT = -EXPONENT_BIAS + 1; + exports.MAX_NORMAL_EXPONENT = EXPONENT_BIAS; + exports.MIN_VALUE = Math.pow(2, -1022); + function getNormalBase2(value) { + const dv = new DataView(new ArrayBuffer(8)); + dv.setFloat64(0, value); + const hiBits = dv.getUint32(0); + const expBits = (hiBits & EXPONENT_MASK) >> 20; + return expBits - EXPONENT_BIAS; + } + exports.getNormalBase2 = getNormalBase2; + function getSignificand(value) { + const dv = new DataView(new ArrayBuffer(8)); + dv.setFloat64(0, value); + const hiBits = dv.getUint32(0); + const loBits = dv.getUint32(4); + const significandHiBits = (hiBits & SIGNIFICAND_MASK) * Math.pow(2, 32); + return significandHiBits + loBits; + } + exports.getSignificand = getSignificand; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js +var require_util = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.nextGreaterSquare = exports.ldexp = undefined; + function ldexp(frac, exp) { + if (frac === 0 || frac === Number.POSITIVE_INFINITY || frac === Number.NEGATIVE_INFINITY || Number.isNaN(frac)) { + return frac; + } + return frac * Math.pow(2, exp); + } + exports.ldexp = ldexp; + function nextGreaterSquare(v) { + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; + } + exports.nextGreaterSquare = nextGreaterSquare; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/types.js +var require_types4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MappingError = undefined; + + class MappingError extends Error { + } + exports.MappingError = MappingError; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js +var require_ExponentMapping = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExponentMapping = undefined; + var ieee754 = require_ieee754(); + var util = require_util(); + var types_1 = require_types4(); + + class ExponentMapping { + _shift; + constructor(scale) { + this._shift = -scale; + } + mapToIndex(value) { + if (value < ieee754.MIN_VALUE) { + return this._minNormalLowerBoundaryIndex(); + } + const exp = ieee754.getNormalBase2(value); + const correction = this._rightShift(ieee754.getSignificand(value) - 1, ieee754.SIGNIFICAND_WIDTH); + return exp + correction >> this._shift; + } + lowerBoundary(index) { + const minIndex = this._minNormalLowerBoundaryIndex(); + if (index < minIndex) { + throw new types_1.MappingError(`underflow: ${index} is < minimum lower boundary: ${minIndex}`); + } + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index > maxIndex) { + throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); + } + return util.ldexp(1, index << this._shift); + } + get scale() { + if (this._shift === 0) { + return 0; + } + return -this._shift; + } + _minNormalLowerBoundaryIndex() { + let index = ieee754.MIN_NORMAL_EXPONENT >> this._shift; + if (this._shift < 2) { + index--; + } + return index; + } + _maxNormalLowerBoundaryIndex() { + return ieee754.MAX_NORMAL_EXPONENT >> this._shift; + } + _rightShift(value, shift) { + return Math.floor(value * Math.pow(2, -shift)); + } + } + exports.ExponentMapping = ExponentMapping; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js +var require_LogarithmMapping = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.LogarithmMapping = undefined; + var ieee754 = require_ieee754(); + var util = require_util(); + var types_1 = require_types4(); + + class LogarithmMapping { + _scale; + _scaleFactor; + _inverseFactor; + constructor(scale) { + this._scale = scale; + this._scaleFactor = util.ldexp(Math.LOG2E, scale); + this._inverseFactor = util.ldexp(Math.LN2, -scale); + } + mapToIndex(value) { + if (value <= ieee754.MIN_VALUE) { + return this._minNormalLowerBoundaryIndex() - 1; + } + if (ieee754.getSignificand(value) === 0) { + const exp = ieee754.getNormalBase2(value); + return (exp << this._scale) - 1; + } + const index = Math.floor(Math.log(value) * this._scaleFactor); + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index >= maxIndex) { + return maxIndex; + } + return index; + } + lowerBoundary(index) { + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index >= maxIndex) { + if (index === maxIndex) { + return 2 * Math.exp((index - (1 << this._scale)) / this._scaleFactor); + } + throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); + } + const minIndex = this._minNormalLowerBoundaryIndex(); + if (index <= minIndex) { + if (index === minIndex) { + return ieee754.MIN_VALUE; + } else if (index === minIndex - 1) { + return Math.exp((index + (1 << this._scale)) / this._scaleFactor) / 2; + } + throw new types_1.MappingError(`overflow: ${index} is < minimum lower boundary: ${minIndex}`); + } + return Math.exp(index * this._inverseFactor); + } + get scale() { + return this._scale; + } + _minNormalLowerBoundaryIndex() { + return ieee754.MIN_NORMAL_EXPONENT << this._scale; + } + _maxNormalLowerBoundaryIndex() { + return (ieee754.MAX_NORMAL_EXPONENT + 1 << this._scale) - 1; + } + } + exports.LogarithmMapping = LogarithmMapping; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/getMapping.js +var require_getMapping = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMapping = undefined; + var ExponentMapping_1 = require_ExponentMapping(); + var LogarithmMapping_1 = require_LogarithmMapping(); + var types_1 = require_types4(); + var MIN_SCALE = -10; + var MAX_SCALE = 20; + var PREBUILT_MAPPINGS = Array.from({ length: 31 }, (_, i) => { + if (i > 10) { + return new LogarithmMapping_1.LogarithmMapping(i - 10); + } + return new ExponentMapping_1.ExponentMapping(i - 10); + }); + function getMapping(scale) { + if (scale > MAX_SCALE || scale < MIN_SCALE) { + throw new types_1.MappingError(`expected scale >= ${MIN_SCALE} && <= ${MAX_SCALE}, got: ${scale}`); + } + return PREBUILT_MAPPINGS[scale + 10]; + } + exports.getMapping = getMapping; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js +var require_ExponentialHistogram = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = undefined; + var types_1 = require_types3(); + var MetricData_1 = require_MetricData(); + var api_1 = require_src(); + var Buckets_1 = require_Buckets(); + var getMapping_1 = require_getMapping(); + var util_1 = require_util(); + + class HighLow { + low; + high; + static combine(h1, h2) { + return new HighLow(Math.min(h1.low, h2.low), Math.max(h1.high, h2.high)); + } + constructor(low, high) { + this.low = low; + this.high = high; + } + } + var MAX_SCALE = 20; + var DEFAULT_MAX_SIZE = 160; + var MIN_MAX_SIZE = 2; + + class ExponentialHistogramAccumulation { + startTime; + _maxSize; + _recordMinMax; + _sum; + _count; + _zeroCount; + _min; + _max; + _positive; + _negative; + _mapping; + constructor(startTime, _maxSize2 = DEFAULT_MAX_SIZE, _recordMinMax = true, _sum = 0, _count = 0, _zeroCount = 0, _min = Number.POSITIVE_INFINITY, _max = Number.NEGATIVE_INFINITY, _positive2 = new Buckets_1.Buckets, _negative2 = new Buckets_1.Buckets, _mapping = (0, getMapping_1.getMapping)(MAX_SCALE)) { + this.startTime = startTime; + this._maxSize = _maxSize2; + this._recordMinMax = _recordMinMax; + this._sum = _sum; + this._count = _count; + this._zeroCount = _zeroCount; + this._min = _min; + this._max = _max; + this._positive = _positive2; + this._negative = _negative2; + this._mapping = _mapping; + if (this._maxSize < MIN_MAX_SIZE) { + api_1.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${MIN_MAX_SIZE}`); + this._maxSize = MIN_MAX_SIZE; + } + } + record(value) { + this.updateByIncrement(value, 1); + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return { + hasMinMax: this._recordMinMax, + min: this.min, + max: this.max, + sum: this.sum, + positive: { + offset: this.positive.offset, + bucketCounts: this.positive.counts() + }, + negative: { + offset: this.negative.offset, + bucketCounts: this.negative.counts() + }, + count: this.count, + scale: this.scale, + zeroCount: this.zeroCount + }; + } + get sum() { + return this._sum; + } + get min() { + return this._min; + } + get max() { + return this._max; + } + get count() { + return this._count; + } + get zeroCount() { + return this._zeroCount; + } + get scale() { + if (this._count === this._zeroCount) { + return 0; + } + return this._mapping.scale; + } + get positive() { + return this._positive; + } + get negative() { + return this._negative; + } + updateByIncrement(value, increment) { + if (Number.isNaN(value)) { + return; + } + if (value > this._max) { + this._max = value; + } + if (value < this._min) { + this._min = value; + } + this._count += increment; + if (value === 0) { + this._zeroCount += increment; + return; + } + this._sum += value * increment; + if (value > 0) { + this._updateBuckets(this._positive, value, increment); + } else { + this._updateBuckets(this._negative, -value, increment); + } + } + merge(previous) { + if (this._count === 0) { + this._min = previous.min; + this._max = previous.max; + } else if (previous.count !== 0) { + if (previous.min < this.min) { + this._min = previous.min; + } + if (previous.max > this.max) { + this._max = previous.max; + } + } + this.startTime = previous.startTime; + this._sum += previous.sum; + this._count += previous.count; + this._zeroCount += previous.zeroCount; + const minScale = this._minScale(previous); + this._downscale(this.scale - minScale); + this._mergeBuckets(this.positive, previous, previous.positive, minScale); + this._mergeBuckets(this.negative, previous, previous.negative, minScale); + } + diff(other) { + this._min = Infinity; + this._max = -Infinity; + this._sum -= other.sum; + this._count -= other.count; + this._zeroCount -= other.zeroCount; + const minScale = this._minScale(other); + this._downscale(this.scale - minScale); + this._diffBuckets(this.positive, other, other.positive, minScale); + this._diffBuckets(this.negative, other, other.negative, minScale); + } + clone() { + return new ExponentialHistogramAccumulation(this.startTime, this._maxSize, this._recordMinMax, this._sum, this._count, this._zeroCount, this._min, this._max, this.positive.clone(), this.negative.clone(), this._mapping); + } + _updateBuckets(buckets, value, increment) { + let index = this._mapping.mapToIndex(value); + let rescalingNeeded = false; + let high = 0; + let low = 0; + if (buckets.length === 0) { + buckets.indexStart = index; + buckets.indexEnd = buckets.indexStart; + buckets.indexBase = buckets.indexStart; + } else if (index < buckets.indexStart && buckets.indexEnd - index >= this._maxSize) { + rescalingNeeded = true; + low = index; + high = buckets.indexEnd; + } else if (index > buckets.indexEnd && index - buckets.indexStart >= this._maxSize) { + rescalingNeeded = true; + low = buckets.indexStart; + high = index; + } + if (rescalingNeeded) { + const change = this._changeScale(high, low); + this._downscale(change); + index = this._mapping.mapToIndex(value); + } + this._incrementIndexBy(buckets, index, increment); + } + _incrementIndexBy(buckets, index, increment) { + if (increment === 0) { + return; + } + if (buckets.length === 0) { + buckets.indexStart = buckets.indexEnd = buckets.indexBase = index; + } + if (index < buckets.indexStart) { + const span = buckets.indexEnd - index; + if (span >= buckets.backing.length) { + this._grow(buckets, span + 1); + } + buckets.indexStart = index; + } else if (index > buckets.indexEnd) { + const span = index - buckets.indexStart; + if (span >= buckets.backing.length) { + this._grow(buckets, span + 1); + } + buckets.indexEnd = index; + } + let bucketIndex = index - buckets.indexBase; + if (bucketIndex < 0) { + bucketIndex += buckets.backing.length; + } + buckets.incrementBucket(bucketIndex, increment); + } + _grow(buckets, needed) { + const size = buckets.backing.length; + const bias = buckets.indexBase - buckets.indexStart; + const oldPositiveLimit = size - bias; + let newSize = (0, util_1.nextGreaterSquare)(needed); + if (newSize > this._maxSize) { + newSize = this._maxSize; + } + const newPositiveLimit = newSize - bias; + buckets.backing.growTo(newSize, oldPositiveLimit, newPositiveLimit); + } + _changeScale(high, low) { + let change = 0; + while (high - low >= this._maxSize) { + high >>= 1; + low >>= 1; + change++; + } + return change; + } + _downscale(change) { + if (change === 0) { + return; + } + if (change < 0) { + throw new Error(`impossible change of scale: ${this.scale}`); + } + const newScale = this._mapping.scale - change; + this._positive.downscale(change); + this._negative.downscale(change); + this._mapping = (0, getMapping_1.getMapping)(newScale); + } + _minScale(other) { + const minScale = Math.min(this.scale, other.scale); + const highLowPos = HighLow.combine(this._highLowAtScale(this.positive, this.scale, minScale), this._highLowAtScale(other.positive, other.scale, minScale)); + const highLowNeg = HighLow.combine(this._highLowAtScale(this.negative, this.scale, minScale), this._highLowAtScale(other.negative, other.scale, minScale)); + return Math.min(minScale - this._changeScale(highLowPos.high, highLowPos.low), minScale - this._changeScale(highLowNeg.high, highLowNeg.low)); + } + _highLowAtScale(buckets, currentScale, newScale) { + if (buckets.length === 0) { + return new HighLow(0, -1); + } + const shift = currentScale - newScale; + return new HighLow(buckets.indexStart >> shift, buckets.indexEnd >> shift); + } + _mergeBuckets(ours, other, theirs, scale) { + const theirOffset = theirs.offset; + const theirChange = other.scale - scale; + for (let i = 0;i < theirs.length; i++) { + this._incrementIndexBy(ours, theirOffset + i >> theirChange, theirs.at(i)); + } + } + _diffBuckets(ours, other, theirs, scale) { + const theirOffset = theirs.offset; + const theirChange = other.scale - scale; + for (let i = 0;i < theirs.length; i++) { + const ourIndex = theirOffset + i >> theirChange; + let bucketIndex = ourIndex - ours.indexBase; + if (bucketIndex < 0) { + bucketIndex += ours.backing.length; + } + ours.decrementBucket(bucketIndex, theirs.at(i)); + } + ours.trim(); + } + } + exports.ExponentialHistogramAccumulation = ExponentialHistogramAccumulation; + + class ExponentialHistogramAggregator { + _maxSize; + _recordMinMax; + kind = types_1.AggregatorKind.EXPONENTIAL_HISTOGRAM; + constructor(_maxSize2, _recordMinMax) { + this._maxSize = _maxSize2; + this._recordMinMax = _recordMinMax; + } + createAccumulation(startTime) { + return new ExponentialHistogramAccumulation(startTime, this._maxSize, this._recordMinMax); + } + merge(previous, delta) { + const result = delta.clone(); + result.merge(previous); + return result; + } + diff(previous, current) { + const result = current.clone(); + result.diff(previous); + return result; + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.EXPONENTIAL_HISTOGRAM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + const pointValue = accumulation.toPointValue(); + const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: { + min: pointValue.hasMinMax ? pointValue.min : undefined, + max: pointValue.hasMinMax ? pointValue.max : undefined, + sum: !allowsNegativeValues ? pointValue.sum : undefined, + positive: { + offset: pointValue.positive.offset, + bucketCounts: pointValue.positive.bucketCounts + }, + negative: { + offset: pointValue.negative.offset, + bucketCounts: pointValue.negative.bucketCounts + }, + count: pointValue.count, + scale: pointValue.scale, + zeroCount: pointValue.zeroCount + } + }; + }) + }; + } + } + exports.ExponentialHistogramAggregator = ExponentialHistogramAggregator; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; + var api_1 = require_src(); + var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils9 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; + var api_1 = require_src(); + var constants_1 = require_constants4(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; + } + exports.parsePairKeyValue = parsePairKeyValue; + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); + } + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing4(); + var constants_1 = require_constants4(); + var utils_1 = require_utils9(); + + class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach((entry) => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + } + exports.W3CBaggagePropagator = W3CBaggagePropagator; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = undefined; + + class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + } + exports.AnchoredClock = AnchoredClock; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; + var api_1 = require_src(); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key.length > 0; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case "number": + case "boolean": + case "string": + return true; + } + return false; + } +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = undefined; + var api_1 = require_src(); + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); + } + } + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; + } +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; + var logging_error_handler_1 = require_logging_error_handler4(); + var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = undefined; + var api_1 = require_src(); + var util_1 = __require("util"); + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") { + return false; + } + if (raw === "true") { + return true; + } else if (raw === "false") { + return false; + } else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js +var require_globalThis4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = undefined; + exports._globalThis = typeof globalThis === "object" ? globalThis : global; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/platform/node/performance.js +var require_performance3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = undefined; + var perf_hooks_1 = __require("perf_hooks"); + exports.otperformance = perf_hooks_1.performance; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/version.js +var require_version6 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.1.0"; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = undefined; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = undefined; + var version_1 = require_version6(); + var semantic_conventions_1 = require_src2(); + var semconv_1 = require_semconv4(); + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js +var require_timer_util4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = undefined; + function unrefTimer(timer) { + timer.unref(); + } + exports.unrefTimer = unrefTimer; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined; + var environment_1 = require_environment4(); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return environment_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return environment_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return environment_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return environment_1.getStringListFromEnv; + } }); + var globalThis_1 = require_globalThis4(); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return globalThis_1._globalThis; + } }); + var performance_1 = require_performance3(); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return performance_1.otperformance; + } }); + var sdk_info_1 = require_sdk_info4(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return sdk_info_1.SDK_INFO; + } }); + var timer_util_1 = require_timer_util4(); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return timer_util_1.unrefTimer; + } }); +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined; + var node_1 = require_node4(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return node_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return node_1._globalThis; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return node_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return node_1.unrefTimer; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return node_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return node_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return node_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return node_1.getStringListFromEnv; + } }); +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = undefined; + var platform_1 = require_platform4(); + var NANOSECOND_DIGITS = 9; + var NANOSECOND_DIGITS_IN_MILLIS = 6; + var MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); + var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + const seconds = Math.trunc(epochSeconds); + const nanos = Math.round(epochMillis % 1000 * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== "number") { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); + } + exports.hrTime = hrTime; + function timeInputToHrTime(time3) { + if (isTimeInputHrTime(time3)) { + return time3; + } else if (typeof time3 === "number") { + if (time3 < getTimeOrigin()) { + return hrTime(time3); + } else { + return millisToHrTime(time3); + } + } else if (time3 instanceof Date) { + return millisToHrTime(time3.getTime()); + } else { + throw TypeError("Invalid input type"); + } + } + exports.timeInputToHrTime = timeInputToHrTime; + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + function hrTimeToTimeStamp(time3) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time3[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date5 = new Date(time3[0] * 1000).toISOString(); + return date5.replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + function hrTimeToNanoseconds(time3) { + return time3[0] * SECOND_TO_NANOSECONDS + time3[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + function hrTimeToMilliseconds(time3) { + return time3[0] * 1000 + time3[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + function hrTimeToMicroseconds(time3) { + return time3[0] * 1e6 + time3[1] / 1000; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + function addHrTimes(time1, time22) { + const out = [time1[0] + time22[0], time1[1] + time22[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = undefined; + var ExportResultCode; + (function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; + })(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = undefined; + var api_1 = require_src(); + + class CompositePropagator { + _propagators; + _fields; + constructor(config2 = {}) { + this._propagators = config2.propagators ?? []; + this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); + } + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + return this._fields.slice(); + } + } + exports.CompositePropagator = CompositePropagator; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = undefined; + var validators_1 = require_validators4(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceState { + _internalState = new Map; + constructor(rawTraceState) { + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys().reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => { + const listMember = part.trim(); + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } else {} + } + return agg; + }, new Map); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState; + traceState._internalState = new Map(this._internalState); + return traceState; + } + } + exports.TraceState = TraceState; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing4(); + var TraceState_1 = require_TraceState4(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + var VERSION = "00"; + var VERSION_PART = "(?!ff)[\\da-f]{2}"; + var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; + var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; + var FLAGS_PART = "[\\da-f]{2}"; + var TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + + class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + } + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; + var api_1 = require_src(); + var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; + (function(RPCType2) { + RPCType2["HTTP"] = "http"; + })(RPCType = exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context, meta3) { + return context.setValue(RPC_METADATA_KEY, meta3); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = undefined; + var objectTag = "[object Object]"; + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + var objectCtorString = funcToString.call(Object); + var getPrototypeOf = Object.getPrototypeOf; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeObjectToString = objectProto.toString; + function isPlainObject2(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject2; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + function objectToString(value) { + return nativeObjectToString.call(value); + } +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = undefined; + var lodash_merge_1 = require_lodash_merge4(); + var MAX_LEVEL = 20; + function merge2(...args) { + let result = args.shift(); + const objects = new WeakMap; + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; + } + exports.merge = merge2; + function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; + } + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length;i < j; i++) { + result.push(takeValue(two[i])); + } + } else if (isObject2(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } else if (isObject2(one)) { + if (isObject2(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject2(obj1) && isObject2(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; + } + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length;i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject2(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; + } +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = undefined; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise2, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise2, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = undefined; + function urlMatches(url2, urlToMatch) { + if (typeof urlToMatch === "string") { + return url2 === urlToMatch; + } else { + return !!url2.match(urlToMatch); + } + } + exports.urlMatches = urlMatches; + function isUrlIgnored(url2, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url2, ignoreUrl)) { + return true; + } + } + return false; + } + exports.isUrlIgnored = isUrlIgnored; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = undefined; + + class Deferred { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + } + exports.Deferred = Deferred; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = undefined; + var promise_1 = require_promise4(); + + class BindOnceFuture { + _callback; + _that; + _isCalled = false; + _deferred = new promise_1.Deferred; + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + } + exports.BindOnceFuture = BindOnceFuture; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = undefined; + var api_1 = require_src(); + var logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + function diagLogLevelFromString(value) { + if (value == null) { + return; + } + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing4(); + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); + } + exports._export = _export; +}); + +// node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core/build/src/index.js +var require_src7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator4(); + Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } }); + var anchored_clock_1 = require_anchored_clock4(); + Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { + return anchored_clock_1.AnchoredClock; + } }); + var attributes_1 = require_attributes4(); + Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { + return attributes_1.isAttributeValue; + } }); + Object.defineProperty(exports, "sanitizeAttributes", { enumerable: true, get: function() { + return attributes_1.sanitizeAttributes; + } }); + var global_error_handler_1 = require_global_error_handler4(); + Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.globalErrorHandler; + } }); + Object.defineProperty(exports, "setGlobalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } }); + var logging_error_handler_1 = require_logging_error_handler4(); + Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { + return logging_error_handler_1.loggingErrorHandler; + } }); + var time_1 = require_time4(); + Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { + return time_1.addHrTimes; + } }); + Object.defineProperty(exports, "getTimeOrigin", { enumerable: true, get: function() { + return time_1.getTimeOrigin; + } }); + Object.defineProperty(exports, "hrTime", { enumerable: true, get: function() { + return time_1.hrTime; + } }); + Object.defineProperty(exports, "hrTimeDuration", { enumerable: true, get: function() { + return time_1.hrTimeDuration; + } }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMicroseconds; + } }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMilliseconds; + } }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { enumerable: true, get: function() { + return time_1.hrTimeToNanoseconds; + } }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { + return time_1.hrTimeToTimeStamp; + } }); + Object.defineProperty(exports, "isTimeInput", { enumerable: true, get: function() { + return time_1.isTimeInput; + } }); + Object.defineProperty(exports, "isTimeInputHrTime", { enumerable: true, get: function() { + return time_1.isTimeInputHrTime; + } }); + Object.defineProperty(exports, "millisToHrTime", { enumerable: true, get: function() { + return time_1.millisToHrTime; + } }); + Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() { + return time_1.timeInputToHrTime; + } }); + var ExportResult_1 = require_ExportResult4(); + Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { + return ExportResult_1.ExportResultCode; + } }); + var utils_1 = require_utils9(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { + return utils_1.parseKeyPairsIntoRecord; + } }); + var platform_1 = require_platform4(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return platform_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return platform_1._globalThis; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return platform_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return platform_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return platform_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return platform_1.getStringListFromEnv; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return platform_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return platform_1.unrefTimer; + } }); + var composite_1 = require_composite4(); + Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { + return composite_1.CompositePropagator; + } }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator4(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } }); + Object.defineProperty(exports, "parseTraceParent", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } }); + var rpc_metadata_1 = require_rpc_metadata4(); + Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { + return rpc_metadata_1.RPCType; + } }); + Object.defineProperty(exports, "deleteRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } }); + Object.defineProperty(exports, "getRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.getRPCMetadata; + } }); + Object.defineProperty(exports, "setRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.setRPCMetadata; + } }); + var suppress_tracing_1 = require_suppress_tracing4(); + Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { + return suppress_tracing_1.isTracingSuppressed; + } }); + Object.defineProperty(exports, "suppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.suppressTracing; + } }); + Object.defineProperty(exports, "unsuppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.unsuppressTracing; + } }); + var TraceState_1 = require_TraceState4(); + Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { + return TraceState_1.TraceState; + } }); + var merge_1 = require_merge4(); + Object.defineProperty(exports, "merge", { enumerable: true, get: function() { + return merge_1.merge; + } }); + var timeout_1 = require_timeout4(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return timeout_1.TimeoutError; + } }); + Object.defineProperty(exports, "callWithTimeout", { enumerable: true, get: function() { + return timeout_1.callWithTimeout; + } }); + var url_1 = require_url4(); + Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { + return url_1.isUrlIgnored; + } }); + Object.defineProperty(exports, "urlMatches", { enumerable: true, get: function() { + return url_1.urlMatches; + } }); + var callback_1 = require_callback4(); + Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { + return callback_1.BindOnceFuture; + } }); + var configuration_1 = require_configuration4(); + Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { + return configuration_1.diagLogLevelFromString; + } }); + var exporter_1 = require_exporter4(); + exports.internal = { + _export: exporter_1._export + }; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/LastValue.js +var require_LastValue = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.LastValueAggregator = exports.LastValueAccumulation = undefined; + var types_1 = require_types3(); + var core_1 = require_src7(); + var MetricData_1 = require_MetricData(); + + class LastValueAccumulation { + startTime; + _current; + sampleTime; + constructor(startTime, _current = 0, sampleTime = [0, 0]) { + this.startTime = startTime; + this._current = _current; + this.sampleTime = sampleTime; + } + record(value) { + this._current = value; + this.sampleTime = (0, core_1.millisToHrTime)(Date.now()); + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + } + exports.LastValueAccumulation = LastValueAccumulation; + + class LastValueAggregator { + kind = types_1.AggregatorKind.LAST_VALUE; + createAccumulation(startTime) { + return new LastValueAccumulation(startTime); + } + merge(previous, delta) { + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(delta.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? delta : previous; + return new LastValueAccumulation(previous.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); + } + diff(previous, current) { + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(current.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? current : previous; + return new LastValueAccumulation(current.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.GAUGE, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue() + }; + }) + }; + } + } + exports.LastValueAggregator = LastValueAggregator; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Sum.js +var require_Sum = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SumAggregator = exports.SumAccumulation = undefined; + var types_1 = require_types3(); + var MetricData_1 = require_MetricData(); + + class SumAccumulation { + startTime; + monotonic; + _current; + reset; + constructor(startTime, monotonic, _current = 0, reset = false) { + this.startTime = startTime; + this.monotonic = monotonic; + this._current = _current; + this.reset = reset; + } + record(value) { + if (this.monotonic && value < 0) { + return; + } + this._current += value; + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + } + exports.SumAccumulation = SumAccumulation; + + class SumAggregator { + monotonic; + kind = types_1.AggregatorKind.SUM; + constructor(monotonic) { + this.monotonic = monotonic; + } + createAccumulation(startTime) { + return new SumAccumulation(startTime, this.monotonic); + } + merge(previous, delta) { + const prevPv = previous.toPointValue(); + const deltaPv = delta.toPointValue(); + if (delta.reset) { + return new SumAccumulation(delta.startTime, this.monotonic, deltaPv, delta.reset); + } + return new SumAccumulation(previous.startTime, this.monotonic, prevPv + deltaPv); + } + diff(previous, current) { + const prevPv = previous.toPointValue(); + const currPv = current.toPointValue(); + if (this.monotonic && prevPv > currPv) { + return new SumAccumulation(current.startTime, this.monotonic, currPv, true); + } + return new SumAccumulation(current.startTime, this.monotonic, currPv - prevPv); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.SUM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue() + }; + }), + isMonotonic: this.monotonic + }; + } + } + exports.SumAggregator = SumAggregator; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/index.js +var require_aggregator = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SumAggregator = exports.SumAccumulation = exports.LastValueAggregator = exports.LastValueAccumulation = exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = exports.HistogramAggregator = exports.HistogramAccumulation = exports.DropAggregator = undefined; + var Drop_1 = require_Drop(); + Object.defineProperty(exports, "DropAggregator", { enumerable: true, get: function() { + return Drop_1.DropAggregator; + } }); + var Histogram_1 = require_Histogram(); + Object.defineProperty(exports, "HistogramAccumulation", { enumerable: true, get: function() { + return Histogram_1.HistogramAccumulation; + } }); + Object.defineProperty(exports, "HistogramAggregator", { enumerable: true, get: function() { + return Histogram_1.HistogramAggregator; + } }); + var ExponentialHistogram_1 = require_ExponentialHistogram(); + Object.defineProperty(exports, "ExponentialHistogramAccumulation", { enumerable: true, get: function() { + return ExponentialHistogram_1.ExponentialHistogramAccumulation; + } }); + Object.defineProperty(exports, "ExponentialHistogramAggregator", { enumerable: true, get: function() { + return ExponentialHistogram_1.ExponentialHistogramAggregator; + } }); + var LastValue_1 = require_LastValue(); + Object.defineProperty(exports, "LastValueAccumulation", { enumerable: true, get: function() { + return LastValue_1.LastValueAccumulation; + } }); + Object.defineProperty(exports, "LastValueAggregator", { enumerable: true, get: function() { + return LastValue_1.LastValueAggregator; + } }); + var Sum_1 = require_Sum(); + Object.defineProperty(exports, "SumAccumulation", { enumerable: true, get: function() { + return Sum_1.SumAccumulation; + } }); + Object.defineProperty(exports, "SumAggregator", { enumerable: true, get: function() { + return Sum_1.SumAggregator; + } }); +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/Aggregation.js +var require_Aggregation = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_AGGREGATION = exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = exports.HISTOGRAM_AGGREGATION = exports.LAST_VALUE_AGGREGATION = exports.SUM_AGGREGATION = exports.DROP_AGGREGATION = exports.DefaultAggregation = exports.ExponentialHistogramAggregation = exports.ExplicitBucketHistogramAggregation = exports.HistogramAggregation = exports.LastValueAggregation = exports.SumAggregation = exports.DropAggregation = undefined; + var api2 = require_src(); + var aggregator_1 = require_aggregator(); + var MetricData_1 = require_MetricData(); + + class DropAggregation { + static DEFAULT_INSTANCE = new aggregator_1.DropAggregator; + createAggregator(_instrument) { + return DropAggregation.DEFAULT_INSTANCE; + } + } + exports.DropAggregation = DropAggregation; + + class SumAggregation { + static MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(true); + static NON_MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(false); + createAggregator(instrument) { + switch (instrument.type) { + case MetricData_1.InstrumentType.COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: + case MetricData_1.InstrumentType.HISTOGRAM: { + return SumAggregation.MONOTONIC_INSTANCE; + } + default: { + return SumAggregation.NON_MONOTONIC_INSTANCE; + } + } + } + } + exports.SumAggregation = SumAggregation; + + class LastValueAggregation { + static DEFAULT_INSTANCE = new aggregator_1.LastValueAggregator; + createAggregator(_instrument) { + return LastValueAggregation.DEFAULT_INSTANCE; + } + } + exports.LastValueAggregation = LastValueAggregation; + + class HistogramAggregation { + static DEFAULT_INSTANCE = new aggregator_1.HistogramAggregator([0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 1e4], true); + createAggregator(_instrument) { + return HistogramAggregation.DEFAULT_INSTANCE; + } + } + exports.HistogramAggregation = HistogramAggregation; + + class ExplicitBucketHistogramAggregation { + _recordMinMax; + _boundaries; + constructor(boundaries, _recordMinMax = true) { + this._recordMinMax = _recordMinMax; + if (boundaries == null) { + throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array"); + } + boundaries = boundaries.concat(); + boundaries = boundaries.sort((a, b) => a - b); + const minusInfinityIndex = boundaries.lastIndexOf(-Infinity); + let infinityIndex = boundaries.indexOf(Infinity); + if (infinityIndex === -1) { + infinityIndex = undefined; + } + this._boundaries = boundaries.slice(minusInfinityIndex + 1, infinityIndex); + } + createAggregator(_instrument) { + return new aggregator_1.HistogramAggregator(this._boundaries, this._recordMinMax); + } + } + exports.ExplicitBucketHistogramAggregation = ExplicitBucketHistogramAggregation; + + class ExponentialHistogramAggregation { + _maxSize; + _recordMinMax; + constructor(_maxSize2 = 160, _recordMinMax = true) { + this._maxSize = _maxSize2; + this._recordMinMax = _recordMinMax; + } + createAggregator(_instrument) { + return new aggregator_1.ExponentialHistogramAggregator(this._maxSize, this._recordMinMax); + } + } + exports.ExponentialHistogramAggregation = ExponentialHistogramAggregation; + + class DefaultAggregation { + _resolve(instrument) { + switch (instrument.type) { + case MetricData_1.InstrumentType.COUNTER: + case MetricData_1.InstrumentType.UP_DOWN_COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: { + return exports.SUM_AGGREGATION; + } + case MetricData_1.InstrumentType.GAUGE: + case MetricData_1.InstrumentType.OBSERVABLE_GAUGE: { + return exports.LAST_VALUE_AGGREGATION; + } + case MetricData_1.InstrumentType.HISTOGRAM: { + if (instrument.advice.explicitBucketBoundaries) { + return new ExplicitBucketHistogramAggregation(instrument.advice.explicitBucketBoundaries); + } + return exports.HISTOGRAM_AGGREGATION; + } + } + api2.diag.warn(`Unable to recognize instrument type: ${instrument.type}`); + return exports.DROP_AGGREGATION; + } + createAggregator(instrument) { + return this._resolve(instrument).createAggregator(instrument); + } + } + exports.DefaultAggregation = DefaultAggregation; + exports.DROP_AGGREGATION = new DropAggregation; + exports.SUM_AGGREGATION = new SumAggregation; + exports.LAST_VALUE_AGGREGATION = new LastValueAggregation; + exports.HISTOGRAM_AGGREGATION = new HistogramAggregation; + exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = new ExponentialHistogramAggregation; + exports.DEFAULT_AGGREGATION = new DefaultAggregation; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/AggregationOption.js +var require_AggregationOption = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toAggregation = exports.AggregationType = undefined; + var Aggregation_1 = require_Aggregation(); + var AggregationType; + (function(AggregationType2) { + AggregationType2[AggregationType2["DEFAULT"] = 0] = "DEFAULT"; + AggregationType2[AggregationType2["DROP"] = 1] = "DROP"; + AggregationType2[AggregationType2["SUM"] = 2] = "SUM"; + AggregationType2[AggregationType2["LAST_VALUE"] = 3] = "LAST_VALUE"; + AggregationType2[AggregationType2["EXPLICIT_BUCKET_HISTOGRAM"] = 4] = "EXPLICIT_BUCKET_HISTOGRAM"; + AggregationType2[AggregationType2["EXPONENTIAL_HISTOGRAM"] = 5] = "EXPONENTIAL_HISTOGRAM"; + })(AggregationType = exports.AggregationType || (exports.AggregationType = {})); + function toAggregation(option) { + switch (option.type) { + case AggregationType.DEFAULT: + return Aggregation_1.DEFAULT_AGGREGATION; + case AggregationType.DROP: + return Aggregation_1.DROP_AGGREGATION; + case AggregationType.SUM: + return Aggregation_1.SUM_AGGREGATION; + case AggregationType.LAST_VALUE: + return Aggregation_1.LAST_VALUE_AGGREGATION; + case AggregationType.EXPONENTIAL_HISTOGRAM: { + const expOption = option; + return new Aggregation_1.ExponentialHistogramAggregation(expOption.options?.maxSize, expOption.options?.recordMinMax); + } + case AggregationType.EXPLICIT_BUCKET_HISTOGRAM: { + const expOption = option; + if (expOption.options == null) { + return Aggregation_1.HISTOGRAM_AGGREGATION; + } else { + return new Aggregation_1.ExplicitBucketHistogramAggregation(expOption.options?.boundaries, expOption.options?.recordMinMax); + } + } + default: + throw new Error("Unsupported Aggregation"); + } + } + exports.toAggregation = toAggregation; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationSelector.js +var require_AggregationSelector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = exports.DEFAULT_AGGREGATION_SELECTOR = undefined; + var AggregationTemporality_1 = require_AggregationTemporality(); + var AggregationOption_1 = require_AggregationOption(); + var DEFAULT_AGGREGATION_SELECTOR = (_instrumentType) => { + return { + type: AggregationOption_1.AggregationType.DEFAULT + }; + }; + exports.DEFAULT_AGGREGATION_SELECTOR = DEFAULT_AGGREGATION_SELECTOR; + var DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = (_instrumentType) => AggregationTemporality_1.AggregationTemporality.CUMULATIVE; + exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReader.js +var require_MetricReader = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricReader = undefined; + var api2 = require_src(); + var utils_1 = require_utils8(); + var AggregationSelector_1 = require_AggregationSelector(); + + class MetricReader { + _shutdown = false; + _metricProducers; + _sdkMetricProducer; + _aggregationTemporalitySelector; + _aggregationSelector; + _cardinalitySelector; + constructor(options) { + this._aggregationSelector = options?.aggregationSelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_SELECTOR; + this._aggregationTemporalitySelector = options?.aggregationTemporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; + this._metricProducers = options?.metricProducers ?? []; + this._cardinalitySelector = options?.cardinalitySelector; + } + setMetricProducer(metricProducer) { + if (this._sdkMetricProducer) { + throw new Error("MetricReader can not be bound to a MeterProvider again."); + } + this._sdkMetricProducer = metricProducer; + this.onInitialized(); + } + selectAggregation(instrumentType) { + return this._aggregationSelector(instrumentType); + } + selectAggregationTemporality(instrumentType) { + return this._aggregationTemporalitySelector(instrumentType); + } + selectCardinalityLimit(instrumentType) { + return this._cardinalitySelector ? this._cardinalitySelector(instrumentType) : 2000; + } + onInitialized() {} + async collect(options) { + if (this._sdkMetricProducer === undefined) { + throw new Error("MetricReader is not bound to a MetricProducer"); + } + if (this._shutdown) { + throw new Error("MetricReader is shutdown"); + } + const [sdkCollectionResults, ...additionalCollectionResults] = await Promise.all([ + this._sdkMetricProducer.collect({ + timeoutMillis: options?.timeoutMillis + }), + ...this._metricProducers.map((producer) => producer.collect({ + timeoutMillis: options?.timeoutMillis + })) + ]); + const errors3 = sdkCollectionResults.errors.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.errors)); + const resource = sdkCollectionResults.resourceMetrics.resource; + const scopeMetrics = sdkCollectionResults.resourceMetrics.scopeMetrics.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.resourceMetrics.scopeMetrics)); + return { + resourceMetrics: { + resource, + scopeMetrics + }, + errors: errors3 + }; + } + async shutdown(options) { + if (this._shutdown) { + api2.diag.error("Cannot call shutdown twice."); + return; + } + if (options?.timeoutMillis == null) { + await this.onShutdown(); + } else { + await (0, utils_1.callWithTimeout)(this.onShutdown(), options.timeoutMillis); + } + this._shutdown = true; + } + async forceFlush(options) { + if (this._shutdown) { + api2.diag.warn("Cannot forceFlush on already shutdown MetricReader."); + return; + } + if (options?.timeoutMillis == null) { + await this.onForceFlush(); + return; + } + await (0, utils_1.callWithTimeout)(this.onForceFlush(), options.timeoutMillis); + } + } + exports.MetricReader = MetricReader; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/export/PeriodicExportingMetricReader.js +var require_PeriodicExportingMetricReader = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PeriodicExportingMetricReader = undefined; + var api2 = require_src(); + var core_1 = require_src7(); + var MetricReader_1 = require_MetricReader(); + var utils_1 = require_utils8(); + + class PeriodicExportingMetricReader extends MetricReader_1.MetricReader { + _interval; + _exporter; + _exportInterval; + _exportTimeout; + constructor(options) { + super({ + aggregationSelector: options.exporter.selectAggregation?.bind(options.exporter), + aggregationTemporalitySelector: options.exporter.selectAggregationTemporality?.bind(options.exporter), + metricProducers: options.metricProducers + }); + if (options.exportIntervalMillis !== undefined && options.exportIntervalMillis <= 0) { + throw Error("exportIntervalMillis must be greater than 0"); + } + if (options.exportTimeoutMillis !== undefined && options.exportTimeoutMillis <= 0) { + throw Error("exportTimeoutMillis must be greater than 0"); + } + if (options.exportTimeoutMillis !== undefined && options.exportIntervalMillis !== undefined && options.exportIntervalMillis < options.exportTimeoutMillis) { + throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis"); + } + this._exportInterval = options.exportIntervalMillis ?? 60000; + this._exportTimeout = options.exportTimeoutMillis ?? 30000; + this._exporter = options.exporter; + } + async _runOnce() { + try { + await (0, utils_1.callWithTimeout)(this._doRun(), this._exportTimeout); + } catch (err) { + if (err instanceof utils_1.TimeoutError) { + api2.diag.error("Export took longer than %s milliseconds and timed out.", this._exportTimeout); + return; + } + (0, core_1.globalErrorHandler)(err); + } + } + async _doRun() { + const { resourceMetrics, errors: errors3 } = await this.collect({ + timeoutMillis: this._exportTimeout + }); + if (errors3.length > 0) { + api2.diag.error("PeriodicExportingMetricReader: metrics collection errors", ...errors3); + } + if (resourceMetrics.resource.asyncAttributesPending) { + try { + await resourceMetrics.resource.waitForAsyncAttributes?.(); + } catch (e) { + api2.diag.debug("Error while resolving async portion of resource: ", e); + (0, core_1.globalErrorHandler)(e); + } + } + if (resourceMetrics.scopeMetrics.length === 0) { + return; + } + const result = await core_1.internal._export(this._exporter, resourceMetrics); + if (result.code !== core_1.ExportResultCode.SUCCESS) { + throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result.error})`); + } + } + onInitialized() { + this._interval = setInterval(() => { + this._runOnce(); + }, this._exportInterval); + (0, core_1.unrefTimer)(this._interval); + } + async onForceFlush() { + await this._runOnce(); + await this._exporter.forceFlush(); + } + async onShutdown() { + if (this._interval) { + clearInterval(this._interval); + } + await this.onForceFlush(); + await this._exporter.shutdown(); + } + } + exports.PeriodicExportingMetricReader = PeriodicExportingMetricReader; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/export/InMemoryMetricExporter.js +var require_InMemoryMetricExporter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InMemoryMetricExporter = undefined; + var core_1 = require_src7(); + + class InMemoryMetricExporter { + _shutdown = false; + _aggregationTemporality; + _metrics = []; + constructor(aggregationTemporality) { + this._aggregationTemporality = aggregationTemporality; + } + export(metrics, resultCallback) { + if (this._shutdown) { + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.FAILED }), 0); + return; + } + this._metrics.push(metrics); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + getMetrics() { + return this._metrics; + } + forceFlush() { + return Promise.resolve(); + } + reset() { + this._metrics = []; + } + selectAggregationTemporality(_instrumentType) { + return this._aggregationTemporality; + } + shutdown() { + this._shutdown = true; + return Promise.resolve(); + } + } + exports.InMemoryMetricExporter = InMemoryMetricExporter; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/export/ConsoleMetricExporter.js +var require_ConsoleMetricExporter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ConsoleMetricExporter = undefined; + var core_1 = require_src7(); + var AggregationSelector_1 = require_AggregationSelector(); + + class ConsoleMetricExporter { + _shutdown = false; + _temporalitySelector; + constructor(options) { + this._temporalitySelector = options?.temporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; + } + export(metrics, resultCallback) { + if (this._shutdown) { + setImmediate(resultCallback, { code: core_1.ExportResultCode.FAILED }); + return; + } + return ConsoleMetricExporter._sendMetrics(metrics, resultCallback); + } + forceFlush() { + return Promise.resolve(); + } + selectAggregationTemporality(_instrumentType) { + return this._temporalitySelector(_instrumentType); + } + shutdown() { + this._shutdown = true; + return Promise.resolve(); + } + static _sendMetrics(metrics, done) { + for (const scopeMetrics of metrics.scopeMetrics) { + for (const metric of scopeMetrics.metrics) { + console.dir({ + descriptor: metric.descriptor, + dataPointType: metric.dataPointType, + dataPoints: metric.dataPoints + }, { depth: null }); + } + } + done({ code: core_1.ExportResultCode.SUCCESS }); + } + } + exports.ConsoleMetricExporter = ConsoleMetricExporter; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = undefined; + var api_1 = require_src(); + var SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); + function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); + } + exports.suppressTracing = suppressTracing; + function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); + } + exports.unsuppressTracing = unsuppressTracing; + function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; + } + exports.isTracingSuppressed = isTracingSuppressed; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = undefined; + exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; + exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; + exports.BAGGAGE_ITEMS_SEPARATOR = ","; + exports.BAGGAGE_HEADER = "baggage"; + exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; + exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; + exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils10 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = undefined; + var api_1 = require_src(); + var constants_1 = require_constants5(); + function serializeKeyPairs(keyPairs) { + return keyPairs.reduce((hValue, current) => { + const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; + return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; + }, ""); + } + exports.serializeKeyPairs = serializeKeyPairs; + function getKeyPairs(baggage) { + return baggage.getAllEntries().map(([key, value]) => { + let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; + if (value.metadata !== undefined) { + entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); + } + return entry; + }); + } + exports.getKeyPairs = getKeyPairs; + function parsePairKeyValue(entry) { + const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + if (valueProps.length <= 0) + return; + const keyPairPart = valueProps.shift(); + if (!keyPairPart) + return; + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) + return; + const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); + const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + let metadata; + if (valueProps.length > 0) { + metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + } + return { key, value, metadata }; + } + exports.parsePairKeyValue = parsePairKeyValue; + function parseKeyPairsIntoRecord(value) { + const result = {}; + if (typeof value === "string" && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); + } + return result; + } + exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CBaggagePropagator = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing5(); + var constants_1 = require_constants5(); + var utils_1 = require_utils10(); + + class W3CBaggagePropagator { + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) + return; + const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { + return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; + }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); + const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); + if (headerValue.length > 0) { + setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); + } + } + extract(context, carrier, getter) { + const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); + const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; + if (!baggageString) + return context; + const baggage = {}; + if (baggageString.length === 0) { + return context; + } + const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); + pairs.forEach((entry) => { + const keyPair = (0, utils_1.parsePairKeyValue)(entry); + if (keyPair) { + const baggageEntry = { value: keyPair.value }; + if (keyPair.metadata) { + baggageEntry.metadata = keyPair.metadata; + } + baggage[keyPair.key] = baggageEntry; + } + }); + if (Object.entries(baggage).length === 0) { + return context; + } + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + } + exports.W3CBaggagePropagator = W3CBaggagePropagator; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AnchoredClock = undefined; + + class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; + constructor(systemClock, monotonicClock) { + this._monotonicClock = monotonicClock; + this._epochMillis = systemClock.now(); + this._performanceMillis = monotonicClock.now(); + } + now() { + const delta = this._monotonicClock.now() - this._performanceMillis; + return this._epochMillis + delta; + } + } + exports.AnchoredClock = AnchoredClock; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = undefined; + var api_1 = require_src(); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) { + return out; + } + for (const [key, val] of Object.entries(attributes)) { + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + if (!isAttributeValue(val)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + continue; + } + if (Array.isArray(val)) { + out[key] = val.slice(); + } else { + out[key] = val; + } + } + return out; + } + exports.sanitizeAttributes = sanitizeAttributes; + function isAttributeKey(key) { + return typeof key === "string" && key.length > 0; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) { + return true; + } + if (Array.isArray(val)) { + return isHomogeneousAttributeValueArray(val); + } + return isValidPrimitiveAttributeValue(val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) + continue; + if (!type) { + if (isValidPrimitiveAttributeValue(element)) { + type = typeof element; + continue; + } + return false; + } + if (typeof element === type) { + continue; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValue(val) { + switch (typeof val) { + case "number": + case "boolean": + case "string": + return true; + } + return false; + } +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.loggingErrorHandler = undefined; + var api_1 = require_src(); + function loggingErrorHandler() { + return (ex) => { + api_1.diag.error(stringifyException(ex)); + }; + } + exports.loggingErrorHandler = loggingErrorHandler; + function stringifyException(ex) { + if (typeof ex === "string") { + return ex; + } else { + return JSON.stringify(flattenException(ex)); + } + } + function flattenException(ex) { + const result = {}; + let current = ex; + while (current !== null) { + Object.getOwnPropertyNames(current).forEach((propertyName) => { + if (result[propertyName]) + return; + const value = current[propertyName]; + if (value) { + result[propertyName] = String(value); + } + }); + current = Object.getPrototypeOf(current); + } + return result; + } +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.globalErrorHandler = exports.setGlobalErrorHandler = undefined; + var logging_error_handler_1 = require_logging_error_handler5(); + var delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = undefined; + var api_1 = require_src(); + var util_1 = __require("util"); + function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + const value = Number(raw); + if (isNaN(value)) { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); + return; + } + return value; + } + exports.getNumberFromEnv = getNumberFromEnv; + function getStringFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === "") { + return; + } + return raw; + } + exports.getStringFromEnv = getStringFromEnv; + function getBooleanFromEnv(key) { + const raw = process.env[key]?.trim().toLowerCase(); + if (raw == null || raw === "") { + return false; + } + if (raw === "true") { + return true; + } else if (raw === "false") { + return false; + } else { + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + exports.getBooleanFromEnv = getBooleanFromEnv; + function getStringListFromEnv(key) { + return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); + } + exports.getStringListFromEnv = getStringListFromEnv; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js +var require_globalThis5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._globalThis = undefined; + exports._globalThis = typeof globalThis === "object" ? globalThis : global; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/platform/node/performance.js +var require_performance4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = undefined; + var perf_hooks_1 = __require("perf_hooks"); + exports.otperformance = perf_hooks_1.performance; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/version.js +var require_version7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.1.0"; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_PROCESS_RUNTIME_NAME = undefined; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = undefined; + var version_1 = require_version7(); + var semantic_conventions_1 = require_src2(); + var semconv_1 = require_semconv5(); + exports.SDK_INFO = { + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + }; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js +var require_timer_util5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = undefined; + function unrefTimer(timer) { + timer.unref(); + } + exports.unrefTimer = unrefTimer; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = undefined; + var environment_1 = require_environment5(); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return environment_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return environment_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return environment_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return environment_1.getStringListFromEnv; + } }); + var globalThis_1 = require_globalThis5(); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return globalThis_1._globalThis; + } }); + var performance_1 = require_performance4(); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return performance_1.otperformance; + } }); + var sdk_info_1 = require_sdk_info5(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return sdk_info_1.SDK_INFO; + } }); + var timer_util_1 = require_timer_util5(); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return timer_util_1.unrefTimer; + } }); +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = undefined; + var node_1 = require_node5(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return node_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return node_1._globalThis; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return node_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return node_1.unrefTimer; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return node_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return node_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return node_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return node_1.getStringListFromEnv; + } }); +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = undefined; + var platform_1 = require_platform5(); + var NANOSECOND_DIGITS = 9; + var NANOSECOND_DIGITS_IN_MILLIS = 6; + var MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); + var SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1000; + const seconds = Math.trunc(epochSeconds); + const nanos = Math.round(epochMillis % 1000 * MILLISECONDS_TO_NANOSECONDS); + return [seconds, nanos]; + } + exports.millisToHrTime = millisToHrTime; + function getTimeOrigin() { + let timeOrigin = platform_1.otperformance.timeOrigin; + if (typeof timeOrigin !== "number") { + const perf = platform_1.otperformance; + timeOrigin = perf.timing && perf.timing.fetchStart; + } + return timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + function hrTime(performanceNow) { + const timeOrigin = millisToHrTime(getTimeOrigin()); + const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now()); + return addHrTimes(timeOrigin, now); + } + exports.hrTime = hrTime; + function timeInputToHrTime(time3) { + if (isTimeInputHrTime(time3)) { + return time3; + } else if (typeof time3 === "number") { + if (time3 < getTimeOrigin()) { + return hrTime(time3); + } else { + return millisToHrTime(time3); + } + } else if (time3 instanceof Date) { + return millisToHrTime(time3.getTime()); + } else { + throw TypeError("Invalid input type"); + } + } + exports.timeInputToHrTime = timeInputToHrTime; + function hrTimeDuration(startTime, endTime) { + let seconds = endTime[0] - startTime[0]; + let nanos = endTime[1] - startTime[1]; + if (nanos < 0) { + seconds -= 1; + nanos += SECOND_TO_NANOSECONDS; + } + return [seconds, nanos]; + } + exports.hrTimeDuration = hrTimeDuration; + function hrTimeToTimeStamp(time3) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time3[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + const date5 = new Date(time3[0] * 1000).toISOString(); + return date5.replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + function hrTimeToNanoseconds(time3) { + return time3[0] * SECOND_TO_NANOSECONDS + time3[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + function hrTimeToMilliseconds(time3) { + return time3[0] * 1000 + time3[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + function hrTimeToMicroseconds(time3) { + return time3[0] * 1e6 + time3[1] / 1000; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + function addHrTimes(time1, time22) { + const out = [time1[0] + time22[0], time1[1] + time22[1]]; + if (out[1] >= SECOND_TO_NANOSECONDS) { + out[1] -= SECOND_TO_NANOSECONDS; + out[0] += 1; + } + return out; + } + exports.addHrTimes = addHrTimes; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExportResultCode = undefined; + var ExportResultCode; + (function(ExportResultCode2) { + ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED"; + })(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CompositePropagator = undefined; + var api_1 = require_src(); + + class CompositePropagator { + _propagators; + _fields; + constructor(config2 = {}) { + this._propagators = config2.propagators ?? []; + this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); + } + inject(context, carrier, setter) { + for (const propagator of this._propagators) { + try { + propagator.inject(context, carrier, setter); + } catch (err) { + api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + } + } + } + extract(context, carrier, getter) { + return this._propagators.reduce((ctx, propagator) => { + try { + return propagator.extract(ctx, carrier, getter); + } catch (err) { + api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); + } + return ctx; + }, context); + } + fields() { + return this._fields.slice(); + } + } + exports.CompositePropagator = CompositePropagator; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateValue = exports.validateKey = undefined; + var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; + var VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; + var VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; + var VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + exports.validateKey = validateKey; + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = undefined; + var validators_1 = require_validators5(); + var MAX_TRACE_STATE_ITEMS = 32; + var MAX_TRACE_STATE_LEN = 512; + var LIST_MEMBERS_SEPARATOR = ","; + var LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + + class TraceState { + _internalState = new Map; + constructor(rawTraceState) { + if (rawTraceState) + this._parse(rawTraceState); + } + set(key, value) { + const traceState = this._clone(); + if (traceState._internalState.has(key)) { + traceState._internalState.delete(key); + } + traceState._internalState.set(key, value); + return traceState; + } + unset(key) { + const traceState = this._clone(); + traceState._internalState.delete(key); + return traceState; + } + get(key) { + return this._internalState.get(key); + } + serialize() { + return this._keys().reduce((agg, key) => { + agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); + return agg; + }, []).join(LIST_MEMBERS_SEPARATOR); + } + _parse(rawTraceState) { + if (rawTraceState.length > MAX_TRACE_STATE_LEN) + return; + this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => { + const listMember = part.trim(); + const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (i !== -1) { + const key = listMember.slice(0, i); + const value = listMember.slice(i + 1, part.length); + if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { + agg.set(key, value); + } else {} + } + return agg; + }, new Map); + if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { + this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); + } + } + _keys() { + return Array.from(this._internalState.keys()).reverse(); + } + _clone() { + const traceState = new TraceState; + traceState._internalState = new Map(this._internalState); + return traceState; + } + } + exports.TraceState = TraceState; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing5(); + var TraceState_1 = require_TraceState5(); + exports.TRACE_PARENT_HEADER = "traceparent"; + exports.TRACE_STATE_HEADER = "tracestate"; + var VERSION = "00"; + var VERSION_PART = "(?!ff)[\\da-f]{2}"; + var TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}"; + var PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}"; + var FLAGS_PART = "[\\da-f]{2}"; + var TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); + function parseTraceParent(traceParent) { + const match = TRACE_PARENT_REGEX.exec(traceParent); + if (!match) + return null; + if (match[1] === "00" && match[5]) + return null; + return { + traceId: match[2], + spanId: match[3], + traceFlags: parseInt(match[4], 16) + }; + } + exports.parseTraceParent = parseTraceParent; + + class W3CTraceContextPropagator { + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) + return; + const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; + setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); + if (spanContext.traceState) { + setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); + } + } + extract(context, carrier, getter) { + const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); + if (!traceParentHeader) + return context; + const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; + if (typeof traceParent !== "string") + return context; + const spanContext = parseTraceParent(traceParent); + if (!spanContext) + return context; + spanContext.isRemote = true; + const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); + if (traceStateHeader) { + const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; + spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : undefined); + } + return api_1.trace.setSpanContext(context, spanContext); + } + fields() { + return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + } + } + exports.W3CTraceContextPropagator = W3CTraceContextPropagator; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = undefined; + var api_1 = require_src(); + var RPC_METADATA_KEY = (0, api_1.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; + (function(RPCType2) { + RPCType2["HTTP"] = "http"; + })(RPCType = exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context, meta3) { + return context.setValue(RPC_METADATA_KEY, meta3); + } + exports.setRPCMetadata = setRPCMetadata; + function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); + } + exports.deleteRPCMetadata = deleteRPCMetadata; + function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); + } + exports.getRPCMetadata = getRPCMetadata; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPlainObject = undefined; + var objectTag = "[object Object]"; + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + var objectCtorString = funcToString.call(Object); + var getPrototypeOf = Object.getPrototypeOf; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeObjectToString = objectProto.toString; + function isPlainObject2(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototypeOf(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + exports.isPlainObject = isPlainObject2; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + function getRawTag(value) { + const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + let unmasked = false; + try { + value[symToStringTag] = undefined; + unmasked = true; + } catch {} + const result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + function objectToString(value) { + return nativeObjectToString.call(value); + } +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = undefined; + var lodash_merge_1 = require_lodash_merge5(); + var MAX_LEVEL = 20; + function merge2(...args) { + let result = args.shift(); + const objects = new WeakMap; + while (args.length > 0) { + result = mergeTwoObjects(result, args.shift(), 0, objects); + } + return result; + } + exports.merge = merge2; + function takeValue(value) { + if (isArray(value)) { + return value.slice(); + } + return value; + } + function mergeTwoObjects(one, two, level = 0, objects) { + let result; + if (level > MAX_LEVEL) { + return; + } + level++; + if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { + result = takeValue(two); + } else if (isArray(one)) { + result = one.slice(); + if (isArray(two)) { + for (let i = 0, j = two.length;i < j; i++) { + result.push(takeValue(two[i])); + } + } else if (isObject2(two)) { + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + result[key] = takeValue(two[key]); + } + } + } else if (isObject2(one)) { + if (isObject2(two)) { + if (!shouldMerge(one, two)) { + return two; + } + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length;i < j; i++) { + const key = keys[i]; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") { + delete result[key]; + } else { + result[key] = twoValue; + } + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) { + delete result[key]; + } else { + if (isObject2(obj1) && isObject2(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ obj: one, key }); + arr2.push({ obj: two, key }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else { + result = two; + } + } + return result; + } + function wasObjectReferenced(obj, key, objects) { + const arr = objects.get(obj[key]) || []; + for (let i = 0, j = arr.length;i < j; i++) { + const info = arr[i]; + if (info.key === key && info.obj === obj) { + return true; + } + } + return false; + } + function isArray(value) { + return Array.isArray(value); + } + function isFunction(value) { + return typeof value === "function"; + } + function isObject2(value) { + return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; + } + function isPrimitive(value) { + return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; + } + function shouldMerge(one, two) { + if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { + return false; + } + return true; + } +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = undefined; + + class TimeoutError extends Error { + constructor(message) { + super(message); + Object.setPrototypeOf(this, TimeoutError.prototype); + } + } + exports.TimeoutError = TimeoutError; + function callWithTimeout(promise2, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError("Operation timed out.")); + }, timeout); + }); + return Promise.race([promise2, timeoutPromise]).then((result) => { + clearTimeout(timeoutHandle); + return result; + }, (reason) => { + clearTimeout(timeoutHandle); + throw reason; + }); + } + exports.callWithTimeout = callWithTimeout; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isUrlIgnored = exports.urlMatches = undefined; + function urlMatches(url2, urlToMatch) { + if (typeof urlToMatch === "string") { + return url2 === urlToMatch; + } else { + return !!url2.match(urlToMatch); + } + } + exports.urlMatches = urlMatches; + function isUrlIgnored(url2, ignoredUrls) { + if (!ignoredUrls) { + return false; + } + for (const ignoreUrl of ignoredUrls) { + if (urlMatches(url2, ignoreUrl)) { + return true; + } + } + return false; + } + exports.isUrlIgnored = isUrlIgnored; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Deferred = undefined; + + class Deferred { + _promise; + _resolve; + _reject; + constructor() { + this._promise = new Promise((resolve, reject) => { + this._resolve = resolve; + this._reject = reject; + }); + } + get promise() { + return this._promise; + } + resolve(val) { + this._resolve(val); + } + reject(err) { + this._reject(err); + } + } + exports.Deferred = Deferred; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = undefined; + var promise_1 = require_promise5(); + + class BindOnceFuture { + _callback; + _that; + _isCalled = false; + _deferred = new promise_1.Deferred; + constructor(_callback, _that) { + this._callback = _callback; + this._that = _that; + } + get isCalled() { + return this._isCalled; + } + get promise() { + return this._deferred.promise; + } + call(...args) { + if (!this._isCalled) { + this._isCalled = true; + try { + Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); + } catch (err) { + this._deferred.reject(err); + } + } + return this._deferred.promise; + } + } + exports.BindOnceFuture = BindOnceFuture; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.diagLogLevelFromString = undefined; + var api_1 = require_src(); + var logLevelMap = { + ALL: api_1.DiagLogLevel.ALL, + VERBOSE: api_1.DiagLogLevel.VERBOSE, + DEBUG: api_1.DiagLogLevel.DEBUG, + INFO: api_1.DiagLogLevel.INFO, + WARN: api_1.DiagLogLevel.WARN, + ERROR: api_1.DiagLogLevel.ERROR, + NONE: api_1.DiagLogLevel.NONE + }; + function diagLogLevelFromString(value) { + if (value == null) { + return; + } + const resolvedLogLevel = logLevelMap[value.toUpperCase()]; + if (resolvedLogLevel == null) { + api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); + return api_1.DiagLogLevel.INFO; + } + return resolvedLogLevel; + } + exports.diagLogLevelFromString = diagLogLevelFromString; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter5 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._export = undefined; + var api_1 = require_src(); + var suppress_tracing_1 = require_suppress_tracing5(); + function _export(exporter, arg) { + return new Promise((resolve) => { + api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { + exporter.export(arg, (result) => { + resolve(result); + }); + }); + }); + } + exports._export = _export; +}); + +// node_modules/@opentelemetry/resources/node_modules/@opentelemetry/core/build/src/index.js +var require_src8 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = undefined; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator5(); + Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } }); + var anchored_clock_1 = require_anchored_clock5(); + Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { + return anchored_clock_1.AnchoredClock; + } }); + var attributes_1 = require_attributes5(); + Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { + return attributes_1.isAttributeValue; + } }); + Object.defineProperty(exports, "sanitizeAttributes", { enumerable: true, get: function() { + return attributes_1.sanitizeAttributes; + } }); + var global_error_handler_1 = require_global_error_handler5(); + Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.globalErrorHandler; + } }); + Object.defineProperty(exports, "setGlobalErrorHandler", { enumerable: true, get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } }); + var logging_error_handler_1 = require_logging_error_handler5(); + Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { + return logging_error_handler_1.loggingErrorHandler; + } }); + var time_1 = require_time5(); + Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { + return time_1.addHrTimes; + } }); + Object.defineProperty(exports, "getTimeOrigin", { enumerable: true, get: function() { + return time_1.getTimeOrigin; + } }); + Object.defineProperty(exports, "hrTime", { enumerable: true, get: function() { + return time_1.hrTime; + } }); + Object.defineProperty(exports, "hrTimeDuration", { enumerable: true, get: function() { + return time_1.hrTimeDuration; + } }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMicroseconds; + } }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { enumerable: true, get: function() { + return time_1.hrTimeToMilliseconds; + } }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { enumerable: true, get: function() { + return time_1.hrTimeToNanoseconds; + } }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { + return time_1.hrTimeToTimeStamp; + } }); + Object.defineProperty(exports, "isTimeInput", { enumerable: true, get: function() { + return time_1.isTimeInput; + } }); + Object.defineProperty(exports, "isTimeInputHrTime", { enumerable: true, get: function() { + return time_1.isTimeInputHrTime; + } }); + Object.defineProperty(exports, "millisToHrTime", { enumerable: true, get: function() { + return time_1.millisToHrTime; + } }); + Object.defineProperty(exports, "timeInputToHrTime", { enumerable: true, get: function() { + return time_1.timeInputToHrTime; + } }); + var ExportResult_1 = require_ExportResult5(); + Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { + return ExportResult_1.ExportResultCode; + } }); + var utils_1 = require_utils10(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { + return utils_1.parseKeyPairsIntoRecord; + } }); + var platform_1 = require_platform5(); + Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { + return platform_1.SDK_INFO; + } }); + Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { + return platform_1._globalThis; + } }); + Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { + return platform_1.getStringFromEnv; + } }); + Object.defineProperty(exports, "getBooleanFromEnv", { enumerable: true, get: function() { + return platform_1.getBooleanFromEnv; + } }); + Object.defineProperty(exports, "getNumberFromEnv", { enumerable: true, get: function() { + return platform_1.getNumberFromEnv; + } }); + Object.defineProperty(exports, "getStringListFromEnv", { enumerable: true, get: function() { + return platform_1.getStringListFromEnv; + } }); + Object.defineProperty(exports, "otperformance", { enumerable: true, get: function() { + return platform_1.otperformance; + } }); + Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { + return platform_1.unrefTimer; + } }); + var composite_1 = require_composite5(); + Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { + return composite_1.CompositePropagator; + } }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator5(); + Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; + } }); + Object.defineProperty(exports, "TRACE_STATE_HEADER", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; + } }); + Object.defineProperty(exports, "W3CTraceContextPropagator", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.W3CTraceContextPropagator; + } }); + Object.defineProperty(exports, "parseTraceParent", { enumerable: true, get: function() { + return W3CTraceContextPropagator_1.parseTraceParent; + } }); + var rpc_metadata_1 = require_rpc_metadata5(); + Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { + return rpc_metadata_1.RPCType; + } }); + Object.defineProperty(exports, "deleteRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.deleteRPCMetadata; + } }); + Object.defineProperty(exports, "getRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.getRPCMetadata; + } }); + Object.defineProperty(exports, "setRPCMetadata", { enumerable: true, get: function() { + return rpc_metadata_1.setRPCMetadata; + } }); + var suppress_tracing_1 = require_suppress_tracing5(); + Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { + return suppress_tracing_1.isTracingSuppressed; + } }); + Object.defineProperty(exports, "suppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.suppressTracing; + } }); + Object.defineProperty(exports, "unsuppressTracing", { enumerable: true, get: function() { + return suppress_tracing_1.unsuppressTracing; + } }); + var TraceState_1 = require_TraceState5(); + Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { + return TraceState_1.TraceState; + } }); + var merge_1 = require_merge5(); + Object.defineProperty(exports, "merge", { enumerable: true, get: function() { + return merge_1.merge; + } }); + var timeout_1 = require_timeout5(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return timeout_1.TimeoutError; + } }); + Object.defineProperty(exports, "callWithTimeout", { enumerable: true, get: function() { + return timeout_1.callWithTimeout; + } }); + var url_1 = require_url5(); + Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { + return url_1.isUrlIgnored; + } }); + Object.defineProperty(exports, "urlMatches", { enumerable: true, get: function() { + return url_1.urlMatches; + } }); + var callback_1 = require_callback5(); + Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { + return callback_1.BindOnceFuture; + } }); + var configuration_1 = require_configuration5(); + Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { + return configuration_1.diagLogLevelFromString; + } }); + var exporter_1 = require_exporter5(); + exports.internal = { + _export: exporter_1._export + }; +}); + +// node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js +var require_default_service_name = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = undefined; + function defaultServiceName() { + return `unknown_service:${process.argv0}`; + } + exports.defaultServiceName = defaultServiceName; +}); + +// node_modules/@opentelemetry/resources/build/src/platform/node/index.js +var require_node6 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = undefined; + var default_service_name_1 = require_default_service_name(); + Object.defineProperty(exports, "defaultServiceName", { enumerable: true, get: function() { + return default_service_name_1.defaultServiceName; + } }); +}); + +// node_modules/@opentelemetry/resources/build/src/platform/index.js +var require_platform6 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = undefined; + var node_1 = require_node6(); + Object.defineProperty(exports, "defaultServiceName", { enumerable: true, get: function() { + return node_1.defaultServiceName; + } }); +}); + +// node_modules/@opentelemetry/resources/build/src/utils.js +var require_utils11 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.identity = exports.isPromiseLike = undefined; + var isPromiseLike = (val) => { + return val !== null && typeof val === "object" && typeof val.then === "function"; + }; + exports.isPromiseLike = isPromiseLike; + function identity(_) { + return _; + } + exports.identity = identity; +}); + +// node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +var require_ResourceImpl = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = undefined; + var api_1 = require_src(); + var core_1 = require_src8(); + var semantic_conventions_1 = require_src2(); + var platform_1 = require_platform6(); + var utils_1 = require_utils11(); + + class ResourceImpl { + _rawAttributes; + _asyncAttributesPending = false; + _schemaUrl; + _memoizedAttributes; + static FromAttributeList(attributes, options) { + const res = new ResourceImpl({}, options); + res._rawAttributes = guardedRawAttributes(attributes); + res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; + return res; + } + constructor(resource, options) { + const attributes = resource.attributes ?? {}; + this._rawAttributes = Object.entries(attributes).map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) { + this._asyncAttributesPending = true; + } + return [k, v]; + }); + this._rawAttributes = guardedRawAttributes(this._rawAttributes); + this._schemaUrl = validateSchemaUrl(options?.schemaUrl); + } + get asyncAttributesPending() { + return this._asyncAttributesPending; + } + async waitForAsyncAttributes() { + if (!this.asyncAttributesPending) { + return; + } + for (let i = 0;i < this._rawAttributes.length; i++) { + const [k, v] = this._rawAttributes[i]; + this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; + } + this._asyncAttributesPending = false; + } + get attributes() { + if (this.asyncAttributesPending) { + api_1.diag.error("Accessing resource attributes before async attributes settled"); + } + if (this._memoizedAttributes) { + return this._memoizedAttributes; + } + const attrs = {}; + for (const [k, v] of this._rawAttributes) { + if ((0, utils_1.isPromiseLike)(v)) { + api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); + continue; + } + if (v != null) { + attrs[k] ??= v; + } + } + if (!this._asyncAttributesPending) { + this._memoizedAttributes = attrs; + } + return attrs; + } + getRawAttributes() { + return this._rawAttributes; + } + get schemaUrl() { + return this._schemaUrl; + } + merge(resource) { + if (resource == null) + return this; + const mergedSchemaUrl = mergeSchemaUrl(this, resource); + const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : undefined; + return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); + } + } + function resourceFromAttributes(attributes, options) { + return ResourceImpl.FromAttributeList(Object.entries(attributes), options); + } + exports.resourceFromAttributes = resourceFromAttributes; + function resourceFromDetectedResource(detectedResource, options) { + return new ResourceImpl(detectedResource, options); + } + exports.resourceFromDetectedResource = resourceFromDetectedResource; + function emptyResource() { + return resourceFromAttributes({}); + } + exports.emptyResource = emptyResource; + function defaultResource() { + return resourceFromAttributes({ + [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] + }); + } + exports.defaultResource = defaultResource; + function guardedRawAttributes(attributes) { + return attributes.map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) { + return [ + k, + v.catch((err) => { + api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); + return; + }) + ]; + } + return [k, v]; + }); + } + function validateSchemaUrl(schemaUrl) { + if (typeof schemaUrl === "string" || schemaUrl === undefined) { + return schemaUrl; + } + api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); + return; + } + function mergeSchemaUrl(old, updating) { + const oldSchemaUrl = old?.schemaUrl; + const updatingSchemaUrl = updating?.schemaUrl; + const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === ""; + const isUpdatingEmpty = updatingSchemaUrl === undefined || updatingSchemaUrl === ""; + if (isOldEmpty) { + return updatingSchemaUrl; + } + if (isUpdatingEmpty) { + return oldSchemaUrl; + } + if (oldSchemaUrl === updatingSchemaUrl) { + return oldSchemaUrl; + } + api_1.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.', oldSchemaUrl, updatingSchemaUrl); + return; + } +}); + +// node_modules/@opentelemetry/resources/build/src/detect-resources.js +var require_detect_resources = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.detectResources = undefined; + var api_1 = require_src(); + var ResourceImpl_1 = require_ResourceImpl(); + var detectResources = (config2 = {}) => { + const resources = (config2.detectors || []).map((d) => { + try { + const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config2)); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return (0, ResourceImpl_1.emptyResource)(); + } + }); + return resources.reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); + }; + exports.detectResources = detectResources; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js +var require_EnvDetector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.envDetector = undefined; + var api_1 = require_src(); + var semantic_conventions_1 = require_src2(); + var core_1 = require_src8(); + + class EnvDetector { + _MAX_LENGTH = 255; + _COMMA_SEPARATOR = ","; + _LABEL_KEY_VALUE_SPLITTER = "="; + _ERROR_MESSAGE_INVALID_CHARS = "should be a ASCII string with a length greater than 0 and not exceed " + this._MAX_LENGTH + " characters."; + _ERROR_MESSAGE_INVALID_VALUE = "should be a ASCII string with a length not exceed " + this._MAX_LENGTH + " characters."; + detect(_config) { + const attributes = {}; + const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); + const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); + if (rawAttributes) { + try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e.message}`); + } + } + if (serviceName) { + attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; + } + return { attributes }; + } + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) + return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); + if (keyValuePair.length !== 2) { + continue; + } + let [key, value] = keyValuePair; + key = key.trim(); + value = value.trim().split(/^"|"$/).join(""); + if (!this._isValidAndNotEmpty(key)) { + throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); + } + if (!this._isValid(value)) { + throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); + } + attributes[key] = decodeURIComponent(value); + } + return attributes; + } + _isValid(name) { + return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); + } + _isBaggageOctetString(str) { + for (let i = 0;i < str.length; i++) { + const ch = str.charCodeAt(i); + if (ch < 33 || ch === 44 || ch === 59 || ch === 92 || ch > 126) { + return false; + } + } + return true; + } + _isValidAndNotEmpty(str) { + return str.length > 0 && this._isValid(str); + } + } + exports.envDetector = new EnvDetector; +}); + +// node_modules/@opentelemetry/resources/build/src/semconv.js +var require_semconv6 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = undefined; + exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; + exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; + exports.ATTR_CLOUD_REGION = "cloud.region"; + exports.ATTR_CONTAINER_ID = "container.id"; + exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; + exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; + exports.ATTR_CONTAINER_NAME = "container.name"; + exports.ATTR_HOST_ARCH = "host.arch"; + exports.ATTR_HOST_ID = "host.id"; + exports.ATTR_HOST_IMAGE_ID = "host.image.id"; + exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; + exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; + exports.ATTR_HOST_NAME = "host.name"; + exports.ATTR_HOST_TYPE = "host.type"; + exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; + exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; + exports.ATTR_OS_TYPE = "os.type"; + exports.ATTR_OS_VERSION = "os.version"; + exports.ATTR_PROCESS_COMMAND = "process.command"; + exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; + exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + exports.ATTR_PROCESS_OWNER = "process.owner"; + exports.ATTR_PROCESS_PID = "process.pid"; + exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; + exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; + exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; + exports.ATTR_WEBENGINE_NAME = "webengine.name"; + exports.ATTR_WEBENGINE_VERSION = "webengine.version"; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js +var require_execAsync = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.execAsync = undefined; + var child_process = __require("child_process"); + var util = __require("util"); + exports.execAsync = util.promisify(child_process.exec); +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js +var require_getMachineId_darwin = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var execAsync_1 = require_execAsync(); + var api_1 = require_src(); + async function getMachineId() { + try { + const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); + const idLine = result.stdout.split(` +`).find((line) => line.includes("IOPlatformUUID")); + if (!idLine) { + return; + } + const parts = idLine.split('" = "'); + if (parts.length === 2) { + return parts[1].slice(0, -1); + } + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js +var require_getMachineId_linux = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var fs_1 = __require("fs"); + var api_1 = require_src(); + async function getMachineId() { + const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"]; + for (const path2 of paths) { + try { + const result = await fs_1.promises.readFile(path2, { encoding: "utf8" }); + return result.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js +var require_getMachineId_bsd = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var fs_1 = __require("fs"); + var execAsync_1 = require_execAsync(); + var api_1 = require_src(); + async function getMachineId() { + try { + const result = await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" }); + return result.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + try { + const result = await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid"); + return result.stdout.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js +var require_getMachineId_win = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var process3 = __require("process"); + var execAsync_1 = require_execAsync(); + var api_1 = require_src(); + async function getMachineId() { + const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; + let command = "%windir%\\System32\\REG.exe"; + if (process3.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process3.env) { + command = "%windir%\\sysnative\\cmd.exe /c " + command; + } + try { + const result = await (0, execAsync_1.execAsync)(`${command} ${args}`); + const parts = result.stdout.split("REG_SZ"); + if (parts.length === 2) { + return parts[1].trim(); + } + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js +var require_getMachineId_unsupported = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var api_1 = require_src(); + async function getMachineId() { + api_1.diag.debug("could not read machine-id: unsupported platform"); + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js +var require_getMachineId = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var process3 = __require("process"); + var getMachineIdImpl; + async function getMachineId() { + if (!getMachineIdImpl) { + switch (process3.platform) { + case "darwin": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_darwin()))).getMachineId; + break; + case "linux": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_linux()))).getMachineId; + break; + case "freebsd": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_bsd()))).getMachineId; + break; + case "win32": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_win()))).getMachineId; + break; + default: + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_unsupported()))).getMachineId; + break; + } + } + return getMachineIdImpl(); + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js +var require_utils12 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.normalizeType = exports.normalizeArch = undefined; + var normalizeArch = (nodeArchString) => { + switch (nodeArchString) { + case "arm": + return "arm32"; + case "ppc": + return "ppc32"; + case "x64": + return "amd64"; + default: + return nodeArchString; + } + }; + exports.normalizeArch = normalizeArch; + var normalizeType = (nodePlatform) => { + switch (nodePlatform) { + case "sunos": + return "solaris"; + case "win32": + return "windows"; + default: + return nodePlatform; + } + }; + exports.normalizeType = normalizeType; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js +var require_HostDetector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hostDetector = undefined; + var semconv_1 = require_semconv6(); + var os_1 = __require("os"); + var getMachineId_1 = require_getMachineId(); + var utils_1 = require_utils12(); + + class HostDetector { + detect(_config) { + const attributes = { + [semconv_1.ATTR_HOST_NAME]: (0, os_1.hostname)(), + [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()), + [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() + }; + return { attributes }; + } + } + exports.hostDetector = new HostDetector; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js +var require_OSDetector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.osDetector = undefined; + var semconv_1 = require_semconv6(); + var os_1 = __require("os"); + var utils_1 = require_utils12(); + + class OSDetector { + detect(_config) { + const attributes = { + [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), + [semconv_1.ATTR_OS_VERSION]: (0, os_1.release)() + }; + return { attributes }; + } + } + exports.osDetector = new OSDetector; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js +var require_ProcessDetector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.processDetector = undefined; + var api_1 = require_src(); + var semconv_1 = require_semconv6(); + var os2 = __require("os"); + + class ProcessDetector { + detect(_config) { + const attributes = { + [semconv_1.ATTR_PROCESS_PID]: process.pid, + [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, + [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, + [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ + process.argv[0], + ...process.execArgv, + ...process.argv.slice(1) + ], + [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", + [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" + }; + if (process.argv.length > 1) { + attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; + } + try { + const userInfo = os2.userInfo(); + attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; + } catch (e) { + api_1.diag.debug(`error obtaining process owner: ${e}`); + } + return { attributes }; + } + } + exports.processDetector = new ProcessDetector; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js +var require_ServiceInstanceIdDetector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = undefined; + var semconv_1 = require_semconv6(); + var crypto_1 = __require("crypto"); + + class ServiceInstanceIdDetector { + detect(_config) { + return { + attributes: { + [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)() + } + }; + } + } + exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js +var require_node7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = undefined; + var HostDetector_1 = require_HostDetector(); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return HostDetector_1.hostDetector; + } }); + var OSDetector_1 = require_OSDetector(); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return OSDetector_1.osDetector; + } }); + var ProcessDetector_1 = require_ProcessDetector(); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return ProcessDetector_1.processDetector; + } }); + var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector(); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; + } }); +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js +var require_platform7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = undefined; + var node_1 = require_node7(); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return node_1.hostDetector; + } }); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return node_1.osDetector; + } }); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return node_1.processDetector; + } }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return node_1.serviceInstanceIdDetector; + } }); +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js +var require_NoopDetector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.NoopDetector = undefined; + + class NoopDetector { + detect() { + return { + attributes: {} + }; + } + } + exports.NoopDetector = NoopDetector; + exports.noopDetector = new NoopDetector; +}); + +// node_modules/@opentelemetry/resources/build/src/detectors/index.js +var require_detectors = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = undefined; + var EnvDetector_1 = require_EnvDetector(); + Object.defineProperty(exports, "envDetector", { enumerable: true, get: function() { + return EnvDetector_1.envDetector; + } }); + var platform_1 = require_platform7(); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return platform_1.hostDetector; + } }); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return platform_1.osDetector; + } }); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return platform_1.processDetector; + } }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return platform_1.serviceInstanceIdDetector; + } }); + var NoopDetector_1 = require_NoopDetector(); + Object.defineProperty(exports, "noopDetector", { enumerable: true, get: function() { + return NoopDetector_1.noopDetector; + } }); +}); + +// node_modules/@opentelemetry/resources/build/src/index.js +var require_src9 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = undefined; + var detect_resources_1 = require_detect_resources(); + Object.defineProperty(exports, "detectResources", { enumerable: true, get: function() { + return detect_resources_1.detectResources; + } }); + var detectors_1 = require_detectors(); + Object.defineProperty(exports, "envDetector", { enumerable: true, get: function() { + return detectors_1.envDetector; + } }); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return detectors_1.hostDetector; + } }); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return detectors_1.osDetector; + } }); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return detectors_1.processDetector; + } }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return detectors_1.serviceInstanceIdDetector; + } }); + var ResourceImpl_1 = require_ResourceImpl(); + Object.defineProperty(exports, "resourceFromAttributes", { enumerable: true, get: function() { + return ResourceImpl_1.resourceFromAttributes; + } }); + Object.defineProperty(exports, "defaultResource", { enumerable: true, get: function() { + return ResourceImpl_1.defaultResource; + } }); + Object.defineProperty(exports, "emptyResource", { enumerable: true, get: function() { + return ResourceImpl_1.emptyResource; + } }); + var platform_1 = require_platform6(); + Object.defineProperty(exports, "defaultServiceName", { enumerable: true, get: function() { + return platform_1.defaultServiceName; + } }); +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/ViewRegistry.js +var require_ViewRegistry = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ViewRegistry = undefined; + + class ViewRegistry { + _registeredViews = []; + addView(view) { + this._registeredViews.push(view); + } + findViews(instrument, meter) { + const views = this._registeredViews.filter((registeredView) => { + return this._matchInstrument(registeredView.instrumentSelector, instrument) && this._matchMeter(registeredView.meterSelector, meter); + }); + return views; + } + _matchInstrument(selector, instrument) { + return (selector.getType() === undefined || instrument.type === selector.getType()) && selector.getNameFilter().match(instrument.name) && selector.getUnitFilter().match(instrument.unit); + } + _matchMeter(selector, meter) { + return selector.getNameFilter().match(meter.name) && (meter.version === undefined || selector.getVersionFilter().match(meter.version)) && (meter.schemaUrl === undefined || selector.getSchemaUrlFilter().match(meter.schemaUrl)); + } + } + exports.ViewRegistry = ViewRegistry; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js +var require_InstrumentDescriptor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isValidName = exports.isDescriptorCompatibleWith = exports.createInstrumentDescriptorWithView = exports.createInstrumentDescriptor = undefined; + var api_1 = require_src(); + var utils_1 = require_utils8(); + function createInstrumentDescriptor(name, type, options) { + if (!isValidName(name)) { + api_1.diag.warn(`Invalid metric name: "${name}". The metric name should be a ASCII string with a length no greater than 255 characters.`); + } + return { + name, + type, + description: options?.description ?? "", + unit: options?.unit ?? "", + valueType: options?.valueType ?? api_1.ValueType.DOUBLE, + advice: options?.advice ?? {} + }; + } + exports.createInstrumentDescriptor = createInstrumentDescriptor; + function createInstrumentDescriptorWithView(view, instrument) { + return { + name: view.name ?? instrument.name, + description: view.description ?? instrument.description, + type: instrument.type, + unit: instrument.unit, + valueType: instrument.valueType, + advice: instrument.advice + }; + } + exports.createInstrumentDescriptorWithView = createInstrumentDescriptorWithView; + function isDescriptorCompatibleWith(descriptor, otherDescriptor) { + return (0, utils_1.equalsCaseInsensitive)(descriptor.name, otherDescriptor.name) && descriptor.unit === otherDescriptor.unit && descriptor.type === otherDescriptor.type && descriptor.valueType === otherDescriptor.valueType; + } + exports.isDescriptorCompatibleWith = isDescriptorCompatibleWith; + var NAME_REGEXP = /^[a-z][a-z0-9_.\-/]{0,254}$/i; + function isValidName(name) { + return name.match(NAME_REGEXP) != null; + } + exports.isValidName = isValidName; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/Instruments.js +var require_Instruments = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isObservableInstrument = exports.ObservableUpDownCounterInstrument = exports.ObservableGaugeInstrument = exports.ObservableCounterInstrument = exports.ObservableInstrument = exports.HistogramInstrument = exports.GaugeInstrument = exports.CounterInstrument = exports.UpDownCounterInstrument = exports.SyncInstrument = undefined; + var api_1 = require_src(); + var core_1 = require_src7(); + + class SyncInstrument { + _writableMetricStorage; + _descriptor; + constructor(_writableMetricStorage, _descriptor) { + this._writableMetricStorage = _writableMetricStorage; + this._descriptor = _descriptor; + } + _record(value, attributes = {}, context = api_1.context.active()) { + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${value}`); + return; + } + if (this._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) { + return; + } + } + this._writableMetricStorage.record(value, attributes, context, (0, core_1.millisToHrTime)(Date.now())); + } + } + exports.SyncInstrument = SyncInstrument; + + class UpDownCounterInstrument extends SyncInstrument { + add(value, attributes, ctx) { + this._record(value, attributes, ctx); + } + } + exports.UpDownCounterInstrument = UpDownCounterInstrument; + + class CounterInstrument extends SyncInstrument { + add(value, attributes, ctx) { + if (value < 0) { + api_1.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); + } + } + exports.CounterInstrument = CounterInstrument; + + class GaugeInstrument extends SyncInstrument { + record(value, attributes, ctx) { + this._record(value, attributes, ctx); + } + } + exports.GaugeInstrument = GaugeInstrument; + + class HistogramInstrument extends SyncInstrument { + record(value, attributes, ctx) { + if (value < 0) { + api_1.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); + } + } + exports.HistogramInstrument = HistogramInstrument; + + class ObservableInstrument { + _observableRegistry; + _metricStorages; + _descriptor; + constructor(descriptor, metricStorages, _observableRegistry) { + this._observableRegistry = _observableRegistry; + this._descriptor = descriptor; + this._metricStorages = metricStorages; + } + addCallback(callback) { + this._observableRegistry.addCallback(callback, this); + } + removeCallback(callback) { + this._observableRegistry.removeCallback(callback, this); + } + } + exports.ObservableInstrument = ObservableInstrument; + + class ObservableCounterInstrument extends ObservableInstrument { + } + exports.ObservableCounterInstrument = ObservableCounterInstrument; + + class ObservableGaugeInstrument extends ObservableInstrument { + } + exports.ObservableGaugeInstrument = ObservableGaugeInstrument; + + class ObservableUpDownCounterInstrument extends ObservableInstrument { + } + exports.ObservableUpDownCounterInstrument = ObservableUpDownCounterInstrument; + function isObservableInstrument(it) { + return it instanceof ObservableInstrument; + } + exports.isObservableInstrument = isObservableInstrument; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/Meter.js +var require_Meter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Meter = undefined; + var InstrumentDescriptor_1 = require_InstrumentDescriptor(); + var Instruments_1 = require_Instruments(); + var MetricData_1 = require_MetricData(); + + class Meter { + _meterSharedState; + constructor(_meterSharedState) { + this._meterSharedState = _meterSharedState; + } + createGauge(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.GAUGE, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.GaugeInstrument(storage, descriptor); + } + createHistogram(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.HISTOGRAM, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.HistogramInstrument(storage, descriptor); + } + createCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.CounterInstrument(storage, descriptor); + } + createUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.UP_DOWN_COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.UpDownCounterInstrument(storage, descriptor); + } + createObservableGauge(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_GAUGE, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableGaugeInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + createObservableCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + createObservableUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableUpDownCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + addBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.addBatchCallback(callback, observables); + } + removeBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.removeBatchCallback(callback, observables); + } + } + exports.Meter = Meter; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorage.js +var require_MetricStorage = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricStorage = undefined; + var InstrumentDescriptor_1 = require_InstrumentDescriptor(); + + class MetricStorage { + _instrumentDescriptor; + constructor(_instrumentDescriptor) { + this._instrumentDescriptor = _instrumentDescriptor; + } + getInstrumentDescriptor() { + return this._instrumentDescriptor; + } + updateDescription(description) { + this._instrumentDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(this._instrumentDescriptor.name, this._instrumentDescriptor.type, { + description, + valueType: this._instrumentDescriptor.valueType, + unit: this._instrumentDescriptor.unit, + advice: this._instrumentDescriptor.advice + }); + } + } + exports.MetricStorage = MetricStorage; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/HashMap.js +var require_HashMap = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttributeHashMap = exports.HashMap = undefined; + var utils_1 = require_utils8(); + + class HashMap { + _hash; + _valueMap = new Map; + _keyMap = new Map; + constructor(_hash) { + this._hash = _hash; + } + get(key, hashCode) { + hashCode ??= this._hash(key); + return this._valueMap.get(hashCode); + } + getOrDefault(key, defaultFactory) { + const hash2 = this._hash(key); + if (this._valueMap.has(hash2)) { + return this._valueMap.get(hash2); + } + const val = defaultFactory(); + if (!this._keyMap.has(hash2)) { + this._keyMap.set(hash2, key); + } + this._valueMap.set(hash2, val); + return val; + } + set(key, value, hashCode) { + hashCode ??= this._hash(key); + if (!this._keyMap.has(hashCode)) { + this._keyMap.set(hashCode, key); + } + this._valueMap.set(hashCode, value); + } + has(key, hashCode) { + hashCode ??= this._hash(key); + return this._valueMap.has(hashCode); + } + *keys() { + const keyIterator = this._keyMap.entries(); + let next = keyIterator.next(); + while (next.done !== true) { + yield [next.value[1], next.value[0]]; + next = keyIterator.next(); + } + } + *entries() { + const valueIterator = this._valueMap.entries(); + let next = valueIterator.next(); + while (next.done !== true) { + yield [this._keyMap.get(next.value[0]), next.value[1], next.value[0]]; + next = valueIterator.next(); + } + } + get size() { + return this._valueMap.size; + } + } + exports.HashMap = HashMap; + + class AttributeHashMap extends HashMap { + constructor() { + super(utils_1.hashAttributes); + } + } + exports.AttributeHashMap = AttributeHashMap; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/DeltaMetricProcessor.js +var require_DeltaMetricProcessor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DeltaMetricProcessor = undefined; + var utils_1 = require_utils8(); + var HashMap_1 = require_HashMap(); + + class DeltaMetricProcessor { + _aggregator; + _activeCollectionStorage = new HashMap_1.AttributeHashMap; + _cumulativeMemoStorage = new HashMap_1.AttributeHashMap; + _cardinalityLimit; + _overflowAttributes = { "otel.metric.overflow": true }; + _overflowHashCode; + constructor(_aggregator, aggregationCardinalityLimit) { + this._aggregator = _aggregator; + this._cardinalityLimit = (aggregationCardinalityLimit ?? 2000) - 1; + this._overflowHashCode = (0, utils_1.hashAttributes)(this._overflowAttributes); + } + record(value, attributes, _context, collectionTime) { + let accumulation = this._activeCollectionStorage.get(attributes); + if (!accumulation) { + if (this._activeCollectionStorage.size >= this._cardinalityLimit) { + const overflowAccumulation = this._activeCollectionStorage.getOrDefault(this._overflowAttributes, () => this._aggregator.createAccumulation(collectionTime)); + overflowAccumulation?.record(value); + return; + } + accumulation = this._aggregator.createAccumulation(collectionTime); + this._activeCollectionStorage.set(attributes, accumulation); + } + accumulation?.record(value); + } + batchCumulate(measurements, collectionTime) { + Array.from(measurements.entries()).forEach(([attributes, value, hashCode]) => { + const accumulation = this._aggregator.createAccumulation(collectionTime); + accumulation?.record(value); + let delta = accumulation; + if (this._cumulativeMemoStorage.has(attributes, hashCode)) { + const previous = this._cumulativeMemoStorage.get(attributes, hashCode); + delta = this._aggregator.diff(previous, accumulation); + } else { + if (this._cumulativeMemoStorage.size >= this._cardinalityLimit) { + attributes = this._overflowAttributes; + hashCode = this._overflowHashCode; + if (this._cumulativeMemoStorage.has(attributes, hashCode)) { + const previous = this._cumulativeMemoStorage.get(attributes, hashCode); + delta = this._aggregator.diff(previous, accumulation); + } + } + } + if (this._activeCollectionStorage.has(attributes, hashCode)) { + const active = this._activeCollectionStorage.get(attributes, hashCode); + delta = this._aggregator.merge(active, delta); + } + this._cumulativeMemoStorage.set(attributes, accumulation, hashCode); + this._activeCollectionStorage.set(attributes, delta, hashCode); + }); + } + collect() { + const unreportedDelta = this._activeCollectionStorage; + this._activeCollectionStorage = new HashMap_1.AttributeHashMap; + return unreportedDelta; + } + } + exports.DeltaMetricProcessor = DeltaMetricProcessor; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/TemporalMetricProcessor.js +var require_TemporalMetricProcessor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TemporalMetricProcessor = undefined; + var AggregationTemporality_1 = require_AggregationTemporality(); + var HashMap_1 = require_HashMap(); + + class TemporalMetricProcessor { + _aggregator; + _unreportedAccumulations = new Map; + _reportHistory = new Map; + constructor(_aggregator, collectorHandles) { + this._aggregator = _aggregator; + collectorHandles.forEach((handle) => { + this._unreportedAccumulations.set(handle, []); + }); + } + buildMetrics(collector, instrumentDescriptor, currentAccumulations, collectionTime) { + this._stashAccumulations(currentAccumulations); + const unreportedAccumulations = this._getMergedUnreportedAccumulations(collector); + let result = unreportedAccumulations; + let aggregationTemporality; + if (this._reportHistory.has(collector)) { + const last = this._reportHistory.get(collector); + const lastCollectionTime = last.collectionTime; + aggregationTemporality = last.aggregationTemporality; + if (aggregationTemporality === AggregationTemporality_1.AggregationTemporality.CUMULATIVE) { + result = TemporalMetricProcessor.merge(last.accumulations, unreportedAccumulations, this._aggregator); + } else { + result = TemporalMetricProcessor.calibrateStartTime(last.accumulations, unreportedAccumulations, lastCollectionTime); + } + } else { + aggregationTemporality = collector.selectAggregationTemporality(instrumentDescriptor.type); + } + this._reportHistory.set(collector, { + accumulations: result, + collectionTime, + aggregationTemporality + }); + const accumulationRecords = AttributesMapToAccumulationRecords(result); + if (accumulationRecords.length === 0) { + return; + } + return this._aggregator.toMetricData(instrumentDescriptor, aggregationTemporality, accumulationRecords, collectionTime); + } + _stashAccumulations(currentAccumulation) { + const registeredCollectors = this._unreportedAccumulations.keys(); + for (const collector of registeredCollectors) { + let stash = this._unreportedAccumulations.get(collector); + if (stash === undefined) { + stash = []; + this._unreportedAccumulations.set(collector, stash); + } + stash.push(currentAccumulation); + } + } + _getMergedUnreportedAccumulations(collector) { + let result = new HashMap_1.AttributeHashMap; + const unreportedList = this._unreportedAccumulations.get(collector); + this._unreportedAccumulations.set(collector, []); + if (unreportedList === undefined) { + return result; + } + for (const it of unreportedList) { + result = TemporalMetricProcessor.merge(result, it, this._aggregator); + } + return result; + } + static merge(last, current, aggregator) { + const result = last; + const iterator = current.entries(); + let next = iterator.next(); + while (next.done !== true) { + const [key, record2, hash2] = next.value; + if (last.has(key, hash2)) { + const lastAccumulation = last.get(key, hash2); + const accumulation = aggregator.merge(lastAccumulation, record2); + result.set(key, accumulation, hash2); + } else { + result.set(key, record2, hash2); + } + next = iterator.next(); + } + return result; + } + static calibrateStartTime(last, current, lastCollectionTime) { + for (const [key, hash2] of last.keys()) { + const currentAccumulation = current.get(key, hash2); + currentAccumulation?.setStartTime(lastCollectionTime); + } + return current; + } + } + exports.TemporalMetricProcessor = TemporalMetricProcessor; + function AttributesMapToAccumulationRecords(map2) { + return Array.from(map2.entries()); + } +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/AsyncMetricStorage.js +var require_AsyncMetricStorage = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncMetricStorage = undefined; + var MetricStorage_1 = require_MetricStorage(); + var DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); + var TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); + var HashMap_1 = require_HashMap(); + + class AsyncMetricStorage extends MetricStorage_1.MetricStorage { + _attributesProcessor; + _aggregationCardinalityLimit; + _deltaMetricStorage; + _temporalMetricStorage; + constructor(_instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { + super(_instrumentDescriptor); + this._attributesProcessor = _attributesProcessor; + this._aggregationCardinalityLimit = _aggregationCardinalityLimit; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); + } + record(measurements, observationTime) { + const processed = new HashMap_1.AttributeHashMap; + Array.from(measurements.entries()).forEach(([attributes, value]) => { + processed.set(this._attributesProcessor.process(attributes), value); + }); + this._deltaMetricStorage.batchCumulate(processed, observationTime); + } + collect(collector, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + } + } + exports.AsyncMetricStorage = AsyncMetricStorage; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/RegistrationConflicts.js +var require_RegistrationConflicts = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getConflictResolutionRecipe = exports.getDescriptionResolutionRecipe = exports.getTypeConflictResolutionRecipe = exports.getUnitConflictResolutionRecipe = exports.getValueTypeConflictResolutionRecipe = exports.getIncompatibilityDetails = undefined; + function getIncompatibilityDetails(existing, otherDescriptor) { + let incompatibility = ""; + if (existing.unit !== otherDescriptor.unit) { + incompatibility += ` - Unit '${existing.unit}' does not match '${otherDescriptor.unit}' +`; + } + if (existing.type !== otherDescriptor.type) { + incompatibility += ` - Type '${existing.type}' does not match '${otherDescriptor.type}' +`; + } + if (existing.valueType !== otherDescriptor.valueType) { + incompatibility += ` - Value Type '${existing.valueType}' does not match '${otherDescriptor.valueType}' +`; + } + if (existing.description !== otherDescriptor.description) { + incompatibility += ` - Description '${existing.description}' does not match '${otherDescriptor.description}' +`; + } + return incompatibility; + } + exports.getIncompatibilityDetails = getIncompatibilityDetails; + function getValueTypeConflictResolutionRecipe(existing, otherDescriptor) { + return ` - use valueType '${existing.valueType}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; + } + exports.getValueTypeConflictResolutionRecipe = getValueTypeConflictResolutionRecipe; + function getUnitConflictResolutionRecipe(existing, otherDescriptor) { + return ` - use unit '${existing.unit}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; + } + exports.getUnitConflictResolutionRecipe = getUnitConflictResolutionRecipe; + function getTypeConflictResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type, + unit: otherDescriptor.unit + }; + const selectorString = JSON.stringify(selector); + return ` - create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}'`; + } + exports.getTypeConflictResolutionRecipe = getTypeConflictResolutionRecipe; + function getDescriptionResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type, + unit: otherDescriptor.unit + }; + const selectorString = JSON.stringify(selector); + return ` - create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}' + - OR - create a new view with the name ${existing.name} and description '${existing.description}' and InstrumentSelector ${selectorString} + - OR - create a new view with the name ${otherDescriptor.name} and description '${existing.description}' and InstrumentSelector ${selectorString}`; + } + exports.getDescriptionResolutionRecipe = getDescriptionResolutionRecipe; + function getConflictResolutionRecipe(existing, otherDescriptor) { + if (existing.valueType !== otherDescriptor.valueType) { + return getValueTypeConflictResolutionRecipe(existing, otherDescriptor); + } + if (existing.unit !== otherDescriptor.unit) { + return getUnitConflictResolutionRecipe(existing, otherDescriptor); + } + if (existing.type !== otherDescriptor.type) { + return getTypeConflictResolutionRecipe(existing, otherDescriptor); + } + if (existing.description !== otherDescriptor.description) { + return getDescriptionResolutionRecipe(existing, otherDescriptor); + } + return ""; + } + exports.getConflictResolutionRecipe = getConflictResolutionRecipe; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorageRegistry.js +var require_MetricStorageRegistry = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricStorageRegistry = undefined; + var InstrumentDescriptor_1 = require_InstrumentDescriptor(); + var api2 = require_src(); + var RegistrationConflicts_1 = require_RegistrationConflicts(); + + class MetricStorageRegistry { + _sharedRegistry = new Map; + _perCollectorRegistry = new Map; + static create() { + return new MetricStorageRegistry; + } + getStorages(collector) { + let storages = []; + for (const metricStorages of this._sharedRegistry.values()) { + storages = storages.concat(metricStorages); + } + const perCollectorStorages = this._perCollectorRegistry.get(collector); + if (perCollectorStorages != null) { + for (const metricStorages of perCollectorStorages.values()) { + storages = storages.concat(metricStorages); + } + } + return storages; + } + register(storage) { + this._registerStorage(storage, this._sharedRegistry); + } + registerForCollector(collector, storage) { + let storageMap = this._perCollectorRegistry.get(collector); + if (storageMap == null) { + storageMap = new Map; + this._perCollectorRegistry.set(collector, storageMap); + } + this._registerStorage(storage, storageMap); + } + findOrUpdateCompatibleStorage(expectedDescriptor) { + const storages = this._sharedRegistry.get(expectedDescriptor.name); + if (storages === undefined) { + return null; + } + return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); + } + findOrUpdateCompatibleCollectorStorage(collector, expectedDescriptor) { + const storageMap = this._perCollectorRegistry.get(collector); + if (storageMap === undefined) { + return null; + } + const storages = storageMap.get(expectedDescriptor.name); + if (storages === undefined) { + return null; + } + return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); + } + _registerStorage(storage, storageMap) { + const descriptor = storage.getInstrumentDescriptor(); + const storages = storageMap.get(descriptor.name); + if (storages === undefined) { + storageMap.set(descriptor.name, [storage]); + return; + } + storages.push(storage); + } + _findOrUpdateCompatibleStorage(expectedDescriptor, existingStorages) { + let compatibleStorage = null; + for (const existingStorage of existingStorages) { + const existingDescriptor = existingStorage.getInstrumentDescriptor(); + if ((0, InstrumentDescriptor_1.isDescriptorCompatibleWith)(existingDescriptor, expectedDescriptor)) { + if (existingDescriptor.description !== expectedDescriptor.description) { + if (expectedDescriptor.description.length > existingDescriptor.description.length) { + existingStorage.updateDescription(expectedDescriptor.description); + } + api2.diag.warn("A view or instrument with the name ", expectedDescriptor.name, ` has already been registered, but has a different description and is incompatible with another registered view. +`, `Details: +`, (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), `The longer description will be used. +To resolve the conflict:`, (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } + compatibleStorage = existingStorage; + } else { + api2.diag.warn("A view or instrument with the name ", expectedDescriptor.name, ` has already been registered and is incompatible with another registered view. +`, `Details: +`, (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), `To resolve the conflict: +`, (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } + } + return compatibleStorage; + } + } + exports.MetricStorageRegistry = MetricStorageRegistry; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/MultiWritableMetricStorage.js +var require_MultiWritableMetricStorage = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MultiMetricStorage = undefined; + + class MultiMetricStorage { + _backingStorages; + constructor(_backingStorages) { + this._backingStorages = _backingStorages; + } + record(value, attributes, context, recordTime) { + this._backingStorages.forEach((it) => { + it.record(value, attributes, context, recordTime); + }); + } + } + exports.MultiMetricStorage = MultiMetricStorage; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/ObservableResult.js +var require_ObservableResult = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BatchObservableResultImpl = exports.ObservableResultImpl = undefined; + var api_1 = require_src(); + var HashMap_1 = require_HashMap(); + var Instruments_1 = require_Instruments(); + + class ObservableResultImpl { + _instrumentName; + _valueType; + _buffer = new HashMap_1.AttributeHashMap; + constructor(_instrumentName, _valueType) { + this._instrumentName = _instrumentName; + this._valueType = _valueType; + } + observe(value, attributes = {}) { + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${value}`); + return; + } + if (this._valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) { + return; + } + } + this._buffer.set(attributes, value); + } + } + exports.ObservableResultImpl = ObservableResultImpl; + + class BatchObservableResultImpl { + _buffer = new Map; + observe(metric, value, attributes = {}) { + if (!(0, Instruments_1.isObservableInstrument)(metric)) { + return; + } + let map2 = this._buffer.get(metric); + if (map2 == null) { + map2 = new HashMap_1.AttributeHashMap; + this._buffer.set(metric, map2); + } + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${metric._descriptor.name}: ${value}`); + return; + } + if (metric._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${metric._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) { + return; + } + } + map2.set(attributes, value); + } + } + exports.BatchObservableResultImpl = BatchObservableResultImpl; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/ObservableRegistry.js +var require_ObservableRegistry = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ObservableRegistry = undefined; + var api_1 = require_src(); + var Instruments_1 = require_Instruments(); + var ObservableResult_1 = require_ObservableResult(); + var utils_1 = require_utils8(); + + class ObservableRegistry { + _callbacks = []; + _batchCallbacks = []; + addCallback(callback, instrument) { + const idx = this._findCallback(callback, instrument); + if (idx >= 0) { + return; + } + this._callbacks.push({ callback, instrument }); + } + removeCallback(callback, instrument) { + const idx = this._findCallback(callback, instrument); + if (idx < 0) { + return; + } + this._callbacks.splice(idx, 1); + } + addBatchCallback(callback, instruments) { + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + if (observableInstruments.size === 0) { + api_1.diag.error("BatchObservableCallback is not associated with valid instruments", instruments); + return; + } + const idx = this._findBatchCallback(callback, observableInstruments); + if (idx >= 0) { + return; + } + this._batchCallbacks.push({ callback, instruments: observableInstruments }); + } + removeBatchCallback(callback, instruments) { + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + const idx = this._findBatchCallback(callback, observableInstruments); + if (idx < 0) { + return; + } + this._batchCallbacks.splice(idx, 1); + } + async observe(collectionTime, timeoutMillis) { + const callbackFutures = this._observeCallbacks(collectionTime, timeoutMillis); + const batchCallbackFutures = this._observeBatchCallbacks(collectionTime, timeoutMillis); + const results = await (0, utils_1.PromiseAllSettled)([ + ...callbackFutures, + ...batchCallbackFutures + ]); + const rejections = results.filter(utils_1.isPromiseAllSettledRejectionResult).map((it) => it.reason); + return rejections; + } + _observeCallbacks(observationTime, timeoutMillis) { + return this._callbacks.map(async ({ callback, instrument }) => { + const observableResult = new ObservableResult_1.ObservableResultImpl(instrument._descriptor.name, instrument._descriptor.valueType); + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) { + callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + } + await callPromise; + instrument._metricStorages.forEach((metricStorage) => { + metricStorage.record(observableResult._buffer, observationTime); + }); + }); + } + _observeBatchCallbacks(observationTime, timeoutMillis) { + return this._batchCallbacks.map(async ({ callback, instruments }) => { + const observableResult = new ObservableResult_1.BatchObservableResultImpl; + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) { + callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + } + await callPromise; + instruments.forEach((instrument) => { + const buffer = observableResult._buffer.get(instrument); + if (buffer == null) { + return; + } + instrument._metricStorages.forEach((metricStorage) => { + metricStorage.record(buffer, observationTime); + }); + }); + }); + } + _findCallback(callback, instrument) { + return this._callbacks.findIndex((record2) => { + return record2.callback === callback && record2.instrument === instrument; + }); + } + _findBatchCallback(callback, instruments) { + return this._batchCallbacks.findIndex((record2) => { + return record2.callback === callback && (0, utils_1.setEquals)(record2.instruments, instruments); + }); + } + } + exports.ObservableRegistry = ObservableRegistry; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/SyncMetricStorage.js +var require_SyncMetricStorage = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SyncMetricStorage = undefined; + var MetricStorage_1 = require_MetricStorage(); + var DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); + var TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); + + class SyncMetricStorage extends MetricStorage_1.MetricStorage { + _attributesProcessor; + _aggregationCardinalityLimit; + _deltaMetricStorage; + _temporalMetricStorage; + constructor(instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { + super(instrumentDescriptor); + this._attributesProcessor = _attributesProcessor; + this._aggregationCardinalityLimit = _aggregationCardinalityLimit; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); + } + record(value, attributes, context, recordTime) { + attributes = this._attributesProcessor.process(attributes, context); + this._deltaMetricStorage.record(value, attributes, context, recordTime); + } + collect(collector, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + } + } + exports.SyncMetricStorage = SyncMetricStorage; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/AttributesProcessor.js +var require_AttributesProcessor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.createMultiAttributesProcessor = exports.createNoopAttributesProcessor = undefined; + + class NoopAttributesProcessor { + process(incoming, _context) { + return incoming; + } + } + + class MultiAttributesProcessor { + _processors; + constructor(_processors) { + this._processors = _processors; + } + process(incoming, context) { + let filteredAttributes = incoming; + for (const processor of this._processors) { + filteredAttributes = processor.process(filteredAttributes, context); + } + return filteredAttributes; + } + } + + class AllowListProcessor { + _allowedAttributeNames; + constructor(_allowedAttributeNames) { + this._allowedAttributeNames = _allowedAttributeNames; + } + process(incoming, _context) { + const filteredAttributes = {}; + Object.keys(incoming).filter((attributeName) => this._allowedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); + return filteredAttributes; + } + } + + class DenyListProcessor { + _deniedAttributeNames; + constructor(_deniedAttributeNames) { + this._deniedAttributeNames = _deniedAttributeNames; + } + process(incoming, _context) { + const filteredAttributes = {}; + Object.keys(incoming).filter((attributeName) => !this._deniedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); + return filteredAttributes; + } + } + function createNoopAttributesProcessor() { + return NOOP; + } + exports.createNoopAttributesProcessor = createNoopAttributesProcessor; + function createMultiAttributesProcessor(processors) { + return new MultiAttributesProcessor(processors); + } + exports.createMultiAttributesProcessor = createMultiAttributesProcessor; + function createAllowListAttributesProcessor(attributeAllowList) { + return new AllowListProcessor(attributeAllowList); + } + exports.createAllowListAttributesProcessor = createAllowListAttributesProcessor; + function createDenyListAttributesProcessor(attributeDenyList) { + return new DenyListProcessor(attributeDenyList); + } + exports.createDenyListAttributesProcessor = createDenyListAttributesProcessor; + var NOOP = new NoopAttributesProcessor; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterSharedState.js +var require_MeterSharedState = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterSharedState = undefined; + var InstrumentDescriptor_1 = require_InstrumentDescriptor(); + var Meter_1 = require_Meter(); + var utils_1 = require_utils8(); + var AsyncMetricStorage_1 = require_AsyncMetricStorage(); + var MetricStorageRegistry_1 = require_MetricStorageRegistry(); + var MultiWritableMetricStorage_1 = require_MultiWritableMetricStorage(); + var ObservableRegistry_1 = require_ObservableRegistry(); + var SyncMetricStorage_1 = require_SyncMetricStorage(); + var AttributesProcessor_1 = require_AttributesProcessor(); + + class MeterSharedState { + _meterProviderSharedState; + _instrumentationScope; + metricStorageRegistry = new MetricStorageRegistry_1.MetricStorageRegistry; + observableRegistry = new ObservableRegistry_1.ObservableRegistry; + meter; + constructor(_meterProviderSharedState, _instrumentationScope) { + this._meterProviderSharedState = _meterProviderSharedState; + this._instrumentationScope = _instrumentationScope; + this.meter = new Meter_1.Meter(this); + } + registerMetricStorage(descriptor) { + const storages = this._registerMetricStorage(descriptor, SyncMetricStorage_1.SyncMetricStorage); + if (storages.length === 1) { + return storages[0]; + } + return new MultiWritableMetricStorage_1.MultiMetricStorage(storages); + } + registerAsyncMetricStorage(descriptor) { + const storages = this._registerMetricStorage(descriptor, AsyncMetricStorage_1.AsyncMetricStorage); + return storages; + } + async collect(collector, collectionTime, options) { + const errors3 = await this.observableRegistry.observe(collectionTime, options?.timeoutMillis); + const storages = this.metricStorageRegistry.getStorages(collector); + if (storages.length === 0) { + return null; + } + const metricDataList = storages.map((metricStorage) => { + return metricStorage.collect(collector, collectionTime); + }).filter(utils_1.isNotNullish); + if (metricDataList.length === 0) { + return { errors: errors3 }; + } + return { + scopeMetrics: { + scope: this._instrumentationScope, + metrics: metricDataList + }, + errors: errors3 + }; + } + _registerMetricStorage(descriptor, MetricStorageType) { + const views = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationScope); + let storages = views.map((view) => { + const viewDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptorWithView)(view, descriptor); + const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleStorage(viewDescriptor); + if (compatibleStorage != null) { + return compatibleStorage; + } + const aggregator = view.aggregation.createAggregator(viewDescriptor); + const viewStorage = new MetricStorageType(viewDescriptor, aggregator, view.attributesProcessor, this._meterProviderSharedState.metricCollectors, view.aggregationCardinalityLimit); + this.metricStorageRegistry.register(viewStorage); + return viewStorage; + }); + if (storages.length === 0) { + const perCollectorAggregations = this._meterProviderSharedState.selectAggregations(descriptor.type); + const collectorStorages = perCollectorAggregations.map(([collector, aggregation]) => { + const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(collector, descriptor); + if (compatibleStorage != null) { + return compatibleStorage; + } + const aggregator = aggregation.createAggregator(descriptor); + const cardinalityLimit = collector.selectCardinalityLimit(descriptor.type); + const storage = new MetricStorageType(descriptor, aggregator, (0, AttributesProcessor_1.createNoopAttributesProcessor)(), [collector], cardinalityLimit); + this.metricStorageRegistry.registerForCollector(collector, storage); + return storage; + }); + storages = storages.concat(collectorStorages); + } + return storages; + } + } + exports.MeterSharedState = MeterSharedState; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterProviderSharedState.js +var require_MeterProviderSharedState = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterProviderSharedState = undefined; + var utils_1 = require_utils8(); + var ViewRegistry_1 = require_ViewRegistry(); + var MeterSharedState_1 = require_MeterSharedState(); + var AggregationOption_1 = require_AggregationOption(); + + class MeterProviderSharedState { + resource; + viewRegistry = new ViewRegistry_1.ViewRegistry; + metricCollectors = []; + meterSharedStates = new Map; + constructor(resource) { + this.resource = resource; + } + getMeterSharedState(instrumentationScope) { + const id = (0, utils_1.instrumentationScopeId)(instrumentationScope); + let meterSharedState = this.meterSharedStates.get(id); + if (meterSharedState == null) { + meterSharedState = new MeterSharedState_1.MeterSharedState(this, instrumentationScope); + this.meterSharedStates.set(id, meterSharedState); + } + return meterSharedState; + } + selectAggregations(instrumentType) { + const result = []; + for (const collector of this.metricCollectors) { + result.push([ + collector, + (0, AggregationOption_1.toAggregation)(collector.selectAggregation(instrumentType)) + ]); + } + return result; + } + } + exports.MeterProviderSharedState = MeterProviderSharedState; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricCollector.js +var require_MetricCollector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricCollector = undefined; + var core_1 = require_src7(); + + class MetricCollector { + _sharedState; + _metricReader; + constructor(_sharedState, _metricReader) { + this._sharedState = _sharedState; + this._metricReader = _metricReader; + } + async collect(options) { + const collectionTime = (0, core_1.millisToHrTime)(Date.now()); + const scopeMetrics = []; + const errors3 = []; + const meterCollectionPromises = Array.from(this._sharedState.meterSharedStates.values()).map(async (meterSharedState) => { + const current = await meterSharedState.collect(this, collectionTime, options); + if (current?.scopeMetrics != null) { + scopeMetrics.push(current.scopeMetrics); + } + if (current?.errors != null) { + errors3.push(...current.errors); + } + }); + await Promise.all(meterCollectionPromises); + return { + resourceMetrics: { + resource: this._sharedState.resource, + scopeMetrics + }, + errors: errors3 + }; + } + async forceFlush(options) { + await this._metricReader.forceFlush(options); + } + async shutdown(options) { + await this._metricReader.shutdown(options); + } + selectAggregationTemporality(instrumentType) { + return this._metricReader.selectAggregationTemporality(instrumentType); + } + selectAggregation(instrumentType) { + return this._metricReader.selectAggregation(instrumentType); + } + selectCardinalityLimit(instrumentType) { + return this._metricReader.selectCardinalityLimit?.(instrumentType) ?? 2000; + } + } + exports.MetricCollector = MetricCollector; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/Predicate.js +var require_Predicate = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExactPredicate = exports.PatternPredicate = undefined; + var ESCAPE = /[\^$\\.+?()[\]{}|]/g; + + class PatternPredicate { + _matchAll; + _regexp; + constructor(pattern) { + if (pattern === "*") { + this._matchAll = true; + this._regexp = /.*/; + } else { + this._matchAll = false; + this._regexp = new RegExp(PatternPredicate.escapePattern(pattern)); + } + } + match(str) { + if (this._matchAll) { + return true; + } + return this._regexp.test(str); + } + static escapePattern(pattern) { + return `^${pattern.replace(ESCAPE, "\\$&").replace("*", ".*")}$`; + } + static hasWildcard(pattern) { + return pattern.includes("*"); + } + } + exports.PatternPredicate = PatternPredicate; + + class ExactPredicate { + _matchAll; + _pattern; + constructor(pattern) { + this._matchAll = pattern === undefined; + this._pattern = pattern; + } + match(str) { + if (this._matchAll) { + return true; + } + if (str === this._pattern) { + return true; + } + return false; + } + } + exports.ExactPredicate = ExactPredicate; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/InstrumentSelector.js +var require_InstrumentSelector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InstrumentSelector = undefined; + var Predicate_1 = require_Predicate(); + + class InstrumentSelector { + _nameFilter; + _type; + _unitFilter; + constructor(criteria) { + this._nameFilter = new Predicate_1.PatternPredicate(criteria?.name ?? "*"); + this._type = criteria?.type; + this._unitFilter = new Predicate_1.ExactPredicate(criteria?.unit); + } + getType() { + return this._type; + } + getNameFilter() { + return this._nameFilter; + } + getUnitFilter() { + return this._unitFilter; + } + } + exports.InstrumentSelector = InstrumentSelector; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/MeterSelector.js +var require_MeterSelector = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterSelector = undefined; + var Predicate_1 = require_Predicate(); + + class MeterSelector { + _nameFilter; + _versionFilter; + _schemaUrlFilter; + constructor(criteria) { + this._nameFilter = new Predicate_1.ExactPredicate(criteria?.name); + this._versionFilter = new Predicate_1.ExactPredicate(criteria?.version); + this._schemaUrlFilter = new Predicate_1.ExactPredicate(criteria?.schemaUrl); + } + getNameFilter() { + return this._nameFilter; + } + getVersionFilter() { + return this._versionFilter; + } + getSchemaUrlFilter() { + return this._schemaUrlFilter; + } + } + exports.MeterSelector = MeterSelector; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/view/View.js +var require_View = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.View = undefined; + var Predicate_1 = require_Predicate(); + var AttributesProcessor_1 = require_AttributesProcessor(); + var InstrumentSelector_1 = require_InstrumentSelector(); + var MeterSelector_1 = require_MeterSelector(); + var AggregationOption_1 = require_AggregationOption(); + function isSelectorNotProvided(options) { + return options.instrumentName == null && options.instrumentType == null && options.instrumentUnit == null && options.meterName == null && options.meterVersion == null && options.meterSchemaUrl == null; + } + function validateViewOptions(viewOptions) { + if (isSelectorNotProvided(viewOptions)) { + throw new Error("Cannot create view with no selector arguments supplied"); + } + if (viewOptions.name != null && (viewOptions?.instrumentName == null || Predicate_1.PatternPredicate.hasWildcard(viewOptions.instrumentName))) { + throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter."); + } + } + + class View { + name; + description; + aggregation; + attributesProcessor; + instrumentSelector; + meterSelector; + aggregationCardinalityLimit; + constructor(viewOptions) { + validateViewOptions(viewOptions); + if (viewOptions.attributesProcessors != null) { + this.attributesProcessor = (0, AttributesProcessor_1.createMultiAttributesProcessor)(viewOptions.attributesProcessors); + } else { + this.attributesProcessor = (0, AttributesProcessor_1.createNoopAttributesProcessor)(); + } + this.name = viewOptions.name; + this.description = viewOptions.description; + this.aggregation = (0, AggregationOption_1.toAggregation)(viewOptions.aggregation ?? { type: AggregationOption_1.AggregationType.DEFAULT }); + this.instrumentSelector = new InstrumentSelector_1.InstrumentSelector({ + name: viewOptions.instrumentName, + type: viewOptions.instrumentType, + unit: viewOptions.instrumentUnit + }); + this.meterSelector = new MeterSelector_1.MeterSelector({ + name: viewOptions.meterName, + version: viewOptions.meterVersion, + schemaUrl: viewOptions.meterSchemaUrl + }); + this.aggregationCardinalityLimit = viewOptions.aggregationCardinalityLimit; + } + } + exports.View = View; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider.js +var require_MeterProvider = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterProvider = undefined; + var api_1 = require_src(); + var resources_1 = require_src9(); + var MeterProviderSharedState_1 = require_MeterProviderSharedState(); + var MetricCollector_1 = require_MetricCollector(); + var View_1 = require_View(); + + class MeterProvider { + _sharedState; + _shutdown = false; + constructor(options) { + this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState(options?.resource ?? (0, resources_1.defaultResource)()); + if (options?.views != null && options.views.length > 0) { + for (const viewOption of options.views) { + this._sharedState.viewRegistry.addView(new View_1.View(viewOption)); + } + } + if (options?.readers != null && options.readers.length > 0) { + for (const metricReader of options.readers) { + const collector = new MetricCollector_1.MetricCollector(this._sharedState, metricReader); + metricReader.setMetricProducer(collector); + this._sharedState.metricCollectors.push(collector); + } + } + } + getMeter(name, version2 = "", options = {}) { + if (this._shutdown) { + api_1.diag.warn("A shutdown MeterProvider cannot provide a Meter"); + return (0, api_1.createNoopMeter)(); + } + return this._sharedState.getMeterSharedState({ + name, + version: version2, + schemaUrl: options.schemaUrl + }).meter; + } + async shutdown(options) { + if (this._shutdown) { + api_1.diag.warn("shutdown may only be called once per MeterProvider"); + return; + } + this._shutdown = true; + await Promise.all(this._sharedState.metricCollectors.map((collector) => { + return collector.shutdown(options); + })); + } + async forceFlush(options) { + if (this._shutdown) { + api_1.diag.warn("invalid attempt to force flush after MeterProvider shutdown"); + return; + } + await Promise.all(this._sharedState.metricCollectors.map((collector) => { + return collector.forceFlush(options); + })); + } + } + exports.MeterProvider = MeterProvider; +}); + +// node_modules/@opentelemetry/sdk-metrics/build/src/index.js +var require_src10 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TimeoutError = exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.AggregationType = exports.MeterProvider = exports.ConsoleMetricExporter = exports.InMemoryMetricExporter = exports.PeriodicExportingMetricReader = exports.MetricReader = exports.InstrumentType = exports.DataPointType = exports.AggregationTemporality = undefined; + var AggregationTemporality_1 = require_AggregationTemporality(); + Object.defineProperty(exports, "AggregationTemporality", { enumerable: true, get: function() { + return AggregationTemporality_1.AggregationTemporality; + } }); + var MetricData_1 = require_MetricData(); + Object.defineProperty(exports, "DataPointType", { enumerable: true, get: function() { + return MetricData_1.DataPointType; + } }); + Object.defineProperty(exports, "InstrumentType", { enumerable: true, get: function() { + return MetricData_1.InstrumentType; + } }); + var MetricReader_1 = require_MetricReader(); + Object.defineProperty(exports, "MetricReader", { enumerable: true, get: function() { + return MetricReader_1.MetricReader; + } }); + var PeriodicExportingMetricReader_1 = require_PeriodicExportingMetricReader(); + Object.defineProperty(exports, "PeriodicExportingMetricReader", { enumerable: true, get: function() { + return PeriodicExportingMetricReader_1.PeriodicExportingMetricReader; + } }); + var InMemoryMetricExporter_1 = require_InMemoryMetricExporter(); + Object.defineProperty(exports, "InMemoryMetricExporter", { enumerable: true, get: function() { + return InMemoryMetricExporter_1.InMemoryMetricExporter; + } }); + var ConsoleMetricExporter_1 = require_ConsoleMetricExporter(); + Object.defineProperty(exports, "ConsoleMetricExporter", { enumerable: true, get: function() { + return ConsoleMetricExporter_1.ConsoleMetricExporter; + } }); + var MeterProvider_1 = require_MeterProvider(); + Object.defineProperty(exports, "MeterProvider", { enumerable: true, get: function() { + return MeterProvider_1.MeterProvider; + } }); + var AggregationOption_1 = require_AggregationOption(); + Object.defineProperty(exports, "AggregationType", { enumerable: true, get: function() { + return AggregationOption_1.AggregationType; + } }); + var AttributesProcessor_1 = require_AttributesProcessor(); + Object.defineProperty(exports, "createAllowListAttributesProcessor", { enumerable: true, get: function() { + return AttributesProcessor_1.createAllowListAttributesProcessor; + } }); + Object.defineProperty(exports, "createDenyListAttributesProcessor", { enumerable: true, get: function() { + return AttributesProcessor_1.createDenyListAttributesProcessor; + } }); + var utils_1 = require_utils8(); + Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { + return utils_1.TimeoutError; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal-types.js +var require_internal_types = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EAggregationTemporality = undefined; + var EAggregationTemporality; + (function(EAggregationTemporality2) { + EAggregationTemporality2[EAggregationTemporality2["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"; + EAggregationTemporality2[EAggregationTemporality2["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA"; + EAggregationTemporality2[EAggregationTemporality2["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"; + })(EAggregationTemporality = exports.EAggregationTemporality || (exports.EAggregationTemporality = {})); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal.js +var require_internal3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createExportMetricsServiceRequest = exports.toMetric = exports.toScopeMetrics = exports.toResourceMetrics = undefined; + var api_1 = require_src(); + var sdk_metrics_1 = require_src10(); + var internal_types_1 = require_internal_types(); + var utils_1 = require_utils7(); + var internal_1 = require_internal(); + function toResourceMetrics(resourceMetrics, options) { + const encoder = (0, utils_1.getOtlpEncoder)(options); + const processedResource = (0, internal_1.createResource)(resourceMetrics.resource); + return { + resource: processedResource, + schemaUrl: processedResource.schemaUrl, + scopeMetrics: toScopeMetrics(resourceMetrics.scopeMetrics, encoder) + }; + } + exports.toResourceMetrics = toResourceMetrics; + function toScopeMetrics(scopeMetrics, encoder) { + return Array.from(scopeMetrics.map((metrics) => ({ + scope: (0, internal_1.createInstrumentationScope)(metrics.scope), + metrics: metrics.metrics.map((metricData) => toMetric(metricData, encoder)), + schemaUrl: metrics.scope.schemaUrl + }))); + } + exports.toScopeMetrics = toScopeMetrics; + function toMetric(metricData, encoder) { + const out = { + name: metricData.descriptor.name, + description: metricData.descriptor.description, + unit: metricData.descriptor.unit + }; + const aggregationTemporality = toAggregationTemporality(metricData.aggregationTemporality); + switch (metricData.dataPointType) { + case sdk_metrics_1.DataPointType.SUM: + out.sum = { + aggregationTemporality, + isMonotonic: metricData.isMonotonic, + dataPoints: toSingularDataPoints(metricData, encoder) + }; + break; + case sdk_metrics_1.DataPointType.GAUGE: + out.gauge = { + dataPoints: toSingularDataPoints(metricData, encoder) + }; + break; + case sdk_metrics_1.DataPointType.HISTOGRAM: + out.histogram = { + aggregationTemporality, + dataPoints: toHistogramDataPoints(metricData, encoder) + }; + break; + case sdk_metrics_1.DataPointType.EXPONENTIAL_HISTOGRAM: + out.exponentialHistogram = { + aggregationTemporality, + dataPoints: toExponentialHistogramDataPoints(metricData, encoder) + }; + break; + } + return out; + } + exports.toMetric = toMetric; + function toSingularDataPoint(dataPoint, valueType, encoder) { + const out = { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + switch (valueType) { + case api_1.ValueType.INT: + out.asInt = dataPoint.value; + break; + case api_1.ValueType.DOUBLE: + out.asDouble = dataPoint.value; + break; + } + return out; + } + function toSingularDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + return toSingularDataPoint(dataPoint, metricData.descriptor.valueType, encoder); + }); + } + function toHistogramDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + const histogram = dataPoint.value; + return { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + bucketCounts: histogram.buckets.counts, + explicitBounds: histogram.buckets.boundaries, + count: histogram.count, + sum: histogram.sum, + min: histogram.min, + max: histogram.max, + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + }); + } + function toExponentialHistogramDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + const histogram = dataPoint.value; + return { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + count: histogram.count, + min: histogram.min, + max: histogram.max, + sum: histogram.sum, + positive: { + offset: histogram.positive.offset, + bucketCounts: histogram.positive.bucketCounts + }, + negative: { + offset: histogram.negative.offset, + bucketCounts: histogram.negative.bucketCounts + }, + scale: histogram.scale, + zeroCount: histogram.zeroCount, + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + }); + } + function toAggregationTemporality(temporality) { + switch (temporality) { + case sdk_metrics_1.AggregationTemporality.DELTA: + return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA; + case sdk_metrics_1.AggregationTemporality.CUMULATIVE: + return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE; + } + } + function createExportMetricsServiceRequest(resourceMetrics, options) { + return { + resourceMetrics: resourceMetrics.map((metrics) => toResourceMetrics(metrics, options)) + }; + } + exports.createExportMetricsServiceRequest = createExportMetricsServiceRequest; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics.js +var require_metrics2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufMetricsSerializer = undefined; + var root = require_root(); + var internal_1 = require_internal3(); + var metricsResponseType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; + var metricsRequestType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; + exports.ProtobufMetricsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportMetricsServiceRequest)([arg]); + return metricsRequestType.encode(request).finish(); + }, + deserializeResponse: (arg) => { + return metricsResponseType.decode(arg); + } + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/index.js +var require_protobuf2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufMetricsSerializer = undefined; + var metrics_1 = require_metrics2(); + Object.defineProperty(exports, "ProtobufMetricsSerializer", { enumerable: true, get: function() { + return metrics_1.ProtobufMetricsSerializer; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +var require_internal4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createExportTraceServiceRequest = exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = undefined; + var internal_1 = require_internal(); + var utils_1 = require_utils7(); + function sdkSpanToOtlpSpan(span, encoder) { + const ctx = span.spanContext(); + const status = span.status; + const parentSpanId = span.parentSpanContext?.spanId ? encoder.encodeSpanContext(span.parentSpanContext?.spanId) : undefined; + return { + traceId: encoder.encodeSpanContext(ctx.traceId), + spanId: encoder.encodeSpanContext(ctx.spanId), + parentSpanId, + traceState: ctx.traceState?.serialize(), + name: span.name, + kind: span.kind == null ? 0 : span.kind + 1, + startTimeUnixNano: encoder.encodeHrTime(span.startTime), + endTimeUnixNano: encoder.encodeHrTime(span.endTime), + attributes: (0, internal_1.toAttributes)(span.attributes), + droppedAttributesCount: span.droppedAttributesCount, + events: span.events.map((event) => toOtlpSpanEvent(event, encoder)), + droppedEventsCount: span.droppedEventsCount, + status: { + code: status.code, + message: status.message + }, + links: span.links.map((link) => toOtlpLink(link, encoder)), + droppedLinksCount: span.droppedLinksCount + }; + } + exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan; + function toOtlpLink(link, encoder) { + return { + attributes: link.attributes ? (0, internal_1.toAttributes)(link.attributes) : [], + spanId: encoder.encodeSpanContext(link.context.spanId), + traceId: encoder.encodeSpanContext(link.context.traceId), + traceState: link.context.traceState?.serialize(), + droppedAttributesCount: link.droppedAttributesCount || 0 + }; + } + exports.toOtlpLink = toOtlpLink; + function toOtlpSpanEvent(timedEvent, encoder) { + return { + attributes: timedEvent.attributes ? (0, internal_1.toAttributes)(timedEvent.attributes) : [], + name: timedEvent.name, + timeUnixNano: encoder.encodeHrTime(timedEvent.time), + droppedAttributesCount: timedEvent.droppedAttributesCount || 0 + }; + } + exports.toOtlpSpanEvent = toOtlpSpanEvent; + function createExportTraceServiceRequest(spans, options) { + const encoder = (0, utils_1.getOtlpEncoder)(options); + return { + resourceSpans: spanRecordsToResourceSpans(spans, encoder) + }; + } + exports.createExportTraceServiceRequest = createExportTraceServiceRequest; + function createResourceMap(readableSpans) { + const resourceMap = new Map; + for (const record2 of readableSpans) { + let ilsMap = resourceMap.get(record2.resource); + if (!ilsMap) { + ilsMap = new Map; + resourceMap.set(record2.resource, ilsMap); + } + const instrumentationScopeKey = `${record2.instrumentationScope.name}@${record2.instrumentationScope.version || ""}:${record2.instrumentationScope.schemaUrl || ""}`; + let records = ilsMap.get(instrumentationScopeKey); + if (!records) { + records = []; + ilsMap.set(instrumentationScopeKey, records); + } + records.push(record2); + } + return resourceMap; + } + function spanRecordsToResourceSpans(readableSpans, encoder) { + const resourceMap = createResourceMap(readableSpans); + const out = []; + const entryIterator = resourceMap.entries(); + let entry = entryIterator.next(); + while (!entry.done) { + const [resource, ilmMap] = entry.value; + const scopeResourceSpans = []; + const ilmIterator = ilmMap.values(); + let ilmEntry = ilmIterator.next(); + while (!ilmEntry.done) { + const scopeSpans = ilmEntry.value; + if (scopeSpans.length > 0) { + const spans = scopeSpans.map((readableSpan) => sdkSpanToOtlpSpan(readableSpan, encoder)); + scopeResourceSpans.push({ + scope: (0, internal_1.createInstrumentationScope)(scopeSpans[0].instrumentationScope), + spans, + schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl + }); + } + ilmEntry = ilmIterator.next(); + } + const processedResource = (0, internal_1.createResource)(resource); + const transformedSpans = { + resource: processedResource, + scopeSpans: scopeResourceSpans, + schemaUrl: processedResource.schemaUrl + }; + out.push(transformedSpans); + entry = entryIterator.next(); + } + return out; + } +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace.js +var require_trace3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufTraceSerializer = undefined; + var root = require_root(); + var internal_1 = require_internal4(); + var traceResponseType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; + var traceRequestType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; + exports.ProtobufTraceSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportTraceServiceRequest)(arg); + return traceRequestType.encode(request).finish(); + }, + deserializeResponse: (arg) => { + return traceResponseType.decode(arg); + } + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/index.js +var require_protobuf3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufTraceSerializer = undefined; + var trace_1 = require_trace3(); + Object.defineProperty(exports, "ProtobufTraceSerializer", { enumerable: true, get: function() { + return trace_1.ProtobufTraceSerializer; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js +var require_logs2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonLogsSerializer = undefined; + var internal_1 = require_internal2(); + exports.JsonLogsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportLogsServiceRequest)(arg, { + useHex: true, + useLongBits: false + }); + const encoder = new TextEncoder; + return encoder.encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) { + return {}; + } + const decoder = new TextDecoder; + return JSON.parse(decoder.decode(arg)); + } + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/index.js +var require_json = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonLogsSerializer = undefined; + var logs_1 = require_logs2(); + Object.defineProperty(exports, "JsonLogsSerializer", { enumerable: true, get: function() { + return logs_1.JsonLogsSerializer; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/metrics.js +var require_metrics3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonMetricsSerializer = undefined; + var internal_1 = require_internal3(); + exports.JsonMetricsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportMetricsServiceRequest)([arg], { + useLongBits: false + }); + const encoder = new TextEncoder; + return encoder.encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) { + return {}; + } + const decoder = new TextDecoder; + return JSON.parse(decoder.decode(arg)); + } + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/index.js +var require_json2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonMetricsSerializer = undefined; + var metrics_1 = require_metrics3(); + Object.defineProperty(exports, "JsonMetricsSerializer", { enumerable: true, get: function() { + return metrics_1.JsonMetricsSerializer; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/trace.js +var require_trace4 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonTraceSerializer = undefined; + var internal_1 = require_internal4(); + exports.JsonTraceSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportTraceServiceRequest)(arg, { + useHex: true, + useLongBits: false + }); + const encoder = new TextEncoder; + return encoder.encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) { + return {}; + } + const decoder = new TextDecoder; + return JSON.parse(decoder.decode(arg)); + } + }; +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/index.js +var require_json3 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonTraceSerializer = undefined; + var trace_1 = require_trace4(); + Object.defineProperty(exports, "JsonTraceSerializer", { enumerable: true, get: function() { + return trace_1.JsonTraceSerializer; + } }); +}); + +// node_modules/@opentelemetry/otlp-transformer/build/src/index.js +var require_src11 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonTraceSerializer = exports.JsonMetricsSerializer = exports.JsonLogsSerializer = exports.ProtobufTraceSerializer = exports.ProtobufMetricsSerializer = exports.ProtobufLogsSerializer = undefined; + var protobuf_1 = require_protobuf(); + Object.defineProperty(exports, "ProtobufLogsSerializer", { enumerable: true, get: function() { + return protobuf_1.ProtobufLogsSerializer; + } }); + var protobuf_2 = require_protobuf2(); + Object.defineProperty(exports, "ProtobufMetricsSerializer", { enumerable: true, get: function() { + return protobuf_2.ProtobufMetricsSerializer; + } }); + var protobuf_3 = require_protobuf3(); + Object.defineProperty(exports, "ProtobufTraceSerializer", { enumerable: true, get: function() { + return protobuf_3.ProtobufTraceSerializer; + } }); + var json_1 = require_json(); + Object.defineProperty(exports, "JsonLogsSerializer", { enumerable: true, get: function() { + return json_1.JsonLogsSerializer; + } }); + var json_2 = require_json2(); + Object.defineProperty(exports, "JsonMetricsSerializer", { enumerable: true, get: function() { + return json_2.JsonMetricsSerializer; + } }); + var json_3 = require_json3(); + Object.defineProperty(exports, "JsonTraceSerializer", { enumerable: true, get: function() { + return json_3.JsonTraceSerializer; + } }); +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/util.js +var require_util2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.validateAndNormalizeHeaders = undefined; + var api_1 = require_src(); + function validateAndNormalizeHeaders(partialHeaders) { + return () => { + const headers = {}; + Object.entries(partialHeaders?.() ?? {}).forEach(([key, value]) => { + if (typeof value !== "undefined") { + headers[key] = String(value); + } else { + api_1.diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`); + } + }); + return headers; + }; + } + exports.validateAndNormalizeHeaders = validateAndNormalizeHeaders; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/otlp-http-configuration.js +var require_otlp_http_configuration = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getHttpConfigurationDefaults = exports.mergeOtlpHttpConfigurationWithDefaults = undefined; + var shared_configuration_1 = require_shared_configuration(); + var util_1 = require_util2(); + function mergeHeaders2(userProvidedHeaders, fallbackHeaders, defaultHeaders) { + const requiredHeaders = { + ...defaultHeaders() + }; + const headers = {}; + return () => { + if (fallbackHeaders != null) { + Object.assign(headers, fallbackHeaders()); + } + if (userProvidedHeaders != null) { + Object.assign(headers, userProvidedHeaders()); + } + return Object.assign(headers, requiredHeaders); + }; + } + function validateUserProvidedUrl(url2) { + if (url2 == null) { + return; + } + try { + const base = globalThis.location?.href; + return new URL(url2, base).href; + } catch { + throw new Error(`Configuration: Could not parse user-provided export URL: '${url2}'`); + } + } + function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + ...(0, shared_configuration_1.mergeOtlpSharedConfigurationWithDefaults)(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), + headers: mergeHeaders2((0, util_1.validateAndNormalizeHeaders)(userProvidedConfiguration.headers), fallbackConfiguration.headers, defaultConfiguration.headers), + url: validateUserProvidedUrl(userProvidedConfiguration.url) ?? fallbackConfiguration.url ?? defaultConfiguration.url + }; + } + exports.mergeOtlpHttpConfigurationWithDefaults = mergeOtlpHttpConfigurationWithDefaults; + function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { + return { + ...(0, shared_configuration_1.getSharedConfigurationDefaults)(), + headers: () => requiredHeaders, + url: "http://localhost:4318/" + signalResourcePath + }; + } + exports.getHttpConfigurationDefaults = getHttpConfigurationDefaults; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/otlp-node-http-configuration.js +var require_otlp_node_http_configuration = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getNodeHttpConfigurationDefaults = exports.mergeOtlpNodeHttpConfigurationWithDefaults = exports.httpAgentFactoryFromOptions = undefined; + var otlp_http_configuration_1 = require_otlp_http_configuration(); + function httpAgentFactoryFromOptions(options) { + return async (protocol) => { + const module2 = protocol === "http:" ? import("http") : import("https"); + const { Agent } = await module2; + return new Agent(options); + }; + } + exports.httpAgentFactoryFromOptions = httpAgentFactoryFromOptions; + function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + ...(0, otlp_http_configuration_1.mergeOtlpHttpConfigurationWithDefaults)(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), + agentFactory: userProvidedConfiguration.agentFactory ?? fallbackConfiguration.agentFactory ?? defaultConfiguration.agentFactory + }; + } + exports.mergeOtlpNodeHttpConfigurationWithDefaults = mergeOtlpNodeHttpConfigurationWithDefaults; + function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { + return { + ...(0, otlp_http_configuration_1.getHttpConfigurationDefaults)(requiredHeaders, signalResourcePath), + agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }) + }; + } + exports.getNodeHttpConfigurationDefaults = getNodeHttpConfigurationDefaults; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/is-export-retryable.js +var require_is_export_retryable = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.parseRetryAfterToMills = exports.isExportRetryable = undefined; + function isExportRetryable(statusCode) { + const retryCodes = [429, 502, 503, 504]; + return retryCodes.includes(statusCode); + } + exports.isExportRetryable = isExportRetryable; + function parseRetryAfterToMills(retryAfter) { + if (retryAfter == null) { + return; + } + const seconds = Number.parseInt(retryAfter, 10); + if (Number.isInteger(seconds)) { + return seconds > 0 ? seconds * 1000 : -1; + } + const delay = new Date(retryAfter).getTime() - Date.now(); + if (delay >= 0) { + return delay; + } + return 0; + } + exports.parseRetryAfterToMills = parseRetryAfterToMills; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/transport/http-transport-utils.js +var require_http_transport_utils = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.compressAndSend = exports.sendWithHttp = undefined; + var zlib = __require("zlib"); + var stream_1 = __require("stream"); + var is_export_retryable_1 = require_is_export_retryable(); + var types_1 = require_types2(); + function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) { + const parsedUrl = new URL(params.url); + const options = { + hostname: parsedUrl.hostname, + port: parsedUrl.port, + path: parsedUrl.pathname, + method: "POST", + headers: { + ...params.headers() + }, + agent + }; + const req = request(options, (res) => { + const responseData = []; + res.on("data", (chunk) => responseData.push(chunk)); + res.on("end", () => { + if (res.statusCode && res.statusCode < 299) { + onDone({ + status: "success", + data: Buffer.concat(responseData) + }); + } else if (res.statusCode && (0, is_export_retryable_1.isExportRetryable)(res.statusCode)) { + onDone({ + status: "retryable", + retryInMillis: (0, is_export_retryable_1.parseRetryAfterToMills)(res.headers["retry-after"]) + }); + } else { + const error51 = new types_1.OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString()); + onDone({ + status: "failure", + error: error51 + }); + } + }); + }); + req.setTimeout(timeoutMillis, () => { + req.destroy(); + onDone({ + status: "failure", + error: new Error("Request Timeout") + }); + }); + req.on("error", (error51) => { + onDone({ + status: "failure", + error: error51 + }); + }); + compressAndSend(req, params.compression, data, (error51) => { + onDone({ + status: "failure", + error: error51 + }); + }); + } + exports.sendWithHttp = sendWithHttp; + function compressAndSend(req, compression, data, onError) { + let dataStream = readableFromUint8Array(data); + if (compression === "gzip") { + req.setHeader("Content-Encoding", "gzip"); + dataStream = dataStream.on("error", onError).pipe(zlib.createGzip()).on("error", onError); + } + dataStream.pipe(req).on("error", onError); + } + exports.compressAndSend = compressAndSend; + function readableFromUint8Array(buff) { + const readable = new stream_1.Readable; + readable.push(buff); + readable.push(null); + return readable; + } +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/transport/http-exporter-transport.js +var require_http_exporter_transport = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createHttpExporterTransport = undefined; + var http_transport_utils_1 = require_http_transport_utils(); + + class HttpExporterTransport { + _parameters; + _utils = null; + constructor(_parameters) { + this._parameters = _parameters; + } + async send(data, timeoutMillis) { + const { agent, request } = await this._loadUtils(); + return new Promise((resolve) => { + (0, http_transport_utils_1.sendWithHttp)(request, this._parameters, agent, data, (result) => { + resolve(result); + }, timeoutMillis); + }); + } + shutdown() {} + async _loadUtils() { + let utils = this._utils; + if (utils === null) { + const protocol = new URL(this._parameters.url).protocol; + const [agent, request] = await Promise.all([ + this._parameters.agentFactory(protocol), + requestFunctionFactory(protocol) + ]); + utils = this._utils = { agent, request }; + } + return utils; + } + } + async function requestFunctionFactory(protocol) { + const module2 = protocol === "http:" ? import("http") : import("https"); + const { request } = await module2; + return request; + } + function createHttpExporterTransport(parameters) { + return new HttpExporterTransport(parameters); + } + exports.createHttpExporterTransport = createHttpExporterTransport; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/retrying-transport.js +var require_retrying_transport = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createRetryingTransport = undefined; + var MAX_ATTEMPTS = 5; + var INITIAL_BACKOFF = 1000; + var MAX_BACKOFF = 5000; + var BACKOFF_MULTIPLIER = 1.5; + var JITTER = 0.2; + function getJitter() { + return Math.random() * (2 * JITTER) - JITTER; + } + + class RetryingTransport { + _transport; + constructor(_transport) { + this._transport = _transport; + } + retry(data, timeoutMillis, inMillis) { + return new Promise((resolve, reject) => { + setTimeout(() => { + this._transport.send(data, timeoutMillis).then(resolve, reject); + }, inMillis); + }); + } + async send(data, timeoutMillis) { + const deadline = Date.now() + timeoutMillis; + let result = await this._transport.send(data, timeoutMillis); + let attempts = MAX_ATTEMPTS; + let nextBackoff = INITIAL_BACKOFF; + while (result.status === "retryable" && attempts > 0) { + attempts--; + const backoff = Math.max(Math.min(nextBackoff, MAX_BACKOFF) + getJitter(), 0); + nextBackoff = nextBackoff * BACKOFF_MULTIPLIER; + const retryInMillis = result.retryInMillis ?? backoff; + const remainingTimeoutMillis = deadline - Date.now(); + if (retryInMillis > remainingTimeoutMillis) { + return result; + } + result = await this.retry(data, remainingTimeoutMillis, retryInMillis); + } + return result; + } + shutdown() { + return this._transport.shutdown(); + } + } + function createRetryingTransport(options) { + return new RetryingTransport(options.transport); + } + exports.createRetryingTransport = createRetryingTransport; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/otlp-http-export-delegate.js +var require_otlp_http_export_delegate = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createOtlpHttpExportDelegate = undefined; + var otlp_export_delegate_1 = require_otlp_export_delegate(); + var http_exporter_transport_1 = require_http_exporter_transport(); + var bounded_queue_export_promise_handler_1 = require_bounded_queue_export_promise_handler(); + var retrying_transport_1 = require_retrying_transport(); + function createOtlpHttpExportDelegate(options, serializer) { + return (0, otlp_export_delegate_1.createOtlpExportDelegate)({ + transport: (0, retrying_transport_1.createRetryingTransport)({ + transport: (0, http_exporter_transport_1.createHttpExporterTransport)(options) + }), + serializer, + promiseHandler: (0, bounded_queue_export_promise_handler_1.createBoundedQueueExportPromiseHandler)(options) + }, { timeout: options.timeoutMillis }); + } + exports.createOtlpHttpExportDelegate = createOtlpHttpExportDelegate; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/shared-env-configuration.js +var require_shared_env_configuration = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSharedConfigurationFromEnvironment = undefined; + var api_1 = require_src(); + function parseAndValidateTimeoutFromEnv(timeoutEnvVar) { + const envTimeout = process.env[timeoutEnvVar]?.trim(); + if (envTimeout != null && envTimeout !== "") { + const definedTimeout = Number(envTimeout); + if (Number.isFinite(definedTimeout) && definedTimeout > 0) { + return definedTimeout; + } + api_1.diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`); + } + return; + } + function getTimeoutFromEnv(signalIdentifier) { + const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`); + const nonSpecificTimeout = parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT"); + return specificTimeout ?? nonSpecificTimeout; + } + function parseAndValidateCompressionFromEnv(compressionEnvVar) { + const compression = process.env[compressionEnvVar]?.trim(); + if (compression === "") { + return; + } + if (compression == null || compression === "none" || compression === "gzip") { + return compression; + } + api_1.diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`); + return; + } + function getCompressionFromEnv(signalIdentifier) { + const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`); + const nonSpecificCompression = parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION"); + return specificCompression ?? nonSpecificCompression; + } + function getSharedConfigurationFromEnvironment(signalIdentifier) { + return { + timeoutMillis: getTimeoutFromEnv(signalIdentifier), + compression: getCompressionFromEnv(signalIdentifier) + }; + } + exports.getSharedConfigurationFromEnvironment = getSharedConfigurationFromEnvironment; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/otlp-node-http-env-configuration.js +var require_otlp_node_http_env_configuration = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getNodeHttpConfigurationFromEnvironment = undefined; + var core_1 = require_src4(); + var api_1 = require_src(); + var shared_env_configuration_1 = require_shared_env_configuration(); + var shared_configuration_1 = require_shared_configuration(); + function getStaticHeadersFromEnv(signalIdentifier) { + const signalSpecificRawHeaders = (0, core_1.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`); + const nonSignalSpecificRawHeaders = (0, core_1.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"); + const signalSpecificHeaders = (0, core_1.parseKeyPairsIntoRecord)(signalSpecificRawHeaders); + const nonSignalSpecificHeaders = (0, core_1.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders); + if (Object.keys(signalSpecificHeaders).length === 0 && Object.keys(nonSignalSpecificHeaders).length === 0) { + return; + } + return Object.assign({}, (0, core_1.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders), (0, core_1.parseKeyPairsIntoRecord)(signalSpecificRawHeaders)); + } + function appendRootPathToUrlIfNeeded(url2) { + try { + const parsedUrl = new URL(url2); + return parsedUrl.toString(); + } catch { + api_1.diag.warn(`Configuration: Could not parse environment-provided export URL: '${url2}', falling back to undefined`); + return; + } + } + function appendResourcePathToUrl(url2, path2) { + try { + new URL(url2); + } catch { + api_1.diag.warn(`Configuration: Could not parse environment-provided export URL: '${url2}', falling back to undefined`); + return; + } + if (!url2.endsWith("/")) { + url2 = url2 + "/"; + } + url2 += path2; + try { + new URL(url2); + } catch { + api_1.diag.warn(`Configuration: Provided URL appended with '${path2}' is not a valid URL, using 'undefined' instead of '${url2}'`); + return; + } + return url2; + } + function getNonSpecificUrlFromEnv(signalResourcePath) { + const envUrl = (0, core_1.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT"); + if (envUrl === undefined) { + return; + } + return appendResourcePathToUrl(envUrl, signalResourcePath); + } + function getSpecificUrlFromEnv(signalIdentifier) { + const envUrl = (0, core_1.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`); + if (envUrl === undefined) { + return; + } + return appendRootPathToUrlIfNeeded(envUrl); + } + function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) { + return { + ...(0, shared_env_configuration_1.getSharedConfigurationFromEnvironment)(signalIdentifier), + url: getSpecificUrlFromEnv(signalIdentifier) ?? getNonSpecificUrlFromEnv(signalResourcePath), + headers: (0, shared_configuration_1.wrapStaticHeadersInFunction)(getStaticHeadersFromEnv(signalIdentifier)) + }; + } + exports.getNodeHttpConfigurationFromEnvironment = getNodeHttpConfigurationFromEnvironment; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/configuration/convert-legacy-node-http-options.js +var require_convert_legacy_node_http_options = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.convertLegacyHttpOptions = undefined; + var api_1 = require_src(); + var shared_configuration_1 = require_shared_configuration(); + var otlp_node_http_configuration_1 = require_otlp_node_http_configuration(); + var index_node_http_1 = require_index_node_http(); + var otlp_node_http_env_configuration_1 = require_otlp_node_http_env_configuration(); + function convertLegacyAgentOptions(config2) { + if (typeof config2.httpAgentOptions === "function") { + return config2.httpAgentOptions; + } + let legacy = config2.httpAgentOptions; + if (config2.keepAlive != null) { + legacy = { keepAlive: config2.keepAlive, ...legacy }; + } + if (legacy != null) { + return (0, index_node_http_1.httpAgentFactoryFromOptions)(legacy); + } else { + return; + } + } + function convertLegacyHttpOptions(config2, signalIdentifier, signalResourcePath, requiredHeaders) { + if (config2.metadata) { + api_1.diag.warn("Metadata cannot be set when using http"); + } + return (0, otlp_node_http_configuration_1.mergeOtlpNodeHttpConfigurationWithDefaults)({ + url: config2.url, + headers: (0, shared_configuration_1.wrapStaticHeadersInFunction)(config2.headers), + concurrencyLimit: config2.concurrencyLimit, + timeoutMillis: config2.timeoutMillis, + compression: config2.compression, + agentFactory: convertLegacyAgentOptions(config2) + }, (0, otlp_node_http_env_configuration_1.getNodeHttpConfigurationFromEnvironment)(signalIdentifier, signalResourcePath), (0, otlp_node_http_configuration_1.getNodeHttpConfigurationDefaults)(requiredHeaders, signalResourcePath)); + } + exports.convertLegacyHttpOptions = convertLegacyHttpOptions; +}); + +// node_modules/@opentelemetry/otlp-exporter-base/build/src/index-node-http.js +var require_index_node_http = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.convertLegacyHttpOptions = exports.getSharedConfigurationFromEnvironment = exports.createOtlpHttpExportDelegate = exports.httpAgentFactoryFromOptions = undefined; + var otlp_node_http_configuration_1 = require_otlp_node_http_configuration(); + Object.defineProperty(exports, "httpAgentFactoryFromOptions", { enumerable: true, get: function() { + return otlp_node_http_configuration_1.httpAgentFactoryFromOptions; + } }); + var otlp_http_export_delegate_1 = require_otlp_http_export_delegate(); + Object.defineProperty(exports, "createOtlpHttpExportDelegate", { enumerable: true, get: function() { + return otlp_http_export_delegate_1.createOtlpHttpExportDelegate; + } }); + var shared_env_configuration_1 = require_shared_env_configuration(); + Object.defineProperty(exports, "getSharedConfigurationFromEnvironment", { enumerable: true, get: function() { + return shared_env_configuration_1.getSharedConfigurationFromEnvironment; + } }); + var convert_legacy_node_http_options_1 = require_convert_legacy_node_http_options(); + Object.defineProperty(exports, "convertLegacyHttpOptions", { enumerable: true, get: function() { + return convert_legacy_node_http_options_1.convertLegacyHttpOptions; + } }); +}); + +// node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js +var require_OTLPTraceExporter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = undefined; + var otlp_exporter_base_1 = require_src5(); + var version_1 = require_version4(); + var otlp_transformer_1 = require_src11(); + var node_http_1 = require_index_node_http(); + + class OTLPTraceExporter extends otlp_exporter_base_1.OTLPExporterBase { + constructor(config2 = {}) { + super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config2, "TRACES", "v1/traces", { + "User-Agent": `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`, + "Content-Type": "application/json" + }), otlp_transformer_1.JsonTraceSerializer)); + } + } + exports.OTLPTraceExporter = OTLPTraceExporter; +}); + +// node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js +var require_node8 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = undefined; + var OTLPTraceExporter_1 = require_OTLPTraceExporter(); + Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function() { + return OTLPTraceExporter_1.OTLPTraceExporter; + } }); +}); + +// node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js +var require_platform8 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = undefined; + var node_1 = require_node8(); + Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function() { + return node_1.OTLPTraceExporter; + } }); +}); + +// node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js +var require_src12 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = undefined; + var platform_1 = require_platform8(); + Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function() { + return platform_1.OTLPTraceExporter; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/default-service-name.js +var require_default_service_name2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._clearDefaultServiceNameCache = exports.defaultServiceName = undefined; + var serviceName; + function defaultServiceName() { + if (serviceName === undefined) { + try { + const argv0 = globalThis.process.argv0; + serviceName = argv0 ? `unknown_service:${argv0}` : "unknown_service"; + } catch { + serviceName = "unknown_service"; + } + } + return serviceName; + } + exports.defaultServiceName = defaultServiceName; + function _clearDefaultServiceNameCache() { + serviceName = undefined; + } + exports._clearDefaultServiceNameCache = _clearDefaultServiceNameCache; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/utils.js +var require_utils13 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPromiseLike = undefined; + var isPromiseLike = (val) => { + return val !== null && typeof val === "object" && typeof val.then === "function"; + }; + exports.isPromiseLike = isPromiseLike; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +var require_ResourceImpl2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = undefined; + var api_1 = require_src(); + var core_1 = require_src3(); + var semantic_conventions_1 = require_src2(); + var default_service_name_1 = require_default_service_name2(); + var utils_1 = require_utils13(); + + class ResourceImpl { + _rawAttributes; + _asyncAttributesPending = false; + _schemaUrl; + _memoizedAttributes; + static FromAttributeList(attributes, options) { + const res = new ResourceImpl({}, options); + res._rawAttributes = guardedRawAttributes(attributes); + res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; + return res; + } + constructor(resource, options) { + const attributes = resource.attributes ?? {}; + this._rawAttributes = Object.entries(attributes).map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) { + this._asyncAttributesPending = true; + } + return [k, v]; + }); + this._rawAttributes = guardedRawAttributes(this._rawAttributes); + this._schemaUrl = validateSchemaUrl(options?.schemaUrl); + } + get asyncAttributesPending() { + return this._asyncAttributesPending; + } + async waitForAsyncAttributes() { + if (!this.asyncAttributesPending) { + return; + } + for (let i = 0;i < this._rawAttributes.length; i++) { + const [k, v] = this._rawAttributes[i]; + this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; + } + this._asyncAttributesPending = false; + } + get attributes() { + if (this.asyncAttributesPending) { + api_1.diag.error("Accessing resource attributes before async attributes settled"); + } + if (this._memoizedAttributes) { + return this._memoizedAttributes; + } + const attrs = {}; + for (const [k, v] of this._rawAttributes) { + if ((0, utils_1.isPromiseLike)(v)) { + api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); + continue; + } + if (v != null) { + attrs[k] ??= v; + } + } + if (!this._asyncAttributesPending) { + this._memoizedAttributes = attrs; + } + return attrs; + } + getRawAttributes() { + return this._rawAttributes; + } + get schemaUrl() { + return this._schemaUrl; + } + merge(resource) { + if (resource == null) + return this; + const mergedSchemaUrl = mergeSchemaUrl(this, resource); + const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : undefined; + return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); + } + } + function resourceFromAttributes(attributes, options) { + return ResourceImpl.FromAttributeList(Object.entries(attributes), options); + } + exports.resourceFromAttributes = resourceFromAttributes; + function resourceFromDetectedResource(detectedResource, options) { + return new ResourceImpl(detectedResource, options); + } + exports.resourceFromDetectedResource = resourceFromDetectedResource; + function emptyResource() { + return resourceFromAttributes({}); + } + exports.emptyResource = emptyResource; + function defaultResource() { + return resourceFromAttributes({ + [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, default_service_name_1.defaultServiceName)(), + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] + }); + } + exports.defaultResource = defaultResource; + function guardedRawAttributes(attributes) { + return attributes.map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) { + return [ + k, + v.catch((err) => { + api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); + return; + }) + ]; + } + return [k, v]; + }); + } + function validateSchemaUrl(schemaUrl) { + if (typeof schemaUrl === "string" || schemaUrl === undefined) { + return schemaUrl; + } + api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); + return; + } + function mergeSchemaUrl(old, updating) { + const oldSchemaUrl = old?.schemaUrl; + const updatingSchemaUrl = updating?.schemaUrl; + const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === ""; + const isUpdatingEmpty = updatingSchemaUrl === undefined || updatingSchemaUrl === ""; + if (isOldEmpty) { + return updatingSchemaUrl; + } + if (isUpdatingEmpty) { + return oldSchemaUrl; + } + if (oldSchemaUrl === updatingSchemaUrl) { + return oldSchemaUrl; + } + api_1.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.', oldSchemaUrl, updatingSchemaUrl); + return; + } +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detect-resources.js +var require_detect_resources2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.detectResources = undefined; + var api_1 = require_src(); + var ResourceImpl_1 = require_ResourceImpl2(); + var detectResources = (config2 = {}) => { + const resources = (config2.detectors || []).map((d) => { + try { + const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config2)); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return (0, ResourceImpl_1.emptyResource)(); + } + }); + return resources.reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); + }; + exports.detectResources = detectResources; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js +var require_EnvDetector2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.envDetector = undefined; + var api_1 = require_src(); + var semantic_conventions_1 = require_src2(); + var core_1 = require_src3(); + + class EnvDetector { + _MAX_LENGTH = 255; + _COMMA_SEPARATOR = ","; + _LABEL_KEY_VALUE_SPLITTER = "="; + detect(_config) { + const attributes = {}; + const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); + const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); + if (rawAttributes) { + try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); + } + } + if (serviceName) { + attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; + } + return { attributes }; + } + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) + return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR).filter((attr) => attr.trim() !== ""); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); + if (keyValuePair.length !== 2) { + throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". ` + `Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); + } + const [rawKey, rawValue] = keyValuePair; + const key = rawKey.trim(); + const value = rawValue.trim(); + if (key.length === 0) { + throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); + } + let decodedKey; + let decodedValue; + try { + decodedKey = decodeURIComponent(key); + decodedValue = decodeURIComponent(value); + } catch (e) { + throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`); + } + if (decodedKey.length > this._MAX_LENGTH) { + throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); + } + if (decodedValue.length > this._MAX_LENGTH) { + throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); + } + attributes[decodedKey] = decodedValue; + } + return attributes; + } + } + exports.envDetector = new EnvDetector; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/semconv.js +var require_semconv7 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = undefined; + exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; + exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; + exports.ATTR_CLOUD_REGION = "cloud.region"; + exports.ATTR_CONTAINER_ID = "container.id"; + exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; + exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; + exports.ATTR_CONTAINER_NAME = "container.name"; + exports.ATTR_HOST_ARCH = "host.arch"; + exports.ATTR_HOST_ID = "host.id"; + exports.ATTR_HOST_IMAGE_ID = "host.image.id"; + exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; + exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; + exports.ATTR_HOST_NAME = "host.name"; + exports.ATTR_HOST_TYPE = "host.type"; + exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; + exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; + exports.ATTR_OS_TYPE = "os.type"; + exports.ATTR_OS_VERSION = "os.version"; + exports.ATTR_PROCESS_COMMAND = "process.command"; + exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; + exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + exports.ATTR_PROCESS_OWNER = "process.owner"; + exports.ATTR_PROCESS_PID = "process.pid"; + exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; + exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; + exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; + exports.ATTR_WEBENGINE_NAME = "webengine.name"; + exports.ATTR_WEBENGINE_VERSION = "webengine.version"; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js +var require_execAsync2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.execAsync = undefined; + var child_process = __require("child_process"); + var util = __require("util"); + exports.execAsync = util.promisify(child_process.exec); +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js +var require_getMachineId_darwin2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var execAsync_1 = require_execAsync2(); + var api_1 = require_src(); + async function getMachineId() { + try { + const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); + const idLine = result.stdout.split(` +`).find((line) => line.includes("IOPlatformUUID")); + if (!idLine) { + return; + } + const parts = idLine.split('" = "'); + if (parts.length === 2) { + return parts[1].slice(0, -1); + } + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js +var require_getMachineId_linux2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var fs_1 = __require("fs"); + var api_1 = require_src(); + async function getMachineId() { + const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"]; + for (const path2 of paths) { + try { + const result = await fs_1.promises.readFile(path2, { encoding: "utf8" }); + return result.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js +var require_getMachineId_bsd2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var fs_1 = __require("fs"); + var execAsync_1 = require_execAsync2(); + var api_1 = require_src(); + async function getMachineId() { + try { + const result = await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" }); + return result.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + try { + const result = await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid"); + return result.stdout.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js +var require_getMachineId_win2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var process3 = __require("process"); + var execAsync_1 = require_execAsync2(); + var api_1 = require_src(); + async function getMachineId() { + const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; + let command = "%windir%\\System32\\REG.exe"; + if (process3.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process3.env) { + command = "%windir%\\sysnative\\cmd.exe /c " + command; + } + try { + const result = await (0, execAsync_1.execAsync)(`${command} ${args}`); + const parts = result.stdout.split("REG_SZ"); + if (parts.length === 2) { + return parts[1].trim(); + } + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js +var require_getMachineId_unsupported2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var api_1 = require_src(); + async function getMachineId() { + api_1.diag.debug("could not read machine-id: unsupported platform"); + return; + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js +var require_getMachineId2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = undefined; + var process3 = __require("process"); + var getMachineIdImpl; + async function getMachineId() { + if (!getMachineIdImpl) { + switch (process3.platform) { + case "darwin": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_darwin2()))).getMachineId; + break; + case "linux": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_linux2()))).getMachineId; + break; + case "freebsd": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_bsd2()))).getMachineId; + break; + case "win32": + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_win2()))).getMachineId; + break; + default: + getMachineIdImpl = (await Promise.resolve().then(() => __toESM(require_getMachineId_unsupported2()))).getMachineId; + break; + } + } + return getMachineIdImpl(); + } + exports.getMachineId = getMachineId; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js +var require_utils14 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.normalizeType = exports.normalizeArch = undefined; + var normalizeArch = (nodeArchString) => { + switch (nodeArchString) { + case "arm": + return "arm32"; + case "ppc": + return "ppc32"; + case "x64": + return "amd64"; + default: + return nodeArchString; + } + }; + exports.normalizeArch = normalizeArch; + var normalizeType = (nodePlatform) => { + switch (nodePlatform) { + case "sunos": + return "solaris"; + case "win32": + return "windows"; + default: + return nodePlatform; + } + }; + exports.normalizeType = normalizeType; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js +var require_HostDetector2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hostDetector = undefined; + var semconv_1 = require_semconv7(); + var os_1 = __require("os"); + var getMachineId_1 = require_getMachineId2(); + var utils_1 = require_utils14(); + + class HostDetector { + detect(_config) { + const attributes = { + [semconv_1.ATTR_HOST_NAME]: (0, os_1.hostname)(), + [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()), + [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() + }; + return { attributes }; + } + } + exports.hostDetector = new HostDetector; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js +var require_OSDetector2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.osDetector = undefined; + var semconv_1 = require_semconv7(); + var os_1 = __require("os"); + var utils_1 = require_utils14(); + + class OSDetector { + detect(_config) { + const attributes = { + [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), + [semconv_1.ATTR_OS_VERSION]: (0, os_1.release)() + }; + return { attributes }; + } + } + exports.osDetector = new OSDetector; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js +var require_ProcessDetector2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.processDetector = undefined; + var api_1 = require_src(); + var semconv_1 = require_semconv7(); + var os2 = __require("os"); + + class ProcessDetector { + detect(_config) { + const attributes = { + [semconv_1.ATTR_PROCESS_PID]: process.pid, + [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, + [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, + [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ + process.argv[0], + ...process.execArgv, + ...process.argv.slice(1) + ], + [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", + [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" + }; + if (process.argv.length > 1) { + attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; + } + try { + const userInfo = os2.userInfo(); + attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; + } catch (e) { + api_1.diag.debug(`error obtaining process owner: ${e}`); + } + return { attributes }; + } + } + exports.processDetector = new ProcessDetector; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js +var require_ServiceInstanceIdDetector2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = undefined; + var semconv_1 = require_semconv7(); + var crypto_1 = __require("crypto"); + + class ServiceInstanceIdDetector { + detect(_config) { + return { + attributes: { + [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)() + } + }; + } + } + exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js +var require_node9 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = undefined; + var HostDetector_1 = require_HostDetector2(); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return HostDetector_1.hostDetector; + } }); + var OSDetector_1 = require_OSDetector2(); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return OSDetector_1.osDetector; + } }); + var ProcessDetector_1 = require_ProcessDetector2(); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return ProcessDetector_1.processDetector; + } }); + var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector2(); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js +var require_platform9 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = undefined; + var node_1 = require_node9(); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return node_1.hostDetector; + } }); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return node_1.osDetector; + } }); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return node_1.processDetector; + } }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return node_1.serviceInstanceIdDetector; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js +var require_NoopDetector2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.NoopDetector = undefined; + + class NoopDetector { + detect() { + return { + attributes: {} + }; + } + } + exports.NoopDetector = NoopDetector; + exports.noopDetector = new NoopDetector; +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/detectors/index.js +var require_detectors2 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = undefined; + var EnvDetector_1 = require_EnvDetector2(); + Object.defineProperty(exports, "envDetector", { enumerable: true, get: function() { + return EnvDetector_1.envDetector; + } }); + var platform_1 = require_platform9(); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return platform_1.hostDetector; + } }); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return platform_1.osDetector; + } }); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return platform_1.processDetector; + } }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return platform_1.serviceInstanceIdDetector; + } }); + var NoopDetector_1 = require_NoopDetector2(); + Object.defineProperty(exports, "noopDetector", { enumerable: true, get: function() { + return NoopDetector_1.noopDetector; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/resources/build/src/index.js +var require_src13 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = undefined; + var detect_resources_1 = require_detect_resources2(); + Object.defineProperty(exports, "detectResources", { enumerable: true, get: function() { + return detect_resources_1.detectResources; + } }); + var detectors_1 = require_detectors2(); + Object.defineProperty(exports, "envDetector", { enumerable: true, get: function() { + return detectors_1.envDetector; + } }); + Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function() { + return detectors_1.hostDetector; + } }); + Object.defineProperty(exports, "osDetector", { enumerable: true, get: function() { + return detectors_1.osDetector; + } }); + Object.defineProperty(exports, "processDetector", { enumerable: true, get: function() { + return detectors_1.processDetector; + } }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function() { + return detectors_1.serviceInstanceIdDetector; + } }); + var ResourceImpl_1 = require_ResourceImpl2(); + Object.defineProperty(exports, "resourceFromAttributes", { enumerable: true, get: function() { + return ResourceImpl_1.resourceFromAttributes; + } }); + Object.defineProperty(exports, "defaultResource", { enumerable: true, get: function() { + return ResourceImpl_1.defaultResource; + } }); + Object.defineProperty(exports, "emptyResource", { enumerable: true, get: function() { + return ResourceImpl_1.emptyResource; + } }); + var default_service_name_1 = require_default_service_name2(); + Object.defineProperty(exports, "defaultServiceName", { enumerable: true, get: function() { + return default_service_name_1.defaultServiceName; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/enums.js +var require_enums = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExceptionEventName = undefined; + exports.ExceptionEventName = "exception"; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/Span.js +var require_Span = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SpanImpl = undefined; + var api_1 = require_src(); + var core_1 = require_src3(); + var semantic_conventions_1 = require_src2(); + var enums_1 = require_enums(); + + class SpanImpl { + _spanContext; + kind; + parentSpanContext; + attributes = {}; + links = []; + events = []; + startTime; + resource; + instrumentationScope; + _droppedAttributesCount = 0; + _droppedEventsCount = 0; + _droppedLinksCount = 0; + _attributesCount = 0; + name; + status = { + code: api_1.SpanStatusCode.UNSET + }; + endTime = [0, 0]; + _ended = false; + _duration = [-1, -1]; + _spanProcessor; + _spanLimits; + _attributeValueLengthLimit; + _recordEndMetrics; + _performanceStartTime; + _performanceOffset; + _startTimeProvided; + constructor(opts) { + const now = Date.now(); + this._spanContext = opts.spanContext; + this._performanceStartTime = core_1.otperformance.now(); + this._performanceOffset = now - (this._performanceStartTime + core_1.otperformance.timeOrigin); + this._startTimeProvided = opts.startTime != null; + this._spanLimits = opts.spanLimits; + this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0; + this._spanProcessor = opts.spanProcessor; + this.name = opts.name; + this.parentSpanContext = opts.parentSpanContext; + this.kind = opts.kind; + if (opts.links) { + for (const link of opts.links) { + this.addLink(link); + } + } + this.startTime = this._getTime(opts.startTime ?? now); + this.resource = opts.resource; + this.instrumentationScope = opts.scope; + this._recordEndMetrics = opts.recordEndMetrics; + if (opts.attributes != null) { + this.setAttributes(opts.attributes); + } + this._spanProcessor.onStart(this, opts.context); + } + spanContext() { + return this._spanContext; + } + setAttribute(key, value) { + if (value == null || this._isSpanEnded()) + return this; + if (key.length === 0) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + return this; + } + if (!(0, core_1.isAttributeValue)(value)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + return this; + } + const { attributeCountLimit } = this._spanLimits; + const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key); + if (attributeCountLimit !== undefined && this._attributesCount >= attributeCountLimit && isNewKey) { + this._droppedAttributesCount++; + return this; + } + this.attributes[key] = this._truncateToSize(value); + if (isNewKey) { + this._attributesCount++; + } + return this; + } + setAttributes(attributes) { + for (const key in attributes) { + if (Object.prototype.hasOwnProperty.call(attributes, key)) { + this.setAttribute(key, attributes[key]); + } + } + return this; + } + addEvent(name, attributesOrStartTime, timeStamp) { + if (this._isSpanEnded()) + return this; + const { eventCountLimit } = this._spanLimits; + if (eventCountLimit === 0) { + api_1.diag.warn("No events allowed."); + this._droppedEventsCount++; + return this; + } + if (eventCountLimit !== undefined && this.events.length >= eventCountLimit) { + if (this._droppedEventsCount === 0) { + api_1.diag.debug("Dropping extra events."); + } + this.events.shift(); + this._droppedEventsCount++; + } + if ((0, core_1.isTimeInput)(attributesOrStartTime)) { + if (!(0, core_1.isTimeInput)(timeStamp)) { + timeStamp = attributesOrStartTime; + } + attributesOrStartTime = undefined; + } + const sanitized = (0, core_1.sanitizeAttributes)(attributesOrStartTime); + const { attributePerEventCountLimit } = this._spanLimits; + const attributes = {}; + let droppedAttributesCount = 0; + let eventAttributesCount = 0; + for (const attr in sanitized) { + if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) { + continue; + } + const attrVal = sanitized[attr]; + if (attributePerEventCountLimit !== undefined && eventAttributesCount >= attributePerEventCountLimit) { + droppedAttributesCount++; + continue; + } + attributes[attr] = this._truncateToSize(attrVal); + eventAttributesCount++; + } + this.events.push({ + name, + attributes, + time: this._getTime(timeStamp), + droppedAttributesCount + }); + return this; + } + addLink(link) { + if (this._isSpanEnded()) + return this; + const { linkCountLimit } = this._spanLimits; + if (linkCountLimit === 0) { + this._droppedLinksCount++; + return this; + } + if (linkCountLimit !== undefined && this.links.length >= linkCountLimit) { + if (this._droppedLinksCount === 0) { + api_1.diag.debug("Dropping extra links."); + } + this.links.shift(); + this._droppedLinksCount++; + } + const { attributePerLinkCountLimit } = this._spanLimits; + const sanitized = (0, core_1.sanitizeAttributes)(link.attributes); + const attributes = {}; + let droppedAttributesCount = 0; + let linkAttributesCount = 0; + for (const attr in sanitized) { + if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) { + continue; + } + const attrVal = sanitized[attr]; + if (attributePerLinkCountLimit !== undefined && linkAttributesCount >= attributePerLinkCountLimit) { + droppedAttributesCount++; + continue; + } + attributes[attr] = this._truncateToSize(attrVal); + linkAttributesCount++; + } + const processedLink = { context: link.context }; + if (linkAttributesCount > 0) { + processedLink.attributes = attributes; + } + if (droppedAttributesCount > 0) { + processedLink.droppedAttributesCount = droppedAttributesCount; + } + this.links.push(processedLink); + return this; + } + addLinks(links) { + for (const link of links) { + this.addLink(link); + } + return this; + } + setStatus(status) { + if (this._isSpanEnded()) + return this; + if (status.code === api_1.SpanStatusCode.UNSET) + return this; + if (this.status.code === api_1.SpanStatusCode.OK) + return this; + const newStatus = { code: status.code }; + if (status.code === api_1.SpanStatusCode.ERROR) { + if (typeof status.message === "string") { + newStatus.message = status.message; + } else if (status.message != null) { + api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); + } + } + this.status = newStatus; + return this; + } + updateName(name) { + if (this._isSpanEnded()) + return this; + this.name = name; + return this; + } + end(endTime) { + if (this._isSpanEnded()) { + api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); + return; + } + this.endTime = this._getTime(endTime); + this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); + if (this._duration[0] < 0) { + api_1.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.", this.startTime, this.endTime); + this.endTime = this.startTime.slice(); + this._duration = [0, 0]; + } + if (this._droppedEventsCount > 0) { + api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); + } + if (this._droppedLinksCount > 0) { + api_1.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`); + } + if (this._spanProcessor.onEnding) { + this._spanProcessor.onEnding(this); + } + this._recordEndMetrics?.(); + this._ended = true; + this._spanProcessor.onEnd(this); + } + _getTime(inp) { + if (typeof inp === "number" && inp <= core_1.otperformance.now()) { + return (0, core_1.hrTime)(inp + this._performanceOffset); + } + if (typeof inp === "number") { + return (0, core_1.millisToHrTime)(inp); + } + if (inp instanceof Date) { + return (0, core_1.millisToHrTime)(inp.getTime()); + } + if ((0, core_1.isTimeInputHrTime)(inp)) { + return inp; + } + if (this._startTimeProvided) { + return (0, core_1.millisToHrTime)(Date.now()); + } + const msDuration = core_1.otperformance.now() - this._performanceStartTime; + return (0, core_1.addHrTimes)(this.startTime, (0, core_1.millisToHrTime)(msDuration)); + } + isRecording() { + return this._ended === false; + } + recordException(exception, time3) { + const attributes = {}; + if (typeof exception === "string") { + attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception; + } else if (exception) { + if (exception.code) { + attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.code.toString(); + } else if (exception.name) { + attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.name; + } + if (exception.message) { + attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception.message; + } + if (exception.stack) { + attributes[semantic_conventions_1.ATTR_EXCEPTION_STACKTRACE] = exception.stack; + } + } + if (attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] || attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]) { + this.addEvent(enums_1.ExceptionEventName, attributes, time3); + } else { + api_1.diag.warn(`Failed to record an exception ${exception}`); + } + } + get duration() { + return this._duration; + } + get ended() { + return this._ended; + } + get droppedAttributesCount() { + return this._droppedAttributesCount; + } + get droppedEventsCount() { + return this._droppedEventsCount; + } + get droppedLinksCount() { + return this._droppedLinksCount; + } + _isSpanEnded() { + if (this._ended) { + const error51 = new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); + api_1.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error51); + } + return this._ended; + } + _truncateToLimitUtil(value, limit) { + if (value.length <= limit) { + return value; + } + return value.substring(0, limit); + } + _truncateToSize(value) { + const limit = this._attributeValueLengthLimit; + if (limit <= 0) { + api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); + return value; + } + if (typeof value === "string") { + return this._truncateToLimitUtil(value, limit); + } + if (Array.isArray(value)) { + return value.map((val) => typeof val === "string" ? this._truncateToLimitUtil(val, limit) : val); + } + return value; + } + } + exports.SpanImpl = SpanImpl; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/Sampler.js +var require_Sampler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SamplingDecision = undefined; + var SamplingDecision; + (function(SamplingDecision2) { + SamplingDecision2[SamplingDecision2["NOT_RECORD"] = 0] = "NOT_RECORD"; + SamplingDecision2[SamplingDecision2["RECORD"] = 1] = "RECORD"; + SamplingDecision2[SamplingDecision2["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; + })(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOffSampler.js +var require_AlwaysOffSampler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AlwaysOffSampler = undefined; + var Sampler_1 = require_Sampler(); + + class AlwaysOffSampler { + shouldSample() { + return { + decision: Sampler_1.SamplingDecision.NOT_RECORD + }; + } + toString() { + return "AlwaysOffSampler"; + } + } + exports.AlwaysOffSampler = AlwaysOffSampler; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOnSampler.js +var require_AlwaysOnSampler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AlwaysOnSampler = undefined; + var Sampler_1 = require_Sampler(); + + class AlwaysOnSampler { + shouldSample() { + return { + decision: Sampler_1.SamplingDecision.RECORD_AND_SAMPLED + }; + } + toString() { + return "AlwaysOnSampler"; + } + } + exports.AlwaysOnSampler = AlwaysOnSampler; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/ParentBasedSampler.js +var require_ParentBasedSampler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ParentBasedSampler = undefined; + var api_1 = require_src(); + var core_1 = require_src3(); + var AlwaysOffSampler_1 = require_AlwaysOffSampler(); + var AlwaysOnSampler_1 = require_AlwaysOnSampler(); + + class ParentBasedSampler { + _root; + _remoteParentSampled; + _remoteParentNotSampled; + _localParentSampled; + _localParentNotSampled; + constructor(config2) { + this._root = config2.root; + if (!this._root) { + (0, core_1.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler; + } + this._remoteParentSampled = config2.remoteParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler; + this._remoteParentNotSampled = config2.remoteParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler; + this._localParentSampled = config2.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler; + this._localParentNotSampled = config2.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler; + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { + return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { + return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } + } + exports.ParentBasedSampler = ParentBasedSampler; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/TraceIdRatioBasedSampler.js +var require_TraceIdRatioBasedSampler = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceIdRatioBasedSampler = undefined; + var api_1 = require_src(); + var Sampler_1 = require_Sampler(); + + class TraceIdRatioBasedSampler { + _ratio; + _upperBound; + constructor(ratio = 0) { + this._ratio = this._normalize(ratio); + this._upperBound = Math.floor(this._ratio * 4294967295); + } + shouldSample(context, traceId) { + return { + decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED : Sampler_1.SamplingDecision.NOT_RECORD + }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== "number" || isNaN(ratio)) + return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0;i < 32; i += 8) { + let part = 0; + for (let j = 0;j < 8; j++) { + const c = traceId.charCodeAt(i + j); + const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87; + part = part << 4 | v; + } + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } + } + exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/config.js +var require_config = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.buildSamplerFromEnv = exports.loadDefaultConfig = undefined; + var api_1 = require_src(); + var core_1 = require_src3(); + var AlwaysOffSampler_1 = require_AlwaysOffSampler(); + var AlwaysOnSampler_1 = require_AlwaysOnSampler(); + var ParentBasedSampler_1 = require_ParentBasedSampler(); + var TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); + var TracesSamplerValues; + (function(TracesSamplerValues2) { + TracesSamplerValues2["AlwaysOff"] = "always_off"; + TracesSamplerValues2["AlwaysOn"] = "always_on"; + TracesSamplerValues2["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues2["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues2["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues2["TraceIdRatio"] = "traceidratio"; + })(TracesSamplerValues || (TracesSamplerValues = {})); + var DEFAULT_RATIO = 1; + function loadDefaultConfig() { + return { + sampler: buildSamplerFromEnv(), + forceFlushTimeoutMillis: 30000, + generalLimits: { + attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, + attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? 128 + }, + spanLimits: { + attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, + attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? 128, + linkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT") ?? 128, + eventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT") ?? 128, + attributePerEventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT") ?? 128, + attributePerLinkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT") ?? 128 + } + }; + } + exports.loadDefaultConfig = loadDefaultConfig; + function buildSamplerFromEnv() { + const sampler = (0, core_1.getStringFromEnv)("OTEL_TRACES_SAMPLER") ?? TracesSamplerValues.ParentBasedAlwaysOn; + switch (sampler) { + case TracesSamplerValues.AlwaysOn: + return new AlwaysOnSampler_1.AlwaysOnSampler; + case TracesSamplerValues.AlwaysOff: + return new AlwaysOffSampler_1.AlwaysOffSampler; + case TracesSamplerValues.ParentBasedAlwaysOn: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOnSampler_1.AlwaysOnSampler + }); + case TracesSamplerValues.ParentBasedAlwaysOff: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOffSampler_1.AlwaysOffSampler + }); + case TracesSamplerValues.TraceIdRatio: + return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()); + case TracesSamplerValues.ParentBasedTraceIdRatio: + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()) + }); + default: + api_1.diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`); + return new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOnSampler_1.AlwaysOnSampler + }); + } + } + exports.buildSamplerFromEnv = buildSamplerFromEnv; + function getSamplerProbabilityFromEnv() { + const probability = (0, core_1.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG"); + if (probability == null) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + if (probability < 0 || probability > 1) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + return probability; + } +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js +var require_utility = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.reconfigureLimits = exports.mergeConfig = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = undefined; + var config_1 = require_config(); + var core_1 = require_src3(); + exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; + exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; + function mergeConfig(userConfig) { + const perInstanceDefaults = { + sampler: (0, config_1.buildSamplerFromEnv)() + }; + const DEFAULT_CONFIG = (0, config_1.loadDefaultConfig)(); + const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig); + target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); + target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); + return target; + } + exports.mergeConfig = mergeConfig; + function reconfigureLimits(userConfig) { + const spanLimits = Object.assign({}, userConfig.spanLimits); + spanLimits.attributeCountLimit = userConfig.spanLimits?.attributeCountLimit ?? userConfig.generalLimits?.attributeCountLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT; + spanLimits.attributeValueLengthLimit = userConfig.spanLimits?.attributeValueLengthLimit ?? userConfig.generalLimits?.attributeValueLengthLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; + return Object.assign({}, userConfig, { spanLimits }); + } + exports.reconfigureLimits = reconfigureLimits; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/export/BatchSpanProcessorBase.js +var require_BatchSpanProcessorBase = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BatchSpanProcessorBase = undefined; + var api_1 = require_src(); + var core_1 = require_src3(); + + class BatchSpanProcessorBase { + _maxExportBatchSize; + _maxQueueSize; + _scheduledDelayMillis; + _exportTimeoutMillis; + _exporter; + _isExporting = false; + _finishedSpans = []; + _timer; + _shutdownOnce; + _droppedSpansCount = 0; + constructor(exporter, config2) { + this._exporter = exporter; + this._maxExportBatchSize = typeof config2?.maxExportBatchSize === "number" ? config2.maxExportBatchSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE") ?? 512; + this._maxQueueSize = typeof config2?.maxQueueSize === "number" ? config2.maxQueueSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE") ?? 2048; + this._scheduledDelayMillis = typeof config2?.scheduledDelayMillis === "number" ? config2.scheduledDelayMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY") ?? 5000; + this._exportTimeoutMillis = typeof config2?.exportTimeoutMillis === "number" ? config2.exportTimeoutMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT") ?? 30000; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + if (this._maxExportBatchSize > this._maxQueueSize) { + api_1.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"); + this._maxExportBatchSize = this._maxQueueSize; + } + } + forceFlush() { + if (this._shutdownOnce.isCalled) { + return this._shutdownOnce.promise; + } + return this._flushAll(); + } + onStart(_span, _parentContext) {} + onEnd(span) { + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + this._addToBuffer(span); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return Promise.resolve().then(() => { + return this.onShutdown(); + }).then(() => { + return this._flushAll(); + }).then(() => { + return this._exporter.shutdown(); + }); + } + _addToBuffer(span) { + if (this._finishedSpans.length >= this._maxQueueSize) { + if (this._droppedSpansCount === 0) { + api_1.diag.debug("maxQueueSize reached, dropping spans"); + } + this._droppedSpansCount++; + return; + } + if (this._droppedSpansCount > 0) { + api_1.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`); + this._droppedSpansCount = 0; + } + this._finishedSpans.push(span); + this._maybeStartTimer(); + } + _flushAll() { + return new Promise((resolve, reject) => { + const promises = []; + const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); + for (let i = 0, j = count;i < j; i++) { + promises.push(this._flushOneBatch()); + } + Promise.all(promises).then(() => { + resolve(); + }).catch(reject); + }); + } + _flushOneBatch() { + this._clearTimer(); + if (this._finishedSpans.length === 0) { + return Promise.resolve(); + } + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + reject(new Error("Timeout")); + }, this._exportTimeoutMillis); + api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + let spans; + if (this._finishedSpans.length <= this._maxExportBatchSize) { + spans = this._finishedSpans; + this._finishedSpans = []; + } else { + spans = this._finishedSpans.splice(0, this._maxExportBatchSize); + } + const doExport = () => this._exporter.export(spans, (result) => { + clearTimeout(timer); + if (result.code === core_1.ExportResultCode.SUCCESS) { + resolve(); + } else { + reject(result.error ?? new Error("BatchSpanProcessor: span export failed")); + } + }); + let pendingResources = null; + for (let i = 0, len = spans.length;i < len; i++) { + const span = spans[i]; + if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) { + pendingResources ??= []; + pendingResources.push(span.resource.waitForAsyncAttributes()); + } + } + if (pendingResources === null) { + doExport(); + } else { + Promise.all(pendingResources).then(doExport, (err) => { + (0, core_1.globalErrorHandler)(err); + reject(err); + }); + } + }); + }); + } + _maybeStartTimer() { + if (this._isExporting) + return; + const flush = () => { + this._isExporting = true; + this._flushOneBatch().finally(() => { + this._isExporting = false; + if (this._finishedSpans.length > 0) { + this._clearTimer(); + this._maybeStartTimer(); + } + }).catch((e) => { + this._isExporting = false; + (0, core_1.globalErrorHandler)(e); + }); + }; + if (this._finishedSpans.length >= this._maxExportBatchSize) { + return flush(); + } + if (this._timer !== undefined) + return; + this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); + if (typeof this._timer !== "number") { + this._timer.unref(); + } + } + _clearTimer() { + if (this._timer !== undefined) { + clearTimeout(this._timer); + this._timer = undefined; + } + } + } + exports.BatchSpanProcessorBase = BatchSpanProcessorBase; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/export/BatchSpanProcessor.js +var require_BatchSpanProcessor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BatchSpanProcessor = undefined; + var BatchSpanProcessorBase_1 = require_BatchSpanProcessorBase(); + + class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { + onShutdown() {} + } + exports.BatchSpanProcessor = BatchSpanProcessor; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/RandomIdGenerator.js +var require_RandomIdGenerator = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RandomIdGenerator = undefined; + var SPAN_ID_BYTES = 8; + var TRACE_ID_BYTES = 16; + + class RandomIdGenerator { + generateTraceId = getIdGenerator(TRACE_ID_BYTES); + generateSpanId = getIdGenerator(SPAN_ID_BYTES); + } + exports.RandomIdGenerator = RandomIdGenerator; + var SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); + function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0;i < bytes / 4; i++) { + SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i * 4); + } + for (let i = 0;i < bytes; i++) { + if (SHARED_BUFFER[i] > 0) { + break; + } else if (i === bytes - 1) { + SHARED_BUFFER[bytes - 1] = 1; + } + } + return SHARED_BUFFER.toString("hex", 0, bytes); + }; + } +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js +var require_node10 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RandomIdGenerator = exports.BatchSpanProcessor = undefined; + var BatchSpanProcessor_1 = require_BatchSpanProcessor(); + Object.defineProperty(exports, "BatchSpanProcessor", { enumerable: true, get: function() { + return BatchSpanProcessor_1.BatchSpanProcessor; + } }); + var RandomIdGenerator_1 = require_RandomIdGenerator(); + Object.defineProperty(exports, "RandomIdGenerator", { enumerable: true, get: function() { + return RandomIdGenerator_1.RandomIdGenerator; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/platform/index.js +var require_platform10 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RandomIdGenerator = exports.BatchSpanProcessor = undefined; + var node_1 = require_node10(); + Object.defineProperty(exports, "BatchSpanProcessor", { enumerable: true, get: function() { + return node_1.BatchSpanProcessor; + } }); + Object.defineProperty(exports, "RandomIdGenerator", { enumerable: true, get: function() { + return node_1.RandomIdGenerator; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/semconv.js +var require_semconv8 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.METRIC_OTEL_SDK_SPAN_STARTED = exports.METRIC_OTEL_SDK_SPAN_LIVE = exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = undefined; + exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = "otel.span.parent.origin"; + exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = "otel.span.sampling_result"; + exports.METRIC_OTEL_SDK_SPAN_LIVE = "otel.sdk.span.live"; + exports.METRIC_OTEL_SDK_SPAN_STARTED = "otel.sdk.span.started"; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/TracerMetrics.js +var require_TracerMetrics = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TracerMetrics = undefined; + var Sampler_1 = require_Sampler(); + var semconv_1 = require_semconv8(); + + class TracerMetrics { + startedSpans; + liveSpans; + constructor(meter) { + this.startedSpans = meter.createCounter(semconv_1.METRIC_OTEL_SDK_SPAN_STARTED, { + unit: "{span}", + description: "The number of created spans." + }); + this.liveSpans = meter.createUpDownCounter(semconv_1.METRIC_OTEL_SDK_SPAN_LIVE, { + unit: "{span}", + description: "The number of currently live spans." + }); + } + startSpan(parentSpanCtx, samplingDecision) { + const samplingDecisionStr = samplingDecisionToString(samplingDecision); + this.startedSpans.add(1, { + [semconv_1.ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx), + [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr + }); + if (samplingDecision === Sampler_1.SamplingDecision.NOT_RECORD) { + return () => {}; + } + const liveSpanAttributes = { + [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr + }; + this.liveSpans.add(1, liveSpanAttributes); + return () => { + this.liveSpans.add(-1, liveSpanAttributes); + }; + } + } + exports.TracerMetrics = TracerMetrics; + function parentOrigin(parentSpanContext) { + if (!parentSpanContext) { + return "none"; + } + if (parentSpanContext.isRemote) { + return "remote"; + } + return "local"; + } + function samplingDecisionToString(decision) { + switch (decision) { + case Sampler_1.SamplingDecision.RECORD_AND_SAMPLED: + return "RECORD_AND_SAMPLE"; + case Sampler_1.SamplingDecision.RECORD: + return "RECORD_ONLY"; + case Sampler_1.SamplingDecision.NOT_RECORD: + return "DROP"; + } + } +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/version.js +var require_version8 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = undefined; + exports.VERSION = "2.7.1"; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/Tracer.js +var require_Tracer = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Tracer = undefined; + var api2 = require_src(); + var core_1 = require_src3(); + var Span_1 = require_Span(); + var utility_1 = require_utility(); + var platform_1 = require_platform10(); + var TracerMetrics_1 = require_TracerMetrics(); + var version_1 = require_version8(); + + class Tracer { + _sampler; + _generalLimits; + _spanLimits; + _idGenerator; + instrumentationScope; + _resource; + _spanProcessor; + _tracerMetrics; + constructor(instrumentationScope, config2, resource, spanProcessor) { + const localConfig = (0, utility_1.mergeConfig)(config2); + this._sampler = localConfig.sampler; + this._generalLimits = localConfig.generalLimits; + this._spanLimits = localConfig.spanLimits; + this._idGenerator = config2.idGenerator || new platform_1.RandomIdGenerator; + this._resource = resource; + this._spanProcessor = spanProcessor; + this.instrumentationScope = instrumentationScope; + const meter = localConfig.meterProvider ? localConfig.meterProvider.getMeter("@opentelemetry/sdk-trace", version_1.VERSION) : api2.createNoopMeter(); + this._tracerMetrics = new TracerMetrics_1.TracerMetrics(meter); + } + startSpan(name, options = {}, context = api2.context.active()) { + if (options.root) { + context = api2.trace.deleteSpan(context); + } + const parentSpan = api2.trace.getSpan(context); + if ((0, core_1.isTracingSuppressed)(context)) { + api2.diag.debug("Instrumentation suppressed, returning Noop Span"); + const nonRecordingSpan = api2.trace.wrapSpanContext(api2.INVALID_SPAN_CONTEXT); + return nonRecordingSpan; + } + const parentSpanContext = parentSpan?.spanContext(); + const spanId = this._idGenerator.generateSpanId(); + let validParentSpanContext; + let traceId; + let traceState; + if (!parentSpanContext || !api2.trace.isSpanContextValid(parentSpanContext)) { + traceId = this._idGenerator.generateTraceId(); + } else { + traceId = parentSpanContext.traceId; + traceState = parentSpanContext.traceState; + validParentSpanContext = parentSpanContext; + } + const spanKind = options.kind ?? api2.SpanKind.INTERNAL; + const links = (options.links ?? []).map((link) => { + return { + context: link.context, + attributes: (0, core_1.sanitizeAttributes)(link.attributes) + }; + }); + const attributes = (0, core_1.sanitizeAttributes)(options.attributes); + const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); + const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision); + traceState = samplingResult.traceState ?? traceState; + const traceFlags = samplingResult.decision === api2.SamplingDecision.RECORD_AND_SAMPLED ? api2.TraceFlags.SAMPLED : api2.TraceFlags.NONE; + const spanContext = { traceId, spanId, traceFlags, traceState }; + if (samplingResult.decision === api2.SamplingDecision.NOT_RECORD) { + api2.diag.debug("Recording is off, propagating context in a non-recording span"); + const nonRecordingSpan = api2.trace.wrapSpanContext(spanContext); + return nonRecordingSpan; + } + const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); + const span = new Span_1.SpanImpl({ + resource: this._resource, + scope: this.instrumentationScope, + context, + spanContext, + name, + kind: spanKind, + links, + parentSpanContext: validParentSpanContext, + attributes: initAttributes, + startTime: options.startTime, + spanProcessor: this._spanProcessor, + spanLimits: this._spanLimits, + recordEndMetrics + }); + return span; + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) { + return; + } else if (arguments.length === 2) { + fn = arg2; + } else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx ?? api2.context.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = api2.trace.setSpan(parentContext, span); + return api2.context.with(contextWithSpanSet, fn, undefined, span); + } + getGeneralLimits() { + return this._generalLimits; + } + getSpanLimits() { + return this._spanLimits; + } + } + exports.Tracer = Tracer; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/MultiSpanProcessor.js +var require_MultiSpanProcessor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MultiSpanProcessor = undefined; + var core_1 = require_src3(); + + class MultiSpanProcessor { + _spanProcessors; + constructor(spanProcessors) { + this._spanProcessors = spanProcessors; + } + forceFlush() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.forceFlush()); + } + return new Promise((resolve) => { + Promise.all(promises).then(() => { + resolve(); + }).catch((error51) => { + (0, core_1.globalErrorHandler)(error51 || new Error("MultiSpanProcessor: forceFlush failed")); + resolve(); + }); + }); + } + onStart(span, context) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onStart(span, context); + } + } + onEnding(span) { + for (const spanProcessor of this._spanProcessors) { + if (spanProcessor.onEnding) { + spanProcessor.onEnding(span); + } + } + } + onEnd(span) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onEnd(span); + } + } + shutdown() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.shutdown()); + } + return new Promise((resolve, reject) => { + Promise.all(promises).then(() => { + resolve(); + }, reject); + }); + } + } + exports.MultiSpanProcessor = MultiSpanProcessor; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js +var require_BasicTracerProvider = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BasicTracerProvider = exports.ForceFlushState = undefined; + var core_1 = require_src3(); + var resources_1 = require_src13(); + var Tracer_1 = require_Tracer(); + var config_1 = require_config(); + var MultiSpanProcessor_1 = require_MultiSpanProcessor(); + var utility_1 = require_utility(); + var ForceFlushState; + (function(ForceFlushState2) { + ForceFlushState2[ForceFlushState2["resolved"] = 0] = "resolved"; + ForceFlushState2[ForceFlushState2["timeout"] = 1] = "timeout"; + ForceFlushState2[ForceFlushState2["error"] = 2] = "error"; + ForceFlushState2[ForceFlushState2["unresolved"] = 3] = "unresolved"; + })(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); + + class BasicTracerProvider { + _config; + _tracers = new Map; + _resource; + _activeSpanProcessor; + constructor(config2 = {}) { + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config2)); + this._resource = mergedConfig.resource ?? (0, resources_1.defaultResource)(); + this._config = Object.assign({}, mergedConfig, { + resource: this._resource + }); + const spanProcessors = []; + if (config2.spanProcessors?.length) { + spanProcessors.push(...config2.spanProcessors); + } + this._activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(spanProcessors); + } + getTracer(name, version2, options) { + const key = `${name}@${version2 || ""}:${options?.schemaUrl || ""}`; + if (!this._tracers.has(key)) { + this._tracers.set(key, new Tracer_1.Tracer({ name, version: version2, schemaUrl: options?.schemaUrl }, this._config, this._resource, this._activeSpanProcessor)); + } + return this._tracers.get(key); + } + forceFlush() { + const timeout = this._config.forceFlushTimeoutMillis; + const promises = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => { + return new Promise((resolve) => { + let state; + const timeoutInterval = setTimeout(() => { + resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); + state = ForceFlushState.timeout; + }, timeout); + spanProcessor.forceFlush().then(() => { + clearTimeout(timeoutInterval); + if (state !== ForceFlushState.timeout) { + state = ForceFlushState.resolved; + resolve(state); + } + }).catch((error51) => { + clearTimeout(timeoutInterval); + state = ForceFlushState.error; + resolve(error51); + }); + }); + }); + return new Promise((resolve, reject) => { + Promise.all(promises).then((results) => { + const errors3 = results.filter((result) => result !== ForceFlushState.resolved); + if (errors3.length > 0) { + reject(errors3); + } else { + resolve(); + } + }).catch((error51) => reject([error51])); + }); + } + shutdown() { + return this._activeSpanProcessor.shutdown(); + } + } + exports.BasicTracerProvider = BasicTracerProvider; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/export/ConsoleSpanExporter.js +var require_ConsoleSpanExporter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ConsoleSpanExporter = undefined; + var core_1 = require_src3(); + + class ConsoleSpanExporter { + export(spans, resultCallback) { + return this._sendSpans(spans, resultCallback); + } + shutdown() { + this._sendSpans([]); + return this.forceFlush(); + } + forceFlush() { + return Promise.resolve(); + } + _exportInfo(span) { + return { + resource: { + attributes: span.resource.attributes + }, + instrumentationScope: span.instrumentationScope, + traceId: span.spanContext().traceId, + parentSpanContext: span.parentSpanContext, + traceState: span.spanContext().traceState?.serialize(), + name: span.name, + id: span.spanContext().spanId, + kind: span.kind, + timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), + duration: (0, core_1.hrTimeToMicroseconds)(span.duration), + attributes: span.attributes, + status: span.status, + events: span.events, + links: span.links + }; + } + _sendSpans(spans, done) { + for (const span of spans) { + console.dir(this._exportInfo(span), { depth: 3 }); + } + if (done) { + return done({ code: core_1.ExportResultCode.SUCCESS }); + } + } + } + exports.ConsoleSpanExporter = ConsoleSpanExporter; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/export/InMemorySpanExporter.js +var require_InMemorySpanExporter = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InMemorySpanExporter = undefined; + var core_1 = require_src3(); + + class InMemorySpanExporter { + _finishedSpans = []; + _stopped = false; + export(spans, resultCallback) { + if (this._stopped) + return resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error("Exporter has been stopped") + }); + this._finishedSpans.push(...spans); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + shutdown() { + this._stopped = true; + this._finishedSpans = []; + return this.forceFlush(); + } + forceFlush() { + return Promise.resolve(); + } + reset() { + this._finishedSpans = []; + } + getFinishedSpans() { + return this._finishedSpans; + } + } + exports.InMemorySpanExporter = InMemorySpanExporter; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/export/SimpleSpanProcessor.js +var require_SimpleSpanProcessor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SimpleSpanProcessor = undefined; + var api_1 = require_src(); + var core_1 = require_src3(); + + class SimpleSpanProcessor { + _exporter; + _shutdownOnce; + _pendingExports; + constructor(exporter) { + this._exporter = exporter; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + this._pendingExports = new Set; + } + async forceFlush() { + await Promise.all(Array.from(this._pendingExports)); + if (this._exporter.forceFlush) { + await this._exporter.forceFlush(); + } + } + onStart(_span, _parentContext) {} + onEnd(span) { + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + const pendingExport = this._doExport(span).catch((err) => (0, core_1.globalErrorHandler)(err)); + this._pendingExports.add(pendingExport); + pendingExport.finally(() => this._pendingExports.delete(pendingExport)); + } + async _doExport(span) { + if (span.resource.asyncAttributesPending) { + await span.resource.waitForAsyncAttributes?.(); + } + const result = await core_1.internal._export(this._exporter, [span]); + if (result.code !== core_1.ExportResultCode.SUCCESS) { + throw result.error ?? new Error(`SimpleSpanProcessor: span export failed (status ${result})`); + } + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return this._exporter.shutdown(); + } + } + exports.SimpleSpanProcessor = SimpleSpanProcessor; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js +var require_NoopSpanProcessor = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NoopSpanProcessor = undefined; + + class NoopSpanProcessor { + onStart(_span, _context) {} + onEnd(_span) {} + shutdown() { + return Promise.resolve(); + } + forceFlush() { + return Promise.resolve(); + } + } + exports.NoopSpanProcessor = NoopSpanProcessor; +}); + +// node_modules/@opentelemetry/sdk-trace-base/build/src/index.js +var require_src14 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.BasicTracerProvider = undefined; + var BasicTracerProvider_1 = require_BasicTracerProvider(); + Object.defineProperty(exports, "BasicTracerProvider", { enumerable: true, get: function() { + return BasicTracerProvider_1.BasicTracerProvider; + } }); + var platform_1 = require_platform10(); + Object.defineProperty(exports, "BatchSpanProcessor", { enumerable: true, get: function() { + return platform_1.BatchSpanProcessor; + } }); + Object.defineProperty(exports, "RandomIdGenerator", { enumerable: true, get: function() { + return platform_1.RandomIdGenerator; + } }); + var ConsoleSpanExporter_1 = require_ConsoleSpanExporter(); + Object.defineProperty(exports, "ConsoleSpanExporter", { enumerable: true, get: function() { + return ConsoleSpanExporter_1.ConsoleSpanExporter; + } }); + var InMemorySpanExporter_1 = require_InMemorySpanExporter(); + Object.defineProperty(exports, "InMemorySpanExporter", { enumerable: true, get: function() { + return InMemorySpanExporter_1.InMemorySpanExporter; + } }); + var SimpleSpanProcessor_1 = require_SimpleSpanProcessor(); + Object.defineProperty(exports, "SimpleSpanProcessor", { enumerable: true, get: function() { + return SimpleSpanProcessor_1.SimpleSpanProcessor; + } }); + var NoopSpanProcessor_1 = require_NoopSpanProcessor(); + Object.defineProperty(exports, "NoopSpanProcessor", { enumerable: true, get: function() { + return NoopSpanProcessor_1.NoopSpanProcessor; + } }); + var AlwaysOffSampler_1 = require_AlwaysOffSampler(); + Object.defineProperty(exports, "AlwaysOffSampler", { enumerable: true, get: function() { + return AlwaysOffSampler_1.AlwaysOffSampler; + } }); + var AlwaysOnSampler_1 = require_AlwaysOnSampler(); + Object.defineProperty(exports, "AlwaysOnSampler", { enumerable: true, get: function() { + return AlwaysOnSampler_1.AlwaysOnSampler; + } }); + var ParentBasedSampler_1 = require_ParentBasedSampler(); + Object.defineProperty(exports, "ParentBasedSampler", { enumerable: true, get: function() { + return ParentBasedSampler_1.ParentBasedSampler; + } }); + var TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); + Object.defineProperty(exports, "TraceIdRatioBasedSampler", { enumerable: true, get: function() { + return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; + } }); + var Sampler_1 = require_Sampler(); + Object.defineProperty(exports, "SamplingDecision", { enumerable: true, get: function() { + return Sampler_1.SamplingDecision; + } }); +}); + +// node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js +var require_AbstractAsyncHooksContextManager = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AbstractAsyncHooksContextManager = undefined; + var events_1 = __require("events"); + var ADD_LISTENER_METHODS = [ + "addListener", + "on", + "once", + "prependListener", + "prependOnceListener" + ]; + + class AbstractAsyncHooksContextManager { + bind(context, target) { + if (target instanceof events_1.EventEmitter) { + return this._bindEventEmitter(context, target); + } + if (typeof target === "function") { + return this._bindFunction(context, target); + } + return target; + } + _bindFunction(context, target) { + const manager = this; + const contextWrapper = function(...args) { + return manager.with(context, () => target.apply(this, args)); + }; + Object.defineProperty(contextWrapper, "length", { + enumerable: false, + configurable: true, + writable: false, + value: target.length + }); + return contextWrapper; + } + _bindEventEmitter(context, ee) { + const map2 = this._getPatchMap(ee); + if (map2 !== undefined) + return ee; + this._createPatchMap(ee); + ADD_LISTENER_METHODS.forEach((methodName) => { + if (ee[methodName] === undefined) + return; + ee[methodName] = this._patchAddListener(ee, ee[methodName], context); + }); + if (typeof ee.removeListener === "function") { + ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); + } + if (typeof ee.off === "function") { + ee.off = this._patchRemoveListener(ee, ee.off); + } + if (typeof ee.removeAllListeners === "function") { + ee.removeAllListeners = this._patchRemoveAllListeners(ee, ee.removeAllListeners); + } + return ee; + } + _patchRemoveListener(ee, original) { + const contextManager = this; + return function(event, listener) { + const events = contextManager._getPatchMap(ee)?.[event]; + if (events === undefined) { + return original.call(this, event, listener); + } + const patchedListener = events.get(listener); + return original.call(this, event, patchedListener || listener); + }; + } + _patchRemoveAllListeners(ee, original) { + const contextManager = this; + return function(event) { + const map2 = contextManager._getPatchMap(ee); + if (map2 !== undefined) { + if (arguments.length === 0) { + contextManager._createPatchMap(ee); + } else if (map2[event] !== undefined) { + delete map2[event]; + } + } + return original.apply(this, arguments); + }; + } + _patchAddListener(ee, original, context) { + const contextManager = this; + return function(event, listener) { + if (contextManager._wrapped) { + return original.call(this, event, listener); + } + let map2 = contextManager._getPatchMap(ee); + if (map2 === undefined) { + map2 = contextManager._createPatchMap(ee); + } + let listeners = map2[event]; + if (listeners === undefined) { + listeners = new WeakMap; + map2[event] = listeners; + } + const patchedListener = contextManager.bind(context, listener); + listeners.set(listener, patchedListener); + contextManager._wrapped = true; + try { + return original.call(this, event, patchedListener); + } finally { + contextManager._wrapped = false; + } + }; + } + _createPatchMap(ee) { + const map2 = Object.create(null); + ee[this._kOtListeners] = map2; + return map2; + } + _getPatchMap(ee) { + return ee[this._kOtListeners]; + } + _kOtListeners = Symbol("OtListeners"); + _wrapped = false; + } + exports.AbstractAsyncHooksContextManager = AbstractAsyncHooksContextManager; +}); + +// node_modules/@opentelemetry/context-async-hooks/build/src/AsyncHooksContextManager.js +var require_AsyncHooksContextManager = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncHooksContextManager = undefined; + var api_1 = require_src(); + var asyncHooks = __require("async_hooks"); + var AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); + + class AsyncHooksContextManager extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + _asyncHook; + _contexts = new Map; + _stack = []; + constructor() { + super(); + this._asyncHook = asyncHooks.createHook({ + init: this._init.bind(this), + before: this._before.bind(this), + after: this._after.bind(this), + destroy: this._destroy.bind(this), + promiseResolve: this._destroy.bind(this) + }); + } + active() { + return this._stack[this._stack.length - 1] ?? api_1.ROOT_CONTEXT; + } + with(context, fn, thisArg, ...args) { + this._enterContext(context); + try { + return fn.call(thisArg, ...args); + } finally { + this._exitContext(); + } + } + enable() { + this._asyncHook.enable(); + return this; + } + disable() { + this._asyncHook.disable(); + this._contexts.clear(); + this._stack = []; + return this; + } + _init(uid, type) { + if (type === "TIMERWRAP") + return; + const context = this._stack[this._stack.length - 1]; + if (context !== undefined) { + this._contexts.set(uid, context); + } + } + _destroy(uid) { + this._contexts.delete(uid); + } + _before(uid) { + const context = this._contexts.get(uid); + if (context !== undefined) { + this._enterContext(context); + } + } + _after() { + this._exitContext(); + } + _enterContext(context) { + this._stack.push(context); + } + _exitContext() { + this._stack.pop(); + } + } + exports.AsyncHooksContextManager = AsyncHooksContextManager; +}); + +// node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js +var require_AsyncLocalStorageContextManager = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncLocalStorageContextManager = undefined; + var api_1 = require_src(); + var async_hooks_1 = __require("async_hooks"); + var AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); + + class AsyncLocalStorageContextManager extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + _asyncLocalStorage; + constructor() { + super(); + this._asyncLocalStorage = new async_hooks_1.AsyncLocalStorage; + } + active() { + return this._asyncLocalStorage.getStore() ?? api_1.ROOT_CONTEXT; + } + with(context, fn, thisArg, ...args) { + const cb = thisArg == null ? fn : fn.bind(thisArg); + return this._asyncLocalStorage.run(context, cb, ...args); + } + enable() { + return this; + } + disable() { + this._asyncLocalStorage.disable(); + return this; + } + } + exports.AsyncLocalStorageContextManager = AsyncLocalStorageContextManager; +}); + +// node_modules/@opentelemetry/context-async-hooks/build/src/index.js +var require_src15 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsyncLocalStorageContextManager = exports.AsyncHooksContextManager = undefined; + var AsyncHooksContextManager_1 = require_AsyncHooksContextManager(); + Object.defineProperty(exports, "AsyncHooksContextManager", { enumerable: true, get: function() { + return AsyncHooksContextManager_1.AsyncHooksContextManager; + } }); + var AsyncLocalStorageContextManager_1 = require_AsyncLocalStorageContextManager(); + Object.defineProperty(exports, "AsyncLocalStorageContextManager", { enumerable: true, get: function() { + return AsyncLocalStorageContextManager_1.AsyncLocalStorageContextManager; + } }); +}); + +// node_modules/@opentelemetry/sdk-trace-node/build/src/NodeTracerProvider.js +var require_NodeTracerProvider = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NodeTracerProvider = undefined; + var context_async_hooks_1 = require_src15(); + var sdk_trace_base_1 = require_src14(); + var api_1 = require_src(); + var core_1 = require_src3(); + function setupContextManager(contextManager) { + if (contextManager === null) { + return; + } + if (contextManager === undefined) { + const defaultContextManager = new context_async_hooks_1.AsyncLocalStorageContextManager; + defaultContextManager.enable(); + api_1.context.setGlobalContextManager(defaultContextManager); + return; + } + contextManager.enable(); + api_1.context.setGlobalContextManager(contextManager); + } + function setupPropagator(propagator) { + if (propagator === null) { + return; + } + if (propagator === undefined) { + api_1.propagation.setGlobalPropagator(new core_1.CompositePropagator({ + propagators: [ + new core_1.W3CTraceContextPropagator, + new core_1.W3CBaggagePropagator + ] + })); + return; + } + api_1.propagation.setGlobalPropagator(propagator); + } + + class NodeTracerProvider extends sdk_trace_base_1.BasicTracerProvider { + constructor(config2 = {}) { + super(config2); + } + register(config2 = {}) { + api_1.trace.setGlobalTracerProvider(this); + setupContextManager(config2.contextManager); + setupPropagator(config2.propagator); + } + } + exports.NodeTracerProvider = NodeTracerProvider; +}); + +// node_modules/@opentelemetry/sdk-trace-node/build/src/index.js +var require_src16 = __commonJS((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceIdRatioBasedSampler = exports.SimpleSpanProcessor = exports.SamplingDecision = exports.RandomIdGenerator = exports.ParentBasedSampler = exports.NoopSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.BatchSpanProcessor = exports.BasicTracerProvider = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NodeTracerProvider = undefined; + var NodeTracerProvider_1 = require_NodeTracerProvider(); + Object.defineProperty(exports, "NodeTracerProvider", { enumerable: true, get: function() { + return NodeTracerProvider_1.NodeTracerProvider; + } }); + var sdk_trace_base_1 = require_src14(); + Object.defineProperty(exports, "AlwaysOffSampler", { enumerable: true, get: function() { + return sdk_trace_base_1.AlwaysOffSampler; + } }); + Object.defineProperty(exports, "AlwaysOnSampler", { enumerable: true, get: function() { + return sdk_trace_base_1.AlwaysOnSampler; + } }); + Object.defineProperty(exports, "BasicTracerProvider", { enumerable: true, get: function() { + return sdk_trace_base_1.BasicTracerProvider; + } }); + Object.defineProperty(exports, "BatchSpanProcessor", { enumerable: true, get: function() { + return sdk_trace_base_1.BatchSpanProcessor; + } }); + Object.defineProperty(exports, "ConsoleSpanExporter", { enumerable: true, get: function() { + return sdk_trace_base_1.ConsoleSpanExporter; + } }); + Object.defineProperty(exports, "InMemorySpanExporter", { enumerable: true, get: function() { + return sdk_trace_base_1.InMemorySpanExporter; + } }); + Object.defineProperty(exports, "NoopSpanProcessor", { enumerable: true, get: function() { + return sdk_trace_base_1.NoopSpanProcessor; + } }); + Object.defineProperty(exports, "ParentBasedSampler", { enumerable: true, get: function() { + return sdk_trace_base_1.ParentBasedSampler; + } }); + Object.defineProperty(exports, "RandomIdGenerator", { enumerable: true, get: function() { + return sdk_trace_base_1.RandomIdGenerator; + } }); + Object.defineProperty(exports, "SamplingDecision", { enumerable: true, get: function() { + return sdk_trace_base_1.SamplingDecision; + } }); + Object.defineProperty(exports, "SimpleSpanProcessor", { enumerable: true, get: function() { + return sdk_trace_base_1.SimpleSpanProcessor; + } }); + Object.defineProperty(exports, "TraceIdRatioBasedSampler", { enumerable: true, get: function() { + return sdk_trace_base_1.TraceIdRatioBasedSampler; + } }); +}); + +// src/config.ts +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; + +// node_modules/zod/v4/classic/external.js +var exports_external = {}; +__export(exports_external, { + xor: () => xor, + xid: () => xid2, + void: () => _void2, + uuidv7: () => uuidv7, + uuidv6: () => uuidv6, + uuidv4: () => uuidv4, + uuid: () => uuid2, + util: () => exports_util, + url: () => url, + uppercase: () => _uppercase, + unknown: () => unknown, + union: () => union, + undefined: () => _undefined3, + ulid: () => ulid2, + uint64: () => uint64, + uint32: () => uint32, + tuple: () => tuple, + trim: () => _trim, + treeifyError: () => treeifyError, + transform: () => transform, + toUpperCase: () => _toUpperCase, + toLowerCase: () => _toLowerCase, + toJSONSchema: () => toJSONSchema, + templateLiteral: () => templateLiteral, + symbol: () => symbol, + superRefine: () => superRefine, + success: () => success, + stringbool: () => stringbool, + stringFormat: () => stringFormat, + string: () => string2, + strictObject: () => strictObject, + startsWith: () => _startsWith, + slugify: () => _slugify, + size: () => _size, + setErrorMap: () => setErrorMap, + set: () => set, + safeParseAsync: () => safeParseAsync2, + safeParse: () => safeParse2, + safeEncodeAsync: () => safeEncodeAsync2, + safeEncode: () => safeEncode2, + safeDecodeAsync: () => safeDecodeAsync2, + safeDecode: () => safeDecode2, + registry: () => registry, + regexes: () => exports_regexes, + regex: () => _regex, + refine: () => refine, + record: () => record, + readonly: () => readonly, + property: () => _property, + promise: () => promise, + prettifyError: () => prettifyError, + preprocess: () => preprocess, + prefault: () => prefault, + positive: () => _positive, + pipe: () => pipe, + partialRecord: () => partialRecord, + parseAsync: () => parseAsync2, + parse: () => parse3, + overwrite: () => _overwrite, + optional: () => optional, + object: () => object, + number: () => number2, + nullish: () => nullish2, + nullable: () => nullable, + null: () => _null3, + normalize: () => _normalize, + nonpositive: () => _nonpositive, + nonoptional: () => nonoptional, + nonnegative: () => _nonnegative, + never: () => never, + negative: () => _negative, + nativeEnum: () => nativeEnum, + nanoid: () => nanoid2, + nan: () => nan, + multipleOf: () => _multipleOf, + minSize: () => _minSize, + minLength: () => _minLength, + mime: () => _mime, + meta: () => meta2, + maxSize: () => _maxSize, + maxLength: () => _maxLength, + map: () => map, + mac: () => mac2, + lte: () => _lte, + lt: () => _lt, + lowercase: () => _lowercase, + looseRecord: () => looseRecord, + looseObject: () => looseObject, + locales: () => exports_locales, + literal: () => literal, + length: () => _length, + lazy: () => lazy, + ksuid: () => ksuid2, + keyof: () => keyof, + jwt: () => jwt, + json: () => json, + iso: () => exports_iso, + ipv6: () => ipv62, + ipv4: () => ipv42, + invertCodec: () => invertCodec, + intersection: () => intersection, + int64: () => int64, + int32: () => int32, + int: () => int, + instanceof: () => _instanceof, + includes: () => _includes, + httpUrl: () => httpUrl, + hostname: () => hostname2, + hex: () => hex2, + hash: () => hash, + guid: () => guid2, + gte: () => _gte, + gt: () => _gt, + globalRegistry: () => globalRegistry, + getErrorMap: () => getErrorMap, + function: () => _function, + fromJSONSchema: () => fromJSONSchema, + formatError: () => formatError, + float64: () => float64, + float32: () => float32, + flattenError: () => flattenError, + file: () => file, + exactOptional: () => exactOptional, + enum: () => _enum2, + endsWith: () => _endsWith, + encodeAsync: () => encodeAsync2, + encode: () => encode2, + emoji: () => emoji2, + email: () => email2, + e164: () => e1642, + discriminatedUnion: () => discriminatedUnion, + describe: () => describe2, + decodeAsync: () => decodeAsync2, + decode: () => decode2, + date: () => date3, + custom: () => custom, + cuid2: () => cuid22, + cuid: () => cuid3, + core: () => exports_core2, + config: () => config, + coerce: () => exports_coerce, + codec: () => codec, + clone: () => clone, + cidrv6: () => cidrv62, + cidrv4: () => cidrv42, + check: () => check, + catch: () => _catch2, + boolean: () => boolean2, + bigint: () => bigint2, + base64url: () => base64url2, + base64: () => base642, + array: () => array, + any: () => any, + _function: () => _function, + _default: () => _default2, + _ZodString: () => _ZodString, + ZodXor: () => ZodXor, + ZodXID: () => ZodXID, + ZodVoid: () => ZodVoid, + ZodUnknown: () => ZodUnknown, + ZodUnion: () => ZodUnion, + ZodUndefined: () => ZodUndefined, + ZodUUID: () => ZodUUID, + ZodURL: () => ZodURL, + ZodULID: () => ZodULID, + ZodType: () => ZodType, + ZodTuple: () => ZodTuple, + ZodTransform: () => ZodTransform, + ZodTemplateLiteral: () => ZodTemplateLiteral, + ZodSymbol: () => ZodSymbol, + ZodSuccess: () => ZodSuccess, + ZodStringFormat: () => ZodStringFormat, + ZodString: () => ZodString, + ZodSet: () => ZodSet, + ZodRecord: () => ZodRecord, + ZodRealError: () => ZodRealError, + ZodReadonly: () => ZodReadonly, + ZodPromise: () => ZodPromise, + ZodPreprocess: () => ZodPreprocess, + ZodPrefault: () => ZodPrefault, + ZodPipe: () => ZodPipe, + ZodOptional: () => ZodOptional, + ZodObject: () => ZodObject, + ZodNumberFormat: () => ZodNumberFormat, + ZodNumber: () => ZodNumber, + ZodNullable: () => ZodNullable, + ZodNull: () => ZodNull, + ZodNonOptional: () => ZodNonOptional, + ZodNever: () => ZodNever, + ZodNanoID: () => ZodNanoID, + ZodNaN: () => ZodNaN, + ZodMap: () => ZodMap, + ZodMAC: () => ZodMAC, + ZodLiteral: () => ZodLiteral, + ZodLazy: () => ZodLazy, + ZodKSUID: () => ZodKSUID, + ZodJWT: () => ZodJWT, + ZodIssueCode: () => ZodIssueCode, + ZodIntersection: () => ZodIntersection, + ZodISOTime: () => ZodISOTime, + ZodISODuration: () => ZodISODuration, + ZodISODateTime: () => ZodISODateTime, + ZodISODate: () => ZodISODate, + ZodIPv6: () => ZodIPv6, + ZodIPv4: () => ZodIPv4, + ZodGUID: () => ZodGUID, + ZodFunction: () => ZodFunction, + ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind, + ZodFile: () => ZodFile, + ZodExactOptional: () => ZodExactOptional, + ZodError: () => ZodError, + ZodEnum: () => ZodEnum, + ZodEmoji: () => ZodEmoji, + ZodEmail: () => ZodEmail, + ZodE164: () => ZodE164, + ZodDiscriminatedUnion: () => ZodDiscriminatedUnion, + ZodDefault: () => ZodDefault, + ZodDate: () => ZodDate, + ZodCustomStringFormat: () => ZodCustomStringFormat, + ZodCustom: () => ZodCustom, + ZodCodec: () => ZodCodec, + ZodCatch: () => ZodCatch, + ZodCUID2: () => ZodCUID2, + ZodCUID: () => ZodCUID, + ZodCIDRv6: () => ZodCIDRv6, + ZodCIDRv4: () => ZodCIDRv4, + ZodBoolean: () => ZodBoolean, + ZodBigIntFormat: () => ZodBigIntFormat, + ZodBigInt: () => ZodBigInt, + ZodBase64URL: () => ZodBase64URL, + ZodBase64: () => ZodBase64, + ZodArray: () => ZodArray, + ZodAny: () => ZodAny, + TimePrecision: () => TimePrecision, + NEVER: () => NEVER, + $output: () => $output, + $input: () => $input, + $brand: () => $brand +}); + +// node_modules/zod/v4/core/index.js +var exports_core2 = {}; +__export(exports_core2, { + version: () => version, + util: () => exports_util, + treeifyError: () => treeifyError, + toJSONSchema: () => toJSONSchema, + toDotPath: () => toDotPath, + safeParseAsync: () => safeParseAsync, + safeParse: () => safeParse, + safeEncodeAsync: () => safeEncodeAsync, + safeEncode: () => safeEncode, + safeDecodeAsync: () => safeDecodeAsync, + safeDecode: () => safeDecode, + registry: () => registry, + regexes: () => exports_regexes, + process: () => process2, + prettifyError: () => prettifyError, + parseAsync: () => parseAsync, + parse: () => parse, + meta: () => meta, + locales: () => exports_locales, + isValidJWT: () => isValidJWT, + isValidBase64URL: () => isValidBase64URL, + isValidBase64: () => isValidBase64, + initializeContext: () => initializeContext, + globalRegistry: () => globalRegistry, + globalConfig: () => globalConfig, + formatError: () => formatError, + flattenError: () => flattenError, + finalize: () => finalize, + extractDefs: () => extractDefs, + encodeAsync: () => encodeAsync, + encode: () => encode, + describe: () => describe, + decodeAsync: () => decodeAsync, + decode: () => decode, + createToJSONSchemaMethod: () => createToJSONSchemaMethod, + createStandardJSONSchemaMethod: () => createStandardJSONSchemaMethod, + config: () => config, + clone: () => clone, + _xor: () => _xor, + _xid: () => _xid, + _void: () => _void, + _uuidv7: () => _uuidv7, + _uuidv6: () => _uuidv6, + _uuidv4: () => _uuidv4, + _uuid: () => _uuid, + _url: () => _url, + _uppercase: () => _uppercase, + _unknown: () => _unknown, + _union: () => _union, + _undefined: () => _undefined2, + _ulid: () => _ulid, + _uint64: () => _uint64, + _uint32: () => _uint32, + _tuple: () => _tuple, + _trim: () => _trim, + _transform: () => _transform, + _toUpperCase: () => _toUpperCase, + _toLowerCase: () => _toLowerCase, + _templateLiteral: () => _templateLiteral, + _symbol: () => _symbol, + _superRefine: () => _superRefine, + _success: () => _success, + _stringbool: () => _stringbool, + _stringFormat: () => _stringFormat, + _string: () => _string, + _startsWith: () => _startsWith, + _slugify: () => _slugify, + _size: () => _size, + _set: () => _set, + _safeParseAsync: () => _safeParseAsync, + _safeParse: () => _safeParse, + _safeEncodeAsync: () => _safeEncodeAsync, + _safeEncode: () => _safeEncode, + _safeDecodeAsync: () => _safeDecodeAsync, + _safeDecode: () => _safeDecode, + _regex: () => _regex, + _refine: () => _refine, + _record: () => _record, + _readonly: () => _readonly, + _property: () => _property, + _promise: () => _promise, + _positive: () => _positive, + _pipe: () => _pipe, + _parseAsync: () => _parseAsync, + _parse: () => _parse, + _overwrite: () => _overwrite, + _optional: () => _optional, + _number: () => _number, + _nullable: () => _nullable, + _null: () => _null2, + _normalize: () => _normalize, + _nonpositive: () => _nonpositive, + _nonoptional: () => _nonoptional, + _nonnegative: () => _nonnegative, + _never: () => _never, + _negative: () => _negative, + _nativeEnum: () => _nativeEnum, + _nanoid: () => _nanoid, + _nan: () => _nan, + _multipleOf: () => _multipleOf, + _minSize: () => _minSize, + _minLength: () => _minLength, + _min: () => _gte, + _mime: () => _mime, + _maxSize: () => _maxSize, + _maxLength: () => _maxLength, + _max: () => _lte, + _map: () => _map, + _mac: () => _mac, + _lte: () => _lte, + _lt: () => _lt, + _lowercase: () => _lowercase, + _literal: () => _literal, + _length: () => _length, + _lazy: () => _lazy, + _ksuid: () => _ksuid, + _jwt: () => _jwt, + _isoTime: () => _isoTime, + _isoDuration: () => _isoDuration, + _isoDateTime: () => _isoDateTime, + _isoDate: () => _isoDate, + _ipv6: () => _ipv6, + _ipv4: () => _ipv4, + _intersection: () => _intersection, + _int64: () => _int64, + _int32: () => _int32, + _int: () => _int, + _includes: () => _includes, + _guid: () => _guid, + _gte: () => _gte, + _gt: () => _gt, + _float64: () => _float64, + _float32: () => _float32, + _file: () => _file, + _enum: () => _enum, + _endsWith: () => _endsWith, + _encodeAsync: () => _encodeAsync, + _encode: () => _encode, + _emoji: () => _emoji2, + _email: () => _email, + _e164: () => _e164, + _discriminatedUnion: () => _discriminatedUnion, + _default: () => _default, + _decodeAsync: () => _decodeAsync, + _decode: () => _decode, + _date: () => _date, + _custom: () => _custom, + _cuid2: () => _cuid2, + _cuid: () => _cuid, + _coercedString: () => _coercedString, + _coercedNumber: () => _coercedNumber, + _coercedDate: () => _coercedDate, + _coercedBoolean: () => _coercedBoolean, + _coercedBigint: () => _coercedBigint, + _cidrv6: () => _cidrv6, + _cidrv4: () => _cidrv4, + _check: () => _check, + _catch: () => _catch, + _boolean: () => _boolean, + _bigint: () => _bigint, + _base64url: () => _base64url, + _base64: () => _base64, + _array: () => _array, + _any: () => _any, + TimePrecision: () => TimePrecision, + NEVER: () => NEVER, + JSONSchemaGenerator: () => JSONSchemaGenerator, + JSONSchema: () => exports_json_schema, + Doc: () => Doc, + $output: () => $output, + $input: () => $input, + $constructor: () => $constructor, + $brand: () => $brand, + $ZodXor: () => $ZodXor, + $ZodXID: () => $ZodXID, + $ZodVoid: () => $ZodVoid, + $ZodUnknown: () => $ZodUnknown, + $ZodUnion: () => $ZodUnion, + $ZodUndefined: () => $ZodUndefined, + $ZodUUID: () => $ZodUUID, + $ZodURL: () => $ZodURL, + $ZodULID: () => $ZodULID, + $ZodType: () => $ZodType, + $ZodTuple: () => $ZodTuple, + $ZodTransform: () => $ZodTransform, + $ZodTemplateLiteral: () => $ZodTemplateLiteral, + $ZodSymbol: () => $ZodSymbol, + $ZodSuccess: () => $ZodSuccess, + $ZodStringFormat: () => $ZodStringFormat, + $ZodString: () => $ZodString, + $ZodSet: () => $ZodSet, + $ZodRegistry: () => $ZodRegistry, + $ZodRecord: () => $ZodRecord, + $ZodRealError: () => $ZodRealError, + $ZodReadonly: () => $ZodReadonly, + $ZodPromise: () => $ZodPromise, + $ZodPreprocess: () => $ZodPreprocess, + $ZodPrefault: () => $ZodPrefault, + $ZodPipe: () => $ZodPipe, + $ZodOptional: () => $ZodOptional, + $ZodObjectJIT: () => $ZodObjectJIT, + $ZodObject: () => $ZodObject, + $ZodNumberFormat: () => $ZodNumberFormat, + $ZodNumber: () => $ZodNumber, + $ZodNullable: () => $ZodNullable, + $ZodNull: () => $ZodNull, + $ZodNonOptional: () => $ZodNonOptional, + $ZodNever: () => $ZodNever, + $ZodNanoID: () => $ZodNanoID, + $ZodNaN: () => $ZodNaN, + $ZodMap: () => $ZodMap, + $ZodMAC: () => $ZodMAC, + $ZodLiteral: () => $ZodLiteral, + $ZodLazy: () => $ZodLazy, + $ZodKSUID: () => $ZodKSUID, + $ZodJWT: () => $ZodJWT, + $ZodIntersection: () => $ZodIntersection, + $ZodISOTime: () => $ZodISOTime, + $ZodISODuration: () => $ZodISODuration, + $ZodISODateTime: () => $ZodISODateTime, + $ZodISODate: () => $ZodISODate, + $ZodIPv6: () => $ZodIPv6, + $ZodIPv4: () => $ZodIPv4, + $ZodGUID: () => $ZodGUID, + $ZodFunction: () => $ZodFunction, + $ZodFile: () => $ZodFile, + $ZodExactOptional: () => $ZodExactOptional, + $ZodError: () => $ZodError, + $ZodEnum: () => $ZodEnum, + $ZodEncodeError: () => $ZodEncodeError, + $ZodEmoji: () => $ZodEmoji, + $ZodEmail: () => $ZodEmail, + $ZodE164: () => $ZodE164, + $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion, + $ZodDefault: () => $ZodDefault, + $ZodDate: () => $ZodDate, + $ZodCustomStringFormat: () => $ZodCustomStringFormat, + $ZodCustom: () => $ZodCustom, + $ZodCodec: () => $ZodCodec, + $ZodCheckUpperCase: () => $ZodCheckUpperCase, + $ZodCheckStringFormat: () => $ZodCheckStringFormat, + $ZodCheckStartsWith: () => $ZodCheckStartsWith, + $ZodCheckSizeEquals: () => $ZodCheckSizeEquals, + $ZodCheckRegex: () => $ZodCheckRegex, + $ZodCheckProperty: () => $ZodCheckProperty, + $ZodCheckOverwrite: () => $ZodCheckOverwrite, + $ZodCheckNumberFormat: () => $ZodCheckNumberFormat, + $ZodCheckMultipleOf: () => $ZodCheckMultipleOf, + $ZodCheckMinSize: () => $ZodCheckMinSize, + $ZodCheckMinLength: () => $ZodCheckMinLength, + $ZodCheckMimeType: () => $ZodCheckMimeType, + $ZodCheckMaxSize: () => $ZodCheckMaxSize, + $ZodCheckMaxLength: () => $ZodCheckMaxLength, + $ZodCheckLowerCase: () => $ZodCheckLowerCase, + $ZodCheckLessThan: () => $ZodCheckLessThan, + $ZodCheckLengthEquals: () => $ZodCheckLengthEquals, + $ZodCheckIncludes: () => $ZodCheckIncludes, + $ZodCheckGreaterThan: () => $ZodCheckGreaterThan, + $ZodCheckEndsWith: () => $ZodCheckEndsWith, + $ZodCheckBigIntFormat: () => $ZodCheckBigIntFormat, + $ZodCheck: () => $ZodCheck, + $ZodCatch: () => $ZodCatch, + $ZodCUID2: () => $ZodCUID2, + $ZodCUID: () => $ZodCUID, + $ZodCIDRv6: () => $ZodCIDRv6, + $ZodCIDRv4: () => $ZodCIDRv4, + $ZodBoolean: () => $ZodBoolean, + $ZodBigIntFormat: () => $ZodBigIntFormat, + $ZodBigInt: () => $ZodBigInt, + $ZodBase64URL: () => $ZodBase64URL, + $ZodBase64: () => $ZodBase64, + $ZodAsyncError: () => $ZodAsyncError, + $ZodArray: () => $ZodArray, + $ZodAny: () => $ZodAny +}); + +// node_modules/zod/v4/core/core.js +var _a; +var NEVER = /* @__PURE__ */ Object.freeze({ + status: "aborted" +}); +function $constructor(name, initializer, params) { + function init(inst, def) { + if (!inst._zod) { + Object.defineProperty(inst, "_zod", { + value: { + def, + constr: _, + traits: new Set + }, + enumerable: false + }); + } + if (inst._zod.traits.has(name)) { + return; + } + inst._zod.traits.add(name); + initializer(inst, def); + const proto = _.prototype; + const keys = Object.keys(proto); + for (let i = 0;i < keys.length; i++) { + const k = keys[i]; + if (!(k in inst)) { + inst[k] = proto[k].bind(inst); + } + } + } + const Parent = params?.Parent ?? Object; + + class Definition extends Parent { + } + Object.defineProperty(Definition, "name", { value: name }); + function _(def) { + var _a2; + const inst = params?.Parent ? new Definition : this; + init(inst, def); + (_a2 = inst._zod).deferred ?? (_a2.deferred = []); + for (const fn of inst._zod.deferred) { + fn(); + } + return inst; + } + Object.defineProperty(_, "init", { value: init }); + Object.defineProperty(_, Symbol.hasInstance, { + value: (inst) => { + if (params?.Parent && inst instanceof params.Parent) + return true; + return inst?._zod?.traits?.has(name); + } + }); + Object.defineProperty(_, "name", { value: name }); + return _; +} +var $brand = Symbol("zod_brand"); + +class $ZodAsyncError extends Error { + constructor() { + super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); + } +} + +class $ZodEncodeError extends Error { + constructor(name) { + super(`Encountered unidirectional transform during encode: ${name}`); + this.name = "ZodEncodeError"; + } +} +(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {}); +var globalConfig = globalThis.__zod_globalConfig; +function config(newConfig) { + if (newConfig) + Object.assign(globalConfig, newConfig); + return globalConfig; +} +// node_modules/zod/v4/core/util.js +var exports_util = {}; +__export(exports_util, { + unwrapMessage: () => unwrapMessage, + uint8ArrayToHex: () => uint8ArrayToHex, + uint8ArrayToBase64url: () => uint8ArrayToBase64url, + uint8ArrayToBase64: () => uint8ArrayToBase64, + stringifyPrimitive: () => stringifyPrimitive, + slugify: () => slugify, + shallowClone: () => shallowClone, + safeExtend: () => safeExtend, + required: () => required, + randomString: () => randomString, + propertyKeyTypes: () => propertyKeyTypes, + promiseAllObject: () => promiseAllObject, + primitiveTypes: () => primitiveTypes, + prefixIssues: () => prefixIssues, + pick: () => pick, + partial: () => partial, + parsedType: () => parsedType, + optionalKeys: () => optionalKeys, + omit: () => omit, + objectClone: () => objectClone, + numKeys: () => numKeys, + nullish: () => nullish, + normalizeParams: () => normalizeParams, + mergeDefs: () => mergeDefs, + merge: () => merge, + jsonStringifyReplacer: () => jsonStringifyReplacer, + joinValues: () => joinValues, + issue: () => issue, + isPlainObject: () => isPlainObject, + isObject: () => isObject, + hexToUint8Array: () => hexToUint8Array, + getSizableOrigin: () => getSizableOrigin, + getParsedType: () => getParsedType, + getLengthableOrigin: () => getLengthableOrigin, + getEnumValues: () => getEnumValues, + getElementAtPath: () => getElementAtPath, + floatSafeRemainder: () => floatSafeRemainder, + finalizeIssue: () => finalizeIssue, + extend: () => extend, + explicitlyAborted: () => explicitlyAborted, + escapeRegex: () => escapeRegex, + esc: () => esc, + defineLazy: () => defineLazy, + createTransparentProxy: () => createTransparentProxy, + cloneDef: () => cloneDef, + clone: () => clone, + cleanRegex: () => cleanRegex, + cleanEnum: () => cleanEnum, + captureStackTrace: () => captureStackTrace, + cached: () => cached, + base64urlToUint8Array: () => base64urlToUint8Array, + base64ToUint8Array: () => base64ToUint8Array, + assignProp: () => assignProp, + assertNotEqual: () => assertNotEqual, + assertNever: () => assertNever, + assertIs: () => assertIs, + assertEqual: () => assertEqual, + assert: () => assert, + allowsEval: () => allowsEval, + aborted: () => aborted, + NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES, + Class: () => Class, + BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES +}); +function assertEqual(val) { + return val; +} +function assertNotEqual(val) { + return val; +} +function assertIs(_arg) {} +function assertNever(_x) { + throw new Error("Unexpected value in exhaustive check"); +} +function assert(_) {} +function getEnumValues(entries) { + const numericValues = Object.values(entries).filter((v) => typeof v === "number"); + const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); + return values; +} +function joinValues(array, separator = "|") { + return array.map((val) => stringifyPrimitive(val)).join(separator); +} +function jsonStringifyReplacer(_, value) { + if (typeof value === "bigint") + return value.toString(); + return value; +} +function cached(getter) { + const set = false; + return { + get value() { + if (!set) { + const value = getter(); + Object.defineProperty(this, "value", { value }); + return value; + } + throw new Error("cached value already set"); + } + }; +} +function nullish(input) { + return input === null || input === undefined; +} +function cleanRegex(source) { + const start = source.startsWith("^") ? 1 : 0; + const end = source.endsWith("$") ? source.length - 1 : source.length; + return source.slice(start, end); +} +function floatSafeRemainder(val, step) { + const ratio = val / step; + const roundedRatio = Math.round(ratio); + const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1); + if (Math.abs(ratio - roundedRatio) < tolerance) + return 0; + return ratio - roundedRatio; +} +var EVALUATING = /* @__PURE__ */ Symbol("evaluating"); +function defineLazy(object, key, getter) { + let value = undefined; + Object.defineProperty(object, key, { + get() { + if (value === EVALUATING) { + return; + } + if (value === undefined) { + value = EVALUATING; + value = getter(); + } + return value; + }, + set(v) { + Object.defineProperty(object, key, { + value: v + }); + }, + configurable: true + }); +} +function objectClone(obj) { + return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj)); +} +function assignProp(target, prop, value) { + Object.defineProperty(target, prop, { + value, + writable: true, + enumerable: true, + configurable: true + }); +} +function mergeDefs(...defs) { + const mergedDescriptors = {}; + for (const def of defs) { + const descriptors = Object.getOwnPropertyDescriptors(def); + Object.assign(mergedDescriptors, descriptors); + } + return Object.defineProperties({}, mergedDescriptors); +} +function cloneDef(schema) { + return mergeDefs(schema._zod.def); +} +function getElementAtPath(obj, path) { + if (!path) + return obj; + return path.reduce((acc, key) => acc?.[key], obj); +} +function promiseAllObject(promisesObj) { + const keys = Object.keys(promisesObj); + const promises = keys.map((key) => promisesObj[key]); + return Promise.all(promises).then((results) => { + const resolvedObj = {}; + for (let i = 0;i < keys.length; i++) { + resolvedObj[keys[i]] = results[i]; + } + return resolvedObj; + }); +} +function randomString(length = 10) { + const chars = "abcdefghijklmnopqrstuvwxyz"; + let str = ""; + for (let i = 0;i < length; i++) { + str += chars[Math.floor(Math.random() * chars.length)]; + } + return str; +} +function esc(str) { + return JSON.stringify(str); +} +function slugify(input) { + return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, ""); +} +var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {}; +function isObject(data) { + return typeof data === "object" && data !== null && !Array.isArray(data); +} +var allowsEval = /* @__PURE__ */ cached(() => { + if (globalConfig.jitless) { + return false; + } + if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { + return false; + } + try { + const F = Function; + new F(""); + return true; + } catch (_) { + return false; + } +}); +function isPlainObject(o) { + if (isObject(o) === false) + return false; + const ctor = o.constructor; + if (ctor === undefined) + return true; + if (typeof ctor !== "function") + return true; + const prot = ctor.prototype; + if (isObject(prot) === false) + return false; + if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { + return false; + } + return true; +} +function shallowClone(o) { + if (isPlainObject(o)) + return { ...o }; + if (Array.isArray(o)) + return [...o]; + if (o instanceof Map) + return new Map(o); + if (o instanceof Set) + return new Set(o); + return o; +} +function numKeys(data) { + let keyCount = 0; + for (const key in data) { + if (Object.prototype.hasOwnProperty.call(data, key)) { + keyCount++; + } + } + return keyCount; +} +var getParsedType = (data) => { + const t = typeof data; + switch (t) { + case "undefined": + return "undefined"; + case "string": + return "string"; + case "number": + return Number.isNaN(data) ? "nan" : "number"; + case "boolean": + return "boolean"; + case "function": + return "function"; + case "bigint": + return "bigint"; + case "symbol": + return "symbol"; + case "object": + if (Array.isArray(data)) { + return "array"; + } + if (data === null) { + return "null"; + } + if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { + return "promise"; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return "map"; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return "set"; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return "date"; + } + if (typeof File !== "undefined" && data instanceof File) { + return "file"; + } + return "object"; + default: + throw new Error(`Unknown data type: ${t}`); + } +}; +var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]); +var primitiveTypes = /* @__PURE__ */ new Set([ + "string", + "number", + "bigint", + "boolean", + "symbol", + "undefined" +]); +function escapeRegex(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +} +function clone(inst, def, params) { + const cl = new inst._zod.constr(def ?? inst._zod.def); + if (!def || params?.parent) + cl._zod.parent = inst; + return cl; +} +function normalizeParams(_params) { + const params = _params; + if (!params) + return {}; + if (typeof params === "string") + return { error: () => params }; + if (params?.message !== undefined) { + if (params?.error !== undefined) + throw new Error("Cannot specify both `message` and `error` params"); + params.error = params.message; + } + delete params.message; + if (typeof params.error === "string") + return { ...params, error: () => params.error }; + return params; +} +function createTransparentProxy(getter) { + let target; + return new Proxy({}, { + get(_, prop, receiver) { + target ?? (target = getter()); + return Reflect.get(target, prop, receiver); + }, + set(_, prop, value, receiver) { + target ?? (target = getter()); + return Reflect.set(target, prop, value, receiver); + }, + has(_, prop) { + target ?? (target = getter()); + return Reflect.has(target, prop); + }, + deleteProperty(_, prop) { + target ?? (target = getter()); + return Reflect.deleteProperty(target, prop); + }, + ownKeys(_) { + target ?? (target = getter()); + return Reflect.ownKeys(target); + }, + getOwnPropertyDescriptor(_, prop) { + target ?? (target = getter()); + return Reflect.getOwnPropertyDescriptor(target, prop); + }, + defineProperty(_, prop, descriptor) { + target ?? (target = getter()); + return Reflect.defineProperty(target, prop, descriptor); + } + }); +} +function stringifyPrimitive(value) { + if (typeof value === "bigint") + return value.toString() + "n"; + if (typeof value === "string") + return `"${value}"`; + return `${value}`; +} +function optionalKeys(shape) { + return Object.keys(shape).filter((k) => { + return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; + }); +} +var NUMBER_FORMAT_RANGES = { + safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], + int32: [-2147483648, 2147483647], + uint32: [0, 4294967295], + float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000], + float64: [-Number.MAX_VALUE, Number.MAX_VALUE] +}; +var BIGINT_FORMAT_RANGES = { + int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")], + uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")] +}; +function pick(schema, mask) { + const currDef = schema._zod.def; + const checks = currDef.checks; + const hasChecks = checks && checks.length > 0; + if (hasChecks) { + throw new Error(".pick() cannot be used on object schemas containing refinements"); + } + const def = mergeDefs(schema._zod.def, { + get shape() { + const newShape = {}; + for (const key in mask) { + if (!(key in currDef.shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + newShape[key] = currDef.shape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + }); + return clone(schema, def); +} +function omit(schema, mask) { + const currDef = schema._zod.def; + const checks = currDef.checks; + const hasChecks = checks && checks.length > 0; + if (hasChecks) { + throw new Error(".omit() cannot be used on object schemas containing refinements"); + } + const def = mergeDefs(schema._zod.def, { + get shape() { + const newShape = { ...schema._zod.def.shape }; + for (const key in mask) { + if (!(key in currDef.shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + delete newShape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + }); + return clone(schema, def); +} +function extend(schema, shape) { + if (!isPlainObject(shape)) { + throw new Error("Invalid input to extend: expected a plain object"); + } + const checks = schema._zod.def.checks; + const hasChecks = checks && checks.length > 0; + if (hasChecks) { + const existingShape = schema._zod.def.shape; + for (const key in shape) { + if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) { + throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); + } + } + } + const def = mergeDefs(schema._zod.def, { + get shape() { + const _shape = { ...schema._zod.def.shape, ...shape }; + assignProp(this, "shape", _shape); + return _shape; + } + }); + return clone(schema, def); +} +function safeExtend(schema, shape) { + if (!isPlainObject(shape)) { + throw new Error("Invalid input to safeExtend: expected a plain object"); + } + const def = mergeDefs(schema._zod.def, { + get shape() { + const _shape = { ...schema._zod.def.shape, ...shape }; + assignProp(this, "shape", _shape); + return _shape; + } + }); + return clone(schema, def); +} +function merge(a, b) { + if (a._zod.def.checks?.length) { + throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead."); + } + const def = mergeDefs(a._zod.def, { + get shape() { + const _shape = { ...a._zod.def.shape, ...b._zod.def.shape }; + assignProp(this, "shape", _shape); + return _shape; + }, + get catchall() { + return b._zod.def.catchall; + }, + checks: b._zod.def.checks ?? [] + }); + return clone(a, def); +} +function partial(Class, schema, mask) { + const currDef = schema._zod.def; + const checks = currDef.checks; + const hasChecks = checks && checks.length > 0; + if (hasChecks) { + throw new Error(".partial() cannot be used on object schemas containing refinements"); + } + const def = mergeDefs(schema._zod.def, { + get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) { + for (const key in mask) { + if (!(key in oldShape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + shape[key] = Class ? new Class({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + } + } else { + for (const key in oldShape) { + shape[key] = Class ? new Class({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + } + } + assignProp(this, "shape", shape); + return shape; + }, + checks: [] + }); + return clone(schema, def); +} +function required(Class, schema, mask) { + const def = mergeDefs(schema._zod.def, { + get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) { + for (const key in mask) { + if (!(key in shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + shape[key] = new Class({ + type: "nonoptional", + innerType: oldShape[key] + }); + } + } else { + for (const key in oldShape) { + shape[key] = new Class({ + type: "nonoptional", + innerType: oldShape[key] + }); + } + } + assignProp(this, "shape", shape); + return shape; + } + }); + return clone(schema, def); +} +function aborted(x, startIndex = 0) { + if (x.aborted === true) + return true; + for (let i = startIndex;i < x.issues.length; i++) { + if (x.issues[i]?.continue !== true) { + return true; + } + } + return false; +} +function explicitlyAborted(x, startIndex = 0) { + if (x.aborted === true) + return true; + for (let i = startIndex;i < x.issues.length; i++) { + if (x.issues[i]?.continue === false) { + return true; + } + } + return false; +} +function prefixIssues(path, issues) { + return issues.map((iss) => { + var _a2; + (_a2 = iss).path ?? (_a2.path = []); + iss.path.unshift(path); + return iss; + }); +} +function unwrapMessage(message) { + return typeof message === "string" ? message : message?.message; +} +function finalizeIssue(iss, ctx, config2) { + const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input"; + const { inst: _inst, continue: _continue, input: _input, ...rest } = iss; + rest.path ?? (rest.path = []); + rest.message = message; + if (ctx?.reportInput) { + rest.input = _input; + } + return rest; +} +function getSizableOrigin(input) { + if (input instanceof Set) + return "set"; + if (input instanceof Map) + return "map"; + if (input instanceof File) + return "file"; + return "unknown"; +} +function getLengthableOrigin(input) { + if (Array.isArray(input)) + return "array"; + if (typeof input === "string") + return "string"; + return "unknown"; +} +function parsedType(data) { + const t = typeof data; + switch (t) { + case "number": { + return Number.isNaN(data) ? "nan" : "number"; + } + case "object": { + if (data === null) { + return "null"; + } + if (Array.isArray(data)) { + return "array"; + } + const obj = data; + if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) { + return obj.constructor.name; + } + } + } + return t; +} +function issue(...args) { + const [iss, input, inst] = args; + if (typeof iss === "string") { + return { + message: iss, + code: "custom", + input, + inst + }; + } + return { ...iss }; +} +function cleanEnum(obj) { + return Object.entries(obj).filter(([k, _]) => { + return Number.isNaN(Number.parseInt(k, 10)); + }).map((el) => el[1]); +} +function base64ToUint8Array(base64) { + const binaryString = atob(base64); + const bytes = new Uint8Array(binaryString.length); + for (let i = 0;i < binaryString.length; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + return bytes; +} +function uint8ArrayToBase64(bytes) { + let binaryString = ""; + for (let i = 0;i < bytes.length; i++) { + binaryString += String.fromCharCode(bytes[i]); + } + return btoa(binaryString); +} +function base64urlToUint8Array(base64url) { + const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/"); + const padding = "=".repeat((4 - base64.length % 4) % 4); + return base64ToUint8Array(base64 + padding); +} +function uint8ArrayToBase64url(bytes) { + return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); +} +function hexToUint8Array(hex) { + const cleanHex = hex.replace(/^0x/, ""); + if (cleanHex.length % 2 !== 0) { + throw new Error("Invalid hex string length"); + } + const bytes = new Uint8Array(cleanHex.length / 2); + for (let i = 0;i < cleanHex.length; i += 2) { + bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16); + } + return bytes; +} +function uint8ArrayToHex(bytes) { + return Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join(""); +} + +class Class { + constructor(..._args) {} +} + +// node_modules/zod/v4/core/errors.js +var initializer = (inst, def) => { + inst.name = "$ZodError"; + Object.defineProperty(inst, "_zod", { + value: inst._zod, + enumerable: false + }); + Object.defineProperty(inst, "issues", { + value: def, + enumerable: false + }); + inst.message = JSON.stringify(def, jsonStringifyReplacer, 2); + Object.defineProperty(inst, "toString", { + value: () => inst.message, + enumerable: false + }); +}; +var $ZodError = $constructor("$ZodError", initializer); +var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error }); +function flattenError(error, mapper = (issue2) => issue2.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of error.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } else { + formErrors.push(mapper(sub)); + } + } + return { formErrors, fieldErrors }; +} +function formatError(error, mapper = (issue2) => issue2.message) { + const fieldErrors = { _errors: [] }; + const processError = (error2, path = []) => { + for (const issue2 of error2.issues) { + if (issue2.code === "invalid_union" && issue2.errors.length) { + issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path])); + } else if (issue2.code === "invalid_key") { + processError({ issues: issue2.issues }, [...path, ...issue2.path]); + } else if (issue2.code === "invalid_element") { + processError({ issues: issue2.issues }, [...path, ...issue2.path]); + } else { + const fullpath = [...path, ...issue2.path]; + if (fullpath.length === 0) { + fieldErrors._errors.push(mapper(issue2)); + } else { + let curr = fieldErrors; + let i = 0; + while (i < fullpath.length) { + const el = fullpath[i]; + const terminal = i === fullpath.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + } else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue2)); + } + curr = curr[el]; + i++; + } + } + } + } + }; + processError(error); + return fieldErrors; +} +function treeifyError(error, mapper = (issue2) => issue2.message) { + const result = { errors: [] }; + const processError = (error2, path = []) => { + var _a2, _b; + for (const issue2 of error2.issues) { + if (issue2.code === "invalid_union" && issue2.errors.length) { + issue2.errors.map((issues) => processError({ issues }, [...path, ...issue2.path])); + } else if (issue2.code === "invalid_key") { + processError({ issues: issue2.issues }, [...path, ...issue2.path]); + } else if (issue2.code === "invalid_element") { + processError({ issues: issue2.issues }, [...path, ...issue2.path]); + } else { + const fullpath = [...path, ...issue2.path]; + if (fullpath.length === 0) { + result.errors.push(mapper(issue2)); + continue; + } + let curr = result; + let i = 0; + while (i < fullpath.length) { + const el = fullpath[i]; + const terminal = i === fullpath.length - 1; + if (typeof el === "string") { + curr.properties ?? (curr.properties = {}); + (_a2 = curr.properties)[el] ?? (_a2[el] = { errors: [] }); + curr = curr.properties[el]; + } else { + curr.items ?? (curr.items = []); + (_b = curr.items)[el] ?? (_b[el] = { errors: [] }); + curr = curr.items[el]; + } + if (terminal) { + curr.errors.push(mapper(issue2)); + } + i++; + } + } + } + }; + processError(error); + return result; +} +function toDotPath(_path) { + const segs = []; + const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg); + for (const seg of path) { + if (typeof seg === "number") + segs.push(`[${seg}]`); + else if (typeof seg === "symbol") + segs.push(`[${JSON.stringify(String(seg))}]`); + else if (/[^\w$]/.test(seg)) + segs.push(`[${JSON.stringify(seg)}]`); + else { + if (segs.length) + segs.push("."); + segs.push(seg); + } + } + return segs.join(""); +} +function prettifyError(error) { + const lines = []; + const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length); + for (const issue2 of issues) { + lines.push(`✖ ${issue2.message}`); + if (issue2.path?.length) + lines.push(` → at ${toDotPath(issue2.path)}`); + } + return lines.join(` +`); +} + +// node_modules/zod/v4/core/parse.js +var _parse = (_Err) => (schema, value, _ctx, _params) => { + const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; + const result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) { + throw new $ZodAsyncError; + } + if (result.issues.length) { + const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, _params?.callee); + throw e; + } + return result.value; +}; +var parse = /* @__PURE__ */ _parse($ZodRealError); +var _parseAsync = (_Err) => async (schema, value, _ctx, params) => { + const ctx = _ctx ? { ..._ctx, async: true } : { async: true }; + let result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) + result = await result; + if (result.issues.length) { + const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, params?.callee); + throw e; + } + return result.value; +}; +var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError); +var _safeParse = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; + const result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) { + throw new $ZodAsyncError; + } + return result.issues.length ? { + success: false, + error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { success: true, data: result.value }; +}; +var safeParse = /* @__PURE__ */ _safeParse($ZodRealError); +var _safeParseAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, async: true } : { async: true }; + let result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) + result = await result; + return result.issues.length ? { + success: false, + error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { success: true, data: result.value }; +}; +var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError); +var _encode = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" }; + return _parse(_Err)(schema, value, ctx); +}; +var encode = /* @__PURE__ */ _encode($ZodRealError); +var _decode = (_Err) => (schema, value, _ctx) => { + return _parse(_Err)(schema, value, _ctx); +}; +var decode = /* @__PURE__ */ _decode($ZodRealError); +var _encodeAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" }; + return _parseAsync(_Err)(schema, value, ctx); +}; +var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError); +var _decodeAsync = (_Err) => async (schema, value, _ctx) => { + return _parseAsync(_Err)(schema, value, _ctx); +}; +var decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError); +var _safeEncode = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" }; + return _safeParse(_Err)(schema, value, ctx); +}; +var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError); +var _safeDecode = (_Err) => (schema, value, _ctx) => { + return _safeParse(_Err)(schema, value, _ctx); +}; +var safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError); +var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" }; + return _safeParseAsync(_Err)(schema, value, ctx); +}; +var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError); +var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => { + return _safeParseAsync(_Err)(schema, value, _ctx); +}; +var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError); +// node_modules/zod/v4/core/regexes.js +var exports_regexes = {}; +__export(exports_regexes, { + xid: () => xid, + uuid7: () => uuid7, + uuid6: () => uuid6, + uuid4: () => uuid4, + uuid: () => uuid, + uppercase: () => uppercase, + unicodeEmail: () => unicodeEmail, + undefined: () => _undefined, + ulid: () => ulid, + time: () => time, + string: () => string, + sha512_hex: () => sha512_hex, + sha512_base64url: () => sha512_base64url, + sha512_base64: () => sha512_base64, + sha384_hex: () => sha384_hex, + sha384_base64url: () => sha384_base64url, + sha384_base64: () => sha384_base64, + sha256_hex: () => sha256_hex, + sha256_base64url: () => sha256_base64url, + sha256_base64: () => sha256_base64, + sha1_hex: () => sha1_hex, + sha1_base64url: () => sha1_base64url, + sha1_base64: () => sha1_base64, + rfc5322Email: () => rfc5322Email, + number: () => number, + null: () => _null, + nanoid: () => nanoid, + md5_hex: () => md5_hex, + md5_base64url: () => md5_base64url, + md5_base64: () => md5_base64, + mac: () => mac, + lowercase: () => lowercase, + ksuid: () => ksuid, + ipv6: () => ipv6, + ipv4: () => ipv4, + integer: () => integer, + idnEmail: () => idnEmail, + httpProtocol: () => httpProtocol, + html5Email: () => html5Email, + hostname: () => hostname, + hex: () => hex, + guid: () => guid, + extendedDuration: () => extendedDuration, + emoji: () => emoji, + email: () => email, + e164: () => e164, + duration: () => duration, + domain: () => domain, + datetime: () => datetime, + date: () => date, + cuid2: () => cuid2, + cuid: () => cuid, + cidrv6: () => cidrv6, + cidrv4: () => cidrv4, + browserEmail: () => browserEmail, + boolean: () => boolean, + bigint: () => bigint, + base64url: () => base64url, + base64: () => base64 +}); +var cuid = /^[cC][0-9a-z]{6,}$/; +var cuid2 = /^[0-9a-z]+$/; +var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; +var xid = /^[0-9a-vA-V]{20}$/; +var ksuid = /^[A-Za-z0-9]{27}$/; +var nanoid = /^[a-zA-Z0-9_-]{21}$/; +var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; +var extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/; +var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; +var uuid = (version) => { + if (!version) + return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; + return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); +}; +var uuid4 = /* @__PURE__ */ uuid(4); +var uuid6 = /* @__PURE__ */ uuid(6); +var uuid7 = /* @__PURE__ */ uuid(7); +var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; +var html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; +var rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; +var unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u; +var idnEmail = unicodeEmail; +var browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; +var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +function emoji() { + return new RegExp(_emoji, "u"); +} +var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; +var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; +var mac = (delimiter) => { + const escapedDelim = escapeRegex(delimiter ?? ":"); + return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`); +}; +var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; +var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; +var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; +var base64url = /^[A-Za-z0-9_-]*$/; +var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/; +var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/; +var httpProtocol = /^https?$/; +var e164 = /^\+[1-9]\d{6,14}$/; +var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; +var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`); +function timeSource(args) { + const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; + const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; + return regex; +} +function time(args) { + return new RegExp(`^${timeSource(args)}$`); +} +function datetime(args) { + const time2 = timeSource({ precision: args.precision }); + const opts = ["Z"]; + if (args.local) + opts.push(""); + if (args.offset) + opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); + const timeRegex = `${time2}(?:${opts.join("|")})`; + return new RegExp(`^${dateSource}T(?:${timeRegex})$`); +} +var string = (params) => { + const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; + return new RegExp(`^${regex}$`); +}; +var bigint = /^-?\d+n?$/; +var integer = /^-?\d+$/; +var number = /^-?\d+(?:\.\d+)?$/; +var boolean = /^(?:true|false)$/i; +var _null = /^null$/i; +var _undefined = /^undefined$/i; +var lowercase = /^[^A-Z]*$/; +var uppercase = /^[^a-z]*$/; +var hex = /^[0-9a-fA-F]*$/; +function fixedBase64(bodyLength, padding) { + return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`); +} +function fixedBase64url(length) { + return new RegExp(`^[A-Za-z0-9_-]{${length}}$`); +} +var md5_hex = /^[0-9a-fA-F]{32}$/; +var md5_base64 = /* @__PURE__ */ fixedBase64(22, "=="); +var md5_base64url = /* @__PURE__ */ fixedBase64url(22); +var sha1_hex = /^[0-9a-fA-F]{40}$/; +var sha1_base64 = /* @__PURE__ */ fixedBase64(27, "="); +var sha1_base64url = /* @__PURE__ */ fixedBase64url(27); +var sha256_hex = /^[0-9a-fA-F]{64}$/; +var sha256_base64 = /* @__PURE__ */ fixedBase64(43, "="); +var sha256_base64url = /* @__PURE__ */ fixedBase64url(43); +var sha384_hex = /^[0-9a-fA-F]{96}$/; +var sha384_base64 = /* @__PURE__ */ fixedBase64(64, ""); +var sha384_base64url = /* @__PURE__ */ fixedBase64url(64); +var sha512_hex = /^[0-9a-fA-F]{128}$/; +var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "=="); +var sha512_base64url = /* @__PURE__ */ fixedBase64url(86); + +// node_modules/zod/v4/core/checks.js +var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { + var _a2; + inst._zod ?? (inst._zod = {}); + inst._zod.def = def; + (_a2 = inst._zod).onattach ?? (_a2.onattach = []); +}); +var numericOriginMap = { + number: "number", + bigint: "bigint", + object: "date" +}; +var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => { + $ZodCheck.init(inst, def); + const origin = numericOriginMap[typeof def.value]; + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; + if (def.value < curr) { + if (def.inclusive) + bag.maximum = def.value; + else + bag.exclusiveMaximum = def.value; + } + }); + inst._zod.check = (payload) => { + if (def.inclusive ? payload.value <= def.value : payload.value < def.value) { + return; + } + payload.issues.push({ + origin, + code: "too_big", + maximum: typeof def.value === "object" ? def.value.getTime() : def.value, + input: payload.value, + inclusive: def.inclusive, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => { + $ZodCheck.init(inst, def); + const origin = numericOriginMap[typeof def.value]; + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; + if (def.value > curr) { + if (def.inclusive) + bag.minimum = def.value; + else + bag.exclusiveMinimum = def.value; + } + }); + inst._zod.check = (payload) => { + if (def.inclusive ? payload.value >= def.value : payload.value > def.value) { + return; + } + payload.issues.push({ + origin, + code: "too_small", + minimum: typeof def.value === "object" ? def.value.getTime() : def.value, + input: payload.value, + inclusive: def.inclusive, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => { + $ZodCheck.init(inst, def); + inst._zod.onattach.push((inst2) => { + var _a2; + (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value); + }); + inst._zod.check = (payload) => { + if (typeof payload.value !== typeof def.value) + throw new Error("Cannot mix number and bigint in multiple_of check."); + const isMultiple = typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0; + if (isMultiple) + return; + payload.issues.push({ + origin: typeof payload.value, + code: "not_multiple_of", + divisor: def.value, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => { + $ZodCheck.init(inst, def); + def.format = def.format || "float64"; + const isInt = def.format?.includes("int"); + const origin = isInt ? "int" : "number"; + const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format]; + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = def.format; + bag.minimum = minimum; + bag.maximum = maximum; + if (isInt) + bag.pattern = integer; + }); + inst._zod.check = (payload) => { + const input = payload.value; + if (isInt) { + if (!Number.isInteger(input)) { + payload.issues.push({ + expected: origin, + format: def.format, + code: "invalid_type", + continue: false, + input, + inst + }); + return; + } + if (!Number.isSafeInteger(input)) { + if (input > 0) { + payload.issues.push({ + input, + code: "too_big", + maximum: Number.MAX_SAFE_INTEGER, + note: "Integers must be within the safe integer range.", + inst, + origin, + inclusive: true, + continue: !def.abort + }); + } else { + payload.issues.push({ + input, + code: "too_small", + minimum: Number.MIN_SAFE_INTEGER, + note: "Integers must be within the safe integer range.", + inst, + origin, + inclusive: true, + continue: !def.abort + }); + } + return; + } + } + if (input < minimum) { + payload.issues.push({ + origin: "number", + input, + code: "too_small", + minimum, + inclusive: true, + inst, + continue: !def.abort + }); + } + if (input > maximum) { + payload.issues.push({ + origin: "number", + input, + code: "too_big", + maximum, + inclusive: true, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat", (inst, def) => { + $ZodCheck.init(inst, def); + const [minimum, maximum] = BIGINT_FORMAT_RANGES[def.format]; + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = def.format; + bag.minimum = minimum; + bag.maximum = maximum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + if (input < minimum) { + payload.issues.push({ + origin: "bigint", + input, + code: "too_small", + minimum, + inclusive: true, + inst, + continue: !def.abort + }); + } + if (input > maximum) { + payload.issues.push({ + origin: "bigint", + input, + code: "too_big", + maximum, + inclusive: true, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => { + var _a2; + $ZodCheck.init(inst, def); + (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.size !== undefined; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; + if (def.maximum < curr) + inst2._zod.bag.maximum = def.maximum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const size = input.size; + if (size <= def.maximum) + return; + payload.issues.push({ + origin: getSizableOrigin(input), + code: "too_big", + maximum: def.maximum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => { + var _a2; + $ZodCheck.init(inst, def); + (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.size !== undefined; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; + if (def.minimum > curr) + inst2._zod.bag.minimum = def.minimum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const size = input.size; + if (size >= def.minimum) + return; + payload.issues.push({ + origin: getSizableOrigin(input), + code: "too_small", + minimum: def.minimum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => { + var _a2; + $ZodCheck.init(inst, def); + (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.size !== undefined; + }); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.minimum = def.size; + bag.maximum = def.size; + bag.size = def.size; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const size = input.size; + if (size === def.size) + return; + const tooBig = size > def.size; + payload.issues.push({ + origin: getSizableOrigin(input), + ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size }, + inclusive: true, + exact: true, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { + var _a2; + $ZodCheck.init(inst, def); + (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== undefined; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; + if (def.maximum < curr) + inst2._zod.bag.maximum = def.maximum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length <= def.maximum) + return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_big", + maximum: def.maximum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => { + var _a2; + $ZodCheck.init(inst, def); + (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== undefined; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; + if (def.minimum > curr) + inst2._zod.bag.minimum = def.minimum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length >= def.minimum) + return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_small", + minimum: def.minimum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => { + var _a2; + $ZodCheck.init(inst, def); + (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== undefined; + }); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.minimum = def.length; + bag.maximum = def.length; + bag.length = def.length; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length === def.length) + return; + const origin = getLengthableOrigin(input); + const tooBig = length > def.length; + payload.issues.push({ + origin, + ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }, + inclusive: true, + exact: true, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => { + var _a2, _b; + $ZodCheck.init(inst, def); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = def.format; + if (def.pattern) { + bag.patterns ?? (bag.patterns = new Set); + bag.patterns.add(def.pattern); + } + }); + if (def.pattern) + (_a2 = inst._zod).check ?? (_a2.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: def.format, + input: payload.value, + ...def.pattern ? { pattern: def.pattern.toString() } : {}, + inst, + continue: !def.abort + }); + }); + else + (_b = inst._zod).check ?? (_b.check = () => {}); +}); +var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + inst._zod.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "regex", + input: payload.value, + pattern: def.pattern.toString(), + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => { + def.pattern ?? (def.pattern = lowercase); + $ZodCheckStringFormat.init(inst, def); +}); +var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => { + def.pattern ?? (def.pattern = uppercase); + $ZodCheckStringFormat.init(inst, def); +}); +var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => { + $ZodCheck.init(inst, def); + const escapedRegex = escapeRegex(def.includes); + const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); + def.pattern = pattern; + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = new Set); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.includes(def.includes, def.position)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "includes", + includes: def.includes, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = new Set); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.startsWith(def.prefix)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "starts_with", + prefix: def.prefix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = new Set); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.endsWith(def.suffix)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "ends_with", + suffix: def.suffix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +function handleCheckPropertyResult(result, payload, property) { + if (result.issues.length) { + payload.issues.push(...prefixIssues(property, result.issues)); + } +} +var $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst, def) => { + $ZodCheck.init(inst, def); + inst._zod.check = (payload) => { + const result = def.schema._zod.run({ + value: payload.value[def.property], + issues: [] + }, {}); + if (result instanceof Promise) { + return result.then((result2) => handleCheckPropertyResult(result2, payload, def.property)); + } + handleCheckPropertyResult(result, payload, def.property); + return; + }; +}); +var $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (inst, def) => { + $ZodCheck.init(inst, def); + const mimeSet = new Set(def.mime); + inst._zod.onattach.push((inst2) => { + inst2._zod.bag.mime = def.mime; + }); + inst._zod.check = (payload) => { + if (mimeSet.has(payload.value.type)) + return; + payload.issues.push({ + code: "invalid_value", + values: def.mime, + input: payload.value.type, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => { + $ZodCheck.init(inst, def); + inst._zod.check = (payload) => { + payload.value = def.tx(payload.value); + }; +}); + +// node_modules/zod/v4/core/doc.js +class Doc { + constructor(args = []) { + this.content = []; + this.indent = 0; + if (this) + this.args = args; + } + indented(fn) { + this.indent += 1; + fn(this); + this.indent -= 1; + } + write(arg) { + if (typeof arg === "function") { + arg(this, { execution: "sync" }); + arg(this, { execution: "async" }); + return; + } + const content = arg; + const lines = content.split(` +`).filter((x) => x); + const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length)); + const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x); + for (const line of dedented) { + this.content.push(line); + } + } + compile() { + const F = Function; + const args = this?.args; + const content = this?.content ?? [``]; + const lines = [...content.map((x) => ` ${x}`)]; + return new F(...args, lines.join(` +`)); + } +} + +// node_modules/zod/v4/core/versions.js +var version = { + major: 4, + minor: 4, + patch: 3 +}; + +// node_modules/zod/v4/core/schemas.js +var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { + var _a2; + inst ?? (inst = {}); + inst._zod.def = def; + inst._zod.bag = inst._zod.bag || {}; + inst._zod.version = version; + const checks = [...inst._zod.def.checks ?? []]; + if (inst._zod.traits.has("$ZodCheck")) { + checks.unshift(inst); + } + for (const ch of checks) { + for (const fn of ch._zod.onattach) { + fn(inst); + } + } + if (checks.length === 0) { + (_a2 = inst._zod).deferred ?? (_a2.deferred = []); + inst._zod.deferred?.push(() => { + inst._zod.run = inst._zod.parse; + }); + } else { + const runChecks = (payload, checks2, ctx) => { + let isAborted = aborted(payload); + let asyncResult; + for (const ch of checks2) { + if (ch._zod.def.when) { + if (explicitlyAborted(payload)) + continue; + const shouldRun = ch._zod.def.when(payload); + if (!shouldRun) + continue; + } else if (isAborted) { + continue; + } + const currLen = payload.issues.length; + const _ = ch._zod.check(payload); + if (_ instanceof Promise && ctx?.async === false) { + throw new $ZodAsyncError; + } + if (asyncResult || _ instanceof Promise) { + asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { + await _; + const nextLen = payload.issues.length; + if (nextLen === currLen) + return; + if (!isAborted) + isAborted = aborted(payload, currLen); + }); + } else { + const nextLen = payload.issues.length; + if (nextLen === currLen) + continue; + if (!isAborted) + isAborted = aborted(payload, currLen); + } + } + if (asyncResult) { + return asyncResult.then(() => { + return payload; + }); + } + return payload; + }; + const handleCanaryResult = (canary, payload, ctx) => { + if (aborted(canary)) { + canary.aborted = true; + return canary; + } + const checkResult = runChecks(payload, checks, ctx); + if (checkResult instanceof Promise) { + if (ctx.async === false) + throw new $ZodAsyncError; + return checkResult.then((checkResult2) => inst._zod.parse(checkResult2, ctx)); + } + return inst._zod.parse(checkResult, ctx); + }; + inst._zod.run = (payload, ctx) => { + if (ctx.skipChecks) { + return inst._zod.parse(payload, ctx); + } + if (ctx.direction === "backward") { + const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true }); + if (canary instanceof Promise) { + return canary.then((canary2) => { + return handleCanaryResult(canary2, payload, ctx); + }); + } + return handleCanaryResult(canary, payload, ctx); + } + const result = inst._zod.parse(payload, ctx); + if (result instanceof Promise) { + if (ctx.async === false) + throw new $ZodAsyncError; + return result.then((result2) => runChecks(result2, checks, ctx)); + } + return runChecks(result, checks, ctx); + }; + } + defineLazy(inst, "~standard", () => ({ + validate: (value) => { + try { + const r = safeParse(inst, value); + return r.success ? { value: r.data } : { issues: r.error?.issues }; + } catch (_) { + return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues }); + } + }, + vendor: "zod", + version: 1 + })); +}); +var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag); + inst._zod.parse = (payload, _) => { + if (def.coerce) + try { + payload.value = String(payload.value); + } catch (_2) {} + if (typeof payload.value === "string") + return payload; + payload.issues.push({ + expected: "string", + code: "invalid_type", + input: payload.value, + inst + }); + return payload; + }; +}); +var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + $ZodString.init(inst, def); +}); +var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => { + def.pattern ?? (def.pattern = guid); + $ZodStringFormat.init(inst, def); +}); +var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { + if (def.version) { + const versionMap = { + v1: 1, + v2: 2, + v3: 3, + v4: 4, + v5: 5, + v6: 6, + v7: 7, + v8: 8 + }; + const v = versionMap[def.version]; + if (v === undefined) + throw new Error(`Invalid UUID version: "${def.version}"`); + def.pattern ?? (def.pattern = uuid(v)); + } else + def.pattern ?? (def.pattern = uuid()); + $ZodStringFormat.init(inst, def); +}); +var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => { + def.pattern ?? (def.pattern = email); + $ZodStringFormat.init(inst, def); +}); +var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + try { + const trimmed = payload.value.trim(); + if (!def.normalize && def.protocol?.source === httpProtocol.source) { + if (!/^https?:\/\//i.test(trimmed)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid URL format", + input: payload.value, + inst, + continue: !def.abort + }); + return; + } + } + const url = new URL(trimmed); + if (def.hostname) { + def.hostname.lastIndex = 0; + if (!def.hostname.test(url.hostname)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid hostname", + pattern: def.hostname.source, + input: payload.value, + inst, + continue: !def.abort + }); + } + } + if (def.protocol) { + def.protocol.lastIndex = 0; + if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid protocol", + pattern: def.protocol.source, + input: payload.value, + inst, + continue: !def.abort + }); + } + } + if (def.normalize) { + payload.value = url.href; + } else { + payload.value = trimmed; + } + return; + } catch (_) { + payload.issues.push({ + code: "invalid_format", + format: "url", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => { + def.pattern ?? (def.pattern = emoji()); + $ZodStringFormat.init(inst, def); +}); +var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { + def.pattern ?? (def.pattern = nanoid); + $ZodStringFormat.init(inst, def); +}); +var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => { + def.pattern ?? (def.pattern = cuid); + $ZodStringFormat.init(inst, def); +}); +var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => { + def.pattern ?? (def.pattern = cuid2); + $ZodStringFormat.init(inst, def); +}); +var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => { + def.pattern ?? (def.pattern = ulid); + $ZodStringFormat.init(inst, def); +}); +var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => { + def.pattern ?? (def.pattern = xid); + $ZodStringFormat.init(inst, def); +}); +var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => { + def.pattern ?? (def.pattern = ksuid); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => { + def.pattern ?? (def.pattern = datetime(def)); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => { + def.pattern ?? (def.pattern = date); + $ZodStringFormat.init(inst, def); +}); +var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => { + def.pattern ?? (def.pattern = time(def)); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => { + def.pattern ?? (def.pattern = duration); + $ZodStringFormat.init(inst, def); +}); +var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => { + def.pattern ?? (def.pattern = ipv4); + $ZodStringFormat.init(inst, def); + inst._zod.bag.format = `ipv4`; +}); +var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { + def.pattern ?? (def.pattern = ipv6); + $ZodStringFormat.init(inst, def); + inst._zod.bag.format = `ipv6`; + inst._zod.check = (payload) => { + try { + new URL(`http://[${payload.value}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "ipv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodMAC = /* @__PURE__ */ $constructor("$ZodMAC", (inst, def) => { + def.pattern ?? (def.pattern = mac(def.delimiter)); + $ZodStringFormat.init(inst, def); + inst._zod.bag.format = `mac`; +}); +var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => { + def.pattern ?? (def.pattern = cidrv4); + $ZodStringFormat.init(inst, def); +}); +var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => { + def.pattern ?? (def.pattern = cidrv6); + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + const parts = payload.value.split("/"); + try { + if (parts.length !== 2) + throw new Error; + const [address, prefix] = parts; + if (!prefix) + throw new Error; + const prefixNum = Number(prefix); + if (`${prefixNum}` !== prefix) + throw new Error; + if (prefixNum < 0 || prefixNum > 128) + throw new Error; + new URL(`http://[${address}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "cidrv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +function isValidBase64(data) { + if (data === "") + return true; + if (/\s/.test(data)) + return false; + if (data.length % 4 !== 0) + return false; + try { + atob(data); + return true; + } catch { + return false; + } +} +var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { + def.pattern ?? (def.pattern = base64); + $ZodStringFormat.init(inst, def); + inst._zod.bag.contentEncoding = "base64"; + inst._zod.check = (payload) => { + if (isValidBase64(payload.value)) + return; + payload.issues.push({ + code: "invalid_format", + format: "base64", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +function isValidBase64URL(data) { + if (!base64url.test(data)) + return false; + const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); + const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "="); + return isValidBase64(padded); +} +var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => { + def.pattern ?? (def.pattern = base64url); + $ZodStringFormat.init(inst, def); + inst._zod.bag.contentEncoding = "base64url"; + inst._zod.check = (payload) => { + if (isValidBase64URL(payload.value)) + return; + payload.issues.push({ + code: "invalid_format", + format: "base64url", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => { + def.pattern ?? (def.pattern = e164); + $ZodStringFormat.init(inst, def); +}); +function isValidJWT(token, algorithm = null) { + try { + const tokensParts = token.split("."); + if (tokensParts.length !== 3) + return false; + const [header] = tokensParts; + if (!header) + return false; + const parsedHeader = JSON.parse(atob(header)); + if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") + return false; + if (!parsedHeader.alg) + return false; + if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) + return false; + return true; + } catch { + return false; + } +} +var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + if (isValidJWT(payload.value, def.alg)) + return; + payload.issues.push({ + code: "invalid_format", + format: "jwt", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + if (def.fn(payload.value)) + return; + payload.issues.push({ + code: "invalid_format", + format: def.format, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = inst._zod.bag.pattern ?? number; + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) + try { + payload.value = Number(payload.value); + } catch (_) {} + const input = payload.value; + if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) { + return payload; + } + const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : undefined : undefined; + payload.issues.push({ + expected: "number", + code: "invalid_type", + input, + inst, + ...received ? { received } : {} + }); + return payload; + }; +}); +var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => { + $ZodCheckNumberFormat.init(inst, def); + $ZodNumber.init(inst, def); +}); +var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = boolean; + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) + try { + payload.value = Boolean(payload.value); + } catch (_) {} + const input = payload.value; + if (typeof input === "boolean") + return payload; + payload.issues.push({ + expected: "boolean", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +var $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = bigint; + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) + try { + payload.value = BigInt(payload.value); + } catch (_) {} + if (typeof payload.value === "bigint") + return payload; + payload.issues.push({ + expected: "bigint", + code: "invalid_type", + input: payload.value, + inst + }); + return payload; + }; +}); +var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, def) => { + $ZodCheckBigIntFormat.init(inst, def); + $ZodBigInt.init(inst, def); +}); +var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (typeof input === "symbol") + return payload; + payload.issues.push({ + expected: "symbol", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = _undefined; + inst._zod.values = new Set([undefined]); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (typeof input === "undefined") + return payload; + payload.issues.push({ + expected: "undefined", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = _null; + inst._zod.values = new Set([null]); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (input === null) + return payload; + payload.issues.push({ + expected: "null", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +var $ZodAny = /* @__PURE__ */ $constructor("$ZodAny", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload) => payload; +}); +var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload) => payload; +}); +var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + payload.issues.push({ + expected: "never", + code: "invalid_type", + input: payload.value, + inst + }); + return payload; + }; +}); +var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (typeof input === "undefined") + return payload; + payload.issues.push({ + expected: "void", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) { + try { + payload.value = new Date(payload.value); + } catch (_err) {} + } + const input = payload.value; + const isDate = input instanceof Date; + const isValidDate = isDate && !Number.isNaN(input.getTime()); + if (isValidDate) + return payload; + payload.issues.push({ + expected: "date", + code: "invalid_type", + input, + ...isDate ? { received: "Invalid Date" } : {}, + inst + }); + return payload; + }; +}); +function handleArrayResult(result, final, index) { + if (result.issues.length) { + final.issues.push(...prefixIssues(index, result.issues)); + } + final.value[index] = result.value; +} +var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!Array.isArray(input)) { + payload.issues.push({ + expected: "array", + code: "invalid_type", + input, + inst + }); + return payload; + } + payload.value = Array(input.length); + const proms = []; + for (let i = 0;i < input.length; i++) { + const item = input[i]; + const result = def.element._zod.run({ + value: item, + issues: [] + }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => handleArrayResult(result2, payload, i))); + } else { + handleArrayResult(result, payload, i); + } + } + if (proms.length) { + return Promise.all(proms).then(() => payload); + } + return payload; + }; +}); +function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) { + const isPresent = key in input; + if (result.issues.length) { + if (isOptionalIn && isOptionalOut && !isPresent) { + return; + } + final.issues.push(...prefixIssues(key, result.issues)); + } + if (!isPresent && !isOptionalIn) { + if (!result.issues.length) { + final.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: undefined, + path: [key] + }); + } + return; + } + if (result.value === undefined) { + if (isPresent) { + final.value[key] = undefined; + } + } else { + final.value[key] = result.value; + } +} +function normalizeDef(def) { + const keys = Object.keys(def.shape); + for (const k of keys) { + if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) { + throw new Error(`Invalid element at key "${k}": expected a Zod schema`); + } + } + const okeys = optionalKeys(def.shape); + return { + ...def, + keys, + keySet: new Set(keys), + numKeys: keys.length, + optionalKeys: new Set(okeys) + }; +} +function handleCatchall(proms, input, payload, ctx, def, inst) { + const unrecognized = []; + const keySet = def.keySet; + const _catchall = def.catchall._zod; + const t = _catchall.def.type; + const isOptionalIn = _catchall.optin === "optional"; + const isOptionalOut = _catchall.optout === "optional"; + for (const key in input) { + if (key === "__proto__") + continue; + if (keySet.has(key)) + continue; + if (t === "never") { + unrecognized.push(key); + continue; + } + const r = _catchall.run({ value: input[key], issues: [] }, ctx); + if (r instanceof Promise) { + proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut))); + } else { + handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); + } + } + if (unrecognized.length) { + payload.issues.push({ + code: "unrecognized_keys", + keys: unrecognized, + input, + inst + }); + } + if (!proms.length) + return payload; + return Promise.all(proms).then(() => { + return payload; + }); +} +var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { + $ZodType.init(inst, def); + const desc = Object.getOwnPropertyDescriptor(def, "shape"); + if (!desc?.get) { + const sh = def.shape; + Object.defineProperty(def, "shape", { + get: () => { + const newSh = { ...sh }; + Object.defineProperty(def, "shape", { + value: newSh + }); + return newSh; + } + }); + } + const _normalized = cached(() => normalizeDef(def)); + defineLazy(inst._zod, "propValues", () => { + const shape = def.shape; + const propValues = {}; + for (const key in shape) { + const field = shape[key]._zod; + if (field.values) { + propValues[key] ?? (propValues[key] = new Set); + for (const v of field.values) + propValues[key].add(v); + } + } + return propValues; + }); + const isObject2 = isObject; + const catchall = def.catchall; + let value; + inst._zod.parse = (payload, ctx) => { + value ?? (value = _normalized.value); + const input = payload.value; + if (!isObject2(input)) { + payload.issues.push({ + expected: "object", + code: "invalid_type", + input, + inst + }); + return payload; + } + payload.value = {}; + const proms = []; + const shape = value.shape; + for (const key of value.keys) { + const el = shape[key]; + const isOptionalIn = el._zod.optin === "optional"; + const isOptionalOut = el._zod.optout === "optional"; + const r = el._zod.run({ value: input[key], issues: [] }, ctx); + if (r instanceof Promise) { + proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut))); + } else { + handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); + } + } + if (!catchall) { + return proms.length ? Promise.all(proms).then(() => payload) : payload; + } + return handleCatchall(proms, input, payload, ctx, _normalized.value, inst); + }; +}); +var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => { + $ZodObject.init(inst, def); + const superParse = inst._zod.parse; + const _normalized = cached(() => normalizeDef(def)); + const generateFastpass = (shape) => { + const doc = new Doc(["shape", "payload", "ctx"]); + const normalized = _normalized.value; + const parseStr = (key) => { + const k = esc(key); + return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`; + }; + doc.write(`const input = payload.value;`); + const ids = Object.create(null); + let counter = 0; + for (const key of normalized.keys) { + ids[key] = `key_${counter++}`; + } + doc.write(`const newResult = {};`); + for (const key of normalized.keys) { + const id = ids[key]; + const k = esc(key); + const schema = shape[key]; + const isOptionalIn = schema?._zod?.optin === "optional"; + const isOptionalOut = schema?._zod?.optout === "optional"; + doc.write(`const ${id} = ${parseStr(key)};`); + if (isOptionalIn && isOptionalOut) { + doc.write(` + if (${id}.issues.length) { + if (${k} in input) { + payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${k}, ...iss.path] : [${k}] + }))); + } + } + + if (${id}.value === undefined) { + if (${k} in input) { + newResult[${k}] = undefined; + } + } else { + newResult[${k}] = ${id}.value; + } + + `); + } else if (!isOptionalIn) { + doc.write(` + const ${id}_present = ${k} in input; + if (${id}.issues.length) { + payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${k}, ...iss.path] : [${k}] + }))); + } + if (!${id}_present && !${id}.issues.length) { + payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: undefined, + path: [${k}] + }); + } + + if (${id}_present) { + if (${id}.value === undefined) { + newResult[${k}] = undefined; + } else { + newResult[${k}] = ${id}.value; + } + } + + `); + } else { + doc.write(` + if (${id}.issues.length) { + payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${k}, ...iss.path] : [${k}] + }))); + } + + if (${id}.value === undefined) { + if (${k} in input) { + newResult[${k}] = undefined; + } + } else { + newResult[${k}] = ${id}.value; + } + + `); + } + } + doc.write(`payload.value = newResult;`); + doc.write(`return payload;`); + const fn = doc.compile(); + return (payload, ctx) => fn(shape, payload, ctx); + }; + let fastpass; + const isObject2 = isObject; + const jit = !globalConfig.jitless; + const allowsEval2 = allowsEval; + const fastEnabled = jit && allowsEval2.value; + const catchall = def.catchall; + let value; + inst._zod.parse = (payload, ctx) => { + value ?? (value = _normalized.value); + const input = payload.value; + if (!isObject2(input)) { + payload.issues.push({ + expected: "object", + code: "invalid_type", + input, + inst + }); + return payload; + } + if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) { + if (!fastpass) + fastpass = generateFastpass(def.shape); + payload = fastpass(payload, ctx); + if (!catchall) + return payload; + return handleCatchall([], input, payload, ctx, value, inst); + } + return superParse(payload, ctx); + }; +}); +function handleUnionResults(results, final, inst, ctx) { + for (const result of results) { + if (result.issues.length === 0) { + final.value = result.value; + return final; + } + } + const nonaborted = results.filter((r) => !aborted(r)); + if (nonaborted.length === 1) { + final.value = nonaborted[0].value; + return nonaborted[0]; + } + final.issues.push({ + code: "invalid_union", + input: final.value, + inst, + errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + }); + return final; +} +var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined); + defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined); + defineLazy(inst._zod, "values", () => { + if (def.options.every((o) => o._zod.values)) { + return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); + } + return; + }); + defineLazy(inst._zod, "pattern", () => { + if (def.options.every((o) => o._zod.pattern)) { + const patterns = def.options.map((o) => o._zod.pattern); + return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); + } + return; + }); + const first = def.options.length === 1 ? def.options[0]._zod.run : null; + inst._zod.parse = (payload, ctx) => { + if (first) { + return first(payload, ctx); + } + let async = false; + const results = []; + for (const option of def.options) { + const result = option._zod.run({ + value: payload.value, + issues: [] + }, ctx); + if (result instanceof Promise) { + results.push(result); + async = true; + } else { + if (result.issues.length === 0) + return result; + results.push(result); + } + } + if (!async) + return handleUnionResults(results, payload, inst, ctx); + return Promise.all(results).then((results2) => { + return handleUnionResults(results2, payload, inst, ctx); + }); + }; +}); +function handleExclusiveUnionResults(results, final, inst, ctx) { + const successes = results.filter((r) => r.issues.length === 0); + if (successes.length === 1) { + final.value = successes[0].value; + return final; + } + if (successes.length === 0) { + final.issues.push({ + code: "invalid_union", + input: final.value, + inst, + errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + }); + } else { + final.issues.push({ + code: "invalid_union", + input: final.value, + inst, + errors: [], + inclusive: false + }); + } + return final; +} +var $ZodXor = /* @__PURE__ */ $constructor("$ZodXor", (inst, def) => { + $ZodUnion.init(inst, def); + def.inclusive = false; + const first = def.options.length === 1 ? def.options[0]._zod.run : null; + inst._zod.parse = (payload, ctx) => { + if (first) { + return first(payload, ctx); + } + let async = false; + const results = []; + for (const option of def.options) { + const result = option._zod.run({ + value: payload.value, + issues: [] + }, ctx); + if (result instanceof Promise) { + results.push(result); + async = true; + } else { + results.push(result); + } + } + if (!async) + return handleExclusiveUnionResults(results, payload, inst, ctx); + return Promise.all(results).then((results2) => { + return handleExclusiveUnionResults(results2, payload, inst, ctx); + }); + }; +}); +var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnion", (inst, def) => { + def.inclusive = false; + $ZodUnion.init(inst, def); + const _super = inst._zod.parse; + defineLazy(inst._zod, "propValues", () => { + const propValues = {}; + for (const option of def.options) { + const pv = option._zod.propValues; + if (!pv || Object.keys(pv).length === 0) + throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`); + for (const [k, v] of Object.entries(pv)) { + if (!propValues[k]) + propValues[k] = new Set; + for (const val of v) { + propValues[k].add(val); + } + } + } + return propValues; + }); + const disc = cached(() => { + const opts = def.options; + const map = new Map; + for (const o of opts) { + const values = o._zod.propValues?.[def.discriminator]; + if (!values || values.size === 0) + throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`); + for (const v of values) { + if (map.has(v)) { + throw new Error(`Duplicate discriminator value "${String(v)}"`); + } + map.set(v, o); + } + } + return map; + }); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!isObject(input)) { + payload.issues.push({ + code: "invalid_type", + expected: "object", + input, + inst + }); + return payload; + } + const opt = disc.value.get(input?.[def.discriminator]); + if (opt) { + return opt._zod.run(payload, ctx); + } + if (def.unionFallback || ctx.direction === "backward") { + return _super(payload, ctx); + } + payload.issues.push({ + code: "invalid_union", + errors: [], + note: "No matching discriminator", + discriminator: def.discriminator, + options: Array.from(disc.value.keys()), + input, + path: [def.discriminator], + inst + }); + return payload; + }; +}); +var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + const left = def.left._zod.run({ value: input, issues: [] }, ctx); + const right = def.right._zod.run({ value: input, issues: [] }, ctx); + const async = left instanceof Promise || right instanceof Promise; + if (async) { + return Promise.all([left, right]).then(([left2, right2]) => { + return handleIntersectionResults(payload, left2, right2); + }); + } + return handleIntersectionResults(payload, left, right); + }; +}); +function mergeValues(a, b) { + if (a === b) { + return { valid: true, data: a }; + } + if (a instanceof Date && b instanceof Date && +a === +b) { + return { valid: true, data: a }; + } + if (isPlainObject(a) && isPlainObject(b)) { + const bKeys = Object.keys(b); + const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) { + return { + valid: false, + mergeErrorPath: [key, ...sharedValue.mergeErrorPath] + }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; + } + if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) { + return { valid: false, mergeErrorPath: [] }; + } + const newArray = []; + for (let index = 0;index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { + valid: false, + mergeErrorPath: [index, ...sharedValue.mergeErrorPath] + }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; + } + return { valid: false, mergeErrorPath: [] }; +} +function handleIntersectionResults(result, left, right) { + const unrecKeys = new Map; + let unrecIssue; + for (const iss of left.issues) { + if (iss.code === "unrecognized_keys") { + unrecIssue ?? (unrecIssue = iss); + for (const k of iss.keys) { + if (!unrecKeys.has(k)) + unrecKeys.set(k, {}); + unrecKeys.get(k).l = true; + } + } else { + result.issues.push(iss); + } + } + for (const iss of right.issues) { + if (iss.code === "unrecognized_keys") { + for (const k of iss.keys) { + if (!unrecKeys.has(k)) + unrecKeys.set(k, {}); + unrecKeys.get(k).r = true; + } + } else { + result.issues.push(iss); + } + } + const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k); + if (bothKeys.length && unrecIssue) { + result.issues.push({ ...unrecIssue, keys: bothKeys }); + } + if (aborted(result)) + return result; + const merged = mergeValues(left.value, right.value); + if (!merged.valid) { + throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`); + } + result.value = merged.data; + return result; +} +var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => { + $ZodType.init(inst, def); + const items = def.items; + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!Array.isArray(input)) { + payload.issues.push({ + input, + inst, + expected: "tuple", + code: "invalid_type" + }); + return payload; + } + payload.value = []; + const proms = []; + const optinStart = getTupleOptStart(items, "optin"); + const optoutStart = getTupleOptStart(items, "optout"); + if (!def.rest) { + if (input.length < optinStart) { + payload.issues.push({ + code: "too_small", + minimum: optinStart, + inclusive: true, + input, + inst, + origin: "array" + }); + return payload; + } + if (input.length > items.length) { + payload.issues.push({ + code: "too_big", + maximum: items.length, + inclusive: true, + input, + inst, + origin: "array" + }); + } + } + const itemResults = new Array(items.length); + for (let i = 0;i < items.length; i++) { + const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx); + if (r instanceof Promise) { + proms.push(r.then((rr) => { + itemResults[i] = rr; + })); + } else { + itemResults[i] = r; + } + } + if (def.rest) { + let i = items.length - 1; + const rest = input.slice(items.length); + for (const el of rest) { + i++; + const result = def.rest._zod.run({ value: el, issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((r) => handleTupleResult(r, payload, i))); + } else { + handleTupleResult(result, payload, i); + } + } + } + if (proms.length) { + return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart)); + } + return handleTupleResults(itemResults, payload, items, input, optoutStart); + }; +}); +function getTupleOptStart(items, key) { + for (let i = items.length - 1;i >= 0; i--) { + if (items[i]._zod[key] !== "optional") + return i + 1; + } + return 0; +} +function handleTupleResult(result, final, index) { + if (result.issues.length) { + final.issues.push(...prefixIssues(index, result.issues)); + } + final.value[index] = result.value; +} +function handleTupleResults(itemResults, final, items, input, optoutStart) { + for (let i = 0;i < items.length; i++) { + const r = itemResults[i]; + const isPresent = i < input.length; + if (r.issues.length) { + if (!isPresent && i >= optoutStart) { + final.value.length = i; + break; + } + final.issues.push(...prefixIssues(i, r.issues)); + } + final.value[i] = r.value; + } + for (let i = final.value.length - 1;i >= input.length; i--) { + if (items[i]._zod.optout === "optional" && final.value[i] === undefined) { + final.value.length = i; + } else { + break; + } + } + return final; +} +var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!isPlainObject(input)) { + payload.issues.push({ + expected: "record", + code: "invalid_type", + input, + inst + }); + return payload; + } + const proms = []; + const values = def.keyType._zod.values; + if (values) { + payload.value = {}; + const recordKeys = new Set; + for (const key of values) { + if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { + recordKeys.add(typeof key === "number" ? key.toString() : key); + const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); + if (keyResult instanceof Promise) { + throw new Error("Async schemas not supported in object keys currently"); + } + if (keyResult.issues.length) { + payload.issues.push({ + code: "invalid_key", + origin: "record", + issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), + input: key, + path: [key], + inst + }); + continue; + } + const outKey = keyResult.value; + const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => { + if (result2.issues.length) { + payload.issues.push(...prefixIssues(key, result2.issues)); + } + payload.value[outKey] = result2.value; + })); + } else { + if (result.issues.length) { + payload.issues.push(...prefixIssues(key, result.issues)); + } + payload.value[outKey] = result.value; + } + } + } + let unrecognized; + for (const key in input) { + if (!recordKeys.has(key)) { + unrecognized = unrecognized ?? []; + unrecognized.push(key); + } + } + if (unrecognized && unrecognized.length > 0) { + payload.issues.push({ + code: "unrecognized_keys", + input, + inst, + keys: unrecognized + }); + } + } else { + payload.value = {}; + for (const key of Reflect.ownKeys(input)) { + if (key === "__proto__") + continue; + if (!Object.prototype.propertyIsEnumerable.call(input, key)) + continue; + let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); + if (keyResult instanceof Promise) { + throw new Error("Async schemas not supported in object keys currently"); + } + const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length; + if (checkNumericKey) { + const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx); + if (retryResult instanceof Promise) { + throw new Error("Async schemas not supported in object keys currently"); + } + if (retryResult.issues.length === 0) { + keyResult = retryResult; + } + } + if (keyResult.issues.length) { + if (def.mode === "loose") { + payload.value[key] = input[key]; + } else { + payload.issues.push({ + code: "invalid_key", + origin: "record", + issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), + input: key, + path: [key], + inst + }); + } + continue; + } + const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => { + if (result2.issues.length) { + payload.issues.push(...prefixIssues(key, result2.issues)); + } + payload.value[keyResult.value] = result2.value; + })); + } else { + if (result.issues.length) { + payload.issues.push(...prefixIssues(key, result.issues)); + } + payload.value[keyResult.value] = result.value; + } + } + } + if (proms.length) { + return Promise.all(proms).then(() => payload); + } + return payload; + }; +}); +var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!(input instanceof Map)) { + payload.issues.push({ + expected: "map", + code: "invalid_type", + input, + inst + }); + return payload; + } + const proms = []; + payload.value = new Map; + for (const [key, value] of input) { + const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); + const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx); + if (keyResult instanceof Promise || valueResult instanceof Promise) { + proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => { + handleMapResult(keyResult2, valueResult2, payload, key, input, inst, ctx); + })); + } else { + handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx); + } + } + if (proms.length) + return Promise.all(proms).then(() => payload); + return payload; + }; +}); +function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) { + if (keyResult.issues.length) { + if (propertyKeyTypes.has(typeof key)) { + final.issues.push(...prefixIssues(key, keyResult.issues)); + } else { + final.issues.push({ + code: "invalid_key", + origin: "map", + input, + inst, + issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }); + } + } + if (valueResult.issues.length) { + if (propertyKeyTypes.has(typeof key)) { + final.issues.push(...prefixIssues(key, valueResult.issues)); + } else { + final.issues.push({ + origin: "map", + code: "invalid_element", + input, + inst, + key, + issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }); + } + } + final.value.set(keyResult.value, valueResult.value); +} +var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!(input instanceof Set)) { + payload.issues.push({ + input, + inst, + expected: "set", + code: "invalid_type" + }); + return payload; + } + const proms = []; + payload.value = new Set; + for (const item of input) { + const result = def.valueType._zod.run({ value: item, issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => handleSetResult(result2, payload))); + } else + handleSetResult(result, payload); + } + if (proms.length) + return Promise.all(proms).then(() => payload); + return payload; + }; +}); +function handleSetResult(result, final) { + if (result.issues.length) { + final.issues.push(...result.issues); + } + final.value.add(result.value); +} +var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { + $ZodType.init(inst, def); + const values = getEnumValues(def.entries); + const valuesSet = new Set(values); + inst._zod.values = valuesSet; + inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (valuesSet.has(input)) { + return payload; + } + payload.issues.push({ + code: "invalid_value", + values, + input, + inst + }); + return payload; + }; +}); +var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => { + $ZodType.init(inst, def); + if (def.values.length === 0) { + throw new Error("Cannot create literal schema with no valid values"); + } + const values = new Set(def.values); + inst._zod.values = values; + inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (values.has(input)) { + return payload; + } + payload.issues.push({ + code: "invalid_value", + values: def.values, + input, + inst + }); + return payload; + }; +}); +var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (input instanceof File) + return payload; + payload.issues.push({ + expected: "file", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + throw new $ZodEncodeError(inst.constructor.name); + } + const _out = def.transform(payload.value, payload); + if (ctx.async) { + const output = _out instanceof Promise ? _out : Promise.resolve(_out); + return output.then((output2) => { + payload.value = output2; + payload.fallback = true; + return payload; + }); + } + if (_out instanceof Promise) { + throw new $ZodAsyncError; + } + payload.value = _out; + payload.fallback = true; + return payload; + }; +}); +function handleOptionalResult(result, input) { + if (input === undefined && (result.issues.length || result.fallback)) { + return { issues: [], value: undefined }; + } + return result; +} +var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + inst._zod.optout = "optional"; + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined; + }); + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined; + }); + inst._zod.parse = (payload, ctx) => { + if (def.innerType._zod.optin === "optional") { + const input = payload.value; + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) + return result.then((r) => handleOptionalResult(r, input)); + return handleOptionalResult(result, input); + } + if (payload.value === undefined) { + return payload; + } + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => { + $ZodOptional.init(inst, def); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern); + inst._zod.parse = (payload, ctx) => { + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : undefined; + }); + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined; + }); + inst._zod.parse = (payload, ctx) => { + if (payload.value === null) + return payload; + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + return def.innerType._zod.run(payload, ctx); + } + if (payload.value === undefined) { + payload.value = def.defaultValue; + return payload; + } + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => handleDefaultResult(result2, def)); + } + return handleDefaultResult(result, def); + }; +}); +function handleDefaultResult(payload, def) { + if (payload.value === undefined) { + payload.value = def.defaultValue; + } + return payload; +} +var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + return def.innerType._zod.run(payload, ctx); + } + if (payload.value === undefined) { + payload.value = def.defaultValue; + } + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => { + const v = def.innerType._zod.values; + return v ? new Set([...v].filter((x) => x !== undefined)) : undefined; + }); + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => handleNonOptionalResult(result2, inst)); + } + return handleNonOptionalResult(result, inst); + }; +}); +function handleNonOptionalResult(payload, inst) { + if (!payload.issues.length && payload.value === undefined) { + payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: payload.value, + inst + }); + } + return payload; +} +var $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + throw new $ZodEncodeError("ZodSuccess"); + } + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => { + payload.value = result2.issues.length === 0; + return payload; + }); + } + payload.value = result.issues.length === 0; + return payload; + }; +}); +var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + return def.innerType._zod.run(payload, ctx); + } + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => { + payload.value = result2.value; + if (result2.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { + issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }, + input: payload.value + }); + payload.issues = []; + payload.fallback = true; + } + return payload; + }); + } + payload.value = result.value; + if (result.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { + issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }, + input: payload.value + }); + payload.issues = []; + payload.fallback = true; + } + return payload; + }; +}); +var $ZodNaN = /* @__PURE__ */ $constructor("$ZodNaN", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) { + payload.issues.push({ + input: payload.value, + inst, + expected: "nan", + code: "invalid_type" + }); + return payload; + } + return payload; + }; +}); +var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => def.in._zod.values); + defineLazy(inst._zod, "optin", () => def.in._zod.optin); + defineLazy(inst._zod, "optout", () => def.out._zod.optout); + defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + const right = def.out._zod.run(payload, ctx); + if (right instanceof Promise) { + return right.then((right2) => handlePipeResult(right2, def.in, ctx)); + } + return handlePipeResult(right, def.in, ctx); + } + const left = def.in._zod.run(payload, ctx); + if (left instanceof Promise) { + return left.then((left2) => handlePipeResult(left2, def.out, ctx)); + } + return handlePipeResult(left, def.out, ctx); + }; +}); +function handlePipeResult(left, next, ctx) { + if (left.issues.length) { + left.aborted = true; + return left; + } + return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx); +} +var $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => def.in._zod.values); + defineLazy(inst._zod, "optin", () => def.in._zod.optin); + defineLazy(inst._zod, "optout", () => def.out._zod.optout); + defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); + inst._zod.parse = (payload, ctx) => { + const direction = ctx.direction || "forward"; + if (direction === "forward") { + const left = def.in._zod.run(payload, ctx); + if (left instanceof Promise) { + return left.then((left2) => handleCodecAResult(left2, def, ctx)); + } + return handleCodecAResult(left, def, ctx); + } else { + const right = def.out._zod.run(payload, ctx); + if (right instanceof Promise) { + return right.then((right2) => handleCodecAResult(right2, def, ctx)); + } + return handleCodecAResult(right, def, ctx); + } + }; +}); +function handleCodecAResult(result, def, ctx) { + if (result.issues.length) { + result.aborted = true; + return result; + } + const direction = ctx.direction || "forward"; + if (direction === "forward") { + const transformed = def.transform(result.value, result); + if (transformed instanceof Promise) { + return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx)); + } + return handleCodecTxResult(result, transformed, def.out, ctx); + } else { + const transformed = def.reverseTransform(result.value, result); + if (transformed instanceof Promise) { + return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx)); + } + return handleCodecTxResult(result, transformed, def.in, ctx); + } +} +function handleCodecTxResult(left, value, nextSchema, ctx) { + if (left.issues.length) { + left.aborted = true; + return left; + } + return nextSchema._zod.run({ value, issues: left.issues }, ctx); +} +var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => { + $ZodPipe.init(inst, def); +}); +var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin); + defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout); + inst._zod.parse = (payload, ctx) => { + if (ctx.direction === "backward") { + return def.innerType._zod.run(payload, ctx); + } + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then(handleReadonlyResult); + } + return handleReadonlyResult(result); + }; +}); +function handleReadonlyResult(payload) { + payload.value = Object.freeze(payload.value); + return payload; +} +var $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => { + $ZodType.init(inst, def); + const regexParts = []; + for (const part of def.parts) { + if (typeof part === "object" && part !== null) { + if (!part._zod.pattern) { + throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`); + } + const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern; + if (!source) + throw new Error(`Invalid template literal part: ${part._zod.traits}`); + const start = source.startsWith("^") ? 1 : 0; + const end = source.endsWith("$") ? source.length - 1 : source.length; + regexParts.push(source.slice(start, end)); + } else if (part === null || primitiveTypes.has(typeof part)) { + regexParts.push(escapeRegex(`${part}`)); + } else { + throw new Error(`Invalid template literal part: ${part}`); + } + } + inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`); + inst._zod.parse = (payload, _ctx) => { + if (typeof payload.value !== "string") { + payload.issues.push({ + input: payload.value, + inst, + expected: "string", + code: "invalid_type" + }); + return payload; + } + inst._zod.pattern.lastIndex = 0; + if (!inst._zod.pattern.test(payload.value)) { + payload.issues.push({ + input: payload.value, + inst, + code: "invalid_format", + format: def.format ?? "template_literal", + pattern: inst._zod.pattern.source + }); + return payload; + } + return payload; + }; +}); +var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => { + $ZodType.init(inst, def); + inst._def = def; + inst._zod.def = def; + inst.implement = (func) => { + if (typeof func !== "function") { + throw new Error("implement() must be called with a function"); + } + return function(...args) { + const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args; + const result = Reflect.apply(func, this, parsedArgs); + if (inst._def.output) { + return parse(inst._def.output, result); + } + return result; + }; + }; + inst.implementAsync = (func) => { + if (typeof func !== "function") { + throw new Error("implementAsync() must be called with a function"); + } + return async function(...args) { + const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args; + const result = await Reflect.apply(func, this, parsedArgs); + if (inst._def.output) { + return await parseAsync(inst._def.output, result); + } + return result; + }; + }; + inst._zod.parse = (payload, _ctx) => { + if (typeof payload.value !== "function") { + payload.issues.push({ + code: "invalid_type", + expected: "function", + input: payload.value, + inst + }); + return payload; + } + const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === "promise"; + if (hasPromiseOutput) { + payload.value = inst.implementAsync(payload.value); + } else { + payload.value = inst.implement(payload.value); + } + return payload; + }; + inst.input = (...args) => { + const F = inst.constructor; + if (Array.isArray(args[0])) { + return new F({ + type: "function", + input: new $ZodTuple({ + type: "tuple", + items: args[0], + rest: args[1] + }), + output: inst._def.output + }); + } + return new F({ + type: "function", + input: args[0], + output: inst._def.output + }); + }; + inst.output = (output) => { + const F = inst.constructor; + return new F({ + type: "function", + input: inst._def.input, + output + }); + }; + return inst; +}); +var $ZodPromise = /* @__PURE__ */ $constructor("$ZodPromise", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx)); + }; +}); +var $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "innerType", () => { + const d = def; + if (!d._cachedInner) + d._cachedInner = def.getter(); + return d._cachedInner; + }); + defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern); + defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues); + defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? undefined); + defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? undefined); + inst._zod.parse = (payload, ctx) => { + const inner = inst._zod.innerType; + return inner._zod.run(payload, ctx); + }; +}); +var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { + $ZodCheck.init(inst, def); + $ZodType.init(inst, def); + inst._zod.parse = (payload, _) => { + return payload; + }; + inst._zod.check = (payload) => { + const input = payload.value; + const r = def.fn(input); + if (r instanceof Promise) { + return r.then((r2) => handleRefineResult(r2, payload, input, inst)); + } + handleRefineResult(r, payload, input, inst); + return; + }; +}); +function handleRefineResult(result, payload, input, inst) { + if (!result) { + const _iss = { + code: "custom", + input, + inst, + path: [...inst._zod.def.path ?? []], + continue: !inst._zod.def.abort + }; + if (inst._zod.def.params) + _iss.params = inst._zod.def.params; + payload.issues.push(issue(_iss)); + } +} +// node_modules/zod/v4/locales/index.js +var exports_locales = {}; +__export(exports_locales, { + zhTW: () => zh_TW_default, + zhCN: () => zh_CN_default, + yo: () => yo_default, + vi: () => vi_default, + uz: () => uz_default, + ur: () => ur_default, + uk: () => uk_default, + ua: () => ua_default, + tr: () => tr_default, + th: () => th_default, + ta: () => ta_default, + sv: () => sv_default, + sl: () => sl_default, + ru: () => ru_default, + ro: () => ro_default, + pt: () => pt_default, + ps: () => ps_default, + pl: () => pl_default, + ota: () => ota_default, + no: () => no_default, + nl: () => nl_default, + ms: () => ms_default, + mk: () => mk_default, + lt: () => lt_default, + ko: () => ko_default, + km: () => km_default, + kh: () => kh_default, + ka: () => ka_default, + ja: () => ja_default, + it: () => it_default, + is: () => is_default, + id: () => id_default, + hy: () => hy_default, + hu: () => hu_default, + hr: () => hr_default, + he: () => he_default, + frCA: () => fr_CA_default, + fr: () => fr_default, + fi: () => fi_default, + fa: () => fa_default, + es: () => es_default, + eo: () => eo_default, + en: () => en_default, + el: () => el_default, + de: () => de_default, + da: () => da_default, + cs: () => cs_default, + ca: () => ca_default, + bg: () => bg_default, + be: () => be_default, + az: () => az_default, + ar: () => ar_default +}); + +// node_modules/zod/v4/locales/ar.js +var error = () => { + const Sizable = { + string: { unit: "حرف", verb: "أن يحوي" }, + file: { unit: "بايت", verb: "أن يحوي" }, + array: { unit: "عنصر", verb: "أن يحوي" }, + set: { unit: "عنصر", verb: "أن يحوي" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "مدخل", + email: "بريد إلكتروني", + url: "رابط", + emoji: "إيموجي", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "تاريخ ووقت بمعيار ISO", + date: "تاريخ بمعيار ISO", + time: "وقت بمعيار ISO", + duration: "مدة بمعيار ISO", + ipv4: "عنوان IPv4", + ipv6: "عنوان IPv6", + cidrv4: "مدى عناوين بصيغة IPv4", + cidrv6: "مدى عناوين بصيغة IPv6", + base64: "نَص بترميز base64-encoded", + base64url: "نَص بترميز base64url-encoded", + json_string: "نَص على هيئة JSON", + e164: "رقم هاتف بمعيار E.164", + jwt: "JWT", + template_literal: "مدخل" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `مدخلات غير مقبولة: يفترض إدخال instanceof ${issue2.expected}، ولكن تم إدخال ${received}`; + } + return `مدخلات غير مقبولة: يفترض إدخال ${expected}، ولكن تم إدخال ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(issue2.values[0])}`; + return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return ` أكبر من اللازم: يفترض أن تكون ${issue2.origin ?? "القيمة"} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "عنصر"}`; + return `أكبر من اللازم: يفترض أن تكون ${issue2.origin ?? "القيمة"} ${adj} ${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `أصغر من اللازم: يفترض لـ ${issue2.origin} أن يكون ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; + } + return `أصغر من اللازم: يفترض لـ ${issue2.origin} أن يكون ${adj} ${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `نَص غير مقبول: يجب أن يبدأ بـ "${issue2.prefix}"`; + if (_issue.format === "ends_with") + return `نَص غير مقبول: يجب أن ينتهي بـ "${_issue.suffix}"`; + if (_issue.format === "includes") + return `نَص غير مقبول: يجب أن يتضمَّن "${_issue.includes}"`; + if (_issue.format === "regex") + return `نَص غير مقبول: يجب أن يطابق النمط ${_issue.pattern}`; + return `${FormatDictionary[_issue.format] ?? issue2.format} غير مقبول`; + } + case "not_multiple_of": + return `رقم غير مقبول: يجب أن يكون من مضاعفات ${issue2.divisor}`; + case "unrecognized_keys": + return `معرف${issue2.keys.length > 1 ? "ات" : ""} غريب${issue2.keys.length > 1 ? "ة" : ""}: ${joinValues(issue2.keys, "، ")}`; + case "invalid_key": + return `معرف غير مقبول في ${issue2.origin}`; + case "invalid_union": + return "مدخل غير مقبول"; + case "invalid_element": + return `مدخل غير مقبول في ${issue2.origin}`; + default: + return "مدخل غير مقبول"; + } + }; +}; +function ar_default() { + return { + localeError: error() + }; +} +// node_modules/zod/v4/locales/az.js +var error2 = () => { + const Sizable = { + string: { unit: "simvol", verb: "olmalıdır" }, + file: { unit: "bayt", verb: "olmalıdır" }, + array: { unit: "element", verb: "olmalıdır" }, + set: { unit: "element", verb: "olmalıdır" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "input", + email: "email address", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO datetime", + date: "ISO date", + time: "ISO time", + duration: "ISO duration", + ipv4: "IPv4 address", + ipv6: "IPv6 address", + cidrv4: "IPv4 range", + cidrv6: "IPv6 range", + base64: "base64-encoded string", + base64url: "base64url-encoded string", + json_string: "JSON string", + e164: "E.164 number", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Yanlış dəyər: gözlənilən instanceof ${issue2.expected}, daxil olan ${received}`; + } + return `Yanlış dəyər: gözlənilən ${expected}, daxil olan ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Yanlış dəyər: gözlənilən ${stringifyPrimitive(issue2.values[0])}`; + return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Çox böyük: gözlənilən ${issue2.origin ?? "dəyər"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element"}`; + return `Çox böyük: gözlənilən ${issue2.origin ?? "dəyər"} ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Çox kiçik: gözlənilən ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + return `Çox kiçik: gözlənilən ${issue2.origin} ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Yanlış mətn: "${_issue.prefix}" ilə başlamalıdır`; + if (_issue.format === "ends_with") + return `Yanlış mətn: "${_issue.suffix}" ilə bitməlidir`; + if (_issue.format === "includes") + return `Yanlış mətn: "${_issue.includes}" daxil olmalıdır`; + if (_issue.format === "regex") + return `Yanlış mətn: ${_issue.pattern} şablonuna uyğun olmalıdır`; + return `Yanlış ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Yanlış ədəd: ${issue2.divisor} ilə bölünə bilən olmalıdır`; + case "unrecognized_keys": + return `Tanınmayan açar${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `${issue2.origin} daxilində yanlış açar`; + case "invalid_union": + return "Yanlış dəyər"; + case "invalid_element": + return `${issue2.origin} daxilində yanlış dəyər`; + default: + return `Yanlış dəyər`; + } + }; +}; +function az_default() { + return { + localeError: error2() + }; +} +// node_modules/zod/v4/locales/be.js +function getBelarusianPlural(count, one, few, many) { + const absCount = Math.abs(count); + const lastDigit = absCount % 10; + const lastTwoDigits = absCount % 100; + if (lastTwoDigits >= 11 && lastTwoDigits <= 19) { + return many; + } + if (lastDigit === 1) { + return one; + } + if (lastDigit >= 2 && lastDigit <= 4) { + return few; + } + return many; +} +var error3 = () => { + const Sizable = { + string: { + unit: { + one: "сімвал", + few: "сімвалы", + many: "сімвалаў" + }, + verb: "мець" + }, + array: { + unit: { + one: "элемент", + few: "элементы", + many: "элементаў" + }, + verb: "мець" + }, + set: { + unit: { + one: "элемент", + few: "элементы", + many: "элементаў" + }, + verb: "мець" + }, + file: { + unit: { + one: "байт", + few: "байты", + many: "байтаў" + }, + verb: "мець" + } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "увод", + email: "email адрас", + url: "URL", + emoji: "эмодзі", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO дата і час", + date: "ISO дата", + time: "ISO час", + duration: "ISO працягласць", + ipv4: "IPv4 адрас", + ipv6: "IPv6 адрас", + cidrv4: "IPv4 дыяпазон", + cidrv6: "IPv6 дыяпазон", + base64: "радок у фармаце base64", + base64url: "радок у фармаце base64url", + json_string: "JSON радок", + e164: "нумар E.164", + jwt: "JWT", + template_literal: "увод" + }; + const TypeDictionary = { + nan: "NaN", + number: "лік", + array: "масіў" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Няправільны ўвод: чакаўся instanceof ${issue2.expected}, атрымана ${received}`; + } + return `Няправільны ўвод: чакаўся ${expected}, атрымана ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Няправільны ўвод: чакалася ${stringifyPrimitive(issue2.values[0])}`; + return `Няправільны варыянт: чакаўся адзін з ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + const maxValue = Number(issue2.maximum); + const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); + return `Занадта вялікі: чакалася, што ${issue2.origin ?? "значэнне"} павінна ${sizing.verb} ${adj}${issue2.maximum.toString()} ${unit}`; + } + return `Занадта вялікі: чакалася, што ${issue2.origin ?? "значэнне"} павінна быць ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + const minValue = Number(issue2.minimum); + const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); + return `Занадта малы: чакалася, што ${issue2.origin} павінна ${sizing.verb} ${adj}${issue2.minimum.toString()} ${unit}`; + } + return `Занадта малы: чакалася, што ${issue2.origin} павінна быць ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Няправільны радок: павінен пачынацца з "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Няправільны радок: павінен заканчвацца на "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Няправільны радок: павінен змяшчаць "${_issue.includes}"`; + if (_issue.format === "regex") + return `Няправільны радок: павінен адпавядаць шаблону ${_issue.pattern}`; + return `Няправільны ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Няправільны лік: павінен быць кратным ${issue2.divisor}`; + case "unrecognized_keys": + return `Нераспазнаны ${issue2.keys.length > 1 ? "ключы" : "ключ"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Няправільны ключ у ${issue2.origin}`; + case "invalid_union": + return "Няправільны ўвод"; + case "invalid_element": + return `Няправільнае значэнне ў ${issue2.origin}`; + default: + return `Няправільны ўвод`; + } + }; +}; +function be_default() { + return { + localeError: error3() + }; +} +// node_modules/zod/v4/locales/bg.js +var error4 = () => { + const Sizable = { + string: { unit: "символа", verb: "да съдържа" }, + file: { unit: "байта", verb: "да съдържа" }, + array: { unit: "елемента", verb: "да съдържа" }, + set: { unit: "елемента", verb: "да съдържа" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "вход", + email: "имейл адрес", + url: "URL", + emoji: "емоджи", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO време", + date: "ISO дата", + time: "ISO време", + duration: "ISO продължителност", + ipv4: "IPv4 адрес", + ipv6: "IPv6 адрес", + cidrv4: "IPv4 диапазон", + cidrv6: "IPv6 диапазон", + base64: "base64-кодиран низ", + base64url: "base64url-кодиран низ", + json_string: "JSON низ", + e164: "E.164 номер", + jwt: "JWT", + template_literal: "вход" + }; + const TypeDictionary = { + nan: "NaN", + number: "число", + array: "масив" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Невалиден вход: очакван instanceof ${issue2.expected}, получен ${received}`; + } + return `Невалиден вход: очакван ${expected}, получен ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Невалиден вход: очакван ${stringifyPrimitive(issue2.values[0])}`; + return `Невалидна опция: очаквано едно от ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Твърде голямо: очаква се ${issue2.origin ?? "стойност"} да съдържа ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "елемента"}`; + return `Твърде голямо: очаква се ${issue2.origin ?? "стойност"} да бъде ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Твърде малко: очаква се ${issue2.origin} да съдържа ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Твърде малко: очаква се ${issue2.origin} да бъде ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Невалиден низ: трябва да започва с "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Невалиден низ: трябва да завършва с "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Невалиден низ: трябва да включва "${_issue.includes}"`; + if (_issue.format === "regex") + return `Невалиден низ: трябва да съвпада с ${_issue.pattern}`; + let invalid_adj = "Невалиден"; + if (_issue.format === "emoji") + invalid_adj = "Невалидно"; + if (_issue.format === "datetime") + invalid_adj = "Невалидно"; + if (_issue.format === "date") + invalid_adj = "Невалидна"; + if (_issue.format === "time") + invalid_adj = "Невалидно"; + if (_issue.format === "duration") + invalid_adj = "Невалидна"; + return `${invalid_adj} ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Невалидно число: трябва да бъде кратно на ${issue2.divisor}`; + case "unrecognized_keys": + return `Неразпознат${issue2.keys.length > 1 ? "и" : ""} ключ${issue2.keys.length > 1 ? "ове" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Невалиден ключ в ${issue2.origin}`; + case "invalid_union": + return "Невалиден вход"; + case "invalid_element": + return `Невалидна стойност в ${issue2.origin}`; + default: + return `Невалиден вход`; + } + }; +}; +function bg_default() { + return { + localeError: error4() + }; +} +// node_modules/zod/v4/locales/ca.js +var error5 = () => { + const Sizable = { + string: { unit: "caràcters", verb: "contenir" }, + file: { unit: "bytes", verb: "contenir" }, + array: { unit: "elements", verb: "contenir" }, + set: { unit: "elements", verb: "contenir" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "entrada", + email: "adreça electrònica", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "data i hora ISO", + date: "data ISO", + time: "hora ISO", + duration: "durada ISO", + ipv4: "adreça IPv4", + ipv6: "adreça IPv6", + cidrv4: "rang IPv4", + cidrv6: "rang IPv6", + base64: "cadena codificada en base64", + base64url: "cadena codificada en base64url", + json_string: "cadena JSON", + e164: "número E.164", + jwt: "JWT", + template_literal: "entrada" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Tipus invàlid: s'esperava instanceof ${issue2.expected}, s'ha rebut ${received}`; + } + return `Tipus invàlid: s'esperava ${expected}, s'ha rebut ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Valor invàlid: s'esperava ${stringifyPrimitive(issue2.values[0])}`; + return `Opció invàlida: s'esperava una de ${joinValues(issue2.values, " o ")}`; + case "too_big": { + const adj = issue2.inclusive ? "com a màxim" : "menys de"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Massa gran: s'esperava que ${issue2.origin ?? "el valor"} contingués ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`; + return `Massa gran: s'esperava que ${issue2.origin ?? "el valor"} fos ${adj} ${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? "com a mínim" : "més de"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Massa petit: s'esperava que ${issue2.origin} contingués ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Massa petit: s'esperava que ${issue2.origin} fos ${adj} ${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Format invàlid: ha de començar amb "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Format invàlid: ha d'acabar amb "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Format invàlid: ha d'incloure "${_issue.includes}"`; + if (_issue.format === "regex") + return `Format invàlid: ha de coincidir amb el patró ${_issue.pattern}`; + return `Format invàlid per a ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Número invàlid: ha de ser múltiple de ${issue2.divisor}`; + case "unrecognized_keys": + return `Clau${issue2.keys.length > 1 ? "s" : ""} no reconeguda${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Clau invàlida a ${issue2.origin}`; + case "invalid_union": + return "Entrada invàlida"; + case "invalid_element": + return `Element invàlid a ${issue2.origin}`; + default: + return `Entrada invàlida`; + } + }; +}; +function ca_default() { + return { + localeError: error5() + }; +} +// node_modules/zod/v4/locales/cs.js +var error6 = () => { + const Sizable = { + string: { unit: "znaků", verb: "mít" }, + file: { unit: "bajtů", verb: "mít" }, + array: { unit: "prvků", verb: "mít" }, + set: { unit: "prvků", verb: "mít" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "regulární výraz", + email: "e-mailová adresa", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "datum a čas ve formátu ISO", + date: "datum ve formátu ISO", + time: "čas ve formátu ISO", + duration: "doba trvání ISO", + ipv4: "IPv4 adresa", + ipv6: "IPv6 adresa", + cidrv4: "rozsah IPv4", + cidrv6: "rozsah IPv6", + base64: "řetězec zakódovaný ve formátu base64", + base64url: "řetězec zakódovaný ve formátu base64url", + json_string: "řetězec ve formátu JSON", + e164: "číslo E.164", + jwt: "JWT", + template_literal: "vstup" + }; + const TypeDictionary = { + nan: "NaN", + number: "číslo", + string: "řetězec", + function: "funkce", + array: "pole" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Neplatný vstup: očekáváno instanceof ${issue2.expected}, obdrženo ${received}`; + } + return `Neplatný vstup: očekáváno ${expected}, obdrženo ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Neplatný vstup: očekáváno ${stringifyPrimitive(issue2.values[0])}`; + return `Neplatná možnost: očekávána jedna z hodnot ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Hodnota je příliš velká: ${issue2.origin ?? "hodnota"} musí mít ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "prvků"}`; + } + return `Hodnota je příliš velká: ${issue2.origin ?? "hodnota"} musí být ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Hodnota je příliš malá: ${issue2.origin ?? "hodnota"} musí mít ${adj}${issue2.minimum.toString()} ${sizing.unit ?? "prvků"}`; + } + return `Hodnota je příliš malá: ${issue2.origin ?? "hodnota"} musí být ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Neplatný řetězec: musí začínat na "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Neplatný řetězec: musí končit na "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Neplatný řetězec: musí obsahovat "${_issue.includes}"`; + if (_issue.format === "regex") + return `Neplatný řetězec: musí odpovídat vzoru ${_issue.pattern}`; + return `Neplatný formát ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Neplatné číslo: musí být násobkem ${issue2.divisor}`; + case "unrecognized_keys": + return `Neznámé klíče: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Neplatný klíč v ${issue2.origin}`; + case "invalid_union": + return "Neplatný vstup"; + case "invalid_element": + return `Neplatná hodnota v ${issue2.origin}`; + default: + return `Neplatný vstup`; + } + }; +}; +function cs_default() { + return { + localeError: error6() + }; +} +// node_modules/zod/v4/locales/da.js +var error7 = () => { + const Sizable = { + string: { unit: "tegn", verb: "havde" }, + file: { unit: "bytes", verb: "havde" }, + array: { unit: "elementer", verb: "indeholdt" }, + set: { unit: "elementer", verb: "indeholdt" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "input", + email: "e-mailadresse", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO dato- og klokkeslæt", + date: "ISO-dato", + time: "ISO-klokkeslæt", + duration: "ISO-varighed", + ipv4: "IPv4-område", + ipv6: "IPv6-område", + cidrv4: "IPv4-spektrum", + cidrv6: "IPv6-spektrum", + base64: "base64-kodet streng", + base64url: "base64url-kodet streng", + json_string: "JSON-streng", + e164: "E.164-nummer", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN", + string: "streng", + number: "tal", + boolean: "boolean", + array: "liste", + object: "objekt", + set: "sæt", + file: "fil" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Ugyldigt input: forventede instanceof ${issue2.expected}, fik ${received}`; + } + return `Ugyldigt input: forventede ${expected}, fik ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Ugyldig værdi: forventede ${stringifyPrimitive(issue2.values[0])}`; + return `Ugyldigt valg: forventede en af følgende ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + if (sizing) + return `For stor: forventede ${origin ?? "value"} ${sizing.verb} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "elementer"}`; + return `For stor: forventede ${origin ?? "value"} havde ${adj} ${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + if (sizing) { + return `For lille: forventede ${origin} ${sizing.verb} ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; + } + return `For lille: forventede ${origin} havde ${adj} ${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Ugyldig streng: skal starte med "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Ugyldig streng: skal ende med "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Ugyldig streng: skal indeholde "${_issue.includes}"`; + if (_issue.format === "regex") + return `Ugyldig streng: skal matche mønsteret ${_issue.pattern}`; + return `Ugyldig ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Ugyldigt tal: skal være deleligt med ${issue2.divisor}`; + case "unrecognized_keys": + return `${issue2.keys.length > 1 ? "Ukendte nøgler" : "Ukendt nøgle"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Ugyldig nøgle i ${issue2.origin}`; + case "invalid_union": + return "Ugyldigt input: matcher ingen af de tilladte typer"; + case "invalid_element": + return `Ugyldig værdi i ${issue2.origin}`; + default: + return `Ugyldigt input`; + } + }; +}; +function da_default() { + return { + localeError: error7() + }; +} +// node_modules/zod/v4/locales/de.js +var error8 = () => { + const Sizable = { + string: { unit: "Zeichen", verb: "zu haben" }, + file: { unit: "Bytes", verb: "zu haben" }, + array: { unit: "Elemente", verb: "zu haben" }, + set: { unit: "Elemente", verb: "zu haben" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "Eingabe", + email: "E-Mail-Adresse", + url: "URL", + emoji: "Emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO-Datum und -Uhrzeit", + date: "ISO-Datum", + time: "ISO-Uhrzeit", + duration: "ISO-Dauer", + ipv4: "IPv4-Adresse", + ipv6: "IPv6-Adresse", + cidrv4: "IPv4-Bereich", + cidrv6: "IPv6-Bereich", + base64: "Base64-codierter String", + base64url: "Base64-URL-codierter String", + json_string: "JSON-String", + e164: "E.164-Nummer", + jwt: "JWT", + template_literal: "Eingabe" + }; + const TypeDictionary = { + nan: "NaN", + number: "Zahl", + array: "Array" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Ungültige Eingabe: erwartet instanceof ${issue2.expected}, erhalten ${received}`; + } + return `Ungültige Eingabe: erwartet ${expected}, erhalten ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Ungültige Eingabe: erwartet ${stringifyPrimitive(issue2.values[0])}`; + return `Ungültige Option: erwartet eine von ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Zu groß: erwartet, dass ${issue2.origin ?? "Wert"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`; + return `Zu groß: erwartet, dass ${issue2.origin ?? "Wert"} ${adj}${issue2.maximum.toString()} ist`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Zu klein: erwartet, dass ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} hat`; + } + return `Zu klein: erwartet, dass ${issue2.origin} ${adj}${issue2.minimum.toString()} ist`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`; + if (_issue.format === "ends_with") + return `Ungültiger String: muss mit "${_issue.suffix}" enden`; + if (_issue.format === "includes") + return `Ungültiger String: muss "${_issue.includes}" enthalten`; + if (_issue.format === "regex") + return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`; + return `Ungültig: ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Ungültige Zahl: muss ein Vielfaches von ${issue2.divisor} sein`; + case "unrecognized_keys": + return `${issue2.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Ungültiger Schlüssel in ${issue2.origin}`; + case "invalid_union": + return "Ungültige Eingabe"; + case "invalid_element": + return `Ungültiger Wert in ${issue2.origin}`; + default: + return `Ungültige Eingabe`; + } + }; +}; +function de_default() { + return { + localeError: error8() + }; +} +// node_modules/zod/v4/locales/el.js +var error9 = () => { + const Sizable = { + string: { unit: "χαρακτήρες", verb: "να έχει" }, + file: { unit: "bytes", verb: "να έχει" }, + array: { unit: "στοιχεία", verb: "να έχει" }, + set: { unit: "στοιχεία", verb: "να έχει" }, + map: { unit: "καταχωρήσεις", verb: "να έχει" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "είσοδος", + email: "διεύθυνση email", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO ημερομηνία και ώρα", + date: "ISO ημερομηνία", + time: "ISO ώρα", + duration: "ISO διάρκεια", + ipv4: "διεύθυνση IPv4", + ipv6: "διεύθυνση IPv6", + mac: "διεύθυνση MAC", + cidrv4: "εύρος IPv4", + cidrv6: "εύρος IPv6", + base64: "συμβολοσειρά κωδικοποιημένη σε base64", + base64url: "συμβολοσειρά κωδικοποιημένη σε base64url", + json_string: "συμβολοσειρά JSON", + e164: "αριθμός E.164", + jwt: "JWT", + template_literal: "είσοδος" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (typeof issue2.expected === "string" && /^[A-Z]/.test(issue2.expected)) { + return `Μη έγκυρη είσοδος: αναμενόταν instanceof ${issue2.expected}, λήφθηκε ${received}`; + } + return `Μη έγκυρη είσοδος: αναμενόταν ${expected}, λήφθηκε ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Μη έγκυρη είσοδος: αναμενόταν ${stringifyPrimitive(issue2.values[0])}`; + return `Μη έγκυρη επιλογή: αναμενόταν ένα από ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Πολύ μεγάλο: αναμενόταν ${issue2.origin ?? "τιμή"} να έχει ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "στοιχεία"}`; + return `Πολύ μεγάλο: αναμενόταν ${issue2.origin ?? "τιμή"} να είναι ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Πολύ μικρό: αναμενόταν ${issue2.origin} να έχει ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Πολύ μικρό: αναμενόταν ${issue2.origin} να είναι ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${_issue.includes}"`; + if (_issue.format === "regex") + return `Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${_issue.pattern}`; + return `Μη έγκυρο: ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${issue2.divisor}`; + case "unrecognized_keys": + return `Άγνωστ${issue2.keys.length > 1 ? "α" : "ο"} κλειδ${issue2.keys.length > 1 ? "ιά" : "ί"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Μη έγκυρο κλειδί στο ${issue2.origin}`; + case "invalid_union": + return "Μη έγκυρη είσοδος"; + case "invalid_element": + return `Μη έγκυρη τιμή στο ${issue2.origin}`; + default: + return `Μη έγκυρη είσοδος`; + } + }; +}; +function el_default() { + return { + localeError: error9() + }; +} +// node_modules/zod/v4/locales/en.js +var error10 = () => { + const Sizable = { + string: { unit: "characters", verb: "to have" }, + file: { unit: "bytes", verb: "to have" }, + array: { unit: "items", verb: "to have" }, + set: { unit: "items", verb: "to have" }, + map: { unit: "entries", verb: "to have" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "input", + email: "email address", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO datetime", + date: "ISO date", + time: "ISO time", + duration: "ISO duration", + ipv4: "IPv4 address", + ipv6: "IPv6 address", + mac: "MAC address", + cidrv4: "IPv4 range", + cidrv6: "IPv6 range", + base64: "base64-encoded string", + base64url: "base64url-encoded string", + json_string: "JSON string", + e164: "E.164 number", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + return `Invalid input: expected ${expected}, received ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`; + return `Invalid option: expected one of ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Too big: expected ${issue2.origin ?? "value"} to have ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"}`; + return `Too big: expected ${issue2.origin ?? "value"} to be ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Too small: expected ${issue2.origin} to have ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Too small: expected ${issue2.origin} to be ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Invalid string: must start with "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Invalid string: must end with "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Invalid string: must include "${_issue.includes}"`; + if (_issue.format === "regex") + return `Invalid string: must match pattern ${_issue.pattern}`; + return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Invalid number: must be a multiple of ${issue2.divisor}`; + case "unrecognized_keys": + return `Unrecognized key${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Invalid key in ${issue2.origin}`; + case "invalid_union": + if (issue2.options && Array.isArray(issue2.options) && issue2.options.length > 0) { + const opts = issue2.options.map((o) => `'${o}'`).join(" | "); + return `Invalid discriminator value. Expected ${opts}`; + } + return "Invalid input"; + case "invalid_element": + return `Invalid value in ${issue2.origin}`; + default: + return `Invalid input`; + } + }; +}; +function en_default() { + return { + localeError: error10() + }; +} +// node_modules/zod/v4/locales/eo.js +var error11 = () => { + const Sizable = { + string: { unit: "karaktrojn", verb: "havi" }, + file: { unit: "bajtojn", verb: "havi" }, + array: { unit: "elementojn", verb: "havi" }, + set: { unit: "elementojn", verb: "havi" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "enigo", + email: "retadreso", + url: "URL", + emoji: "emoĝio", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO-datotempo", + date: "ISO-dato", + time: "ISO-tempo", + duration: "ISO-daŭro", + ipv4: "IPv4-adreso", + ipv6: "IPv6-adreso", + cidrv4: "IPv4-rango", + cidrv6: "IPv6-rango", + base64: "64-ume kodita karaktraro", + base64url: "URL-64-ume kodita karaktraro", + json_string: "JSON-karaktraro", + e164: "E.164-nombro", + jwt: "JWT", + template_literal: "enigo" + }; + const TypeDictionary = { + nan: "NaN", + number: "nombro", + array: "tabelo", + null: "senvalora" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Nevalida enigo: atendiĝis instanceof ${issue2.expected}, riceviĝis ${received}`; + } + return `Nevalida enigo: atendiĝis ${expected}, riceviĝis ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Nevalida enigo: atendiĝis ${stringifyPrimitive(issue2.values[0])}`; + return `Nevalida opcio: atendiĝis unu el ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Tro granda: atendiĝis ke ${issue2.origin ?? "valoro"} havu ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementojn"}`; + return `Tro granda: atendiĝis ke ${issue2.origin ?? "valoro"} havu ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Tro malgranda: atendiĝis ke ${issue2.origin} havu ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Tro malgranda: atendiĝis ke ${issue2.origin} estu ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`; + if (_issue.format === "regex") + return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`; + return `Nevalida ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Nevalida nombro: devas esti oblo de ${issue2.divisor}`; + case "unrecognized_keys": + return `Nekonata${issue2.keys.length > 1 ? "j" : ""} ŝlosilo${issue2.keys.length > 1 ? "j" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Nevalida ŝlosilo en ${issue2.origin}`; + case "invalid_union": + return "Nevalida enigo"; + case "invalid_element": + return `Nevalida valoro en ${issue2.origin}`; + default: + return `Nevalida enigo`; + } + }; +}; +function eo_default() { + return { + localeError: error11() + }; +} +// node_modules/zod/v4/locales/es.js +var error12 = () => { + const Sizable = { + string: { unit: "caracteres", verb: "tener" }, + file: { unit: "bytes", verb: "tener" }, + array: { unit: "elementos", verb: "tener" }, + set: { unit: "elementos", verb: "tener" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "entrada", + email: "dirección de correo electrónico", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "fecha y hora ISO", + date: "fecha ISO", + time: "hora ISO", + duration: "duración ISO", + ipv4: "dirección IPv4", + ipv6: "dirección IPv6", + cidrv4: "rango IPv4", + cidrv6: "rango IPv6", + base64: "cadena codificada en base64", + base64url: "URL codificada en base64", + json_string: "cadena JSON", + e164: "número E.164", + jwt: "JWT", + template_literal: "entrada" + }; + const TypeDictionary = { + nan: "NaN", + string: "texto", + number: "número", + boolean: "booleano", + array: "arreglo", + object: "objeto", + set: "conjunto", + file: "archivo", + date: "fecha", + bigint: "número grande", + symbol: "símbolo", + undefined: "indefinido", + null: "nulo", + function: "función", + map: "mapa", + record: "registro", + tuple: "tupla", + enum: "enumeración", + union: "unión", + literal: "literal", + promise: "promesa", + void: "vacío", + never: "nunca", + unknown: "desconocido", + any: "cualquiera" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Entrada inválida: se esperaba instanceof ${issue2.expected}, recibido ${received}`; + } + return `Entrada inválida: se esperaba ${expected}, recibido ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Entrada inválida: se esperaba ${stringifyPrimitive(issue2.values[0])}`; + return `Opción inválida: se esperaba una de ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + if (sizing) + return `Demasiado grande: se esperaba que ${origin ?? "valor"} tuviera ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementos"}`; + return `Demasiado grande: se esperaba que ${origin ?? "valor"} fuera ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + if (sizing) { + return `Demasiado pequeño: se esperaba que ${origin} tuviera ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Demasiado pequeño: se esperaba que ${origin} fuera ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Cadena inválida: debe comenzar con "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Cadena inválida: debe terminar en "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Cadena inválida: debe incluir "${_issue.includes}"`; + if (_issue.format === "regex") + return `Cadena inválida: debe coincidir con el patrón ${_issue.pattern}`; + return `Inválido ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Número inválido: debe ser múltiplo de ${issue2.divisor}`; + case "unrecognized_keys": + return `Llave${issue2.keys.length > 1 ? "s" : ""} desconocida${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Llave inválida en ${TypeDictionary[issue2.origin] ?? issue2.origin}`; + case "invalid_union": + return "Entrada inválida"; + case "invalid_element": + return `Valor inválido en ${TypeDictionary[issue2.origin] ?? issue2.origin}`; + default: + return `Entrada inválida`; + } + }; +}; +function es_default() { + return { + localeError: error12() + }; +} +// node_modules/zod/v4/locales/fa.js +var error13 = () => { + const Sizable = { + string: { unit: "کاراکتر", verb: "داشته باشد" }, + file: { unit: "بایت", verb: "داشته باشد" }, + array: { unit: "آیتم", verb: "داشته باشد" }, + set: { unit: "آیتم", verb: "داشته باشد" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "ورودی", + email: "آدرس ایمیل", + url: "URL", + emoji: "ایموجی", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "تاریخ و زمان ایزو", + date: "تاریخ ایزو", + time: "زمان ایزو", + duration: "مدت زمان ایزو", + ipv4: "IPv4 آدرس", + ipv6: "IPv6 آدرس", + cidrv4: "IPv4 دامنه", + cidrv6: "IPv6 دامنه", + base64: "base64-encoded رشته", + base64url: "base64url-encoded رشته", + json_string: "JSON رشته", + e164: "E.164 عدد", + jwt: "JWT", + template_literal: "ورودی" + }; + const TypeDictionary = { + nan: "NaN", + number: "عدد", + array: "آرایه" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `ورودی نامعتبر: می‌بایست instanceof ${issue2.expected} می‌بود، ${received} دریافت شد`; + } + return `ورودی نامعتبر: می‌بایست ${expected} می‌بود، ${received} دریافت شد`; + } + case "invalid_value": + if (issue2.values.length === 1) { + return `ورودی نامعتبر: می‌بایست ${stringifyPrimitive(issue2.values[0])} می‌بود`; + } + return `گزینه نامعتبر: می‌بایست یکی از ${joinValues(issue2.values, "|")} می‌بود`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `خیلی بزرگ: ${issue2.origin ?? "مقدار"} باید ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "عنصر"} باشد`; + } + return `خیلی بزرگ: ${issue2.origin ?? "مقدار"} باید ${adj}${issue2.maximum.toString()} باشد`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `خیلی کوچک: ${issue2.origin} باید ${adj}${issue2.minimum.toString()} ${sizing.unit} باشد`; + } + return `خیلی کوچک: ${issue2.origin} باید ${adj}${issue2.minimum.toString()} باشد`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `رشته نامعتبر: باید با "${_issue.prefix}" شروع شود`; + } + if (_issue.format === "ends_with") { + return `رشته نامعتبر: باید با "${_issue.suffix}" تمام شود`; + } + if (_issue.format === "includes") { + return `رشته نامعتبر: باید شامل "${_issue.includes}" باشد`; + } + if (_issue.format === "regex") { + return `رشته نامعتبر: باید با الگوی ${_issue.pattern} مطابقت داشته باشد`; + } + return `${FormatDictionary[_issue.format] ?? issue2.format} نامعتبر`; + } + case "not_multiple_of": + return `عدد نامعتبر: باید مضرب ${issue2.divisor} باشد`; + case "unrecognized_keys": + return `کلید${issue2.keys.length > 1 ? "های" : ""} ناشناس: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `کلید ناشناس در ${issue2.origin}`; + case "invalid_union": + return `ورودی نامعتبر`; + case "invalid_element": + return `مقدار نامعتبر در ${issue2.origin}`; + default: + return `ورودی نامعتبر`; + } + }; +}; +function fa_default() { + return { + localeError: error13() + }; +} +// node_modules/zod/v4/locales/fi.js +var error14 = () => { + const Sizable = { + string: { unit: "merkkiä", subject: "merkkijonon" }, + file: { unit: "tavua", subject: "tiedoston" }, + array: { unit: "alkiota", subject: "listan" }, + set: { unit: "alkiota", subject: "joukon" }, + number: { unit: "", subject: "luvun" }, + bigint: { unit: "", subject: "suuren kokonaisluvun" }, + int: { unit: "", subject: "kokonaisluvun" }, + date: { unit: "", subject: "päivämäärän" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "säännöllinen lauseke", + email: "sähköpostiosoite", + url: "URL-osoite", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO-aikaleima", + date: "ISO-päivämäärä", + time: "ISO-aika", + duration: "ISO-kesto", + ipv4: "IPv4-osoite", + ipv6: "IPv6-osoite", + cidrv4: "IPv4-alue", + cidrv6: "IPv6-alue", + base64: "base64-koodattu merkkijono", + base64url: "base64url-koodattu merkkijono", + json_string: "JSON-merkkijono", + e164: "E.164-luku", + jwt: "JWT", + template_literal: "templaattimerkkijono" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Virheellinen tyyppi: odotettiin instanceof ${issue2.expected}, oli ${received}`; + } + return `Virheellinen tyyppi: odotettiin ${expected}, oli ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Virheellinen syöte: täytyy olla ${stringifyPrimitive(issue2.values[0])}`; + return `Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Liian suuri: ${sizing.subject} täytyy olla ${adj}${issue2.maximum.toString()} ${sizing.unit}`.trim(); + } + return `Liian suuri: arvon täytyy olla ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Liian pieni: ${sizing.subject} täytyy olla ${adj}${issue2.minimum.toString()} ${sizing.unit}`.trim(); + } + return `Liian pieni: arvon täytyy olla ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Virheellinen syöte: täytyy alkaa "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Virheellinen syöte: täytyy loppua "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Virheellinen syöte: täytyy sisältää "${_issue.includes}"`; + if (_issue.format === "regex") { + return `Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${_issue.pattern}`; + } + return `Virheellinen ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Virheellinen luku: täytyy olla luvun ${issue2.divisor} monikerta`; + case "unrecognized_keys": + return `${issue2.keys.length > 1 ? "Tuntemattomat avaimet" : "Tuntematon avain"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return "Virheellinen avain tietueessa"; + case "invalid_union": + return "Virheellinen unioni"; + case "invalid_element": + return "Virheellinen arvo joukossa"; + default: + return `Virheellinen syöte`; + } + }; +}; +function fi_default() { + return { + localeError: error14() + }; +} +// node_modules/zod/v4/locales/fr.js +var error15 = () => { + const Sizable = { + string: { unit: "caractères", verb: "avoir" }, + file: { unit: "octets", verb: "avoir" }, + array: { unit: "éléments", verb: "avoir" }, + set: { unit: "éléments", verb: "avoir" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "entrée", + email: "adresse e-mail", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "date et heure ISO", + date: "date ISO", + time: "heure ISO", + duration: "durée ISO", + ipv4: "adresse IPv4", + ipv6: "adresse IPv6", + cidrv4: "plage IPv4", + cidrv6: "plage IPv6", + base64: "chaîne encodée en base64", + base64url: "chaîne encodée en base64url", + json_string: "chaîne JSON", + e164: "numéro E.164", + jwt: "JWT", + template_literal: "entrée" + }; + const TypeDictionary = { + string: "chaîne", + number: "nombre", + int: "entier", + boolean: "booléen", + bigint: "grand entier", + symbol: "symbole", + undefined: "indéfini", + null: "null", + never: "jamais", + void: "vide", + date: "date", + array: "tableau", + object: "objet", + tuple: "tuple", + record: "enregistrement", + map: "carte", + set: "ensemble", + file: "fichier", + nonoptional: "non-optionnel", + nan: "NaN", + function: "fonction" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Entrée invalide : instanceof ${issue2.expected} attendu, ${received} reçu`; + } + return `Entrée invalide : ${expected} attendu, ${received} reçu`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Entrée invalide : ${stringifyPrimitive(issue2.values[0])} attendu`; + return `Option invalide : une valeur parmi ${joinValues(issue2.values, "|")} attendue`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "élément(s)"}`; + return `Trop grand : ${TypeDictionary[issue2.origin] ?? "valeur"} doit être ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + return `Trop petit : ${TypeDictionary[issue2.origin] ?? "valeur"} doit être ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Chaîne invalide : doit commencer par "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Chaîne invalide : doit inclure "${_issue.includes}"`; + if (_issue.format === "regex") + return `Chaîne invalide : doit correspondre au modèle ${_issue.pattern}`; + return `${FormatDictionary[_issue.format] ?? issue2.format} invalide`; + } + case "not_multiple_of": + return `Nombre invalide : doit être un multiple de ${issue2.divisor}`; + case "unrecognized_keys": + return `Clé${issue2.keys.length > 1 ? "s" : ""} non reconnue${issue2.keys.length > 1 ? "s" : ""} : ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Clé invalide dans ${issue2.origin}`; + case "invalid_union": + return "Entrée invalide"; + case "invalid_element": + return `Valeur invalide dans ${issue2.origin}`; + default: + return `Entrée invalide`; + } + }; +}; +function fr_default() { + return { + localeError: error15() + }; +} +// node_modules/zod/v4/locales/fr-CA.js +var error16 = () => { + const Sizable = { + string: { unit: "caractères", verb: "avoir" }, + file: { unit: "octets", verb: "avoir" }, + array: { unit: "éléments", verb: "avoir" }, + set: { unit: "éléments", verb: "avoir" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "entrée", + email: "adresse courriel", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "date-heure ISO", + date: "date ISO", + time: "heure ISO", + duration: "durée ISO", + ipv4: "adresse IPv4", + ipv6: "adresse IPv6", + cidrv4: "plage IPv4", + cidrv6: "plage IPv6", + base64: "chaîne encodée en base64", + base64url: "chaîne encodée en base64url", + json_string: "chaîne JSON", + e164: "numéro E.164", + jwt: "JWT", + template_literal: "entrée" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Entrée invalide : attendu instanceof ${issue2.expected}, reçu ${received}`; + } + return `Entrée invalide : attendu ${expected}, reçu ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Entrée invalide : attendu ${stringifyPrimitive(issue2.values[0])}`; + return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "≤" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Trop grand : attendu que ${issue2.origin ?? "la valeur"} ait ${adj}${issue2.maximum.toString()} ${sizing.unit}`; + return `Trop grand : attendu que ${issue2.origin ?? "la valeur"} soit ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? "≥" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Trop petit : attendu que ${issue2.origin} ait ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Trop petit : attendu que ${issue2.origin} soit ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Chaîne invalide : doit commencer par "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Chaîne invalide : doit inclure "${_issue.includes}"`; + if (_issue.format === "regex") + return `Chaîne invalide : doit correspondre au motif ${_issue.pattern}`; + return `${FormatDictionary[_issue.format] ?? issue2.format} invalide`; + } + case "not_multiple_of": + return `Nombre invalide : doit être un multiple de ${issue2.divisor}`; + case "unrecognized_keys": + return `Clé${issue2.keys.length > 1 ? "s" : ""} non reconnue${issue2.keys.length > 1 ? "s" : ""} : ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Clé invalide dans ${issue2.origin}`; + case "invalid_union": + return "Entrée invalide"; + case "invalid_element": + return `Valeur invalide dans ${issue2.origin}`; + default: + return `Entrée invalide`; + } + }; +}; +function fr_CA_default() { + return { + localeError: error16() + }; +} +// node_modules/zod/v4/locales/he.js +var error17 = () => { + const TypeNames = { + string: { label: "מחרוזת", gender: "f" }, + number: { label: "מספר", gender: "m" }, + boolean: { label: "ערך בוליאני", gender: "m" }, + bigint: { label: "BigInt", gender: "m" }, + date: { label: "תאריך", gender: "m" }, + array: { label: "מערך", gender: "m" }, + object: { label: "אובייקט", gender: "m" }, + null: { label: "ערך ריק (null)", gender: "m" }, + undefined: { label: "ערך לא מוגדר (undefined)", gender: "m" }, + symbol: { label: "סימבול (Symbol)", gender: "m" }, + function: { label: "פונקציה", gender: "f" }, + map: { label: "מפה (Map)", gender: "f" }, + set: { label: "קבוצה (Set)", gender: "f" }, + file: { label: "קובץ", gender: "m" }, + promise: { label: "Promise", gender: "m" }, + NaN: { label: "NaN", gender: "m" }, + unknown: { label: "ערך לא ידוע", gender: "m" }, + value: { label: "ערך", gender: "m" } + }; + const Sizable = { + string: { unit: "תווים", shortLabel: "קצר", longLabel: "ארוך" }, + file: { unit: "בייטים", shortLabel: "קטן", longLabel: "גדול" }, + array: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" }, + set: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" }, + number: { unit: "", shortLabel: "קטן", longLabel: "גדול" } + }; + const typeEntry = (t) => t ? TypeNames[t] : undefined; + const typeLabel = (t) => { + const e = typeEntry(t); + if (e) + return e.label; + return t ?? TypeNames.unknown.label; + }; + const withDefinite = (t) => `ה${typeLabel(t)}`; + const verbFor = (t) => { + const e = typeEntry(t); + const gender = e?.gender ?? "m"; + return gender === "f" ? "צריכה להיות" : "צריך להיות"; + }; + const getSizing = (origin) => { + if (!origin) + return null; + return Sizable[origin] ?? null; + }; + const FormatDictionary = { + regex: { label: "קלט", gender: "m" }, + email: { label: "כתובת אימייל", gender: "f" }, + url: { label: "כתובת רשת", gender: "f" }, + emoji: { label: "אימוג'י", gender: "m" }, + uuid: { label: "UUID", gender: "m" }, + nanoid: { label: "nanoid", gender: "m" }, + guid: { label: "GUID", gender: "m" }, + cuid: { label: "cuid", gender: "m" }, + cuid2: { label: "cuid2", gender: "m" }, + ulid: { label: "ULID", gender: "m" }, + xid: { label: "XID", gender: "m" }, + ksuid: { label: "KSUID", gender: "m" }, + datetime: { label: "תאריך וזמן ISO", gender: "m" }, + date: { label: "תאריך ISO", gender: "m" }, + time: { label: "זמן ISO", gender: "m" }, + duration: { label: "משך זמן ISO", gender: "m" }, + ipv4: { label: "כתובת IPv4", gender: "f" }, + ipv6: { label: "כתובת IPv6", gender: "f" }, + cidrv4: { label: "טווח IPv4", gender: "m" }, + cidrv6: { label: "טווח IPv6", gender: "m" }, + base64: { label: "מחרוזת בבסיס 64", gender: "f" }, + base64url: { label: "מחרוזת בבסיס 64 לכתובות רשת", gender: "f" }, + json_string: { label: "מחרוזת JSON", gender: "f" }, + e164: { label: "מספר E.164", gender: "m" }, + jwt: { label: "JWT", gender: "m" }, + ends_with: { label: "קלט", gender: "m" }, + includes: { label: "קלט", gender: "m" }, + lowercase: { label: "קלט", gender: "m" }, + starts_with: { label: "קלט", gender: "m" }, + uppercase: { label: "קלט", gender: "m" } + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expectedKey = issue2.expected; + const expected = TypeDictionary[expectedKey ?? ""] ?? typeLabel(expectedKey); + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? TypeNames[receivedType]?.label ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `קלט לא תקין: צריך להיות instanceof ${issue2.expected}, התקבל ${received}`; + } + return `קלט לא תקין: צריך להיות ${expected}, התקבל ${received}`; + } + case "invalid_value": { + if (issue2.values.length === 1) { + return `ערך לא תקין: הערך חייב להיות ${stringifyPrimitive(issue2.values[0])}`; + } + const stringified = issue2.values.map((v) => stringifyPrimitive(v)); + if (issue2.values.length === 2) { + return `ערך לא תקין: האפשרויות המתאימות הן ${stringified[0]} או ${stringified[1]}`; + } + const lastValue = stringified[stringified.length - 1]; + const restValues = stringified.slice(0, -1).join(", "); + return `ערך לא תקין: האפשרויות המתאימות הן ${restValues} או ${lastValue}`; + } + case "too_big": { + const sizing = getSizing(issue2.origin); + const subject = withDefinite(issue2.origin ?? "value"); + if (issue2.origin === "string") { + return `${sizing?.longLabel ?? "ארוך"} מדי: ${subject} צריכה להכיל ${issue2.maximum.toString()} ${sizing?.unit ?? ""} ${issue2.inclusive ? "או פחות" : "לכל היותר"}`.trim(); + } + if (issue2.origin === "number") { + const comparison = issue2.inclusive ? `קטן או שווה ל-${issue2.maximum}` : `קטן מ-${issue2.maximum}`; + return `גדול מדי: ${subject} צריך להיות ${comparison}`; + } + if (issue2.origin === "array" || issue2.origin === "set") { + const verb = issue2.origin === "set" ? "צריכה" : "צריך"; + const comparison = issue2.inclusive ? `${issue2.maximum} ${sizing?.unit ?? ""} או פחות` : `פחות מ-${issue2.maximum} ${sizing?.unit ?? ""}`; + return `גדול מדי: ${subject} ${verb} להכיל ${comparison}`.trim(); + } + const adj = issue2.inclusive ? "<=" : "<"; + const be = verbFor(issue2.origin ?? "value"); + if (sizing?.unit) { + return `${sizing.longLabel} מדי: ${subject} ${be} ${adj}${issue2.maximum.toString()} ${sizing.unit}`; + } + return `${sizing?.longLabel ?? "גדול"} מדי: ${subject} ${be} ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const sizing = getSizing(issue2.origin); + const subject = withDefinite(issue2.origin ?? "value"); + if (issue2.origin === "string") { + return `${sizing?.shortLabel ?? "קצר"} מדי: ${subject} צריכה להכיל ${issue2.minimum.toString()} ${sizing?.unit ?? ""} ${issue2.inclusive ? "או יותר" : "לפחות"}`.trim(); + } + if (issue2.origin === "number") { + const comparison = issue2.inclusive ? `גדול או שווה ל-${issue2.minimum}` : `גדול מ-${issue2.minimum}`; + return `קטן מדי: ${subject} צריך להיות ${comparison}`; + } + if (issue2.origin === "array" || issue2.origin === "set") { + const verb = issue2.origin === "set" ? "צריכה" : "צריך"; + if (issue2.minimum === 1 && issue2.inclusive) { + const singularPhrase = issue2.origin === "set" ? "לפחות פריט אחד" : "לפחות פריט אחד"; + return `קטן מדי: ${subject} ${verb} להכיל ${singularPhrase}`; + } + const comparison = issue2.inclusive ? `${issue2.minimum} ${sizing?.unit ?? ""} או יותר` : `יותר מ-${issue2.minimum} ${sizing?.unit ?? ""}`; + return `קטן מדי: ${subject} ${verb} להכיל ${comparison}`.trim(); + } + const adj = issue2.inclusive ? ">=" : ">"; + const be = verbFor(issue2.origin ?? "value"); + if (sizing?.unit) { + return `${sizing.shortLabel} מדי: ${subject} ${be} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `${sizing?.shortLabel ?? "קטן"} מדי: ${subject} ${be} ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `המחרוזת חייבת להתחיל ב "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `המחרוזת חייבת להסתיים ב "${_issue.suffix}"`; + if (_issue.format === "includes") + return `המחרוזת חייבת לכלול "${_issue.includes}"`; + if (_issue.format === "regex") + return `המחרוזת חייבת להתאים לתבנית ${_issue.pattern}`; + const nounEntry = FormatDictionary[_issue.format]; + const noun = nounEntry?.label ?? _issue.format; + const gender = nounEntry?.gender ?? "m"; + const adjective = gender === "f" ? "תקינה" : "תקין"; + return `${noun} לא ${adjective}`; + } + case "not_multiple_of": + return `מספר לא תקין: חייב להיות מכפלה של ${issue2.divisor}`; + case "unrecognized_keys": + return `מפתח${issue2.keys.length > 1 ? "ות" : ""} לא מזוה${issue2.keys.length > 1 ? "ים" : "ה"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": { + return `שדה לא תקין באובייקט`; + } + case "invalid_union": + return "קלט לא תקין"; + case "invalid_element": { + const place = withDefinite(issue2.origin ?? "array"); + return `ערך לא תקין ב${place}`; + } + default: + return `קלט לא תקין`; + } + }; +}; +function he_default() { + return { + localeError: error17() + }; +} +// node_modules/zod/v4/locales/hr.js +var error18 = () => { + const Sizable = { + string: { unit: "znakova", verb: "imati" }, + file: { unit: "bajtova", verb: "imati" }, + array: { unit: "stavki", verb: "imati" }, + set: { unit: "stavki", verb: "imati" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "unos", + email: "email adresa", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO datum i vrijeme", + date: "ISO datum", + time: "ISO vrijeme", + duration: "ISO trajanje", + ipv4: "IPv4 adresa", + ipv6: "IPv6 adresa", + cidrv4: "IPv4 raspon", + cidrv6: "IPv6 raspon", + base64: "base64 kodirani tekst", + base64url: "base64url kodirani tekst", + json_string: "JSON tekst", + e164: "E.164 broj", + jwt: "JWT", + template_literal: "unos" + }; + const TypeDictionary = { + nan: "NaN", + string: "tekst", + number: "broj", + boolean: "boolean", + array: "niz", + object: "objekt", + set: "skup", + file: "datoteka", + date: "datum", + bigint: "bigint", + symbol: "simbol", + undefined: "undefined", + null: "null", + function: "funkcija", + map: "mapa" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Neispravan unos: očekuje se instanceof ${issue2.expected}, a primljeno je ${received}`; + } + return `Neispravan unos: očekuje se ${expected}, a primljeno je ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Neispravna vrijednost: očekivano ${stringifyPrimitive(issue2.values[0])}`; + return `Neispravna opcija: očekivano jedno od ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + if (sizing) + return `Preveliko: očekivano da ${origin ?? "vrijednost"} ima ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemenata"}`; + return `Preveliko: očekivano da ${origin ?? "vrijednost"} bude ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + if (sizing) { + return `Premalo: očekivano da ${origin} ima ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Premalo: očekivano da ${origin} bude ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Neispravan tekst: mora započinjati s "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Neispravan tekst: mora završavati s "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Neispravan tekst: mora sadržavati "${_issue.includes}"`; + if (_issue.format === "regex") + return `Neispravan tekst: mora odgovarati uzorku ${_issue.pattern}`; + return `Neispravna ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Neispravan broj: mora biti višekratnik od ${issue2.divisor}`; + case "unrecognized_keys": + return `Neprepoznat${issue2.keys.length > 1 ? "i ključevi" : " ključ"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Neispravan ključ u ${TypeDictionary[issue2.origin] ?? issue2.origin}`; + case "invalid_union": + return "Neispravan unos"; + case "invalid_element": + return `Neispravna vrijednost u ${TypeDictionary[issue2.origin] ?? issue2.origin}`; + default: + return `Neispravan unos`; + } + }; +}; +function hr_default() { + return { + localeError: error18() + }; +} +// node_modules/zod/v4/locales/hu.js +var error19 = () => { + const Sizable = { + string: { unit: "karakter", verb: "legyen" }, + file: { unit: "byte", verb: "legyen" }, + array: { unit: "elem", verb: "legyen" }, + set: { unit: "elem", verb: "legyen" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "bemenet", + email: "email cím", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO időbélyeg", + date: "ISO dátum", + time: "ISO idő", + duration: "ISO időintervallum", + ipv4: "IPv4 cím", + ipv6: "IPv6 cím", + cidrv4: "IPv4 tartomány", + cidrv6: "IPv6 tartomány", + base64: "base64-kódolt string", + base64url: "base64url-kódolt string", + json_string: "JSON string", + e164: "E.164 szám", + jwt: "JWT", + template_literal: "bemenet" + }; + const TypeDictionary = { + nan: "NaN", + number: "szám", + array: "tömb" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Érvénytelen bemenet: a várt érték instanceof ${issue2.expected}, a kapott érték ${received}`; + } + return `Érvénytelen bemenet: a várt érték ${expected}, a kapott érték ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Érvénytelen bemenet: a várt érték ${stringifyPrimitive(issue2.values[0])}`; + return `Érvénytelen opció: valamelyik érték várt ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Túl nagy: ${issue2.origin ?? "érték"} mérete túl nagy ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elem"}`; + return `Túl nagy: a bemeneti érték ${issue2.origin ?? "érték"} túl nagy: ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Túl kicsi: a bemeneti érték ${issue2.origin} mérete túl kicsi ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Túl kicsi: a bemeneti érték ${issue2.origin} túl kicsi ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Érvénytelen string: "${_issue.prefix}" értékkel kell kezdődnie`; + if (_issue.format === "ends_with") + return `Érvénytelen string: "${_issue.suffix}" értékkel kell végződnie`; + if (_issue.format === "includes") + return `Érvénytelen string: "${_issue.includes}" értéket kell tartalmaznia`; + if (_issue.format === "regex") + return `Érvénytelen string: ${_issue.pattern} mintának kell megfelelnie`; + return `Érvénytelen ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Érvénytelen szám: ${issue2.divisor} többszörösének kell lennie`; + case "unrecognized_keys": + return `Ismeretlen kulcs${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Érvénytelen kulcs ${issue2.origin}`; + case "invalid_union": + return "Érvénytelen bemenet"; + case "invalid_element": + return `Érvénytelen érték: ${issue2.origin}`; + default: + return `Érvénytelen bemenet`; + } + }; +}; +function hu_default() { + return { + localeError: error19() + }; +} +// node_modules/zod/v4/locales/hy.js +function getArmenianPlural(count, one, many) { + return Math.abs(count) === 1 ? one : many; +} +function withDefiniteArticle(word) { + if (!word) + return ""; + const vowels = ["ա", "ե", "ը", "ի", "ո", "ու", "օ"]; + const lastChar = word[word.length - 1]; + return word + (vowels.includes(lastChar) ? "ն" : "ը"); +} +var error20 = () => { + const Sizable = { + string: { + unit: { + one: "նշան", + many: "նշաններ" + }, + verb: "ունենալ" + }, + file: { + unit: { + one: "բայթ", + many: "բայթեր" + }, + verb: "ունենալ" + }, + array: { + unit: { + one: "տարր", + many: "տարրեր" + }, + verb: "ունենալ" + }, + set: { + unit: { + one: "տարր", + many: "տարրեր" + }, + verb: "ունենալ" + } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "մուտք", + email: "էլ. հասցե", + url: "URL", + emoji: "էմոջի", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO ամսաթիվ և ժամ", + date: "ISO ամսաթիվ", + time: "ISO ժամ", + duration: "ISO տևողություն", + ipv4: "IPv4 հասցե", + ipv6: "IPv6 հասցե", + cidrv4: "IPv4 միջակայք", + cidrv6: "IPv6 միջակայք", + base64: "base64 ձևաչափով տող", + base64url: "base64url ձևաչափով տող", + json_string: "JSON տող", + e164: "E.164 համար", + jwt: "JWT", + template_literal: "մուտք" + }; + const TypeDictionary = { + nan: "NaN", + number: "թիվ", + array: "զանգված" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Սխալ մուտքագրում․ սպասվում էր instanceof ${issue2.expected}, ստացվել է ${received}`; + } + return `Սխալ մուտքագրում․ սպասվում էր ${expected}, ստացվել է ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Սխալ մուտքագրում․ սպասվում էր ${stringifyPrimitive(issue2.values[1])}`; + return `Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + const maxValue = Number(issue2.maximum); + const unit = getArmenianPlural(maxValue, sizing.unit.one, sizing.unit.many); + return `Չափազանց մեծ արժեք․ սպասվում է, որ ${withDefiniteArticle(issue2.origin ?? "արժեք")} կունենա ${adj}${issue2.maximum.toString()} ${unit}`; + } + return `Չափազանց մեծ արժեք․ սպասվում է, որ ${withDefiniteArticle(issue2.origin ?? "արժեք")} լինի ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + const minValue = Number(issue2.minimum); + const unit = getArmenianPlural(minValue, sizing.unit.one, sizing.unit.many); + return `Չափազանց փոքր արժեք․ սպասվում է, որ ${withDefiniteArticle(issue2.origin)} կունենա ${adj}${issue2.minimum.toString()} ${unit}`; + } + return `Չափազանց փոքր արժեք․ սպասվում է, որ ${withDefiniteArticle(issue2.origin)} լինի ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Սխալ տող․ պետք է սկսվի "${_issue.prefix}"-ով`; + if (_issue.format === "ends_with") + return `Սխալ տող․ պետք է ավարտվի "${_issue.suffix}"-ով`; + if (_issue.format === "includes") + return `Սխալ տող․ պետք է պարունակի "${_issue.includes}"`; + if (_issue.format === "regex") + return `Սխալ տող․ պետք է համապատասխանի ${_issue.pattern} ձևաչափին`; + return `Սխալ ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Սխալ թիվ․ պետք է բազմապատիկ լինի ${issue2.divisor}-ի`; + case "unrecognized_keys": + return `Չճանաչված բանալի${issue2.keys.length > 1 ? "ներ" : ""}. ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Սխալ բանալի ${withDefiniteArticle(issue2.origin)}-ում`; + case "invalid_union": + return "Սխալ մուտքագրում"; + case "invalid_element": + return `Սխալ արժեք ${withDefiniteArticle(issue2.origin)}-ում`; + default: + return `Սխալ մուտքագրում`; + } + }; +}; +function hy_default() { + return { + localeError: error20() + }; +} +// node_modules/zod/v4/locales/id.js +var error21 = () => { + const Sizable = { + string: { unit: "karakter", verb: "memiliki" }, + file: { unit: "byte", verb: "memiliki" }, + array: { unit: "item", verb: "memiliki" }, + set: { unit: "item", verb: "memiliki" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "input", + email: "alamat email", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "tanggal dan waktu format ISO", + date: "tanggal format ISO", + time: "jam format ISO", + duration: "durasi format ISO", + ipv4: "alamat IPv4", + ipv6: "alamat IPv6", + cidrv4: "rentang alamat IPv4", + cidrv6: "rentang alamat IPv6", + base64: "string dengan enkode base64", + base64url: "string dengan enkode base64url", + json_string: "string JSON", + e164: "angka E.164", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Input tidak valid: diharapkan instanceof ${issue2.expected}, diterima ${received}`; + } + return `Input tidak valid: diharapkan ${expected}, diterima ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Input tidak valid: diharapkan ${stringifyPrimitive(issue2.values[0])}`; + return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Terlalu besar: diharapkan ${issue2.origin ?? "value"} memiliki ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemen"}`; + return `Terlalu besar: diharapkan ${issue2.origin ?? "value"} menjadi ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Terlalu kecil: diharapkan ${issue2.origin} memiliki ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Terlalu kecil: diharapkan ${issue2.origin} menjadi ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `String tidak valid: harus dimulai dengan "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `String tidak valid: harus berakhir dengan "${_issue.suffix}"`; + if (_issue.format === "includes") + return `String tidak valid: harus menyertakan "${_issue.includes}"`; + if (_issue.format === "regex") + return `String tidak valid: harus sesuai pola ${_issue.pattern}`; + return `${FormatDictionary[_issue.format] ?? issue2.format} tidak valid`; + } + case "not_multiple_of": + return `Angka tidak valid: harus kelipatan dari ${issue2.divisor}`; + case "unrecognized_keys": + return `Kunci tidak dikenali ${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Kunci tidak valid di ${issue2.origin}`; + case "invalid_union": + return "Input tidak valid"; + case "invalid_element": + return `Nilai tidak valid di ${issue2.origin}`; + default: + return `Input tidak valid`; + } + }; +}; +function id_default() { + return { + localeError: error21() + }; +} +// node_modules/zod/v4/locales/is.js +var error22 = () => { + const Sizable = { + string: { unit: "stafi", verb: "að hafa" }, + file: { unit: "bæti", verb: "að hafa" }, + array: { unit: "hluti", verb: "að hafa" }, + set: { unit: "hluti", verb: "að hafa" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "gildi", + email: "netfang", + url: "vefslóð", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO dagsetning og tími", + date: "ISO dagsetning", + time: "ISO tími", + duration: "ISO tímalengd", + ipv4: "IPv4 address", + ipv6: "IPv6 address", + cidrv4: "IPv4 range", + cidrv6: "IPv6 range", + base64: "base64-encoded strengur", + base64url: "base64url-encoded strengur", + json_string: "JSON strengur", + e164: "E.164 tölugildi", + jwt: "JWT", + template_literal: "gildi" + }; + const TypeDictionary = { + nan: "NaN", + number: "númer", + array: "fylki" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Rangt gildi: Þú slóst inn ${received} þar sem á að vera instanceof ${issue2.expected}`; + } + return `Rangt gildi: Þú slóst inn ${received} þar sem á að vera ${expected}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Rangt gildi: gert ráð fyrir ${stringifyPrimitive(issue2.values[0])}`; + return `Ógilt val: má vera eitt af eftirfarandi ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Of stórt: gert er ráð fyrir að ${issue2.origin ?? "gildi"} hafi ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "hluti"}`; + return `Of stórt: gert er ráð fyrir að ${issue2.origin ?? "gildi"} sé ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Of lítið: gert er ráð fyrir að ${issue2.origin} hafi ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Of lítið: gert er ráð fyrir að ${issue2.origin} sé ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Ógildur strengur: verður að byrja á "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Ógildur strengur: verður að enda á "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Ógildur strengur: verður að innihalda "${_issue.includes}"`; + if (_issue.format === "regex") + return `Ógildur strengur: verður að fylgja mynstri ${_issue.pattern}`; + return `Rangt ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Röng tala: verður að vera margfeldi af ${issue2.divisor}`; + case "unrecognized_keys": + return `Óþekkt ${issue2.keys.length > 1 ? "ir lyklar" : "ur lykill"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Rangur lykill í ${issue2.origin}`; + case "invalid_union": + return "Rangt gildi"; + case "invalid_element": + return `Rangt gildi í ${issue2.origin}`; + default: + return `Rangt gildi`; + } + }; +}; +function is_default() { + return { + localeError: error22() + }; +} +// node_modules/zod/v4/locales/it.js +var error23 = () => { + const Sizable = { + string: { unit: "caratteri", verb: "avere" }, + file: { unit: "byte", verb: "avere" }, + array: { unit: "elementi", verb: "avere" }, + set: { unit: "elementi", verb: "avere" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "input", + email: "indirizzo email", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "data e ora ISO", + date: "data ISO", + time: "ora ISO", + duration: "durata ISO", + ipv4: "indirizzo IPv4", + ipv6: "indirizzo IPv6", + cidrv4: "intervallo IPv4", + cidrv6: "intervallo IPv6", + base64: "stringa codificata in base64", + base64url: "URL codificata in base64", + json_string: "stringa JSON", + e164: "numero E.164", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN", + number: "numero", + array: "vettore" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Input non valido: atteso instanceof ${issue2.expected}, ricevuto ${received}`; + } + return `Input non valido: atteso ${expected}, ricevuto ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Input non valido: atteso ${stringifyPrimitive(issue2.values[0])}`; + return `Opzione non valida: atteso uno tra ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Troppo grande: ${issue2.origin ?? "valore"} deve avere ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementi"}`; + return `Troppo grande: ${issue2.origin ?? "valore"} deve essere ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Troppo piccolo: ${issue2.origin} deve avere ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Troppo piccolo: ${issue2.origin} deve essere ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Stringa non valida: deve iniziare con "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Stringa non valida: deve terminare con "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Stringa non valida: deve includere "${_issue.includes}"`; + if (_issue.format === "regex") + return `Stringa non valida: deve corrispondere al pattern ${_issue.pattern}`; + return `Input non valido: ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Numero non valido: deve essere un multiplo di ${issue2.divisor}`; + case "unrecognized_keys": + return `Chiav${issue2.keys.length > 1 ? "i" : "e"} non riconosciut${issue2.keys.length > 1 ? "e" : "a"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Chiave non valida in ${issue2.origin}`; + case "invalid_union": + return "Input non valido"; + case "invalid_element": + return `Valore non valido in ${issue2.origin}`; + default: + return `Input non valido`; + } + }; +}; +function it_default() { + return { + localeError: error23() + }; +} +// node_modules/zod/v4/locales/ja.js +var error24 = () => { + const Sizable = { + string: { unit: "文字", verb: "である" }, + file: { unit: "バイト", verb: "である" }, + array: { unit: "要素", verb: "である" }, + set: { unit: "要素", verb: "である" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "入力値", + email: "メールアドレス", + url: "URL", + emoji: "絵文字", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO日時", + date: "ISO日付", + time: "ISO時刻", + duration: "ISO期間", + ipv4: "IPv4アドレス", + ipv6: "IPv6アドレス", + cidrv4: "IPv4範囲", + cidrv6: "IPv6範囲", + base64: "base64エンコード文字列", + base64url: "base64urlエンコード文字列", + json_string: "JSON文字列", + e164: "E.164番号", + jwt: "JWT", + template_literal: "入力値" + }; + const TypeDictionary = { + nan: "NaN", + number: "数値", + array: "配列" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `無効な入力: instanceof ${issue2.expected}が期待されましたが、${received}が入力されました`; + } + return `無効な入力: ${expected}が期待されましたが、${received}が入力されました`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `無効な入力: ${stringifyPrimitive(issue2.values[0])}が期待されました`; + return `無効な選択: ${joinValues(issue2.values, "、")}のいずれかである必要があります`; + case "too_big": { + const adj = issue2.inclusive ? "以下である" : "より小さい"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `大きすぎる値: ${issue2.origin ?? "値"}は${issue2.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`; + return `大きすぎる値: ${issue2.origin ?? "値"}は${issue2.maximum.toString()}${adj}必要があります`; + } + case "too_small": { + const adj = issue2.inclusive ? "以上である" : "より大きい"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `小さすぎる値: ${issue2.origin}は${issue2.minimum.toString()}${sizing.unit}${adj}必要があります`; + return `小さすぎる値: ${issue2.origin}は${issue2.minimum.toString()}${adj}必要があります`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `無効な文字列: "${_issue.prefix}"で始まる必要があります`; + if (_issue.format === "ends_with") + return `無効な文字列: "${_issue.suffix}"で終わる必要があります`; + if (_issue.format === "includes") + return `無効な文字列: "${_issue.includes}"を含む必要があります`; + if (_issue.format === "regex") + return `無効な文字列: パターン${_issue.pattern}に一致する必要があります`; + return `無効な${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `無効な数値: ${issue2.divisor}の倍数である必要があります`; + case "unrecognized_keys": + return `認識されていないキー${issue2.keys.length > 1 ? "群" : ""}: ${joinValues(issue2.keys, "、")}`; + case "invalid_key": + return `${issue2.origin}内の無効なキー`; + case "invalid_union": + return "無効な入力"; + case "invalid_element": + return `${issue2.origin}内の無効な値`; + default: + return `無効な入力`; + } + }; +}; +function ja_default() { + return { + localeError: error24() + }; +} +// node_modules/zod/v4/locales/ka.js +var error25 = () => { + const Sizable = { + string: { unit: "სიმბოლო", verb: "უნდა შეიცავდეს" }, + file: { unit: "ბაიტი", verb: "უნდა შეიცავდეს" }, + array: { unit: "ელემენტი", verb: "უნდა შეიცავდეს" }, + set: { unit: "ელემენტი", verb: "უნდა შეიცავდეს" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "შეყვანა", + email: "ელ-ფოსტის მისამართი", + url: "URL", + emoji: "ემოჯი", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "თარიღი-დრო", + date: "თარიღი", + time: "დრო", + duration: "ხანგრძლივობა", + ipv4: "IPv4 მისამართი", + ipv6: "IPv6 მისამართი", + cidrv4: "IPv4 დიაპაზონი", + cidrv6: "IPv6 დიაპაზონი", + base64: "base64-კოდირებული ველი", + base64url: "base64url-კოდირებული ველი", + json_string: "JSON ველი", + e164: "E.164 ნომერი", + jwt: "JWT", + template_literal: "შეყვანა" + }; + const TypeDictionary = { + nan: "NaN", + number: "რიცხვი", + string: "ველი", + boolean: "ბულეანი", + function: "ფუნქცია", + array: "მასივი" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `არასწორი შეყვანა: მოსალოდნელი instanceof ${issue2.expected}, მიღებული ${received}`; + } + return `არასწორი შეყვანა: მოსალოდნელი ${expected}, მიღებული ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `არასწორი შეყვანა: მოსალოდნელი ${stringifyPrimitive(issue2.values[0])}`; + return `არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${joinValues(issue2.values, "|")}-დან`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `ზედმეტად დიდი: მოსალოდნელი ${issue2.origin ?? "მნიშვნელობა"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit}`; + return `ზედმეტად დიდი: მოსალოდნელი ${issue2.origin ?? "მნიშვნელობა"} იყოს ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `ზედმეტად პატარა: მოსალოდნელი ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `ზედმეტად პატარა: მოსალოდნელი ${issue2.origin} იყოს ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `არასწორი ველი: უნდა იწყებოდეს "${_issue.prefix}"-ით`; + } + if (_issue.format === "ends_with") + return `არასწორი ველი: უნდა მთავრდებოდეს "${_issue.suffix}"-ით`; + if (_issue.format === "includes") + return `არასწორი ველი: უნდა შეიცავდეს "${_issue.includes}"-ს`; + if (_issue.format === "regex") + return `არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${_issue.pattern}`; + return `არასწორი ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `არასწორი რიცხვი: უნდა იყოს ${issue2.divisor}-ის ჯერადი`; + case "unrecognized_keys": + return `უცნობი გასაღებ${issue2.keys.length > 1 ? "ები" : "ი"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `არასწორი გასაღები ${issue2.origin}-ში`; + case "invalid_union": + return "არასწორი შეყვანა"; + case "invalid_element": + return `არასწორი მნიშვნელობა ${issue2.origin}-ში`; + default: + return `არასწორი შეყვანა`; + } + }; +}; +function ka_default() { + return { + localeError: error25() + }; +} +// node_modules/zod/v4/locales/km.js +var error26 = () => { + const Sizable = { + string: { unit: "តួអក្សរ", verb: "គួរមាន" }, + file: { unit: "បៃ", verb: "គួរមាន" }, + array: { unit: "ធាតុ", verb: "គួរមាន" }, + set: { unit: "ធាតុ", verb: "គួរមាន" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "ទិន្នន័យបញ្ចូល", + email: "អាសយដ្ឋានអ៊ីមែល", + url: "URL", + emoji: "សញ្ញាអារម្មណ៍", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "កាលបរិច្ឆេទ និងម៉ោង ISO", + date: "កាលបរិច្ឆេទ ISO", + time: "ម៉ោង ISO", + duration: "រយៈពេល ISO", + ipv4: "អាសយដ្ឋាន IPv4", + ipv6: "អាសយដ្ឋាន IPv6", + cidrv4: "ដែនអាសយដ្ឋាន IPv4", + cidrv6: "ដែនអាសយដ្ឋាន IPv6", + base64: "ខ្សែអក្សរអ៊ិកូដ base64", + base64url: "ខ្សែអក្សរអ៊ិកូដ base64url", + json_string: "ខ្សែអក្សរ JSON", + e164: "លេខ E.164", + jwt: "JWT", + template_literal: "ទិន្នន័យបញ្ចូល" + }; + const TypeDictionary = { + nan: "NaN", + number: "លេខ", + array: "អារេ (Array)", + null: "គ្មានតម្លៃ (null)" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${issue2.expected} ប៉ុន្តែទទួលបាន ${received}`; + } + return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${expected} ប៉ុន្តែទទួលបាន ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue2.values[0])}`; + return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `ធំពេក៖ ត្រូវការ ${issue2.origin ?? "តម្លៃ"} ${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "ធាតុ"}`; + return `ធំពេក៖ ត្រូវការ ${issue2.origin ?? "តម្លៃ"} ${adj} ${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `តូចពេក៖ ត្រូវការ ${issue2.origin} ${adj} ${issue2.minimum.toString()} ${sizing.unit}`; + } + return `តូចពេក៖ ត្រូវការ ${issue2.origin} ${adj} ${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${_issue.suffix}"`; + if (_issue.format === "includes") + return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${_issue.includes}"`; + if (_issue.format === "regex") + return `ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${_issue.pattern}`; + return `មិនត្រឹមត្រូវ៖ ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${issue2.divisor}`; + case "unrecognized_keys": + return `រកឃើញសោមិនស្គាល់៖ ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `សោមិនត្រឹមត្រូវនៅក្នុង ${issue2.origin}`; + case "invalid_union": + return `ទិន្នន័យមិនត្រឹមត្រូវ`; + case "invalid_element": + return `ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${issue2.origin}`; + default: + return `ទិន្នន័យមិនត្រឹមត្រូវ`; + } + }; +}; +function km_default() { + return { + localeError: error26() + }; +} + +// node_modules/zod/v4/locales/kh.js +function kh_default() { + return km_default(); +} +// node_modules/zod/v4/locales/ko.js +var error27 = () => { + const Sizable = { + string: { unit: "문자", verb: "to have" }, + file: { unit: "바이트", verb: "to have" }, + array: { unit: "개", verb: "to have" }, + set: { unit: "개", verb: "to have" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "입력", + email: "이메일 주소", + url: "URL", + emoji: "이모지", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO 날짜시간", + date: "ISO 날짜", + time: "ISO 시간", + duration: "ISO 기간", + ipv4: "IPv4 주소", + ipv6: "IPv6 주소", + cidrv4: "IPv4 범위", + cidrv6: "IPv6 범위", + base64: "base64 인코딩 문자열", + base64url: "base64url 인코딩 문자열", + json_string: "JSON 문자열", + e164: "E.164 번호", + jwt: "JWT", + template_literal: "입력" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `잘못된 입력: 예상 타입은 instanceof ${issue2.expected}, 받은 타입은 ${received}입니다`; + } + return `잘못된 입력: 예상 타입은 ${expected}, 받은 타입은 ${received}입니다`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `잘못된 입력: 값은 ${stringifyPrimitive(issue2.values[0])} 이어야 합니다`; + return `잘못된 옵션: ${joinValues(issue2.values, "또는 ")} 중 하나여야 합니다`; + case "too_big": { + const adj = issue2.inclusive ? "이하" : "미만"; + const suffix = adj === "미만" ? "이어야 합니다" : "여야 합니다"; + const sizing = getSizing(issue2.origin); + const unit = sizing?.unit ?? "요소"; + if (sizing) + return `${issue2.origin ?? "값"}이 너무 큽니다: ${issue2.maximum.toString()}${unit} ${adj}${suffix}`; + return `${issue2.origin ?? "값"}이 너무 큽니다: ${issue2.maximum.toString()} ${adj}${suffix}`; + } + case "too_small": { + const adj = issue2.inclusive ? "이상" : "초과"; + const suffix = adj === "이상" ? "이어야 합니다" : "여야 합니다"; + const sizing = getSizing(issue2.origin); + const unit = sizing?.unit ?? "요소"; + if (sizing) { + return `${issue2.origin ?? "값"}이 너무 작습니다: ${issue2.minimum.toString()}${unit} ${adj}${suffix}`; + } + return `${issue2.origin ?? "값"}이 너무 작습니다: ${issue2.minimum.toString()} ${adj}${suffix}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `잘못된 문자열: "${_issue.prefix}"(으)로 시작해야 합니다`; + } + if (_issue.format === "ends_with") + return `잘못된 문자열: "${_issue.suffix}"(으)로 끝나야 합니다`; + if (_issue.format === "includes") + return `잘못된 문자열: "${_issue.includes}"을(를) 포함해야 합니다`; + if (_issue.format === "regex") + return `잘못된 문자열: 정규식 ${_issue.pattern} 패턴과 일치해야 합니다`; + return `잘못된 ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `잘못된 숫자: ${issue2.divisor}의 배수여야 합니다`; + case "unrecognized_keys": + return `인식할 수 없는 키: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `잘못된 키: ${issue2.origin}`; + case "invalid_union": + return `잘못된 입력`; + case "invalid_element": + return `잘못된 값: ${issue2.origin}`; + default: + return `잘못된 입력`; + } + }; +}; +function ko_default() { + return { + localeError: error27() + }; +} +// node_modules/zod/v4/locales/lt.js +var capitalizeFirstCharacter = (text) => { + return text.charAt(0).toUpperCase() + text.slice(1); +}; +function getUnitTypeFromNumber(number2) { + const abs = Math.abs(number2); + const last = abs % 10; + const last2 = abs % 100; + if (last2 >= 11 && last2 <= 19 || last === 0) + return "many"; + if (last === 1) + return "one"; + return "few"; +} +var error28 = () => { + const Sizable = { + string: { + unit: { + one: "simbolis", + few: "simboliai", + many: "simbolių" + }, + verb: { + smaller: { + inclusive: "turi būti ne ilgesnė kaip", + notInclusive: "turi būti trumpesnė kaip" + }, + bigger: { + inclusive: "turi būti ne trumpesnė kaip", + notInclusive: "turi būti ilgesnė kaip" + } + } + }, + file: { + unit: { + one: "baitas", + few: "baitai", + many: "baitų" + }, + verb: { + smaller: { + inclusive: "turi būti ne didesnis kaip", + notInclusive: "turi būti mažesnis kaip" + }, + bigger: { + inclusive: "turi būti ne mažesnis kaip", + notInclusive: "turi būti didesnis kaip" + } + } + }, + array: { + unit: { + one: "elementą", + few: "elementus", + many: "elementų" + }, + verb: { + smaller: { + inclusive: "turi turėti ne daugiau kaip", + notInclusive: "turi turėti mažiau kaip" + }, + bigger: { + inclusive: "turi turėti ne mažiau kaip", + notInclusive: "turi turėti daugiau kaip" + } + } + }, + set: { + unit: { + one: "elementą", + few: "elementus", + many: "elementų" + }, + verb: { + smaller: { + inclusive: "turi turėti ne daugiau kaip", + notInclusive: "turi turėti mažiau kaip" + }, + bigger: { + inclusive: "turi turėti ne mažiau kaip", + notInclusive: "turi turėti daugiau kaip" + } + } + } + }; + function getSizing(origin, unitType, inclusive, targetShouldBe) { + const result = Sizable[origin] ?? null; + if (result === null) + return result; + return { + unit: result.unit[unitType], + verb: result.verb[targetShouldBe][inclusive ? "inclusive" : "notInclusive"] + }; + } + const FormatDictionary = { + regex: "įvestis", + email: "el. pašto adresas", + url: "URL", + emoji: "jaustukas", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO data ir laikas", + date: "ISO data", + time: "ISO laikas", + duration: "ISO trukmė", + ipv4: "IPv4 adresas", + ipv6: "IPv6 adresas", + cidrv4: "IPv4 tinklo prefiksas (CIDR)", + cidrv6: "IPv6 tinklo prefiksas (CIDR)", + base64: "base64 užkoduota eilutė", + base64url: "base64url užkoduota eilutė", + json_string: "JSON eilutė", + e164: "E.164 numeris", + jwt: "JWT", + template_literal: "įvestis" + }; + const TypeDictionary = { + nan: "NaN", + number: "skaičius", + bigint: "sveikasis skaičius", + string: "eilutė", + boolean: "loginė reikšmė", + undefined: "neapibrėžta reikšmė", + function: "funkcija", + symbol: "simbolis", + array: "masyvas", + object: "objektas", + null: "nulinė reikšmė" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Gautas tipas ${received}, o tikėtasi - instanceof ${issue2.expected}`; + } + return `Gautas tipas ${received}, o tikėtasi - ${expected}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Privalo būti ${stringifyPrimitive(issue2.values[0])}`; + return `Privalo būti vienas iš ${joinValues(issue2.values, "|")} pasirinkimų`; + case "too_big": { + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.maximum)), issue2.inclusive ?? false, "smaller"); + if (sizing?.verb) + return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} ${sizing.verb} ${issue2.maximum.toString()} ${sizing.unit ?? "elementų"}`; + const adj = issue2.inclusive ? "ne didesnis kaip" : "mažesnis kaip"; + return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} turi būti ${adj} ${issue2.maximum.toString()} ${sizing?.unit}`; + } + case "too_small": { + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + const sizing = getSizing(issue2.origin, getUnitTypeFromNumber(Number(issue2.minimum)), issue2.inclusive ?? false, "bigger"); + if (sizing?.verb) + return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} ${sizing.verb} ${issue2.minimum.toString()} ${sizing.unit ?? "elementų"}`; + const adj = issue2.inclusive ? "ne mažesnis kaip" : "didesnis kaip"; + return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} turi būti ${adj} ${issue2.minimum.toString()} ${sizing?.unit}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Eilutė privalo prasidėti "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Eilutė privalo pasibaigti "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Eilutė privalo įtraukti "${_issue.includes}"`; + if (_issue.format === "regex") + return `Eilutė privalo atitikti ${_issue.pattern}`; + return `Neteisingas ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Skaičius privalo būti ${issue2.divisor} kartotinis.`; + case "unrecognized_keys": + return `Neatpažint${issue2.keys.length > 1 ? "i" : "as"} rakt${issue2.keys.length > 1 ? "ai" : "as"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return "Rastas klaidingas raktas"; + case "invalid_union": + return "Klaidinga įvestis"; + case "invalid_element": { + const origin = TypeDictionary[issue2.origin] ?? issue2.origin; + return `${capitalizeFirstCharacter(origin ?? issue2.origin ?? "reikšmė")} turi klaidingą įvestį`; + } + default: + return "Klaidinga įvestis"; + } + }; +}; +function lt_default() { + return { + localeError: error28() + }; +} +// node_modules/zod/v4/locales/mk.js +var error29 = () => { + const Sizable = { + string: { unit: "знаци", verb: "да имаат" }, + file: { unit: "бајти", verb: "да имаат" }, + array: { unit: "ставки", verb: "да имаат" }, + set: { unit: "ставки", verb: "да имаат" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "внес", + email: "адреса на е-пошта", + url: "URL", + emoji: "емоџи", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO датум и време", + date: "ISO датум", + time: "ISO време", + duration: "ISO времетраење", + ipv4: "IPv4 адреса", + ipv6: "IPv6 адреса", + cidrv4: "IPv4 опсег", + cidrv6: "IPv6 опсег", + base64: "base64-енкодирана низа", + base64url: "base64url-енкодирана низа", + json_string: "JSON низа", + e164: "E.164 број", + jwt: "JWT", + template_literal: "внес" + }; + const TypeDictionary = { + nan: "NaN", + number: "број", + array: "низа" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Грешен внес: се очекува instanceof ${issue2.expected}, примено ${received}`; + } + return `Грешен внес: се очекува ${expected}, примено ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Invalid input: expected ${stringifyPrimitive(issue2.values[0])}`; + return `Грешана опција: се очекува една ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Премногу голем: се очекува ${issue2.origin ?? "вредноста"} да има ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "елементи"}`; + return `Премногу голем: се очекува ${issue2.origin ?? "вредноста"} да биде ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Премногу мал: се очекува ${issue2.origin} да има ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Премногу мал: се очекува ${issue2.origin} да биде ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Неважечка низа: мора да започнува со "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Неважечка низа: мора да завршува со "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Неважечка низа: мора да вклучува "${_issue.includes}"`; + if (_issue.format === "regex") + return `Неважечка низа: мора да одгоара на патернот ${_issue.pattern}`; + return `Invalid ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Грешен број: мора да биде делив со ${issue2.divisor}`; + case "unrecognized_keys": + return `${issue2.keys.length > 1 ? "Непрепознаени клучеви" : "Непрепознаен клуч"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Грешен клуч во ${issue2.origin}`; + case "invalid_union": + return "Грешен внес"; + case "invalid_element": + return `Грешна вредност во ${issue2.origin}`; + default: + return `Грешен внес`; + } + }; +}; +function mk_default() { + return { + localeError: error29() + }; +} +// node_modules/zod/v4/locales/ms.js +var error30 = () => { + const Sizable = { + string: { unit: "aksara", verb: "mempunyai" }, + file: { unit: "bait", verb: "mempunyai" }, + array: { unit: "elemen", verb: "mempunyai" }, + set: { unit: "elemen", verb: "mempunyai" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "input", + email: "alamat e-mel", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "tarikh masa ISO", + date: "tarikh ISO", + time: "masa ISO", + duration: "tempoh ISO", + ipv4: "alamat IPv4", + ipv6: "alamat IPv6", + cidrv4: "julat IPv4", + cidrv6: "julat IPv6", + base64: "string dikodkan base64", + base64url: "string dikodkan base64url", + json_string: "string JSON", + e164: "nombor E.164", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN", + number: "nombor" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Input tidak sah: dijangka instanceof ${issue2.expected}, diterima ${received}`; + } + return `Input tidak sah: dijangka ${expected}, diterima ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Input tidak sah: dijangka ${stringifyPrimitive(issue2.values[0])}`; + return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Terlalu besar: dijangka ${issue2.origin ?? "nilai"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemen"}`; + return `Terlalu besar: dijangka ${issue2.origin ?? "nilai"} adalah ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Terlalu kecil: dijangka ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Terlalu kecil: dijangka ${issue2.origin} adalah ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`; + if (_issue.format === "includes") + return `String tidak sah: mesti mengandungi "${_issue.includes}"`; + if (_issue.format === "regex") + return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`; + return `${FormatDictionary[_issue.format] ?? issue2.format} tidak sah`; + } + case "not_multiple_of": + return `Nombor tidak sah: perlu gandaan ${issue2.divisor}`; + case "unrecognized_keys": + return `Kunci tidak dikenali: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Kunci tidak sah dalam ${issue2.origin}`; + case "invalid_union": + return "Input tidak sah"; + case "invalid_element": + return `Nilai tidak sah dalam ${issue2.origin}`; + default: + return `Input tidak sah`; + } + }; +}; +function ms_default() { + return { + localeError: error30() + }; +} +// node_modules/zod/v4/locales/nl.js +var error31 = () => { + const Sizable = { + string: { unit: "tekens", verb: "heeft" }, + file: { unit: "bytes", verb: "heeft" }, + array: { unit: "elementen", verb: "heeft" }, + set: { unit: "elementen", verb: "heeft" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "invoer", + email: "emailadres", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO datum en tijd", + date: "ISO datum", + time: "ISO tijd", + duration: "ISO duur", + ipv4: "IPv4-adres", + ipv6: "IPv6-adres", + cidrv4: "IPv4-bereik", + cidrv6: "IPv6-bereik", + base64: "base64-gecodeerde tekst", + base64url: "base64 URL-gecodeerde tekst", + json_string: "JSON string", + e164: "E.164-nummer", + jwt: "JWT", + template_literal: "invoer" + }; + const TypeDictionary = { + nan: "NaN", + number: "getal" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Ongeldige invoer: verwacht instanceof ${issue2.expected}, ontving ${received}`; + } + return `Ongeldige invoer: verwacht ${expected}, ontving ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue2.values[0])}`; + return `Ongeldige optie: verwacht één van ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + const longName = issue2.origin === "date" ? "laat" : issue2.origin === "string" ? "lang" : "groot"; + if (sizing) + return `Te ${longName}: verwacht dat ${issue2.origin ?? "waarde"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementen"} ${sizing.verb}`; + return `Te ${longName}: verwacht dat ${issue2.origin ?? "waarde"} ${adj}${issue2.maximum.toString()} is`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + const shortName = issue2.origin === "date" ? "vroeg" : issue2.origin === "string" ? "kort" : "klein"; + if (sizing) { + return `Te ${shortName}: verwacht dat ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`; + } + return `Te ${shortName}: verwacht dat ${issue2.origin} ${adj}${issue2.minimum.toString()} is`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`; + } + if (_issue.format === "ends_with") + return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`; + if (_issue.format === "includes") + return `Ongeldige tekst: moet "${_issue.includes}" bevatten`; + if (_issue.format === "regex") + return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`; + return `Ongeldig: ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Ongeldig getal: moet een veelvoud van ${issue2.divisor} zijn`; + case "unrecognized_keys": + return `Onbekende key${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Ongeldige key in ${issue2.origin}`; + case "invalid_union": + return "Ongeldige invoer"; + case "invalid_element": + return `Ongeldige waarde in ${issue2.origin}`; + default: + return `Ongeldige invoer`; + } + }; +}; +function nl_default() { + return { + localeError: error31() + }; +} +// node_modules/zod/v4/locales/no.js +var error32 = () => { + const Sizable = { + string: { unit: "tegn", verb: "å ha" }, + file: { unit: "bytes", verb: "å ha" }, + array: { unit: "elementer", verb: "å inneholde" }, + set: { unit: "elementer", verb: "å inneholde" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "input", + email: "e-postadresse", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO dato- og klokkeslett", + date: "ISO-dato", + time: "ISO-klokkeslett", + duration: "ISO-varighet", + ipv4: "IPv4-område", + ipv6: "IPv6-område", + cidrv4: "IPv4-spekter", + cidrv6: "IPv6-spekter", + base64: "base64-enkodet streng", + base64url: "base64url-enkodet streng", + json_string: "JSON-streng", + e164: "E.164-nummer", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN", + number: "tall", + array: "liste" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Ugyldig input: forventet instanceof ${issue2.expected}, fikk ${received}`; + } + return `Ugyldig input: forventet ${expected}, fikk ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Ugyldig verdi: forventet ${stringifyPrimitive(issue2.values[0])}`; + return `Ugyldig valg: forventet en av ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `For stor(t): forventet ${issue2.origin ?? "value"} til å ha ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementer"}`; + return `For stor(t): forventet ${issue2.origin ?? "value"} til å ha ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `For lite(n): forventet ${issue2.origin} til å ha ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `For lite(n): forventet ${issue2.origin} til å ha ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Ugyldig streng: må starte med "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Ugyldig streng: må ende med "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Ugyldig streng: må inneholde "${_issue.includes}"`; + if (_issue.format === "regex") + return `Ugyldig streng: må matche mønsteret ${_issue.pattern}`; + return `Ugyldig ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Ugyldig tall: må være et multiplum av ${issue2.divisor}`; + case "unrecognized_keys": + return `${issue2.keys.length > 1 ? "Ukjente nøkler" : "Ukjent nøkkel"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Ugyldig nøkkel i ${issue2.origin}`; + case "invalid_union": + return "Ugyldig input"; + case "invalid_element": + return `Ugyldig verdi i ${issue2.origin}`; + default: + return `Ugyldig input`; + } + }; +}; +function no_default() { + return { + localeError: error32() + }; +} +// node_modules/zod/v4/locales/ota.js +var error33 = () => { + const Sizable = { + string: { unit: "harf", verb: "olmalıdır" }, + file: { unit: "bayt", verb: "olmalıdır" }, + array: { unit: "unsur", verb: "olmalıdır" }, + set: { unit: "unsur", verb: "olmalıdır" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "giren", + email: "epostagâh", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO hengâmı", + date: "ISO tarihi", + time: "ISO zamanı", + duration: "ISO müddeti", + ipv4: "IPv4 nişânı", + ipv6: "IPv6 nişânı", + cidrv4: "IPv4 menzili", + cidrv6: "IPv6 menzili", + base64: "base64-şifreli metin", + base64url: "base64url-şifreli metin", + json_string: "JSON metin", + e164: "E.164 sayısı", + jwt: "JWT", + template_literal: "giren" + }; + const TypeDictionary = { + nan: "NaN", + number: "numara", + array: "saf", + null: "gayb" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Fâsit giren: umulan instanceof ${issue2.expected}, alınan ${received}`; + } + return `Fâsit giren: umulan ${expected}, alınan ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Fâsit giren: umulan ${stringifyPrimitive(issue2.values[0])}`; + return `Fâsit tercih: mûteberler ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Fazla büyük: ${issue2.origin ?? "value"}, ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmalıydı.`; + return `Fazla büyük: ${issue2.origin ?? "value"}, ${adj}${issue2.maximum.toString()} olmalıydı.`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Fazla küçük: ${issue2.origin}, ${adj}${issue2.minimum.toString()} ${sizing.unit} sahip olmalıydı.`; + } + return `Fazla küçük: ${issue2.origin}, ${adj}${issue2.minimum.toString()} olmalıydı.`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Fâsit metin: "${_issue.prefix}" ile başlamalı.`; + if (_issue.format === "ends_with") + return `Fâsit metin: "${_issue.suffix}" ile bitmeli.`; + if (_issue.format === "includes") + return `Fâsit metin: "${_issue.includes}" ihtivâ etmeli.`; + if (_issue.format === "regex") + return `Fâsit metin: ${_issue.pattern} nakşına uymalı.`; + return `Fâsit ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Fâsit sayı: ${issue2.divisor} katı olmalıydı.`; + case "unrecognized_keys": + return `Tanınmayan anahtar ${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `${issue2.origin} için tanınmayan anahtar var.`; + case "invalid_union": + return "Giren tanınamadı."; + case "invalid_element": + return `${issue2.origin} için tanınmayan kıymet var.`; + default: + return `Kıymet tanınamadı.`; + } + }; +}; +function ota_default() { + return { + localeError: error33() + }; +} +// node_modules/zod/v4/locales/ps.js +var error34 = () => { + const Sizable = { + string: { unit: "توکي", verb: "ولري" }, + file: { unit: "بایټس", verb: "ولري" }, + array: { unit: "توکي", verb: "ولري" }, + set: { unit: "توکي", verb: "ولري" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "ورودي", + email: "بریښنالیک", + url: "یو آر ال", + emoji: "ایموجي", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "نیټه او وخت", + date: "نېټه", + time: "وخت", + duration: "موده", + ipv4: "د IPv4 پته", + ipv6: "د IPv6 پته", + cidrv4: "د IPv4 ساحه", + cidrv6: "د IPv6 ساحه", + base64: "base64-encoded متن", + base64url: "base64url-encoded متن", + json_string: "JSON متن", + e164: "د E.164 شمېره", + jwt: "JWT", + template_literal: "ورودي" + }; + const TypeDictionary = { + nan: "NaN", + number: "عدد", + array: "ارې" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `ناسم ورودي: باید instanceof ${issue2.expected} وای, مګر ${received} ترلاسه شو`; + } + return `ناسم ورودي: باید ${expected} وای, مګر ${received} ترلاسه شو`; + } + case "invalid_value": + if (issue2.values.length === 1) { + return `ناسم ورودي: باید ${stringifyPrimitive(issue2.values[0])} وای`; + } + return `ناسم انتخاب: باید یو له ${joinValues(issue2.values, "|")} څخه وای`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `ډیر لوی: ${issue2.origin ?? "ارزښت"} باید ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`; + } + return `ډیر لوی: ${issue2.origin ?? "ارزښت"} باید ${adj}${issue2.maximum.toString()} وي`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `ډیر کوچنی: ${issue2.origin} باید ${adj}${issue2.minimum.toString()} ${sizing.unit} ولري`; + } + return `ډیر کوچنی: ${issue2.origin} باید ${adj}${issue2.minimum.toString()} وي`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`; + } + if (_issue.format === "ends_with") { + return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`; + } + if (_issue.format === "includes") { + return `ناسم متن: باید "${_issue.includes}" ولري`; + } + if (_issue.format === "regex") { + return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`; + } + return `${FormatDictionary[_issue.format] ?? issue2.format} ناسم دی`; + } + case "not_multiple_of": + return `ناسم عدد: باید د ${issue2.divisor} مضرب وي`; + case "unrecognized_keys": + return `ناسم ${issue2.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `ناسم کلیډ په ${issue2.origin} کې`; + case "invalid_union": + return `ناسمه ورودي`; + case "invalid_element": + return `ناسم عنصر په ${issue2.origin} کې`; + default: + return `ناسمه ورودي`; + } + }; +}; +function ps_default() { + return { + localeError: error34() + }; +} +// node_modules/zod/v4/locales/pl.js +var error35 = () => { + const Sizable = { + string: { unit: "znaków", verb: "mieć" }, + file: { unit: "bajtów", verb: "mieć" }, + array: { unit: "elementów", verb: "mieć" }, + set: { unit: "elementów", verb: "mieć" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "wyrażenie", + email: "adres email", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "data i godzina w formacie ISO", + date: "data w formacie ISO", + time: "godzina w formacie ISO", + duration: "czas trwania ISO", + ipv4: "adres IPv4", + ipv6: "adres IPv6", + cidrv4: "zakres IPv4", + cidrv6: "zakres IPv6", + base64: "ciąg znaków zakodowany w formacie base64", + base64url: "ciąg znaków zakodowany w formacie base64url", + json_string: "ciąg znaków w formacie JSON", + e164: "liczba E.164", + jwt: "JWT", + template_literal: "wejście" + }; + const TypeDictionary = { + nan: "NaN", + number: "liczba", + array: "tablica" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Nieprawidłowe dane wejściowe: oczekiwano instanceof ${issue2.expected}, otrzymano ${received}`; + } + return `Nieprawidłowe dane wejściowe: oczekiwano ${expected}, otrzymano ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue2.values[0])}`; + return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Za duża wartość: oczekiwano, że ${issue2.origin ?? "wartość"} będzie mieć ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementów"}`; + } + return `Zbyt duż(y/a/e): oczekiwano, że ${issue2.origin ?? "wartość"} będzie wynosić ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Za mała wartość: oczekiwano, że ${issue2.origin ?? "wartość"} będzie mieć ${adj}${issue2.minimum.toString()} ${sizing.unit ?? "elementów"}`; + } + return `Zbyt mał(y/a/e): oczekiwano, że ${issue2.origin ?? "wartość"} będzie wynosić ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Nieprawidłowy ciąg znaków: musi zaczynać się od "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Nieprawidłowy ciąg znaków: musi kończyć się na "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Nieprawidłowy ciąg znaków: musi zawierać "${_issue.includes}"`; + if (_issue.format === "regex") + return `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${_issue.pattern}`; + return `Nieprawidłow(y/a/e) ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Nieprawidłowa liczba: musi być wielokrotnością ${issue2.divisor}`; + case "unrecognized_keys": + return `Nierozpoznane klucze${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Nieprawidłowy klucz w ${issue2.origin}`; + case "invalid_union": + return "Nieprawidłowe dane wejściowe"; + case "invalid_element": + return `Nieprawidłowa wartość w ${issue2.origin}`; + default: + return `Nieprawidłowe dane wejściowe`; + } + }; +}; +function pl_default() { + return { + localeError: error35() + }; +} +// node_modules/zod/v4/locales/pt.js +var error36 = () => { + const Sizable = { + string: { unit: "caracteres", verb: "ter" }, + file: { unit: "bytes", verb: "ter" }, + array: { unit: "itens", verb: "ter" }, + set: { unit: "itens", verb: "ter" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "padrão", + email: "endereço de e-mail", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "data e hora ISO", + date: "data ISO", + time: "hora ISO", + duration: "duração ISO", + ipv4: "endereço IPv4", + ipv6: "endereço IPv6", + cidrv4: "faixa de IPv4", + cidrv6: "faixa de IPv6", + base64: "texto codificado em base64", + base64url: "URL codificada em base64", + json_string: "texto JSON", + e164: "número E.164", + jwt: "JWT", + template_literal: "entrada" + }; + const TypeDictionary = { + nan: "NaN", + number: "número", + null: "nulo" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Tipo inválido: esperado instanceof ${issue2.expected}, recebido ${received}`; + } + return `Tipo inválido: esperado ${expected}, recebido ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Entrada inválida: esperado ${stringifyPrimitive(issue2.values[0])}`; + return `Opção inválida: esperada uma das ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Muito grande: esperado que ${issue2.origin ?? "valor"} tivesse ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementos"}`; + return `Muito grande: esperado que ${issue2.origin ?? "valor"} fosse ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Muito pequeno: esperado que ${issue2.origin} tivesse ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Muito pequeno: esperado que ${issue2.origin} fosse ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Texto inválido: deve começar com "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Texto inválido: deve terminar com "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Texto inválido: deve incluir "${_issue.includes}"`; + if (_issue.format === "regex") + return `Texto inválido: deve corresponder ao padrão ${_issue.pattern}`; + return `${FormatDictionary[_issue.format] ?? issue2.format} inválido`; + } + case "not_multiple_of": + return `Número inválido: deve ser múltiplo de ${issue2.divisor}`; + case "unrecognized_keys": + return `Chave${issue2.keys.length > 1 ? "s" : ""} desconhecida${issue2.keys.length > 1 ? "s" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Chave inválida em ${issue2.origin}`; + case "invalid_union": + return "Entrada inválida"; + case "invalid_element": + return `Valor inválido em ${issue2.origin}`; + default: + return `Campo inválido`; + } + }; +}; +function pt_default() { + return { + localeError: error36() + }; +} +// node_modules/zod/v4/locales/ro.js +var error37 = () => { + const Sizable = { + string: { unit: "caractere", verb: "să aibă" }, + file: { unit: "octeți", verb: "să aibă" }, + array: { unit: "elemente", verb: "să aibă" }, + set: { unit: "elemente", verb: "să aibă" }, + map: { unit: "intrări", verb: "să aibă" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "intrare", + email: "adresă de email", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "dată și oră ISO", + date: "dată ISO", + time: "oră ISO", + duration: "durată ISO", + ipv4: "adresă IPv4", + ipv6: "adresă IPv6", + mac: "adresă MAC", + cidrv4: "interval IPv4", + cidrv6: "interval IPv6", + base64: "șir codat base64", + base64url: "șir codat base64url", + json_string: "șir JSON", + e164: "număr E.164", + jwt: "JWT", + template_literal: "intrare" + }; + const TypeDictionary = { + nan: "NaN", + string: "șir", + number: "număr", + boolean: "boolean", + function: "funcție", + array: "matrice", + object: "obiect", + undefined: "nedefinit", + symbol: "simbol", + bigint: "număr mare", + void: "void", + never: "never", + map: "hartă", + set: "set" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + return `Intrare invalidă: așteptat ${expected}, primit ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Intrare invalidă: așteptat ${stringifyPrimitive(issue2.values[0])}`; + return `Opțiune invalidă: așteptat una dintre ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Prea mare: așteptat ca ${issue2.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elemente"}`; + return `Prea mare: așteptat ca ${issue2.origin ?? "valoarea"} să fie ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Prea mic: așteptat ca ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Prea mic: așteptat ca ${issue2.origin} să fie ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Șir invalid: trebuie să înceapă cu "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Șir invalid: trebuie să se termine cu "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Șir invalid: trebuie să includă "${_issue.includes}"`; + if (_issue.format === "regex") + return `Șir invalid: trebuie să se potrivească cu modelul ${_issue.pattern}`; + return `Format invalid: ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Număr invalid: trebuie să fie multiplu de ${issue2.divisor}`; + case "unrecognized_keys": + return `Chei nerecunoscute: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Cheie invalidă în ${issue2.origin}`; + case "invalid_union": + return "Intrare invalidă"; + case "invalid_element": + return `Valoare invalidă în ${issue2.origin}`; + default: + return `Intrare invalidă`; + } + }; +}; +function ro_default() { + return { + localeError: error37() + }; +} +// node_modules/zod/v4/locales/ru.js +function getRussianPlural(count, one, few, many) { + const absCount = Math.abs(count); + const lastDigit = absCount % 10; + const lastTwoDigits = absCount % 100; + if (lastTwoDigits >= 11 && lastTwoDigits <= 19) { + return many; + } + if (lastDigit === 1) { + return one; + } + if (lastDigit >= 2 && lastDigit <= 4) { + return few; + } + return many; +} +var error38 = () => { + const Sizable = { + string: { + unit: { + one: "символ", + few: "символа", + many: "символов" + }, + verb: "иметь" + }, + file: { + unit: { + one: "байт", + few: "байта", + many: "байт" + }, + verb: "иметь" + }, + array: { + unit: { + one: "элемент", + few: "элемента", + many: "элементов" + }, + verb: "иметь" + }, + set: { + unit: { + one: "элемент", + few: "элемента", + many: "элементов" + }, + verb: "иметь" + } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "ввод", + email: "email адрес", + url: "URL", + emoji: "эмодзи", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO дата и время", + date: "ISO дата", + time: "ISO время", + duration: "ISO длительность", + ipv4: "IPv4 адрес", + ipv6: "IPv6 адрес", + cidrv4: "IPv4 диапазон", + cidrv6: "IPv6 диапазон", + base64: "строка в формате base64", + base64url: "строка в формате base64url", + json_string: "JSON строка", + e164: "номер E.164", + jwt: "JWT", + template_literal: "ввод" + }; + const TypeDictionary = { + nan: "NaN", + number: "число", + array: "массив" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Неверный ввод: ожидалось instanceof ${issue2.expected}, получено ${received}`; + } + return `Неверный ввод: ожидалось ${expected}, получено ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Неверный ввод: ожидалось ${stringifyPrimitive(issue2.values[0])}`; + return `Неверный вариант: ожидалось одно из ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + const maxValue = Number(issue2.maximum); + const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); + return `Слишком большое значение: ожидалось, что ${issue2.origin ?? "значение"} будет иметь ${adj}${issue2.maximum.toString()} ${unit}`; + } + return `Слишком большое значение: ожидалось, что ${issue2.origin ?? "значение"} будет ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + const minValue = Number(issue2.minimum); + const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many); + return `Слишком маленькое значение: ожидалось, что ${issue2.origin} будет иметь ${adj}${issue2.minimum.toString()} ${unit}`; + } + return `Слишком маленькое значение: ожидалось, что ${issue2.origin} будет ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Неверная строка: должна начинаться с "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Неверная строка: должна содержать "${_issue.includes}"`; + if (_issue.format === "regex") + return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`; + return `Неверный ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Неверное число: должно быть кратным ${issue2.divisor}`; + case "unrecognized_keys": + return `Нераспознанн${issue2.keys.length > 1 ? "ые" : "ый"} ключ${issue2.keys.length > 1 ? "и" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Неверный ключ в ${issue2.origin}`; + case "invalid_union": + return "Неверные входные данные"; + case "invalid_element": + return `Неверное значение в ${issue2.origin}`; + default: + return `Неверные входные данные`; + } + }; +}; +function ru_default() { + return { + localeError: error38() + }; +} +// node_modules/zod/v4/locales/sl.js +var error39 = () => { + const Sizable = { + string: { unit: "znakov", verb: "imeti" }, + file: { unit: "bajtov", verb: "imeti" }, + array: { unit: "elementov", verb: "imeti" }, + set: { unit: "elementov", verb: "imeti" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "vnos", + email: "e-poštni naslov", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO datum in čas", + date: "ISO datum", + time: "ISO čas", + duration: "ISO trajanje", + ipv4: "IPv4 naslov", + ipv6: "IPv6 naslov", + cidrv4: "obseg IPv4", + cidrv6: "obseg IPv6", + base64: "base64 kodiran niz", + base64url: "base64url kodiran niz", + json_string: "JSON niz", + e164: "E.164 številka", + jwt: "JWT", + template_literal: "vnos" + }; + const TypeDictionary = { + nan: "NaN", + number: "število", + array: "tabela" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Neveljaven vnos: pričakovano instanceof ${issue2.expected}, prejeto ${received}`; + } + return `Neveljaven vnos: pričakovano ${expected}, prejeto ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue2.values[0])}`; + return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Preveliko: pričakovano, da bo ${issue2.origin ?? "vrednost"} imelo ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "elementov"}`; + return `Preveliko: pričakovano, da bo ${issue2.origin ?? "vrednost"} ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Premajhno: pričakovano, da bo ${issue2.origin} imelo ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Premajhno: pričakovano, da bo ${issue2.origin} ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Neveljaven niz: mora se končati z "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Neveljaven niz: mora vsebovati "${_issue.includes}"`; + if (_issue.format === "regex") + return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`; + return `Neveljaven ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Neveljavno število: mora biti večkratnik ${issue2.divisor}`; + case "unrecognized_keys": + return `Neprepoznan${issue2.keys.length > 1 ? "i ključi" : " ključ"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Neveljaven ključ v ${issue2.origin}`; + case "invalid_union": + return "Neveljaven vnos"; + case "invalid_element": + return `Neveljavna vrednost v ${issue2.origin}`; + default: + return "Neveljaven vnos"; + } + }; +}; +function sl_default() { + return { + localeError: error39() + }; +} +// node_modules/zod/v4/locales/sv.js +var error40 = () => { + const Sizable = { + string: { unit: "tecken", verb: "att ha" }, + file: { unit: "bytes", verb: "att ha" }, + array: { unit: "objekt", verb: "att innehålla" }, + set: { unit: "objekt", verb: "att innehålla" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "reguljärt uttryck", + email: "e-postadress", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO-datum och tid", + date: "ISO-datum", + time: "ISO-tid", + duration: "ISO-varaktighet", + ipv4: "IPv4-intervall", + ipv6: "IPv6-intervall", + cidrv4: "IPv4-spektrum", + cidrv6: "IPv6-spektrum", + base64: "base64-kodad sträng", + base64url: "base64url-kodad sträng", + json_string: "JSON-sträng", + e164: "E.164-nummer", + jwt: "JWT", + template_literal: "mall-literal" + }; + const TypeDictionary = { + nan: "NaN", + number: "antal", + array: "lista" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Ogiltig inmatning: förväntat instanceof ${issue2.expected}, fick ${received}`; + } + return `Ogiltig inmatning: förväntat ${expected}, fick ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue2.values[0])}`; + return `Ogiltigt val: förväntade en av ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `För stor(t): förväntade ${issue2.origin ?? "värdet"} att ha ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "element"}`; + } + return `För stor(t): förväntat ${issue2.origin ?? "värdet"} att ha ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `För lite(t): förväntade ${issue2.origin ?? "värdet"} att ha ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `För lite(t): förväntade ${issue2.origin ?? "värdet"} att ha ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `Ogiltig sträng: måste börja med "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Ogiltig sträng: måste innehålla "${_issue.includes}"`; + if (_issue.format === "regex") + return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`; + return `Ogiltig(t) ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Ogiltigt tal: måste vara en multipel av ${issue2.divisor}`; + case "unrecognized_keys": + return `${issue2.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Ogiltig nyckel i ${issue2.origin ?? "värdet"}`; + case "invalid_union": + return "Ogiltig input"; + case "invalid_element": + return `Ogiltigt värde i ${issue2.origin ?? "värdet"}`; + default: + return `Ogiltig input`; + } + }; +}; +function sv_default() { + return { + localeError: error40() + }; +} +// node_modules/zod/v4/locales/ta.js +var error41 = () => { + const Sizable = { + string: { unit: "எழுத்துக்கள்", verb: "கொண்டிருக்க வேண்டும்" }, + file: { unit: "பைட்டுகள்", verb: "கொண்டிருக்க வேண்டும்" }, + array: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" }, + set: { unit: "உறுப்புகள்", verb: "கொண்டிருக்க வேண்டும்" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "உள்ளீடு", + email: "மின்னஞ்சல் முகவரி", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO தேதி நேரம்", + date: "ISO தேதி", + time: "ISO நேரம்", + duration: "ISO கால அளவு", + ipv4: "IPv4 முகவரி", + ipv6: "IPv6 முகவரி", + cidrv4: "IPv4 வரம்பு", + cidrv6: "IPv6 வரம்பு", + base64: "base64-encoded சரம்", + base64url: "base64url-encoded சரம்", + json_string: "JSON சரம்", + e164: "E.164 எண்", + jwt: "JWT", + template_literal: "input" + }; + const TypeDictionary = { + nan: "NaN", + number: "எண்", + array: "அணி", + null: "வெறுமை" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${issue2.expected}, பெறப்பட்டது ${received}`; + } + return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${expected}, பெறப்பட்டது ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue2.values[0])}`; + return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(issue2.values, "|")} இல் ஒன்று`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue2.origin ?? "மதிப்பு"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "உறுப்புகள்"} ஆக இருக்க வேண்டும்`; + } + return `மிக பெரியது: எதிர்பார்க்கப்பட்டது ${issue2.origin ?? "மதிப்பு"} ${adj}${issue2.maximum.toString()} ஆக இருக்க வேண்டும்`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} ஆக இருக்க வேண்டும்`; + } + return `மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${issue2.origin} ${adj}${issue2.minimum.toString()} ஆக இருக்க வேண்டும்`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `தவறான சரம்: "${_issue.prefix}" இல் தொடங்க வேண்டும்`; + if (_issue.format === "ends_with") + return `தவறான சரம்: "${_issue.suffix}" இல் முடிவடைய வேண்டும்`; + if (_issue.format === "includes") + return `தவறான சரம்: "${_issue.includes}" ஐ உள்ளடக்க வேண்டும்`; + if (_issue.format === "regex") + return `தவறான சரம்: ${_issue.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`; + return `தவறான ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `தவறான எண்: ${issue2.divisor} இன் பலமாக இருக்க வேண்டும்`; + case "unrecognized_keys": + return `அடையாளம் தெரியாத விசை${issue2.keys.length > 1 ? "கள்" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `${issue2.origin} இல் தவறான விசை`; + case "invalid_union": + return "தவறான உள்ளீடு"; + case "invalid_element": + return `${issue2.origin} இல் தவறான மதிப்பு`; + default: + return `தவறான உள்ளீடு`; + } + }; }; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { - key = keys[i]; - if (!__hasOwnProp.call(to, key) && key !== except) { - __defProp$1(to, key, { - get: ((k) => from[k]).bind(null, key), - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable - }); - } - } - } - return to; +function ta_default() { + return { + localeError: error41() + }; +} +// node_modules/zod/v4/locales/th.js +var error42 = () => { + const Sizable = { + string: { unit: "ตัวอักษร", verb: "ควรมี" }, + file: { unit: "ไบต์", verb: "ควรมี" }, + array: { unit: "รายการ", verb: "ควรมี" }, + set: { unit: "รายการ", verb: "ควรมี" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "ข้อมูลที่ป้อน", + email: "ที่อยู่อีเมล", + url: "URL", + emoji: "อิโมจิ", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "วันที่เวลาแบบ ISO", + date: "วันที่แบบ ISO", + time: "เวลาแบบ ISO", + duration: "ช่วงเวลาแบบ ISO", + ipv4: "ที่อยู่ IPv4", + ipv6: "ที่อยู่ IPv6", + cidrv4: "ช่วง IP แบบ IPv4", + cidrv6: "ช่วง IP แบบ IPv6", + base64: "ข้อความแบบ Base64", + base64url: "ข้อความแบบ Base64 สำหรับ URL", + json_string: "ข้อความแบบ JSON", + e164: "เบอร์โทรศัพท์ระหว่างประเทศ (E.164)", + jwt: "โทเคน JWT", + template_literal: "ข้อมูลที่ป้อน" + }; + const TypeDictionary = { + nan: "NaN", + number: "ตัวเลข", + array: "อาร์เรย์ (Array)", + null: "ไม่มีค่า (null)" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${issue2.expected} แต่ได้รับ ${received}`; + } + return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${expected} แต่ได้รับ ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue2.values[0])}`; + return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "ไม่เกิน" : "น้อยกว่า"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `เกินกำหนด: ${issue2.origin ?? "ค่า"} ควรมี${adj} ${issue2.maximum.toString()} ${sizing.unit ?? "รายการ"}`; + return `เกินกำหนด: ${issue2.origin ?? "ค่า"} ควรมี${adj} ${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? "อย่างน้อย" : "มากกว่า"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `น้อยกว่ากำหนด: ${issue2.origin} ควรมี${adj} ${issue2.minimum.toString()} ${sizing.unit}`; + } + return `น้อยกว่ากำหนด: ${issue2.origin} ควรมี${adj} ${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${_issue.prefix}"`; + } + if (_issue.format === "ends_with") + return `รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${_issue.suffix}"`; + if (_issue.format === "includes") + return `รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${_issue.includes}" อยู่ในข้อความ`; + if (_issue.format === "regex") + return `รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${_issue.pattern}`; + return `รูปแบบไม่ถูกต้อง: ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${issue2.divisor} ได้ลงตัว`; + case "unrecognized_keys": + return `พบคีย์ที่ไม่รู้จัก: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `คีย์ไม่ถูกต้องใน ${issue2.origin}`; + case "invalid_union": + return "ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้"; + case "invalid_element": + return `ข้อมูลไม่ถูกต้องใน ${issue2.origin}`; + default: + return `ข้อมูลไม่ถูกต้อง`; + } + }; }; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", { - value: mod, - enumerable: true -}) : target, mod)); -var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp$1({}, "__esModule", { value: true }), mod); -var __require = /* @__PURE__ */ createRequire(import.meta.url); - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js -var _a$2; -function $constructor(name, initializer$2, params) { - function init(inst, def) { - if (!inst._zod) Object.defineProperty(inst, "_zod", { - value: { - def, - constr: _, - traits: /* @__PURE__ */ new Set() - }, - enumerable: false - }); - if (inst._zod.traits.has(name)) return; - inst._zod.traits.add(name); - initializer$2(inst, def); - const proto = _.prototype; - const keys = Object.keys(proto); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - if (!(k in inst)) inst[k] = proto[k].bind(inst); - } - } - const Parent = params?.Parent ?? Object; - class Definition extends Parent {} - Object.defineProperty(Definition, "name", { value: name }); - function _(def) { - var _a$3; - const inst = params?.Parent ? new Definition() : this; - init(inst, def); - (_a$3 = inst._zod).deferred ?? (_a$3.deferred = []); - for (const fn of inst._zod.deferred) fn(); - return inst; - } - Object.defineProperty(_, "init", { value: init }); - Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => { - if (params?.Parent && inst instanceof params.Parent) return true; - return inst?._zod?.traits?.has(name); - } }); - Object.defineProperty(_, "name", { value: name }); - return _; -} -var $ZodAsyncError = class extends Error { - constructor() { - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); - } +function th_default() { + return { + localeError: error42() + }; +} +// node_modules/zod/v4/locales/tr.js +var error43 = () => { + const Sizable = { + string: { unit: "karakter", verb: "olmalı" }, + file: { unit: "bayt", verb: "olmalı" }, + array: { unit: "öğe", verb: "olmalı" }, + set: { unit: "öğe", verb: "olmalı" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "girdi", + email: "e-posta adresi", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO tarih ve saat", + date: "ISO tarih", + time: "ISO saat", + duration: "ISO süre", + ipv4: "IPv4 adresi", + ipv6: "IPv6 adresi", + cidrv4: "IPv4 aralığı", + cidrv6: "IPv6 aralığı", + base64: "base64 ile şifrelenmiş metin", + base64url: "base64url ile şifrelenmiş metin", + json_string: "JSON dizesi", + e164: "E.164 sayısı", + jwt: "JWT", + template_literal: "Şablon dizesi" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Geçersiz değer: beklenen instanceof ${issue2.expected}, alınan ${received}`; + } + return `Geçersiz değer: beklenen ${expected}, alınan ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Geçersiz değer: beklenen ${stringifyPrimitive(issue2.values[0])}`; + return `Geçersiz seçenek: aşağıdakilerden biri olmalı: ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Çok büyük: beklenen ${issue2.origin ?? "değer"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "öğe"}`; + return `Çok büyük: beklenen ${issue2.origin ?? "değer"} ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Çok küçük: beklenen ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + return `Çok küçük: beklenen ${issue2.origin} ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Geçersiz metin: "${_issue.prefix}" ile başlamalı`; + if (_issue.format === "ends_with") + return `Geçersiz metin: "${_issue.suffix}" ile bitmeli`; + if (_issue.format === "includes") + return `Geçersiz metin: "${_issue.includes}" içermeli`; + if (_issue.format === "regex") + return `Geçersiz metin: ${_issue.pattern} desenine uymalı`; + return `Geçersiz ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Geçersiz sayı: ${issue2.divisor} ile tam bölünebilmeli`; + case "unrecognized_keys": + return `Tanınmayan anahtar${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `${issue2.origin} içinde geçersiz anahtar`; + case "invalid_union": + return "Geçersiz değer"; + case "invalid_element": + return `${issue2.origin} içinde geçersiz değer`; + default: + return `Geçersiz değer`; + } + }; +}; +function tr_default() { + return { + localeError: error43() + }; +} +// node_modules/zod/v4/locales/uk.js +var error44 = () => { + const Sizable = { + string: { unit: "символів", verb: "матиме" }, + file: { unit: "байтів", verb: "матиме" }, + array: { unit: "елементів", verb: "матиме" }, + set: { unit: "елементів", verb: "матиме" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "вхідні дані", + email: "адреса електронної пошти", + url: "URL", + emoji: "емодзі", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "дата та час ISO", + date: "дата ISO", + time: "час ISO", + duration: "тривалість ISO", + ipv4: "адреса IPv4", + ipv6: "адреса IPv6", + cidrv4: "діапазон IPv4", + cidrv6: "діапазон IPv6", + base64: "рядок у кодуванні base64", + base64url: "рядок у кодуванні base64url", + json_string: "рядок JSON", + e164: "номер E.164", + jwt: "JWT", + template_literal: "вхідні дані" + }; + const TypeDictionary = { + nan: "NaN", + number: "число", + array: "масив" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Неправильні вхідні дані: очікується instanceof ${issue2.expected}, отримано ${received}`; + } + return `Неправильні вхідні дані: очікується ${expected}, отримано ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue2.values[0])}`; + return `Неправильна опція: очікується одне з ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Занадто велике: очікується, що ${issue2.origin ?? "значення"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "елементів"}`; + return `Занадто велике: очікується, що ${issue2.origin ?? "значення"} буде ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Занадто мале: очікується, що ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Занадто мале: очікується, що ${issue2.origin} буде ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Неправильний рядок: повинен починатися з "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Неправильний рядок: повинен закінчуватися на "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Неправильний рядок: повинен містити "${_issue.includes}"`; + if (_issue.format === "regex") + return `Неправильний рядок: повинен відповідати шаблону ${_issue.pattern}`; + return `Неправильний ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Неправильне число: повинно бути кратним ${issue2.divisor}`; + case "unrecognized_keys": + return `Нерозпізнаний ключ${issue2.keys.length > 1 ? "і" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Неправильний ключ у ${issue2.origin}`; + case "invalid_union": + return "Неправильні вхідні дані"; + case "invalid_element": + return `Неправильне значення у ${issue2.origin}`; + default: + return `Неправильні вхідні дані`; + } + }; +}; +function uk_default() { + return { + localeError: error44() + }; +} + +// node_modules/zod/v4/locales/ua.js +function ua_default() { + return uk_default(); +} +// node_modules/zod/v4/locales/ur.js +var error45 = () => { + const Sizable = { + string: { unit: "حروف", verb: "ہونا" }, + file: { unit: "بائٹس", verb: "ہونا" }, + array: { unit: "آئٹمز", verb: "ہونا" }, + set: { unit: "آئٹمز", verb: "ہونا" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "ان پٹ", + email: "ای میل ایڈریس", + url: "یو آر ایل", + emoji: "ایموجی", + uuid: "یو یو آئی ڈی", + uuidv4: "یو یو آئی ڈی وی 4", + uuidv6: "یو یو آئی ڈی وی 6", + nanoid: "نینو آئی ڈی", + guid: "جی یو آئی ڈی", + cuid: "سی یو آئی ڈی", + cuid2: "سی یو آئی ڈی 2", + ulid: "یو ایل آئی ڈی", + xid: "ایکس آئی ڈی", + ksuid: "کے ایس یو آئی ڈی", + datetime: "آئی ایس او ڈیٹ ٹائم", + date: "آئی ایس او تاریخ", + time: "آئی ایس او وقت", + duration: "آئی ایس او مدت", + ipv4: "آئی پی وی 4 ایڈریس", + ipv6: "آئی پی وی 6 ایڈریس", + cidrv4: "آئی پی وی 4 رینج", + cidrv6: "آئی پی وی 6 رینج", + base64: "بیس 64 ان کوڈڈ سٹرنگ", + base64url: "بیس 64 یو آر ایل ان کوڈڈ سٹرنگ", + json_string: "جے ایس او این سٹرنگ", + e164: "ای 164 نمبر", + jwt: "جے ڈبلیو ٹی", + template_literal: "ان پٹ" + }; + const TypeDictionary = { + nan: "NaN", + number: "نمبر", + array: "آرے", + null: "نل" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `غلط ان پٹ: instanceof ${issue2.expected} متوقع تھا، ${received} موصول ہوا`; + } + return `غلط ان پٹ: ${expected} متوقع تھا، ${received} موصول ہوا`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `غلط ان پٹ: ${stringifyPrimitive(issue2.values[0])} متوقع تھا`; + return `غلط آپشن: ${joinValues(issue2.values, "|")} میں سے ایک متوقع تھا`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `بہت بڑا: ${issue2.origin ?? "ویلیو"} کے ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "عناصر"} ہونے متوقع تھے`; + return `بہت بڑا: ${issue2.origin ?? "ویلیو"} کا ${adj}${issue2.maximum.toString()} ہونا متوقع تھا`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `بہت چھوٹا: ${issue2.origin} کے ${adj}${issue2.minimum.toString()} ${sizing.unit} ہونے متوقع تھے`; + } + return `بہت چھوٹا: ${issue2.origin} کا ${adj}${issue2.minimum.toString()} ہونا متوقع تھا`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `غلط سٹرنگ: "${_issue.prefix}" سے شروع ہونا چاہیے`; + } + if (_issue.format === "ends_with") + return `غلط سٹرنگ: "${_issue.suffix}" پر ختم ہونا چاہیے`; + if (_issue.format === "includes") + return `غلط سٹرنگ: "${_issue.includes}" شامل ہونا چاہیے`; + if (_issue.format === "regex") + return `غلط سٹرنگ: پیٹرن ${_issue.pattern} سے میچ ہونا چاہیے`; + return `غلط ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `غلط نمبر: ${issue2.divisor} کا مضاعف ہونا چاہیے`; + case "unrecognized_keys": + return `غیر تسلیم شدہ کی${issue2.keys.length > 1 ? "ز" : ""}: ${joinValues(issue2.keys, "، ")}`; + case "invalid_key": + return `${issue2.origin} میں غلط کی`; + case "invalid_union": + return "غلط ان پٹ"; + case "invalid_element": + return `${issue2.origin} میں غلط ویلیو`; + default: + return `غلط ان پٹ`; + } + }; }; -var $ZodEncodeError = class extends Error { - constructor(name) { - super(`Encountered unidirectional transform during encode: ${name}`); - this.name = "ZodEncodeError"; - } +function ur_default() { + return { + localeError: error45() + }; +} +// node_modules/zod/v4/locales/uz.js +var error46 = () => { + const Sizable = { + string: { unit: "belgi", verb: "bo‘lishi kerak" }, + file: { unit: "bayt", verb: "bo‘lishi kerak" }, + array: { unit: "element", verb: "bo‘lishi kerak" }, + set: { unit: "element", verb: "bo‘lishi kerak" }, + map: { unit: "yozuv", verb: "bo‘lishi kerak" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "kirish", + email: "elektron pochta manzili", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO sana va vaqti", + date: "ISO sana", + time: "ISO vaqt", + duration: "ISO davomiylik", + ipv4: "IPv4 manzil", + ipv6: "IPv6 manzil", + mac: "MAC manzil", + cidrv4: "IPv4 diapazon", + cidrv6: "IPv6 diapazon", + base64: "base64 kodlangan satr", + base64url: "base64url kodlangan satr", + json_string: "JSON satr", + e164: "E.164 raqam", + jwt: "JWT", + template_literal: "kirish" + }; + const TypeDictionary = { + nan: "NaN", + number: "raqam", + array: "massiv" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Noto‘g‘ri kirish: kutilgan instanceof ${issue2.expected}, qabul qilingan ${received}`; + } + return `Noto‘g‘ri kirish: kutilgan ${expected}, qabul qilingan ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Noto‘g‘ri kirish: kutilgan ${stringifyPrimitive(issue2.values[0])}`; + return `Noto‘g‘ri variant: quyidagilardan biri kutilgan ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Juda katta: kutilgan ${issue2.origin ?? "qiymat"} ${adj}${issue2.maximum.toString()} ${sizing.unit} ${sizing.verb}`; + return `Juda katta: kutilgan ${issue2.origin ?? "qiymat"} ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Juda kichik: kutilgan ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit} ${sizing.verb}`; + } + return `Juda kichik: kutilgan ${issue2.origin} ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Noto‘g‘ri satr: "${_issue.prefix}" bilan boshlanishi kerak`; + if (_issue.format === "ends_with") + return `Noto‘g‘ri satr: "${_issue.suffix}" bilan tugashi kerak`; + if (_issue.format === "includes") + return `Noto‘g‘ri satr: "${_issue.includes}" ni o‘z ichiga olishi kerak`; + if (_issue.format === "regex") + return `Noto‘g‘ri satr: ${_issue.pattern} shabloniga mos kelishi kerak`; + return `Noto‘g‘ri ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Noto‘g‘ri raqam: ${issue2.divisor} ning karralisi bo‘lishi kerak`; + case "unrecognized_keys": + return `Noma’lum kalit${issue2.keys.length > 1 ? "lar" : ""}: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `${issue2.origin} dagi kalit noto‘g‘ri`; + case "invalid_union": + return "Noto‘g‘ri kirish"; + case "invalid_element": + return `${issue2.origin} da noto‘g‘ri qiymat`; + default: + return `Noto‘g‘ri kirish`; + } + }; }; -(_a$2 = globalThis).__zod_globalConfig ?? (_a$2.__zod_globalConfig = {}); -const globalConfig = globalThis.__zod_globalConfig; -function config(newConfig) { - if (newConfig) Object.assign(globalConfig, newConfig); - return globalConfig; +function uz_default() { + return { + localeError: error46() + }; +} +// node_modules/zod/v4/locales/vi.js +var error47 = () => { + const Sizable = { + string: { unit: "ký tự", verb: "có" }, + file: { unit: "byte", verb: "có" }, + array: { unit: "phần tử", verb: "có" }, + set: { unit: "phần tử", verb: "có" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "đầu vào", + email: "địa chỉ email", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ngày giờ ISO", + date: "ngày ISO", + time: "giờ ISO", + duration: "khoảng thời gian ISO", + ipv4: "địa chỉ IPv4", + ipv6: "địa chỉ IPv6", + cidrv4: "dải IPv4", + cidrv6: "dải IPv6", + base64: "chuỗi mã hóa base64", + base64url: "chuỗi mã hóa base64url", + json_string: "chuỗi JSON", + e164: "số E.164", + jwt: "JWT", + template_literal: "đầu vào" + }; + const TypeDictionary = { + nan: "NaN", + number: "số", + array: "mảng" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Đầu vào không hợp lệ: mong đợi instanceof ${issue2.expected}, nhận được ${received}`; + } + return `Đầu vào không hợp lệ: mong đợi ${expected}, nhận được ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue2.values[0])}`; + return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Quá lớn: mong đợi ${issue2.origin ?? "giá trị"} ${sizing.verb} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "phần tử"}`; + return `Quá lớn: mong đợi ${issue2.origin ?? "giá trị"} ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `Quá nhỏ: mong đợi ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `Quá nhỏ: mong đợi ${issue2.origin} ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Chuỗi không hợp lệ: phải bắt đầu bằng "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Chuỗi không hợp lệ: phải kết thúc bằng "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Chuỗi không hợp lệ: phải bao gồm "${_issue.includes}"`; + if (_issue.format === "regex") + return `Chuỗi không hợp lệ: phải khớp với mẫu ${_issue.pattern}`; + return `${FormatDictionary[_issue.format] ?? issue2.format} không hợp lệ`; + } + case "not_multiple_of": + return `Số không hợp lệ: phải là bội số của ${issue2.divisor}`; + case "unrecognized_keys": + return `Khóa không được nhận dạng: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Khóa không hợp lệ trong ${issue2.origin}`; + case "invalid_union": + return "Đầu vào không hợp lệ"; + case "invalid_element": + return `Giá trị không hợp lệ trong ${issue2.origin}`; + default: + return `Đầu vào không hợp lệ`; + } + }; +}; +function vi_default() { + return { + localeError: error47() + }; +} +// node_modules/zod/v4/locales/zh-CN.js +var error48 = () => { + const Sizable = { + string: { unit: "字符", verb: "包含" }, + file: { unit: "字节", verb: "包含" }, + array: { unit: "项", verb: "包含" }, + set: { unit: "项", verb: "包含" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "输入", + email: "电子邮件", + url: "URL", + emoji: "表情符号", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO日期时间", + date: "ISO日期", + time: "ISO时间", + duration: "ISO时长", + ipv4: "IPv4地址", + ipv6: "IPv6地址", + cidrv4: "IPv4网段", + cidrv6: "IPv6网段", + base64: "base64编码字符串", + base64url: "base64url编码字符串", + json_string: "JSON字符串", + e164: "E.164号码", + jwt: "JWT", + template_literal: "输入" + }; + const TypeDictionary = { + nan: "NaN", + number: "数字", + array: "数组", + null: "空值(null)" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `无效输入:期望 instanceof ${issue2.expected},实际接收 ${received}`; + } + return `无效输入:期望 ${expected},实际接收 ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `无效输入:期望 ${stringifyPrimitive(issue2.values[0])}`; + return `无效选项:期望以下之一 ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `数值过大:期望 ${issue2.origin ?? "值"} ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "个元素"}`; + return `数值过大:期望 ${issue2.origin ?? "值"} ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `数值过小:期望 ${issue2.origin} ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `数值过小:期望 ${issue2.origin} ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `无效字符串:必须以 "${_issue.prefix}" 开头`; + if (_issue.format === "ends_with") + return `无效字符串:必须以 "${_issue.suffix}" 结尾`; + if (_issue.format === "includes") + return `无效字符串:必须包含 "${_issue.includes}"`; + if (_issue.format === "regex") + return `无效字符串:必须满足正则表达式 ${_issue.pattern}`; + return `无效${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `无效数字:必须是 ${issue2.divisor} 的倍数`; + case "unrecognized_keys": + return `出现未知的键(key): ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `${issue2.origin} 中的键(key)无效`; + case "invalid_union": + return "无效输入"; + case "invalid_element": + return `${issue2.origin} 中包含无效值(value)`; + default: + return `无效输入`; + } + }; +}; +function zh_CN_default() { + return { + localeError: error48() + }; +} +// node_modules/zod/v4/locales/zh-TW.js +var error49 = () => { + const Sizable = { + string: { unit: "字元", verb: "擁有" }, + file: { unit: "位元組", verb: "擁有" }, + array: { unit: "項目", verb: "擁有" }, + set: { unit: "項目", verb: "擁有" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "輸入", + email: "郵件地址", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "ISO 日期時間", + date: "ISO 日期", + time: "ISO 時間", + duration: "ISO 期間", + ipv4: "IPv4 位址", + ipv6: "IPv6 位址", + cidrv4: "IPv4 範圍", + cidrv6: "IPv6 範圍", + base64: "base64 編碼字串", + base64url: "base64url 編碼字串", + json_string: "JSON 字串", + e164: "E.164 數值", + jwt: "JWT", + template_literal: "輸入" + }; + const TypeDictionary = { + nan: "NaN" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `無效的輸入值:預期為 instanceof ${issue2.expected},但收到 ${received}`; + } + return `無效的輸入值:預期為 ${expected},但收到 ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `無效的輸入值:預期為 ${stringifyPrimitive(issue2.values[0])}`; + return `無效的選項:預期為以下其中之一 ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `數值過大:預期 ${issue2.origin ?? "值"} 應為 ${adj}${issue2.maximum.toString()} ${sizing.unit ?? "個元素"}`; + return `數值過大:預期 ${issue2.origin ?? "值"} 應為 ${adj}${issue2.maximum.toString()}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) { + return `數值過小:預期 ${issue2.origin} 應為 ${adj}${issue2.minimum.toString()} ${sizing.unit}`; + } + return `數值過小:預期 ${issue2.origin} 應為 ${adj}${issue2.minimum.toString()}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") { + return `無效的字串:必須以 "${_issue.prefix}" 開頭`; + } + if (_issue.format === "ends_with") + return `無效的字串:必須以 "${_issue.suffix}" 結尾`; + if (_issue.format === "includes") + return `無效的字串:必須包含 "${_issue.includes}"`; + if (_issue.format === "regex") + return `無效的字串:必須符合格式 ${_issue.pattern}`; + return `無效的 ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `無效的數字:必須為 ${issue2.divisor} 的倍數`; + case "unrecognized_keys": + return `無法識別的鍵值${issue2.keys.length > 1 ? "們" : ""}:${joinValues(issue2.keys, "、")}`; + case "invalid_key": + return `${issue2.origin} 中有無效的鍵值`; + case "invalid_union": + return "無效的輸入值"; + case "invalid_element": + return `${issue2.origin} 中有無效的值`; + default: + return `無效的輸入值`; + } + }; +}; +function zh_TW_default() { + return { + localeError: error49() + }; +} +// node_modules/zod/v4/locales/yo.js +var error50 = () => { + const Sizable = { + string: { unit: "àmi", verb: "ní" }, + file: { unit: "bytes", verb: "ní" }, + array: { unit: "nkan", verb: "ní" }, + set: { unit: "nkan", verb: "ní" } + }; + function getSizing(origin) { + return Sizable[origin] ?? null; + } + const FormatDictionary = { + regex: "ẹ̀rọ ìbáwọlé", + email: "àdírẹ́sì ìmẹ́lì", + url: "URL", + emoji: "emoji", + uuid: "UUID", + uuidv4: "UUIDv4", + uuidv6: "UUIDv6", + nanoid: "nanoid", + guid: "GUID", + cuid: "cuid", + cuid2: "cuid2", + ulid: "ULID", + xid: "XID", + ksuid: "KSUID", + datetime: "àkókò ISO", + date: "ọjọ́ ISO", + time: "àkókò ISO", + duration: "àkókò tó pé ISO", + ipv4: "àdírẹ́sì IPv4", + ipv6: "àdírẹ́sì IPv6", + cidrv4: "àgbègbè IPv4", + cidrv6: "àgbègbè IPv6", + base64: "ọ̀rọ̀ tí a kọ́ ní base64", + base64url: "ọ̀rọ̀ base64url", + json_string: "ọ̀rọ̀ JSON", + e164: "nọ́mbà E.164", + jwt: "JWT", + template_literal: "ẹ̀rọ ìbáwọlé" + }; + const TypeDictionary = { + nan: "NaN", + number: "nọ́mbà", + array: "akopọ" + }; + return (issue2) => { + switch (issue2.code) { + case "invalid_type": { + const expected = TypeDictionary[issue2.expected] ?? issue2.expected; + const receivedType = parsedType(issue2.input); + const received = TypeDictionary[receivedType] ?? receivedType; + if (/^[A-Z]/.test(issue2.expected)) { + return `Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${issue2.expected}, àmọ̀ a rí ${received}`; + } + return `Ìbáwọlé aṣìṣe: a ní láti fi ${expected}, àmọ̀ a rí ${received}`; + } + case "invalid_value": + if (issue2.values.length === 1) + return `Ìbáwọlé aṣìṣe: a ní láti fi ${stringifyPrimitive(issue2.values[0])}`; + return `Àṣàyàn aṣìṣe: yan ọ̀kan lára ${joinValues(issue2.values, "|")}`; + case "too_big": { + const adj = issue2.inclusive ? "<=" : "<"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Tó pọ̀ jù: a ní láti jẹ́ pé ${issue2.origin ?? "iye"} ${sizing.verb} ${adj}${issue2.maximum} ${sizing.unit}`; + return `Tó pọ̀ jù: a ní láti jẹ́ ${adj}${issue2.maximum}`; + } + case "too_small": { + const adj = issue2.inclusive ? ">=" : ">"; + const sizing = getSizing(issue2.origin); + if (sizing) + return `Kéré ju: a ní láti jẹ́ pé ${issue2.origin} ${sizing.verb} ${adj}${issue2.minimum} ${sizing.unit}`; + return `Kéré ju: a ní láti jẹ́ ${adj}${issue2.minimum}`; + } + case "invalid_format": { + const _issue = issue2; + if (_issue.format === "starts_with") + return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${_issue.prefix}"`; + if (_issue.format === "ends_with") + return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${_issue.suffix}"`; + if (_issue.format === "includes") + return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${_issue.includes}"`; + if (_issue.format === "regex") + return `Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${_issue.pattern}`; + return `Aṣìṣe: ${FormatDictionary[_issue.format] ?? issue2.format}`; + } + case "not_multiple_of": + return `Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${issue2.divisor}`; + case "unrecognized_keys": + return `Bọtìnì àìmọ̀: ${joinValues(issue2.keys, ", ")}`; + case "invalid_key": + return `Bọtìnì aṣìṣe nínú ${issue2.origin}`; + case "invalid_union": + return "Ìbáwọlé aṣìṣe"; + case "invalid_element": + return `Iye aṣìṣe nínú ${issue2.origin}`; + default: + return "Ìbáwọlé aṣìṣe"; + } + }; +}; +function yo_default() { + return { + localeError: error50() + }; +} +// node_modules/zod/v4/core/registries.js +var _a2; +var $output = Symbol("ZodOutput"); +var $input = Symbol("ZodInput"); + +class $ZodRegistry { + constructor() { + this._map = new WeakMap; + this._idmap = new Map; + } + add(schema, ..._meta) { + const meta = _meta[0]; + this._map.set(schema, meta); + if (meta && typeof meta === "object" && "id" in meta) { + this._idmap.set(meta.id, schema); + } + return this; + } + clear() { + this._map = new WeakMap; + this._idmap = new Map; + return this; + } + remove(schema) { + const meta = this._map.get(schema); + if (meta && typeof meta === "object" && "id" in meta) { + this._idmap.delete(meta.id); + } + this._map.delete(schema); + return this; + } + get(schema) { + const p = schema._zod.parent; + if (p) { + const pm = { ...this.get(p) ?? {} }; + delete pm.id; + const f = { ...pm, ...this._map.get(schema) }; + return Object.keys(f).length ? f : undefined; + } + return this._map.get(schema); + } + has(schema) { + return this._map.has(schema); + } } - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js -function getEnumValues(entries) { - const numericValues = Object.values(entries).filter((v) => typeof v === "number"); - return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); +function registry() { + return new $ZodRegistry; +} +(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry()); +var globalRegistry = globalThis.__zod_globalRegistry; +// node_modules/zod/v4/core/api.js +function _string(Class2, params) { + return new Class2({ + type: "string", + ...normalizeParams(params) + }); +} +function _coercedString(Class2, params) { + return new Class2({ + type: "string", + coerce: true, + ...normalizeParams(params) + }); +} +function _email(Class2, params) { + return new Class2({ + type: "string", + format: "email", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _guid(Class2, params) { + return new Class2({ + type: "string", + format: "guid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _uuid(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _uuidv4(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v4", + ...normalizeParams(params) + }); +} +function _uuidv6(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v6", + ...normalizeParams(params) + }); +} +function _uuidv7(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v7", + ...normalizeParams(params) + }); +} +function _url(Class2, params) { + return new Class2({ + type: "string", + format: "url", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _emoji2(Class2, params) { + return new Class2({ + type: "string", + format: "emoji", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _nanoid(Class2, params) { + return new Class2({ + type: "string", + format: "nanoid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cuid(Class2, params) { + return new Class2({ + type: "string", + format: "cuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cuid2(Class2, params) { + return new Class2({ + type: "string", + format: "cuid2", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ulid(Class2, params) { + return new Class2({ + type: "string", + format: "ulid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _xid(Class2, params) { + return new Class2({ + type: "string", + format: "xid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ksuid(Class2, params) { + return new Class2({ + type: "string", + format: "ksuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ipv4(Class2, params) { + return new Class2({ + type: "string", + format: "ipv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ipv6(Class2, params) { + return new Class2({ + type: "string", + format: "ipv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _mac(Class2, params) { + return new Class2({ + type: "string", + format: "mac", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cidrv4(Class2, params) { + return new Class2({ + type: "string", + format: "cidrv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cidrv6(Class2, params) { + return new Class2({ + type: "string", + format: "cidrv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _base64(Class2, params) { + return new Class2({ + type: "string", + format: "base64", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _base64url(Class2, params) { + return new Class2({ + type: "string", + format: "base64url", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _e164(Class2, params) { + return new Class2({ + type: "string", + format: "e164", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _jwt(Class2, params) { + return new Class2({ + type: "string", + format: "jwt", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +var TimePrecision = { + Any: null, + Minute: -1, + Second: 0, + Millisecond: 3, + Microsecond: 6 +}; +function _isoDateTime(Class2, params) { + return new Class2({ + type: "string", + format: "datetime", + check: "string_format", + offset: false, + local: false, + precision: null, + ...normalizeParams(params) + }); +} +function _isoDate(Class2, params) { + return new Class2({ + type: "string", + format: "date", + check: "string_format", + ...normalizeParams(params) + }); +} +function _isoTime(Class2, params) { + return new Class2({ + type: "string", + format: "time", + check: "string_format", + precision: null, + ...normalizeParams(params) + }); +} +function _isoDuration(Class2, params) { + return new Class2({ + type: "string", + format: "duration", + check: "string_format", + ...normalizeParams(params) + }); +} +function _number(Class2, params) { + return new Class2({ + type: "number", + checks: [], + ...normalizeParams(params) + }); +} +function _coercedNumber(Class2, params) { + return new Class2({ + type: "number", + coerce: true, + checks: [], + ...normalizeParams(params) + }); +} +function _int(Class2, params) { + return new Class2({ + type: "number", + check: "number_format", + abort: false, + format: "safeint", + ...normalizeParams(params) + }); +} +function _float32(Class2, params) { + return new Class2({ + type: "number", + check: "number_format", + abort: false, + format: "float32", + ...normalizeParams(params) + }); +} +function _float64(Class2, params) { + return new Class2({ + type: "number", + check: "number_format", + abort: false, + format: "float64", + ...normalizeParams(params) + }); +} +function _int32(Class2, params) { + return new Class2({ + type: "number", + check: "number_format", + abort: false, + format: "int32", + ...normalizeParams(params) + }); +} +function _uint32(Class2, params) { + return new Class2({ + type: "number", + check: "number_format", + abort: false, + format: "uint32", + ...normalizeParams(params) + }); +} +function _boolean(Class2, params) { + return new Class2({ + type: "boolean", + ...normalizeParams(params) + }); +} +function _coercedBoolean(Class2, params) { + return new Class2({ + type: "boolean", + coerce: true, + ...normalizeParams(params) + }); +} +function _bigint(Class2, params) { + return new Class2({ + type: "bigint", + ...normalizeParams(params) + }); +} +function _coercedBigint(Class2, params) { + return new Class2({ + type: "bigint", + coerce: true, + ...normalizeParams(params) + }); +} +function _int64(Class2, params) { + return new Class2({ + type: "bigint", + check: "bigint_format", + abort: false, + format: "int64", + ...normalizeParams(params) + }); +} +function _uint64(Class2, params) { + return new Class2({ + type: "bigint", + check: "bigint_format", + abort: false, + format: "uint64", + ...normalizeParams(params) + }); +} +function _symbol(Class2, params) { + return new Class2({ + type: "symbol", + ...normalizeParams(params) + }); +} +function _undefined2(Class2, params) { + return new Class2({ + type: "undefined", + ...normalizeParams(params) + }); +} +function _null2(Class2, params) { + return new Class2({ + type: "null", + ...normalizeParams(params) + }); +} +function _any(Class2) { + return new Class2({ + type: "any" + }); +} +function _unknown(Class2) { + return new Class2({ + type: "unknown" + }); +} +function _never(Class2, params) { + return new Class2({ + type: "never", + ...normalizeParams(params) + }); +} +function _void(Class2, params) { + return new Class2({ + type: "void", + ...normalizeParams(params) + }); +} +function _date(Class2, params) { + return new Class2({ + type: "date", + ...normalizeParams(params) + }); +} +function _coercedDate(Class2, params) { + return new Class2({ + type: "date", + coerce: true, + ...normalizeParams(params) + }); +} +function _nan(Class2, params) { + return new Class2({ + type: "nan", + ...normalizeParams(params) + }); } -function jsonStringifyReplacer(_, value) { - if (typeof value === "bigint") return value.toString(); - return value; +function _lt(value, params) { + return new $ZodCheckLessThan({ + check: "less_than", + ...normalizeParams(params), + value, + inclusive: false + }); } -function cached(getter) { - return { get value() { - { - const value = getter(); - Object.defineProperty(this, "value", { value }); - return value; - } - throw new Error("cached value already set"); - } }; +function _lte(value, params) { + return new $ZodCheckLessThan({ + check: "less_than", + ...normalizeParams(params), + value, + inclusive: true + }); } -function nullish(input) { - return input === null || input === void 0; +function _gt(value, params) { + return new $ZodCheckGreaterThan({ + check: "greater_than", + ...normalizeParams(params), + value, + inclusive: false + }); } -function cleanRegex(source) { - const start = source.startsWith("^") ? 1 : 0; - const end = source.endsWith("$") ? source.length - 1 : source.length; - return source.slice(start, end); +function _gte(value, params) { + return new $ZodCheckGreaterThan({ + check: "greater_than", + ...normalizeParams(params), + value, + inclusive: true + }); } -function floatSafeRemainder(val, step) { - const ratio = val / step; - const roundedRatio = Math.round(ratio); - const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1); - if (Math.abs(ratio - roundedRatio) < tolerance) return 0; - return ratio - roundedRatio; -} -const EVALUATING = /* @__PURE__ */ Symbol("evaluating"); -function defineLazy(object$1, key, getter) { - let value = void 0; - Object.defineProperty(object$1, key, { - get() { - if (value === EVALUATING) return; - if (value === void 0) { - value = EVALUATING; - value = getter(); - } - return value; - }, - set(v) { - Object.defineProperty(object$1, key, { value: v }); - }, - configurable: true - }); +function _positive(params) { + return _gt(0, params); } -function assignProp(target, prop, value) { - Object.defineProperty(target, prop, { - value, - writable: true, - enumerable: true, - configurable: true - }); +function _negative(params) { + return _lt(0, params); } -function mergeDefs(...defs) { - const mergedDescriptors = {}; - for (const def of defs) { - const descriptors = Object.getOwnPropertyDescriptors(def); - Object.assign(mergedDescriptors, descriptors); - } - return Object.defineProperties({}, mergedDescriptors); +function _nonpositive(params) { + return _lte(0, params); } -function esc(str) { - return JSON.stringify(str); +function _nonnegative(params) { + return _gte(0, params); } -function slugify(input) { - return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, ""); +function _multipleOf(value, params) { + return new $ZodCheckMultipleOf({ + check: "multiple_of", + ...normalizeParams(params), + value + }); +} +function _maxSize(maximum, params) { + return new $ZodCheckMaxSize({ + check: "max_size", + ...normalizeParams(params), + maximum + }); +} +function _minSize(minimum, params) { + return new $ZodCheckMinSize({ + check: "min_size", + ...normalizeParams(params), + minimum + }); +} +function _size(size, params) { + return new $ZodCheckSizeEquals({ + check: "size_equals", + ...normalizeParams(params), + size + }); } -const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {}; -function isObject(data) { - return typeof data === "object" && data !== null && !Array.isArray(data); -} -const allowsEval = /* @__PURE__ */ cached(() => { - if (globalConfig.jitless) return false; - if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false; - try { - new Function(""); - return true; - } catch (_) { - return false; - } -}); -function isPlainObject(o) { - if (isObject(o) === false) return false; - const ctor = o.constructor; - if (ctor === void 0) return true; - if (typeof ctor !== "function") return true; - const prot = ctor.prototype; - if (isObject(prot) === false) return false; - if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false; - return true; +function _maxLength(maximum, params) { + const ch = new $ZodCheckMaxLength({ + check: "max_length", + ...normalizeParams(params), + maximum + }); + return ch; } -function shallowClone(o) { - if (isPlainObject(o)) return { ...o }; - if (Array.isArray(o)) return [...o]; - if (o instanceof Map) return new Map(o); - if (o instanceof Set) return new Set(o); - return o; -} -const propertyKeyTypes = /* @__PURE__ */ new Set([ - "string", - "number", - "symbol" -]); -function escapeRegex(str) { - return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +function _minLength(minimum, params) { + return new $ZodCheckMinLength({ + check: "min_length", + ...normalizeParams(params), + minimum + }); } -function clone(inst, def, params) { - const cl = new inst._zod.constr(def ?? inst._zod.def); - if (!def || params?.parent) cl._zod.parent = inst; - return cl; +function _length(length, params) { + return new $ZodCheckLengthEquals({ + check: "length_equals", + ...normalizeParams(params), + length + }); } -function normalizeParams(_params) { - const params = _params; - if (!params) return {}; - if (typeof params === "string") return { error: () => params }; - if (params?.message !== void 0) { - if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params"); - params.error = params.message; - } - delete params.message; - if (typeof params.error === "string") return { - ...params, - error: () => params.error - }; - return params; +function _regex(pattern, params) { + return new $ZodCheckRegex({ + check: "string_format", + format: "regex", + ...normalizeParams(params), + pattern + }); } -function optionalKeys(shape) { - return Object.keys(shape).filter((k) => { - return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; - }); -} -const NUMBER_FORMAT_RANGES = { - safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -function pick(schema, mask) { - const currDef = schema._zod.def; - const checks = currDef.checks; - if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements"); - return clone(schema, mergeDefs(schema._zod.def, { - get shape() { - const newShape = {}; - for (const key in mask) { - if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - newShape[key] = currDef.shape[key]; - } - assignProp(this, "shape", newShape); - return newShape; - }, - checks: [] - })); +function _lowercase(params) { + return new $ZodCheckLowerCase({ + check: "string_format", + format: "lowercase", + ...normalizeParams(params) + }); } -function omit(schema, mask) { - const currDef = schema._zod.def; - const checks = currDef.checks; - if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements"); - return clone(schema, mergeDefs(schema._zod.def, { - get shape() { - const newShape = { ...schema._zod.def.shape }; - for (const key in mask) { - if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - delete newShape[key]; - } - assignProp(this, "shape", newShape); - return newShape; - }, - checks: [] - })); +function _uppercase(params) { + return new $ZodCheckUpperCase({ + check: "string_format", + format: "uppercase", + ...normalizeParams(params) + }); } -function extend(schema, shape) { - if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object"); - const checks = schema._zod.def.checks; - if (checks && checks.length > 0) { - const existingShape = schema._zod.def.shape; - for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead."); - } - return clone(schema, mergeDefs(schema._zod.def, { get shape() { - const _shape = { - ...schema._zod.def.shape, - ...shape - }; - assignProp(this, "shape", _shape); - return _shape; - } })); +function _includes(includes, params) { + return new $ZodCheckIncludes({ + check: "string_format", + format: "includes", + ...normalizeParams(params), + includes + }); } -function safeExtend(schema, shape) { - if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object"); - return clone(schema, mergeDefs(schema._zod.def, { get shape() { - const _shape = { - ...schema._zod.def.shape, - ...shape - }; - assignProp(this, "shape", _shape); - return _shape; - } })); +function _startsWith(prefix, params) { + return new $ZodCheckStartsWith({ + check: "string_format", + format: "starts_with", + ...normalizeParams(params), + prefix + }); } -function merge(a, b) { - if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead."); - return clone(a, mergeDefs(a._zod.def, { - get shape() { - const _shape = { - ...a._zod.def.shape, - ...b._zod.def.shape - }; - assignProp(this, "shape", _shape); - return _shape; - }, - get catchall() { - return b._zod.def.catchall; - }, - checks: b._zod.def.checks ?? [] - })); +function _endsWith(suffix, params) { + return new $ZodCheckEndsWith({ + check: "string_format", + format: "ends_with", + ...normalizeParams(params), + suffix + }); +} +function _property(property, schema, params) { + return new $ZodCheckProperty({ + check: "property", + property, + schema, + ...normalizeParams(params) + }); +} +function _mime(types, params) { + return new $ZodCheckMimeType({ + check: "mime_type", + mime: types, + ...normalizeParams(params) + }); } -function partial(Class, schema, mask) { - const checks = schema._zod.def.checks; - if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements"); - return clone(schema, mergeDefs(schema._zod.def, { - get shape() { - const oldShape = schema._zod.def.shape; - const shape = { ...oldShape }; - if (mask) for (const key in mask) { - if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - shape[key] = Class ? new Class({ - type: "optional", - innerType: oldShape[key] - }) : oldShape[key]; - } - else for (const key in oldShape) shape[key] = Class ? new Class({ - type: "optional", - innerType: oldShape[key] - }) : oldShape[key]; - assignProp(this, "shape", shape); - return shape; - }, - checks: [] - })); +function _overwrite(tx) { + return new $ZodCheckOverwrite({ + check: "overwrite", + tx + }); } -function required(Class, schema, mask) { - return clone(schema, mergeDefs(schema._zod.def, { get shape() { - const oldShape = schema._zod.def.shape; - const shape = { ...oldShape }; - if (mask) for (const key in mask) { - if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`); - if (!mask[key]) continue; - shape[key] = new Class({ - type: "nonoptional", - innerType: oldShape[key] - }); - } - else for (const key in oldShape) shape[key] = new Class({ - type: "nonoptional", - innerType: oldShape[key] - }); - assignProp(this, "shape", shape); - return shape; - } })); +function _normalize(form) { + return _overwrite((input) => input.normalize(form)); } -function aborted(x, startIndex = 0) { - if (x.aborted === true) return true; - for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true; - return false; +function _trim() { + return _overwrite((input) => input.trim()); } -function explicitlyAborted(x, startIndex = 0) { - if (x.aborted === true) return true; - for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true; - return false; -} -function prefixIssues(path$1, issues) { - return issues.map((iss) => { - var _a$3; - (_a$3 = iss).path ?? (_a$3.path = []); - iss.path.unshift(path$1); - return iss; - }); +function _toLowerCase() { + return _overwrite((input) => input.toLowerCase()); } -function unwrapMessage(message) { - return typeof message === "string" ? message : message?.message; +function _toUpperCase() { + return _overwrite((input) => input.toUpperCase()); } -function finalizeIssue(iss, ctx, config$1) { - const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config$1.customError?.(iss)) ?? unwrapMessage(config$1.localeError?.(iss)) ?? "Invalid input"; - const { inst: _inst, continue: _continue, input: _input, ...rest } = iss; - rest.path ?? (rest.path = []); - rest.message = message; - if (ctx?.reportInput) rest.input = _input; - return rest; +function _slugify() { + return _overwrite((input) => slugify(input)); +} +function _array(Class2, element, params) { + return new Class2({ + type: "array", + element, + ...normalizeParams(params) + }); +} +function _union(Class2, options, params) { + return new Class2({ + type: "union", + options, + ...normalizeParams(params) + }); +} +function _xor(Class2, options, params) { + return new Class2({ + type: "union", + options, + inclusive: false, + ...normalizeParams(params) + }); +} +function _discriminatedUnion(Class2, discriminator, options, params) { + return new Class2({ + type: "union", + options, + discriminator, + ...normalizeParams(params) + }); +} +function _intersection(Class2, left, right) { + return new Class2({ + type: "intersection", + left, + right + }); +} +function _tuple(Class2, items, _paramsOrRest, _params) { + const hasRest = _paramsOrRest instanceof $ZodType; + const params = hasRest ? _params : _paramsOrRest; + const rest = hasRest ? _paramsOrRest : null; + return new Class2({ + type: "tuple", + items, + rest, + ...normalizeParams(params) + }); +} +function _record(Class2, keyType, valueType, params) { + return new Class2({ + type: "record", + keyType, + valueType, + ...normalizeParams(params) + }); +} +function _map(Class2, keyType, valueType, params) { + return new Class2({ + type: "map", + keyType, + valueType, + ...normalizeParams(params) + }); +} +function _set(Class2, valueType, params) { + return new Class2({ + type: "set", + valueType, + ...normalizeParams(params) + }); +} +function _enum(Class2, values, params) { + const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; + return new Class2({ + type: "enum", + entries, + ...normalizeParams(params) + }); +} +function _nativeEnum(Class2, entries, params) { + return new Class2({ + type: "enum", + entries, + ...normalizeParams(params) + }); +} +function _literal(Class2, value, params) { + return new Class2({ + type: "literal", + values: Array.isArray(value) ? value : [value], + ...normalizeParams(params) + }); +} +function _file(Class2, params) { + return new Class2({ + type: "file", + ...normalizeParams(params) + }); +} +function _transform(Class2, fn) { + return new Class2({ + type: "transform", + transform: fn + }); +} +function _optional(Class2, innerType) { + return new Class2({ + type: "optional", + innerType + }); +} +function _nullable(Class2, innerType) { + return new Class2({ + type: "nullable", + innerType + }); +} +function _default(Class2, innerType, defaultValue) { + return new Class2({ + type: "default", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue); + } + }); +} +function _nonoptional(Class2, innerType, params) { + return new Class2({ + type: "nonoptional", + innerType, + ...normalizeParams(params) + }); +} +function _success(Class2, innerType) { + return new Class2({ + type: "success", + innerType + }); +} +function _catch(Class2, innerType, catchValue) { + return new Class2({ + type: "catch", + innerType, + catchValue: typeof catchValue === "function" ? catchValue : () => catchValue + }); +} +function _pipe(Class2, in_, out) { + return new Class2({ + type: "pipe", + in: in_, + out + }); +} +function _readonly(Class2, innerType) { + return new Class2({ + type: "readonly", + innerType + }); +} +function _templateLiteral(Class2, parts, params) { + return new Class2({ + type: "template_literal", + parts, + ...normalizeParams(params) + }); +} +function _lazy(Class2, getter) { + return new Class2({ + type: "lazy", + getter + }); +} +function _promise(Class2, innerType) { + return new Class2({ + type: "promise", + innerType + }); +} +function _custom(Class2, fn, _params) { + const norm = normalizeParams(_params); + norm.abort ?? (norm.abort = true); + const schema = new Class2({ + type: "custom", + check: "custom", + fn, + ...norm + }); + return schema; +} +function _refine(Class2, fn, _params) { + const schema = new Class2({ + type: "custom", + check: "custom", + fn, + ...normalizeParams(_params) + }); + return schema; } -function getLengthableOrigin(input) { - if (Array.isArray(input)) return "array"; - if (typeof input === "string") return "string"; - return "unknown"; +function _superRefine(fn, params) { + const ch = _check((payload) => { + payload.addIssue = (issue2) => { + if (typeof issue2 === "string") { + payload.issues.push(issue(issue2, payload.value, ch._zod.def)); + } else { + const _issue = issue2; + if (_issue.fatal) + _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = ch); + _issue.continue ?? (_issue.continue = !ch._zod.def.abort); + payload.issues.push(issue(_issue)); + } + }; + return fn(payload.value, payload); + }, params); + return ch; } -function issue(...args) { - const [iss, input, inst] = args; - if (typeof iss === "string") return { - message: iss, - code: "custom", - input, - inst - }; - return { ...iss }; -} - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js -const initializer$1 = (inst, def) => { - inst.name = "$ZodError"; - Object.defineProperty(inst, "_zod", { - value: inst._zod, - enumerable: false - }); - Object.defineProperty(inst, "issues", { - value: def, - enumerable: false - }); - inst.message = JSON.stringify(def, jsonStringifyReplacer, 2); - Object.defineProperty(inst, "toString", { - value: () => inst.message, - enumerable: false - }); +function _check(fn, params) { + const ch = new $ZodCheck({ + check: "custom", + ...normalizeParams(params) + }); + ch._zod.check = fn; + return ch; +} +function describe(description) { + const ch = new $ZodCheck({ check: "describe" }); + ch._zod.onattach = [ + (inst) => { + const existing = globalRegistry.get(inst) ?? {}; + globalRegistry.add(inst, { ...existing, description }); + } + ]; + ch._zod.check = () => {}; + return ch; +} +function meta(metadata) { + const ch = new $ZodCheck({ check: "meta" }); + ch._zod.onattach = [ + (inst) => { + const existing = globalRegistry.get(inst) ?? {}; + globalRegistry.add(inst, { ...existing, ...metadata }); + } + ]; + ch._zod.check = () => {}; + return ch; +} +function _stringbool(Classes, _params) { + const params = normalizeParams(_params); + let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"]; + let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"]; + if (params.case !== "sensitive") { + truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v); + falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v); + } + const truthySet = new Set(truthyArray); + const falsySet = new Set(falsyArray); + const _Codec = Classes.Codec ?? $ZodCodec; + const _Boolean = Classes.Boolean ?? $ZodBoolean; + const _String = Classes.String ?? $ZodString; + const stringSchema = new _String({ type: "string", error: params.error }); + const booleanSchema = new _Boolean({ type: "boolean", error: params.error }); + const codec = new _Codec({ + type: "pipe", + in: stringSchema, + out: booleanSchema, + transform: (input, payload) => { + let data = input; + if (params.case !== "sensitive") + data = data.toLowerCase(); + if (truthySet.has(data)) { + return true; + } else if (falsySet.has(data)) { + return false; + } else { + payload.issues.push({ + code: "invalid_value", + expected: "stringbool", + values: [...truthySet, ...falsySet], + input: payload.value, + inst: codec, + continue: false + }); + return {}; + } + }, + reverseTransform: (input, _payload) => { + if (input === true) { + return truthyArray[0] || "true"; + } else { + return falsyArray[0] || "false"; + } + }, + error: params.error + }); + return codec; +} +function _stringFormat(Class2, format, fnOrRegex, _params = {}) { + const params = normalizeParams(_params); + const def = { + ...normalizeParams(_params), + check: "string_format", + type: "string", + format, + fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val), + ...params + }; + if (fnOrRegex instanceof RegExp) { + def.pattern = fnOrRegex; + } + const inst = new Class2(def); + return inst; +} +// node_modules/zod/v4/core/to-json-schema.js +function initializeContext(params) { + let target = params?.target ?? "draft-2020-12"; + if (target === "draft-4") + target = "draft-04"; + if (target === "draft-7") + target = "draft-07"; + return { + processors: params.processors ?? {}, + metadataRegistry: params?.metadata ?? globalRegistry, + target, + unrepresentable: params?.unrepresentable ?? "throw", + override: params?.override ?? (() => {}), + io: params?.io ?? "output", + counter: 0, + seen: new Map, + cycles: params?.cycles ?? "ref", + reused: params?.reused ?? "inline", + external: params?.external ?? undefined + }; +} +function process2(schema, ctx, _params = { path: [], schemaPath: [] }) { + var _a3; + const def = schema._zod.def; + const seen = ctx.seen.get(schema); + if (seen) { + seen.count++; + const isCycle = _params.schemaPath.includes(schema); + if (isCycle) { + seen.cycle = _params.path; + } + return seen.schema; + } + const result = { schema: {}, count: 1, cycle: undefined, path: _params.path }; + ctx.seen.set(schema, result); + const overrideSchema = schema._zod.toJSONSchema?.(); + if (overrideSchema) { + result.schema = overrideSchema; + } else { + const params = { + ..._params, + schemaPath: [..._params.schemaPath, schema], + path: _params.path + }; + if (schema._zod.processJSONSchema) { + schema._zod.processJSONSchema(ctx, result.schema, params); + } else { + const _json = result.schema; + const processor = ctx.processors[def.type]; + if (!processor) { + throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`); + } + processor(schema, ctx, _json, params); + } + const parent = schema._zod.parent; + if (parent) { + if (!result.ref) + result.ref = parent; + process2(parent, ctx, params); + ctx.seen.get(parent).isParent = true; + } + } + const meta2 = ctx.metadataRegistry.get(schema); + if (meta2) + Object.assign(result.schema, meta2); + if (ctx.io === "input" && isTransforming(schema)) { + delete result.schema.examples; + delete result.schema.default; + } + if (ctx.io === "input" && "_prefault" in result.schema) + (_a3 = result.schema).default ?? (_a3.default = result.schema._prefault); + delete result.schema._prefault; + const _result = ctx.seen.get(schema); + return _result.schema; +} +function extractDefs(ctx, schema) { + const root = ctx.seen.get(schema); + if (!root) + throw new Error("Unprocessed schema. This is a bug in Zod."); + const idToSchema = new Map; + for (const entry of ctx.seen.entries()) { + const id = ctx.metadataRegistry.get(entry[0])?.id; + if (id) { + const existing = idToSchema.get(id); + if (existing && existing !== entry[0]) { + throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); + } + idToSchema.set(id, entry[0]); + } + } + const makeURI = (entry) => { + const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions"; + if (ctx.external) { + const externalId = ctx.external.registry.get(entry[0])?.id; + const uriGenerator = ctx.external.uri ?? ((id2) => id2); + if (externalId) { + return { ref: uriGenerator(externalId) }; + } + const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`; + entry[1].defId = id; + return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` }; + } + if (entry[1] === root) { + return { ref: "#" }; + } + const uriPrefix = `#`; + const defUriPrefix = `${uriPrefix}/${defsSegment}/`; + const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`; + return { defId, ref: defUriPrefix + defId }; + }; + const extractToDef = (entry) => { + if (entry[1].schema.$ref) { + return; + } + const seen = entry[1]; + const { ref, defId } = makeURI(entry); + seen.def = { ...seen.schema }; + if (defId) + seen.defId = defId; + const schema2 = seen.schema; + for (const key in schema2) { + delete schema2[key]; + } + schema2.$ref = ref; + }; + if (ctx.cycles === "throw") { + for (const entry of ctx.seen.entries()) { + const seen = entry[1]; + if (seen.cycle) { + throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/` + '\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.'); + } + } + } + for (const entry of ctx.seen.entries()) { + const seen = entry[1]; + if (schema === entry[0]) { + extractToDef(entry); + continue; + } + if (ctx.external) { + const ext = ctx.external.registry.get(entry[0])?.id; + if (schema !== entry[0] && ext) { + extractToDef(entry); + continue; + } + } + const id = ctx.metadataRegistry.get(entry[0])?.id; + if (id) { + extractToDef(entry); + continue; + } + if (seen.cycle) { + extractToDef(entry); + continue; + } + if (seen.count > 1) { + if (ctx.reused === "ref") { + extractToDef(entry); + continue; + } + } + } +} +function finalize(ctx, schema) { + const root = ctx.seen.get(schema); + if (!root) + throw new Error("Unprocessed schema. This is a bug in Zod."); + const flattenRef = (zodSchema) => { + const seen = ctx.seen.get(zodSchema); + if (seen.ref === null) + return; + const schema2 = seen.def ?? seen.schema; + const _cached = { ...schema2 }; + const ref = seen.ref; + seen.ref = null; + if (ref) { + flattenRef(ref); + const refSeen = ctx.seen.get(ref); + const refSchema = refSeen.schema; + if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) { + schema2.allOf = schema2.allOf ?? []; + schema2.allOf.push(refSchema); + } else { + Object.assign(schema2, refSchema); + } + Object.assign(schema2, _cached); + const isParentRef = zodSchema._zod.parent === ref; + if (isParentRef) { + for (const key in schema2) { + if (key === "$ref" || key === "allOf") + continue; + if (!(key in _cached)) { + delete schema2[key]; + } + } + } + if (refSchema.$ref && refSeen.def) { + for (const key in schema2) { + if (key === "$ref" || key === "allOf") + continue; + if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) { + delete schema2[key]; + } + } + } + } + const parent = zodSchema._zod.parent; + if (parent && parent !== ref) { + flattenRef(parent); + const parentSeen = ctx.seen.get(parent); + if (parentSeen?.schema.$ref) { + schema2.$ref = parentSeen.schema.$ref; + if (parentSeen.def) { + for (const key in schema2) { + if (key === "$ref" || key === "allOf") + continue; + if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) { + delete schema2[key]; + } + } + } + } + } + ctx.override({ + zodSchema, + jsonSchema: schema2, + path: seen.path ?? [] + }); + }; + for (const entry of [...ctx.seen.entries()].reverse()) { + flattenRef(entry[0]); + } + const result = {}; + if (ctx.target === "draft-2020-12") { + result.$schema = "https://json-schema.org/draft/2020-12/schema"; + } else if (ctx.target === "draft-07") { + result.$schema = "http://json-schema.org/draft-07/schema#"; + } else if (ctx.target === "draft-04") { + result.$schema = "http://json-schema.org/draft-04/schema#"; + } else if (ctx.target === "openapi-3.0") {} else {} + if (ctx.external?.uri) { + const id = ctx.external.registry.get(schema)?.id; + if (!id) + throw new Error("Schema is missing an `id` property"); + result.$id = ctx.external.uri(id); + } + Object.assign(result, root.def ?? root.schema); + const rootMetaId = ctx.metadataRegistry.get(schema)?.id; + if (rootMetaId !== undefined && result.id === rootMetaId) + delete result.id; + const defs = ctx.external?.defs ?? {}; + for (const entry of ctx.seen.entries()) { + const seen = entry[1]; + if (seen.def && seen.defId) { + if (seen.def.id === seen.defId) + delete seen.def.id; + defs[seen.defId] = seen.def; + } + } + if (ctx.external) {} else { + if (Object.keys(defs).length > 0) { + if (ctx.target === "draft-2020-12") { + result.$defs = defs; + } else { + result.definitions = defs; + } + } + } + try { + const finalized = JSON.parse(JSON.stringify(result)); + Object.defineProperty(finalized, "~standard", { + value: { + ...schema["~standard"], + jsonSchema: { + input: createStandardJSONSchemaMethod(schema, "input", ctx.processors), + output: createStandardJSONSchemaMethod(schema, "output", ctx.processors) + } + }, + enumerable: false, + writable: false + }); + return finalized; + } catch (_err) { + throw new Error("Error converting schema to JSON."); + } +} +function isTransforming(_schema, _ctx) { + const ctx = _ctx ?? { seen: new Set }; + if (ctx.seen.has(_schema)) + return false; + ctx.seen.add(_schema); + const def = _schema._zod.def; + if (def.type === "transform") + return true; + if (def.type === "array") + return isTransforming(def.element, ctx); + if (def.type === "set") + return isTransforming(def.valueType, ctx); + if (def.type === "lazy") + return isTransforming(def.getter(), ctx); + if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") { + return isTransforming(def.innerType, ctx); + } + if (def.type === "intersection") { + return isTransforming(def.left, ctx) || isTransforming(def.right, ctx); + } + if (def.type === "record" || def.type === "map") { + return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx); + } + if (def.type === "pipe") { + if (_schema._zod.traits.has("$ZodCodec")) + return true; + return isTransforming(def.in, ctx) || isTransforming(def.out, ctx); + } + if (def.type === "object") { + for (const key in def.shape) { + if (isTransforming(def.shape[key], ctx)) + return true; + } + return false; + } + if (def.type === "union") { + for (const option of def.options) { + if (isTransforming(option, ctx)) + return true; + } + return false; + } + if (def.type === "tuple") { + for (const item of def.items) { + if (isTransforming(item, ctx)) + return true; + } + if (def.rest && isTransforming(def.rest, ctx)) + return true; + return false; + } + return false; +} +var createToJSONSchemaMethod = (schema, processors = {}) => (params) => { + const ctx = initializeContext({ ...params, processors }); + process2(schema, ctx); + extractDefs(ctx, schema); + return finalize(ctx, schema); }; -const $ZodError = $constructor("$ZodError", initializer$1); -const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error }); -function flattenError(error, mapper = (issue$1) => issue$1.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of error.issues) if (sub.path.length > 0) { - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; - fieldErrors[sub.path[0]].push(mapper(sub)); - } else formErrors.push(mapper(sub)); - return { - formErrors, - fieldErrors - }; -} -function formatError(error, mapper = (issue$1) => issue$1.message) { - const fieldErrors = { _errors: [] }; - const processError = (error$1, path$1 = []) => { - for (const issue$1 of error$1.issues) if (issue$1.code === "invalid_union" && issue$1.errors.length) issue$1.errors.map((issues) => processError({ issues }, [...path$1, ...issue$1.path])); - else if (issue$1.code === "invalid_key") processError({ issues: issue$1.issues }, [...path$1, ...issue$1.path]); - else if (issue$1.code === "invalid_element") processError({ issues: issue$1.issues }, [...path$1, ...issue$1.path]); - else { - const fullpath = [...path$1, ...issue$1.path]; - if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue$1)); - else { - let curr = fieldErrors; - let i = 0; - while (i < fullpath.length) { - const el = fullpath[i]; - if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] }; - else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue$1)); - } - curr = curr[el]; - i++; - } - } - } - }; - processError(error); - return fieldErrors; -} - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js -const _parse = (_Err) => (schema, value, _ctx, _params) => { - const ctx = _ctx ? { - ..._ctx, - async: false - } : { async: false }; - const result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) throw new $ZodAsyncError(); - if (result.issues.length) { - const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); - captureStackTrace(e, _params?.callee); - throw e; - } - return result.value; +var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => { + const { libraryOptions, target } = params ?? {}; + const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors }); + process2(schema, ctx); + extractDefs(ctx, schema); + return finalize(ctx, schema); }; -const parse$1 = /* @__PURE__ */ _parse($ZodRealError); -const _parseAsync = (_Err) => async (schema, value, _ctx, params) => { - const ctx = _ctx ? { - ..._ctx, - async: true - } : { async: true }; - let result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) result = await result; - if (result.issues.length) { - const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); - captureStackTrace(e, params?.callee); - throw e; - } - return result.value; +// node_modules/zod/v4/core/json-schema-processors.js +var formatMap = { + guid: "uuid", + url: "uri", + datetime: "date-time", + json_string: "json-string", + regex: "" }; -const parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError); -const _safeParse = (_Err) => (schema, value, _ctx) => { - const ctx = _ctx ? { - ..._ctx, - async: false - } : { async: false }; - const result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) throw new $ZodAsyncError(); - return result.issues.length ? { - success: false, - error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) - } : { - success: true, - data: result.value - }; +var stringProcessor = (schema, ctx, _json, _params) => { + const json = _json; + json.type = "string"; + const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag; + if (typeof minimum === "number") + json.minLength = minimum; + if (typeof maximum === "number") + json.maxLength = maximum; + if (format) { + json.format = formatMap[format] ?? format; + if (json.format === "") + delete json.format; + if (format === "time") { + delete json.format; + } + } + if (contentEncoding) + json.contentEncoding = contentEncoding; + if (patterns && patterns.size > 0) { + const regexes = [...patterns]; + if (regexes.length === 1) + json.pattern = regexes[0].source; + else if (regexes.length > 1) { + json.allOf = [ + ...regexes.map((regex) => ({ + ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {}, + pattern: regex.source + })) + ]; + } + } }; -const safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError); -const _safeParseAsync = (_Err) => async (schema, value, _ctx) => { - const ctx = _ctx ? { - ..._ctx, - async: true - } : { async: true }; - let result = schema._zod.run({ - value, - issues: [] - }, ctx); - if (result instanceof Promise) result = await result; - return result.issues.length ? { - success: false, - error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) - } : { - success: true, - data: result.value - }; +var numberProcessor = (schema, ctx, _json, _params) => { + const json = _json; + const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag; + if (typeof format === "string" && format.includes("int")) + json.type = "integer"; + else + json.type = "number"; + const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY); + const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY); + const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0"; + if (exMin) { + if (legacy) { + json.minimum = exclusiveMinimum; + json.exclusiveMinimum = true; + } else { + json.exclusiveMinimum = exclusiveMinimum; + } + } else if (typeof minimum === "number") { + json.minimum = minimum; + } + if (exMax) { + if (legacy) { + json.maximum = exclusiveMaximum; + json.exclusiveMaximum = true; + } else { + json.exclusiveMaximum = exclusiveMaximum; + } + } else if (typeof maximum === "number") { + json.maximum = maximum; + } + if (typeof multipleOf === "number") + json.multipleOf = multipleOf; }; -const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError); -const _encode = (_Err) => (schema, value, _ctx) => { - const ctx = _ctx ? { - ..._ctx, - direction: "backward" - } : { direction: "backward" }; - return _parse(_Err)(schema, value, ctx); +var booleanProcessor = (_schema, _ctx, json, _params) => { + json.type = "boolean"; }; -const encode$1 = /* @__PURE__ */ _encode($ZodRealError); -const _decode = (_Err) => (schema, value, _ctx) => { - return _parse(_Err)(schema, value, _ctx); +var bigintProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("BigInt cannot be represented in JSON Schema"); + } }; -const decode$1 = /* @__PURE__ */ _decode($ZodRealError); -const _encodeAsync = (_Err) => async (schema, value, _ctx) => { - const ctx = _ctx ? { - ..._ctx, - direction: "backward" - } : { direction: "backward" }; - return _parseAsync(_Err)(schema, value, ctx); +var symbolProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Symbols cannot be represented in JSON Schema"); + } }; -const encodeAsync$1 = /* @__PURE__ */ _encodeAsync($ZodRealError); -const _decodeAsync = (_Err) => async (schema, value, _ctx) => { - return _parseAsync(_Err)(schema, value, _ctx); +var nullProcessor = (_schema, ctx, json, _params) => { + if (ctx.target === "openapi-3.0") { + json.type = "string"; + json.nullable = true; + json.enum = [null]; + } else { + json.type = "null"; + } }; -const decodeAsync$1 = /* @__PURE__ */ _decodeAsync($ZodRealError); -const _safeEncode = (_Err) => (schema, value, _ctx) => { - const ctx = _ctx ? { - ..._ctx, - direction: "backward" - } : { direction: "backward" }; - return _safeParse(_Err)(schema, value, ctx); +var undefinedProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Undefined cannot be represented in JSON Schema"); + } }; -const safeEncode$1 = /* @__PURE__ */ _safeEncode($ZodRealError); -const _safeDecode = (_Err) => (schema, value, _ctx) => { - return _safeParse(_Err)(schema, value, _ctx); +var voidProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Void cannot be represented in JSON Schema"); + } }; -const safeDecode$1 = /* @__PURE__ */ _safeDecode($ZodRealError); -const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => { - const ctx = _ctx ? { - ..._ctx, - direction: "backward" - } : { direction: "backward" }; - return _safeParseAsync(_Err)(schema, value, ctx); +var neverProcessor = (_schema, _ctx, json, _params) => { + json.not = {}; }; -const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync($ZodRealError); -const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => { - return _safeParseAsync(_Err)(schema, value, _ctx); +var anyProcessor = (_schema, _ctx, _json, _params) => {}; +var unknownProcessor = (_schema, _ctx, _json, _params) => {}; +var dateProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Date cannot be represented in JSON Schema"); + } }; -const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError); - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js -/** -* @deprecated CUID v1 is deprecated by its authors due to information leakage -* (timestamps embedded in the id). Use {@link cuid2} instead. -* See https://github.com/paralleldrive/cuid. -*/ -const cuid = /^[cC][0-9a-z]{6,}$/; -const cuid2 = /^[0-9a-z]+$/; -const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; -const xid = /^[0-9a-vA-V]{20}$/; -const ksuid = /^[A-Za-z0-9]{27}$/; -const nanoid = /^[a-zA-Z0-9_-]{21}$/; -/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */ -const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; -/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */ -const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/; -/** Returns a regex for validating an RFC 9562/4122 UUID. -* -* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */ -const uuid = (version$1) => { - if (!version$1) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; - return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$1}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); +var enumProcessor = (schema, _ctx, json, _params) => { + const def = schema._zod.def; + const values = getEnumValues(def.entries); + if (values.every((v) => typeof v === "number")) + json.type = "number"; + if (values.every((v) => typeof v === "string")) + json.type = "string"; + json.enum = values; }; -/** Practical email validation */ -const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; -const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -function emoji() { - return new RegExp(_emoji$1, "u"); -} -const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/; -const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/; -const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/; -const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/; -const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; -const base64url = /^[A-Za-z0-9_-]*$/; -const httpProtocol = /^https?$/; -const e164 = /^\+[1-9]\d{6,14}$/; -const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; -const date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`); -function timeSource(args) { - const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; -} -function time$1(args) { - return /* @__PURE__ */ new RegExp(`^${timeSource(args)}$`); -} -function datetime$1(args) { - const time$2 = timeSource({ precision: args.precision }); - const opts = ["Z"]; - if (args.local) opts.push(""); - if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); - const timeRegex = `${time$2}(?:${opts.join("|")})`; - return /* @__PURE__ */ new RegExp(`^${dateSource}T(?:${timeRegex})$`); -} -const string$1 = (params) => { - const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; - return /* @__PURE__ */ new RegExp(`^${regex}$`); +var literalProcessor = (schema, ctx, json, _params) => { + const def = schema._zod.def; + const vals = []; + for (const val of def.values) { + if (val === undefined) { + if (ctx.unrepresentable === "throw") { + throw new Error("Literal `undefined` cannot be represented in JSON Schema"); + } else {} + } else if (typeof val === "bigint") { + if (ctx.unrepresentable === "throw") { + throw new Error("BigInt literals cannot be represented in JSON Schema"); + } else { + vals.push(Number(val)); + } + } else { + vals.push(val); + } + } + if (vals.length === 0) {} else if (vals.length === 1) { + const val = vals[0]; + json.type = val === null ? "null" : typeof val; + if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") { + json.enum = [val]; + } else { + json.const = val; + } + } else { + if (vals.every((v) => typeof v === "number")) + json.type = "number"; + if (vals.every((v) => typeof v === "string")) + json.type = "string"; + if (vals.every((v) => typeof v === "boolean")) + json.type = "boolean"; + if (vals.every((v) => v === null)) + json.type = "null"; + json.enum = vals; + } +}; +var nanProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("NaN cannot be represented in JSON Schema"); + } +}; +var templateLiteralProcessor = (schema, _ctx, json, _params) => { + const _json = json; + const pattern = schema._zod.pattern; + if (!pattern) + throw new Error("Pattern not found in template literal"); + _json.type = "string"; + _json.pattern = pattern.source; +}; +var fileProcessor = (schema, _ctx, json, _params) => { + const _json = json; + const file = { + type: "string", + format: "binary", + contentEncoding: "binary" + }; + const { minimum, maximum, mime } = schema._zod.bag; + if (minimum !== undefined) + file.minLength = minimum; + if (maximum !== undefined) + file.maxLength = maximum; + if (mime) { + if (mime.length === 1) { + file.contentMediaType = mime[0]; + Object.assign(_json, file); + } else { + Object.assign(_json, file); + _json.anyOf = mime.map((m) => ({ contentMediaType: m })); + } + } else { + Object.assign(_json, file); + } +}; +var successProcessor = (_schema, _ctx, json, _params) => { + json.type = "boolean"; +}; +var customProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Custom types cannot be represented in JSON Schema"); + } +}; +var functionProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Function types cannot be represented in JSON Schema"); + } +}; +var transformProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Transforms cannot be represented in JSON Schema"); + } +}; +var mapProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Map cannot be represented in JSON Schema"); + } +}; +var setProcessor = (_schema, ctx, _json, _params) => { + if (ctx.unrepresentable === "throw") { + throw new Error("Set cannot be represented in JSON Schema"); + } +}; +var arrayProcessor = (schema, ctx, _json, params) => { + const json = _json; + const def = schema._zod.def; + const { minimum, maximum } = schema._zod.bag; + if (typeof minimum === "number") + json.minItems = minimum; + if (typeof maximum === "number") + json.maxItems = maximum; + json.type = "array"; + json.items = process2(def.element, ctx, { + ...params, + path: [...params.path, "items"] + }); +}; +var objectProcessor = (schema, ctx, _json, params) => { + const json = _json; + const def = schema._zod.def; + json.type = "object"; + json.properties = {}; + const shape = def.shape; + for (const key in shape) { + json.properties[key] = process2(shape[key], ctx, { + ...params, + path: [...params.path, "properties", key] + }); + } + const allKeys = new Set(Object.keys(shape)); + const requiredKeys = new Set([...allKeys].filter((key) => { + const v = def.shape[key]._zod; + if (ctx.io === "input") { + return v.optin === undefined; + } else { + return v.optout === undefined; + } + })); + if (requiredKeys.size > 0) { + json.required = Array.from(requiredKeys); + } + if (def.catchall?._zod.def.type === "never") { + json.additionalProperties = false; + } else if (!def.catchall) { + if (ctx.io === "output") + json.additionalProperties = false; + } else if (def.catchall) { + json.additionalProperties = process2(def.catchall, ctx, { + ...params, + path: [...params.path, "additionalProperties"] + }); + } }; -const integer = /^-?\d+$/; -const number$1 = /^-?\d+(?:\.\d+)?$/; -const boolean$1 = /^(?:true|false)$/i; -const lowercase = /^[^A-Z]*$/; -const uppercase = /^[^a-z]*$/; - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js -const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { - var _a$3; - inst._zod ?? (inst._zod = {}); - inst._zod.def = def; - (_a$3 = inst._zod).onattach ?? (_a$3.onattach = []); -}); -const numericOriginMap = { - number: "number", - bigint: "bigint", - object: "date" +var unionProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + const isExclusive = def.inclusive === false; + const options = def.options.map((x, i) => process2(x, ctx, { + ...params, + path: [...params.path, isExclusive ? "oneOf" : "anyOf", i] + })); + if (isExclusive) { + json.oneOf = options; + } else { + json.anyOf = options; + } }; -const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => { - $ZodCheck.init(inst, def); - const origin = numericOriginMap[typeof def.value]; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; - if (def.value < curr) if (def.inclusive) bag.maximum = def.value; - else bag.exclusiveMaximum = def.value; - }); - inst._zod.check = (payload) => { - if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return; - payload.issues.push({ - origin, - code: "too_big", - maximum: typeof def.value === "object" ? def.value.getTime() : def.value, - input: payload.value, - inclusive: def.inclusive, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => { - $ZodCheck.init(inst, def); - const origin = numericOriginMap[typeof def.value]; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; - if (def.value > curr) if (def.inclusive) bag.minimum = def.value; - else bag.exclusiveMinimum = def.value; - }); - inst._zod.check = (payload) => { - if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return; - payload.issues.push({ - origin, - code: "too_small", - minimum: typeof def.value === "object" ? def.value.getTime() : def.value, - input: payload.value, - inclusive: def.inclusive, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => { - $ZodCheck.init(inst, def); - inst._zod.onattach.push((inst$1) => { - var _a$3; - (_a$3 = inst$1._zod.bag).multipleOf ?? (_a$3.multipleOf = def.value); - }); - inst._zod.check = (payload) => { - if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check."); - if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return; - payload.issues.push({ - origin: typeof payload.value, - code: "not_multiple_of", - divisor: def.value, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => { - $ZodCheck.init(inst, def); - def.format = def.format || "float64"; - const isInt = def.format?.includes("int"); - const origin = isInt ? "int" : "number"; - const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format]; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - bag.format = def.format; - bag.minimum = minimum; - bag.maximum = maximum; - if (isInt) bag.pattern = integer; - }); - inst._zod.check = (payload) => { - const input = payload.value; - if (isInt) { - if (!Number.isInteger(input)) { - payload.issues.push({ - expected: origin, - format: def.format, - code: "invalid_type", - continue: false, - input, - inst - }); - return; - } - if (!Number.isSafeInteger(input)) { - if (input > 0) payload.issues.push({ - input, - code: "too_big", - maximum: Number.MAX_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst, - origin, - inclusive: true, - continue: !def.abort - }); - else payload.issues.push({ - input, - code: "too_small", - minimum: Number.MIN_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst, - origin, - inclusive: true, - continue: !def.abort - }); - return; - } - } - if (input < minimum) payload.issues.push({ - origin: "number", - input, - code: "too_small", - minimum, - inclusive: true, - inst, - continue: !def.abort - }); - if (input > maximum) payload.issues.push({ - origin: "number", - input, - code: "too_big", - maximum, - inclusive: true, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { - var _a$3; - $ZodCheck.init(inst, def); - (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { - const val = payload.value; - return !nullish(val) && val.length !== void 0; - }); - inst._zod.onattach.push((inst$1) => { - const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY; - if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum; - }); - inst._zod.check = (payload) => { - const input = payload.value; - if (input.length <= def.maximum) return; - const origin = getLengthableOrigin(input); - payload.issues.push({ - origin, - code: "too_big", - maximum: def.maximum, - inclusive: true, - input, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => { - var _a$3; - $ZodCheck.init(inst, def); - (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { - const val = payload.value; - return !nullish(val) && val.length !== void 0; - }); - inst._zod.onattach.push((inst$1) => { - const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; - if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum; - }); - inst._zod.check = (payload) => { - const input = payload.value; - if (input.length >= def.minimum) return; - const origin = getLengthableOrigin(input); - payload.issues.push({ - origin, - code: "too_small", - minimum: def.minimum, - inclusive: true, - input, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => { - var _a$3; - $ZodCheck.init(inst, def); - (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { - const val = payload.value; - return !nullish(val) && val.length !== void 0; - }); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - bag.minimum = def.length; - bag.maximum = def.length; - bag.length = def.length; - }); - inst._zod.check = (payload) => { - const input = payload.value; - const length = input.length; - if (length === def.length) return; - const origin = getLengthableOrigin(input); - const tooBig = length > def.length; - payload.issues.push({ - origin, - ...tooBig ? { - code: "too_big", - maximum: def.length - } : { - code: "too_small", - minimum: def.length - }, - inclusive: true, - exact: true, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => { - var _a$3, _b; - $ZodCheck.init(inst, def); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - bag.format = def.format; - if (def.pattern) { - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(def.pattern); - } - }); - if (def.pattern) (_a$3 = inst._zod).check ?? (_a$3.check = (payload) => { - def.pattern.lastIndex = 0; - if (def.pattern.test(payload.value)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: def.format, - input: payload.value, - ...def.pattern ? { pattern: def.pattern.toString() } : {}, - inst, - continue: !def.abort - }); - }); - else (_b = inst._zod).check ?? (_b.check = () => {}); -}); -const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => { - $ZodCheckStringFormat.init(inst, def); - inst._zod.check = (payload) => { - def.pattern.lastIndex = 0; - if (def.pattern.test(payload.value)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "regex", - input: payload.value, - pattern: def.pattern.toString(), - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => { - def.pattern ?? (def.pattern = lowercase); - $ZodCheckStringFormat.init(inst, def); -}); -const $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => { - def.pattern ?? (def.pattern = uppercase); - $ZodCheckStringFormat.init(inst, def); -}); -const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => { - $ZodCheck.init(inst, def); - const escapedRegex = escapeRegex(def.includes); - const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); - def.pattern = pattern; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.includes(def.includes, def.position)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "includes", - includes: def.includes, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => { - $ZodCheck.init(inst, def); - const pattern = /* @__PURE__ */ new RegExp(`^${escapeRegex(def.prefix)}.*`); - def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.startsWith(def.prefix)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "starts_with", - prefix: def.prefix, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => { - $ZodCheck.init(inst, def); - const pattern = /* @__PURE__ */ new RegExp(`.*${escapeRegex(def.suffix)}$`); - def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; - bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); - bag.patterns.add(pattern); - }); - inst._zod.check = (payload) => { - if (payload.value.endsWith(def.suffix)) return; - payload.issues.push({ - origin: "string", - code: "invalid_format", - format: "ends_with", - suffix: def.suffix, - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => { - $ZodCheck.init(inst, def); - inst._zod.check = (payload) => { - payload.value = def.tx(payload.value); - }; -}); - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js -var Doc = class { - constructor(args = []) { - this.content = []; - this.indent = 0; - if (this) this.args = args; - } - indented(fn) { - this.indent += 1; - fn(this); - this.indent -= 1; - } - write(arg) { - if (typeof arg === "function") { - arg(this, { execution: "sync" }); - arg(this, { execution: "async" }); - return; - } - const lines = arg.split("\n").filter((x) => x); - const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length)); - const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x); - for (const line of dedented) this.content.push(line); - } - compile() { - const F = Function; - const args = this?.args; - const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)]; - return new F(...args, lines.join("\n")); - } +var intersectionProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + const a = process2(def.left, ctx, { + ...params, + path: [...params.path, "allOf", 0] + }); + const b = process2(def.right, ctx, { + ...params, + path: [...params.path, "allOf", 1] + }); + const isSimpleIntersection = (val) => ("allOf" in val) && Object.keys(val).length === 1; + const allOf = [ + ...isSimpleIntersection(a) ? a.allOf : [a], + ...isSimpleIntersection(b) ? b.allOf : [b] + ]; + json.allOf = allOf; }; +var tupleProcessor = (schema, ctx, _json, params) => { + const json = _json; + const def = schema._zod.def; + json.type = "array"; + const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items"; + const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems"; + const prefixItems = def.items.map((x, i) => process2(x, ctx, { + ...params, + path: [...params.path, prefixPath, i] + })); + const rest = def.rest ? process2(def.rest, ctx, { + ...params, + path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []] + }) : null; + if (ctx.target === "draft-2020-12") { + json.prefixItems = prefixItems; + if (rest) { + json.items = rest; + } + } else if (ctx.target === "openapi-3.0") { + json.items = { + anyOf: prefixItems + }; + if (rest) { + json.items.anyOf.push(rest); + } + json.minItems = prefixItems.length; + if (!rest) { + json.maxItems = prefixItems.length; + } + } else { + json.items = prefixItems; + if (rest) { + json.additionalItems = rest; + } + } + const { minimum, maximum } = schema._zod.bag; + if (typeof minimum === "number") + json.minItems = minimum; + if (typeof maximum === "number") + json.maxItems = maximum; +}; +var recordProcessor = (schema, ctx, _json, params) => { + const json = _json; + const def = schema._zod.def; + json.type = "object"; + const keyType = def.keyType; + const keyBag = keyType._zod.bag; + const patterns = keyBag?.patterns; + if (def.mode === "loose" && patterns && patterns.size > 0) { + const valueSchema = process2(def.valueType, ctx, { + ...params, + path: [...params.path, "patternProperties", "*"] + }); + json.patternProperties = {}; + for (const pattern of patterns) { + json.patternProperties[pattern.source] = valueSchema; + } + } else { + if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") { + json.propertyNames = process2(def.keyType, ctx, { + ...params, + path: [...params.path, "propertyNames"] + }); + } + json.additionalProperties = process2(def.valueType, ctx, { + ...params, + path: [...params.path, "additionalProperties"] + }); + } + const keyValues = keyType._zod.values; + if (keyValues) { + const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number"); + if (validKeyValues.length > 0) { + json.required = validKeyValues; + } + } +}; +var nullableProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + const inner = process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + if (ctx.target === "openapi-3.0") { + seen.ref = def.innerType; + json.nullable = true; + } else { + json.anyOf = [inner, { type: "null" }]; + } +}; +var nonoptionalProcessor = (schema, ctx, _json, params) => { + const def = schema._zod.def; + process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; +}; +var defaultProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + json.default = JSON.parse(JSON.stringify(def.defaultValue)); +}; +var prefaultProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + if (ctx.io === "input") + json._prefault = JSON.parse(JSON.stringify(def.defaultValue)); +}; +var catchProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + let catchValue; + try { + catchValue = def.catchValue(undefined); + } catch { + throw new Error("Dynamic catch values are not supported in JSON Schema"); + } + json.default = catchValue; +}; +var pipeProcessor = (schema, ctx, _json, params) => { + const def = schema._zod.def; + const inIsTransform = def.in._zod.traits.has("$ZodTransform"); + const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out; + process2(innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = innerType; +}; +var readonlyProcessor = (schema, ctx, json, params) => { + const def = schema._zod.def; + process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; + json.readOnly = true; +}; +var promiseProcessor = (schema, ctx, _json, params) => { + const def = schema._zod.def; + process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; +}; +var optionalProcessor = (schema, ctx, _json, params) => { + const def = schema._zod.def; + process2(def.innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = def.innerType; +}; +var lazyProcessor = (schema, ctx, _json, params) => { + const innerType = schema._zod.innerType; + process2(innerType, ctx, params); + const seen = ctx.seen.get(schema); + seen.ref = innerType; +}; +var allProcessors = { + string: stringProcessor, + number: numberProcessor, + boolean: booleanProcessor, + bigint: bigintProcessor, + symbol: symbolProcessor, + null: nullProcessor, + undefined: undefinedProcessor, + void: voidProcessor, + never: neverProcessor, + any: anyProcessor, + unknown: unknownProcessor, + date: dateProcessor, + enum: enumProcessor, + literal: literalProcessor, + nan: nanProcessor, + template_literal: templateLiteralProcessor, + file: fileProcessor, + success: successProcessor, + custom: customProcessor, + function: functionProcessor, + transform: transformProcessor, + map: mapProcessor, + set: setProcessor, + array: arrayProcessor, + object: objectProcessor, + union: unionProcessor, + intersection: intersectionProcessor, + tuple: tupleProcessor, + record: recordProcessor, + nullable: nullableProcessor, + nonoptional: nonoptionalProcessor, + default: defaultProcessor, + prefault: prefaultProcessor, + catch: catchProcessor, + pipe: pipeProcessor, + readonly: readonlyProcessor, + promise: promiseProcessor, + optional: optionalProcessor, + lazy: lazyProcessor +}; +function toJSONSchema(input, params) { + if ("_idmap" in input) { + const registry2 = input; + const ctx2 = initializeContext({ ...params, processors: allProcessors }); + const defs = {}; + for (const entry of registry2._idmap.entries()) { + const [_, schema] = entry; + process2(schema, ctx2); + } + const schemas = {}; + const external = { + registry: registry2, + uri: params?.uri, + defs + }; + ctx2.external = external; + for (const entry of registry2._idmap.entries()) { + const [key, schema] = entry; + extractDefs(ctx2, schema); + schemas[key] = finalize(ctx2, schema); + } + if (Object.keys(defs).length > 0) { + const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions"; + schemas.__shared = { + [defsSegment]: defs + }; + } + return { schemas }; + } + const ctx = initializeContext({ ...params, processors: allProcessors }); + process2(input, ctx); + extractDefs(ctx, input); + return finalize(ctx, input); +} +// node_modules/zod/v4/core/json-schema-generator.js +class JSONSchemaGenerator { + get metadataRegistry() { + return this.ctx.metadataRegistry; + } + get target() { + return this.ctx.target; + } + get unrepresentable() { + return this.ctx.unrepresentable; + } + get override() { + return this.ctx.override; + } + get io() { + return this.ctx.io; + } + get counter() { + return this.ctx.counter; + } + set counter(value) { + this.ctx.counter = value; + } + get seen() { + return this.ctx.seen; + } + constructor(params) { + let normalizedTarget = params?.target ?? "draft-2020-12"; + if (normalizedTarget === "draft-4") + normalizedTarget = "draft-04"; + if (normalizedTarget === "draft-7") + normalizedTarget = "draft-07"; + this.ctx = initializeContext({ + processors: allProcessors, + target: normalizedTarget, + ...params?.metadata && { metadata: params.metadata }, + ...params?.unrepresentable && { unrepresentable: params.unrepresentable }, + ...params?.override && { override: params.override }, + ...params?.io && { io: params.io } + }); + } + process(schema, _params = { path: [], schemaPath: [] }) { + return process2(schema, this.ctx, _params); + } + emit(schema, _params) { + if (_params) { + if (_params.cycles) + this.ctx.cycles = _params.cycles; + if (_params.reused) + this.ctx.reused = _params.reused; + if (_params.external) + this.ctx.external = _params.external; + } + extractDefs(this.ctx, schema); + const result = finalize(this.ctx, schema); + const { "~standard": _, ...plainResult } = result; + return plainResult; + } +} +// node_modules/zod/v4/core/json-schema.js +var exports_json_schema = {}; +// node_modules/zod/v4/classic/schemas.js +var exports_schemas2 = {}; +__export(exports_schemas2, { + xor: () => xor, + xid: () => xid2, + void: () => _void2, + uuidv7: () => uuidv7, + uuidv6: () => uuidv6, + uuidv4: () => uuidv4, + uuid: () => uuid2, + url: () => url, + unknown: () => unknown, + union: () => union, + undefined: () => _undefined3, + ulid: () => ulid2, + uint64: () => uint64, + uint32: () => uint32, + tuple: () => tuple, + transform: () => transform, + templateLiteral: () => templateLiteral, + symbol: () => symbol, + superRefine: () => superRefine, + success: () => success, + stringbool: () => stringbool, + stringFormat: () => stringFormat, + string: () => string2, + strictObject: () => strictObject, + set: () => set, + refine: () => refine, + record: () => record, + readonly: () => readonly, + promise: () => promise, + preprocess: () => preprocess, + prefault: () => prefault, + pipe: () => pipe, + partialRecord: () => partialRecord, + optional: () => optional, + object: () => object, + number: () => number2, + nullish: () => nullish2, + nullable: () => nullable, + null: () => _null3, + nonoptional: () => nonoptional, + never: () => never, + nativeEnum: () => nativeEnum, + nanoid: () => nanoid2, + nan: () => nan, + meta: () => meta2, + map: () => map, + mac: () => mac2, + looseRecord: () => looseRecord, + looseObject: () => looseObject, + literal: () => literal, + lazy: () => lazy, + ksuid: () => ksuid2, + keyof: () => keyof, + jwt: () => jwt, + json: () => json, + ipv6: () => ipv62, + ipv4: () => ipv42, + invertCodec: () => invertCodec, + intersection: () => intersection, + int64: () => int64, + int32: () => int32, + int: () => int, + instanceof: () => _instanceof, + httpUrl: () => httpUrl, + hostname: () => hostname2, + hex: () => hex2, + hash: () => hash, + guid: () => guid2, + function: () => _function, + float64: () => float64, + float32: () => float32, + file: () => file, + exactOptional: () => exactOptional, + enum: () => _enum2, + emoji: () => emoji2, + email: () => email2, + e164: () => e1642, + discriminatedUnion: () => discriminatedUnion, + describe: () => describe2, + date: () => date3, + custom: () => custom, + cuid2: () => cuid22, + cuid: () => cuid3, + codec: () => codec, + cidrv6: () => cidrv62, + cidrv4: () => cidrv42, + check: () => check, + catch: () => _catch2, + boolean: () => boolean2, + bigint: () => bigint2, + base64url: () => base64url2, + base64: () => base642, + array: () => array, + any: () => any, + _function: () => _function, + _default: () => _default2, + _ZodString: () => _ZodString, + ZodXor: () => ZodXor, + ZodXID: () => ZodXID, + ZodVoid: () => ZodVoid, + ZodUnknown: () => ZodUnknown, + ZodUnion: () => ZodUnion, + ZodUndefined: () => ZodUndefined, + ZodUUID: () => ZodUUID, + ZodURL: () => ZodURL, + ZodULID: () => ZodULID, + ZodType: () => ZodType, + ZodTuple: () => ZodTuple, + ZodTransform: () => ZodTransform, + ZodTemplateLiteral: () => ZodTemplateLiteral, + ZodSymbol: () => ZodSymbol, + ZodSuccess: () => ZodSuccess, + ZodStringFormat: () => ZodStringFormat, + ZodString: () => ZodString, + ZodSet: () => ZodSet, + ZodRecord: () => ZodRecord, + ZodReadonly: () => ZodReadonly, + ZodPromise: () => ZodPromise, + ZodPreprocess: () => ZodPreprocess, + ZodPrefault: () => ZodPrefault, + ZodPipe: () => ZodPipe, + ZodOptional: () => ZodOptional, + ZodObject: () => ZodObject, + ZodNumberFormat: () => ZodNumberFormat, + ZodNumber: () => ZodNumber, + ZodNullable: () => ZodNullable, + ZodNull: () => ZodNull, + ZodNonOptional: () => ZodNonOptional, + ZodNever: () => ZodNever, + ZodNanoID: () => ZodNanoID, + ZodNaN: () => ZodNaN, + ZodMap: () => ZodMap, + ZodMAC: () => ZodMAC, + ZodLiteral: () => ZodLiteral, + ZodLazy: () => ZodLazy, + ZodKSUID: () => ZodKSUID, + ZodJWT: () => ZodJWT, + ZodIntersection: () => ZodIntersection, + ZodIPv6: () => ZodIPv6, + ZodIPv4: () => ZodIPv4, + ZodGUID: () => ZodGUID, + ZodFunction: () => ZodFunction, + ZodFile: () => ZodFile, + ZodExactOptional: () => ZodExactOptional, + ZodEnum: () => ZodEnum, + ZodEmoji: () => ZodEmoji, + ZodEmail: () => ZodEmail, + ZodE164: () => ZodE164, + ZodDiscriminatedUnion: () => ZodDiscriminatedUnion, + ZodDefault: () => ZodDefault, + ZodDate: () => ZodDate, + ZodCustomStringFormat: () => ZodCustomStringFormat, + ZodCustom: () => ZodCustom, + ZodCodec: () => ZodCodec, + ZodCatch: () => ZodCatch, + ZodCUID2: () => ZodCUID2, + ZodCUID: () => ZodCUID, + ZodCIDRv6: () => ZodCIDRv6, + ZodCIDRv4: () => ZodCIDRv4, + ZodBoolean: () => ZodBoolean, + ZodBigIntFormat: () => ZodBigIntFormat, + ZodBigInt: () => ZodBigInt, + ZodBase64URL: () => ZodBase64URL, + ZodBase64: () => ZodBase64, + ZodArray: () => ZodArray, + ZodAny: () => ZodAny +}); + +// node_modules/zod/v4/classic/checks.js +var exports_checks2 = {}; +__export(exports_checks2, { + uppercase: () => _uppercase, + trim: () => _trim, + toUpperCase: () => _toUpperCase, + toLowerCase: () => _toLowerCase, + startsWith: () => _startsWith, + slugify: () => _slugify, + size: () => _size, + regex: () => _regex, + property: () => _property, + positive: () => _positive, + overwrite: () => _overwrite, + normalize: () => _normalize, + nonpositive: () => _nonpositive, + nonnegative: () => _nonnegative, + negative: () => _negative, + multipleOf: () => _multipleOf, + minSize: () => _minSize, + minLength: () => _minLength, + mime: () => _mime, + maxSize: () => _maxSize, + maxLength: () => _maxLength, + lte: () => _lte, + lt: () => _lt, + lowercase: () => _lowercase, + length: () => _length, + includes: () => _includes, + gte: () => _gte, + gt: () => _gt, + endsWith: () => _endsWith +}); -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js -const version = { - major: 4, - minor: 4, - patch: 3 +// node_modules/zod/v4/classic/iso.js +var exports_iso = {}; +__export(exports_iso, { + time: () => time2, + duration: () => duration2, + datetime: () => datetime2, + date: () => date2, + ZodISOTime: () => ZodISOTime, + ZodISODuration: () => ZodISODuration, + ZodISODateTime: () => ZodISODateTime, + ZodISODate: () => ZodISODate +}); +var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => { + $ZodISODateTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function datetime2(params) { + return _isoDateTime(ZodISODateTime, params); +} +var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => { + $ZodISODate.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function date2(params) { + return _isoDate(ZodISODate, params); +} +var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => { + $ZodISOTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function time2(params) { + return _isoTime(ZodISOTime, params); +} +var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => { + $ZodISODuration.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function duration2(params) { + return _isoDuration(ZodISODuration, params); +} + +// node_modules/zod/v4/classic/errors.js +var initializer2 = (inst, issues) => { + $ZodError.init(inst, issues); + inst.name = "ZodError"; + Object.defineProperties(inst, { + format: { + value: (mapper) => formatError(inst, mapper) + }, + flatten: { + value: (mapper) => flattenError(inst, mapper) + }, + addIssue: { + value: (issue2) => { + inst.issues.push(issue2); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); + } + }, + addIssues: { + value: (issues2) => { + inst.issues.push(...issues2); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); + } + }, + isEmpty: { + get() { + return inst.issues.length === 0; + } + } + }); }; +var ZodError = /* @__PURE__ */ $constructor("ZodError", initializer2); +var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, { + Parent: Error +}); -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js -const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { - var _a$3; - inst ?? (inst = {}); - inst._zod.def = def; - inst._zod.bag = inst._zod.bag || {}; - inst._zod.version = version; - const checks = [...inst._zod.def.checks ?? []]; - if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst); - for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst); - if (checks.length === 0) { - (_a$3 = inst._zod).deferred ?? (_a$3.deferred = []); - inst._zod.deferred?.push(() => { - inst._zod.run = inst._zod.parse; - }); - } else { - const runChecks = (payload, checks$1, ctx) => { - let isAborted = aborted(payload); - let asyncResult; - for (const ch of checks$1) { - if (ch._zod.def.when) { - if (explicitlyAborted(payload)) continue; - if (!ch._zod.def.when(payload)) continue; - } else if (isAborted) continue; - const currLen = payload.issues.length; - const _ = ch._zod.check(payload); - if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError(); - if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { - await _; - if (payload.issues.length === currLen) return; - if (!isAborted) isAborted = aborted(payload, currLen); - }); - else { - if (payload.issues.length === currLen) continue; - if (!isAborted) isAborted = aborted(payload, currLen); - } - } - if (asyncResult) return asyncResult.then(() => { - return payload; - }); - return payload; - }; - const handleCanaryResult = (canary, payload, ctx) => { - if (aborted(canary)) { - canary.aborted = true; - return canary; - } - const checkResult = runChecks(payload, checks, ctx); - if (checkResult instanceof Promise) { - if (ctx.async === false) throw new $ZodAsyncError(); - return checkResult.then((checkResult$1) => inst._zod.parse(checkResult$1, ctx)); - } - return inst._zod.parse(checkResult, ctx); - }; - inst._zod.run = (payload, ctx) => { - if (ctx.skipChecks) return inst._zod.parse(payload, ctx); - if (ctx.direction === "backward") { - const canary = inst._zod.parse({ - value: payload.value, - issues: [] - }, { - ...ctx, - skipChecks: true - }); - if (canary instanceof Promise) return canary.then((canary$1) => { - return handleCanaryResult(canary$1, payload, ctx); - }); - return handleCanaryResult(canary, payload, ctx); - } - const result = inst._zod.parse(payload, ctx); - if (result instanceof Promise) { - if (ctx.async === false) throw new $ZodAsyncError(); - return result.then((result$1) => runChecks(result$1, checks, ctx)); - } - return runChecks(result, checks, ctx); - }; - } - defineLazy(inst, "~standard", () => ({ - validate: (value) => { - try { - const r = safeParse$1(inst, value); - return r.success ? { value: r.data } : { issues: r.error?.issues }; - } catch (_) { - return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues }); - } - }, - vendor: "zod", - version: 1 - })); -}); -const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag); - inst._zod.parse = (payload, _) => { - if (def.coerce) try { - payload.value = String(payload.value); - } catch (_$1) {} - if (typeof payload.value === "string") return payload; - payload.issues.push({ - expected: "string", - code: "invalid_type", - input: payload.value, - inst - }); - return payload; - }; -}); -const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => { - $ZodCheckStringFormat.init(inst, def); - $ZodString.init(inst, def); -}); -const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => { - def.pattern ?? (def.pattern = guid); - $ZodStringFormat.init(inst, def); -}); -const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { - if (def.version) { - const v = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }[def.version]; - if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`); - def.pattern ?? (def.pattern = uuid(v)); - } else def.pattern ?? (def.pattern = uuid()); - $ZodStringFormat.init(inst, def); -}); -const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => { - def.pattern ?? (def.pattern = email); - $ZodStringFormat.init(inst, def); -}); -const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { - $ZodStringFormat.init(inst, def); - inst._zod.check = (payload) => { - try { - const trimmed = payload.value.trim(); - if (!def.normalize && def.protocol?.source === httpProtocol.source) { - if (!/^https?:\/\//i.test(trimmed)) { - payload.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid URL format", - input: payload.value, - inst, - continue: !def.abort - }); - return; - } - } - const url = new URL(trimmed); - if (def.hostname) { - def.hostname.lastIndex = 0; - if (!def.hostname.test(url.hostname)) payload.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid hostname", - pattern: def.hostname.source, - input: payload.value, - inst, - continue: !def.abort - }); - } - if (def.protocol) { - def.protocol.lastIndex = 0; - if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid protocol", - pattern: def.protocol.source, - input: payload.value, - inst, - continue: !def.abort - }); - } - if (def.normalize) payload.value = url.href; - else payload.value = trimmed; - return; - } catch (_) { - payload.issues.push({ - code: "invalid_format", - format: "url", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => { - def.pattern ?? (def.pattern = emoji()); - $ZodStringFormat.init(inst, def); -}); -const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { - def.pattern ?? (def.pattern = nanoid); - $ZodStringFormat.init(inst, def); -}); -/** -* @deprecated CUID v1 is deprecated by its authors due to information leakage -* (timestamps embedded in the id). Use {@link $ZodCUID2} instead. -* See https://github.com/paralleldrive/cuid. -*/ -const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => { - def.pattern ?? (def.pattern = cuid); - $ZodStringFormat.init(inst, def); -}); -const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => { - def.pattern ?? (def.pattern = cuid2); - $ZodStringFormat.init(inst, def); -}); -const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => { - def.pattern ?? (def.pattern = ulid); - $ZodStringFormat.init(inst, def); -}); -const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => { - def.pattern ?? (def.pattern = xid); - $ZodStringFormat.init(inst, def); -}); -const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => { - def.pattern ?? (def.pattern = ksuid); - $ZodStringFormat.init(inst, def); -}); -const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => { - def.pattern ?? (def.pattern = datetime$1(def)); - $ZodStringFormat.init(inst, def); -}); -const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => { - def.pattern ?? (def.pattern = date$1); - $ZodStringFormat.init(inst, def); -}); -const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => { - def.pattern ?? (def.pattern = time$1(def)); - $ZodStringFormat.init(inst, def); -}); -const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => { - def.pattern ?? (def.pattern = duration$1); - $ZodStringFormat.init(inst, def); -}); -const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => { - def.pattern ?? (def.pattern = ipv4); - $ZodStringFormat.init(inst, def); - inst._zod.bag.format = `ipv4`; -}); -const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { - def.pattern ?? (def.pattern = ipv6); - $ZodStringFormat.init(inst, def); - inst._zod.bag.format = `ipv6`; - inst._zod.check = (payload) => { - try { - new URL(`http://[${payload.value}]`); - } catch { - payload.issues.push({ - code: "invalid_format", - format: "ipv6", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; -}); -const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => { - def.pattern ?? (def.pattern = cidrv4); - $ZodStringFormat.init(inst, def); -}); -const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => { - def.pattern ?? (def.pattern = cidrv6); - $ZodStringFormat.init(inst, def); - inst._zod.check = (payload) => { - const parts = payload.value.split("/"); - try { - if (parts.length !== 2) throw new Error(); - const [address, prefix] = parts; - if (!prefix) throw new Error(); - const prefixNum = Number(prefix); - if (`${prefixNum}` !== prefix) throw new Error(); - if (prefixNum < 0 || prefixNum > 128) throw new Error(); - new URL(`http://[${address}]`); - } catch { - payload.issues.push({ - code: "invalid_format", - format: "cidrv6", - input: payload.value, - inst, - continue: !def.abort - }); - } - }; +// node_modules/zod/v4/classic/parse.js +var parse3 = /* @__PURE__ */ _parse(ZodRealError); +var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError); +var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError); +var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError); +var encode2 = /* @__PURE__ */ _encode(ZodRealError); +var decode2 = /* @__PURE__ */ _decode(ZodRealError); +var encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError); +var decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError); +var safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError); +var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError); +var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError); +var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError); + +// node_modules/zod/v4/classic/schemas.js +var _installedGroups = /* @__PURE__ */ new WeakMap; +function _installLazyMethods(inst, group, methods) { + const proto = Object.getPrototypeOf(inst); + let installed = _installedGroups.get(proto); + if (!installed) { + installed = new Set; + _installedGroups.set(proto, installed); + } + if (installed.has(group)) + return; + installed.add(group); + for (const key in methods) { + const fn = methods[key]; + Object.defineProperty(proto, key, { + configurable: true, + enumerable: false, + get() { + const bound = fn.bind(this); + Object.defineProperty(this, key, { + configurable: true, + writable: true, + enumerable: true, + value: bound + }); + return bound; + }, + set(v) { + Object.defineProperty(this, key, { + configurable: true, + writable: true, + enumerable: true, + value: v + }); + } + }); + } +} +var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { + $ZodType.init(inst, def); + Object.assign(inst["~standard"], { + jsonSchema: { + input: createStandardJSONSchemaMethod(inst, "input"), + output: createStandardJSONSchemaMethod(inst, "output") + } + }); + inst.toJSONSchema = createToJSONSchemaMethod(inst, {}); + inst.def = def; + inst.type = def.type; + Object.defineProperty(inst, "_def", { value: def }); + inst.parse = (data, params) => parse3(inst, data, params, { callee: inst.parse }); + inst.safeParse = (data, params) => safeParse2(inst, data, params); + inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync }); + inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params); + inst.spa = inst.safeParseAsync; + inst.encode = (data, params) => encode2(inst, data, params); + inst.decode = (data, params) => decode2(inst, data, params); + inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params); + inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params); + inst.safeEncode = (data, params) => safeEncode2(inst, data, params); + inst.safeDecode = (data, params) => safeDecode2(inst, data, params); + inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params); + inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params); + _installLazyMethods(inst, "ZodType", { + check(...chks) { + const def2 = this.def; + return this.clone(exports_util.mergeDefs(def2, { + checks: [ + ...def2.checks ?? [], + ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch) + ] + }), { parent: true }); + }, + with(...chks) { + return this.check(...chks); + }, + clone(def2, params) { + return clone(this, def2, params); + }, + brand() { + return this; + }, + register(reg, meta2) { + reg.add(this, meta2); + return this; + }, + refine(check, params) { + return this.check(refine(check, params)); + }, + superRefine(refinement, params) { + return this.check(superRefine(refinement, params)); + }, + overwrite(fn) { + return this.check(_overwrite(fn)); + }, + optional() { + return optional(this); + }, + exactOptional() { + return exactOptional(this); + }, + nullable() { + return nullable(this); + }, + nullish() { + return optional(nullable(this)); + }, + nonoptional(params) { + return nonoptional(this, params); + }, + array() { + return array(this); + }, + or(arg) { + return union([this, arg]); + }, + and(arg) { + return intersection(this, arg); + }, + transform(tx) { + return pipe(this, transform(tx)); + }, + default(d) { + return _default2(this, d); + }, + prefault(d) { + return prefault(this, d); + }, + catch(params) { + return _catch2(this, params); + }, + pipe(target) { + return pipe(this, target); + }, + readonly() { + return readonly(this); + }, + describe(description) { + const cl = this.clone(); + globalRegistry.add(cl, { description }); + return cl; + }, + meta(...args) { + if (args.length === 0) + return globalRegistry.get(this); + const cl = this.clone(); + globalRegistry.add(cl, args[0]); + return cl; + }, + isOptional() { + return this.safeParse(undefined).success; + }, + isNullable() { + return this.safeParse(null).success; + }, + apply(fn) { + return fn(this); + } + }); + Object.defineProperty(inst, "description", { + get() { + return globalRegistry.get(inst)?.description; + }, + configurable: true + }); + return inst; }); -function isValidBase64(data) { - if (data === "") return true; - if (/\s/.test(data)) return false; - if (data.length % 4 !== 0) return false; - try { - atob(data); - return true; - } catch { - return false; - } -} -const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { - def.pattern ?? (def.pattern = base64); - $ZodStringFormat.init(inst, def); - inst._zod.bag.contentEncoding = "base64"; - inst._zod.check = (payload) => { - if (isValidBase64(payload.value)) return; - payload.issues.push({ - code: "invalid_format", - format: "base64", - input: payload.value, - inst, - continue: !def.abort - }); - }; +var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { + $ZodString.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params); + const bag = inst._zod.bag; + inst.format = bag.format ?? null; + inst.minLength = bag.minimum ?? null; + inst.maxLength = bag.maximum ?? null; + _installLazyMethods(inst, "_ZodString", { + regex(...args) { + return this.check(_regex(...args)); + }, + includes(...args) { + return this.check(_includes(...args)); + }, + startsWith(...args) { + return this.check(_startsWith(...args)); + }, + endsWith(...args) { + return this.check(_endsWith(...args)); + }, + min(...args) { + return this.check(_minLength(...args)); + }, + max(...args) { + return this.check(_maxLength(...args)); + }, + length(...args) { + return this.check(_length(...args)); + }, + nonempty(...args) { + return this.check(_minLength(1, ...args)); + }, + lowercase(params) { + return this.check(_lowercase(params)); + }, + uppercase(params) { + return this.check(_uppercase(params)); + }, + trim() { + return this.check(_trim()); + }, + normalize(...args) { + return this.check(_normalize(...args)); + }, + toLowerCase() { + return this.check(_toLowerCase()); + }, + toUpperCase() { + return this.check(_toUpperCase()); + }, + slugify() { + return this.check(_slugify()); + } + }); }); -function isValidBase64URL(data) { - if (!base64url.test(data)) return false; - const base64$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); - return isValidBase64(base64$1.padEnd(Math.ceil(base64$1.length / 4) * 4, "=")); -} -const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => { - def.pattern ?? (def.pattern = base64url); - $ZodStringFormat.init(inst, def); - inst._zod.bag.contentEncoding = "base64url"; - inst._zod.check = (payload) => { - if (isValidBase64URL(payload.value)) return; - payload.issues.push({ - code: "invalid_format", - format: "base64url", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => { - def.pattern ?? (def.pattern = e164); - $ZodStringFormat.init(inst, def); +var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { + $ZodString.init(inst, def); + _ZodString.init(inst, def); + inst.email = (params) => inst.check(_email(ZodEmail, params)); + inst.url = (params) => inst.check(_url(ZodURL, params)); + inst.jwt = (params) => inst.check(_jwt(ZodJWT, params)); + inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.uuid = (params) => inst.check(_uuid(ZodUUID, params)); + inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params)); + inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params)); + inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params)); + inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.cuid = (params) => inst.check(_cuid(ZodCUID, params)); + inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params)); + inst.ulid = (params) => inst.check(_ulid(ZodULID, params)); + inst.base64 = (params) => inst.check(_base64(ZodBase64, params)); + inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params)); + inst.xid = (params) => inst.check(_xid(ZodXID, params)); + inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params)); + inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params)); + inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params)); + inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params)); + inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params)); + inst.e164 = (params) => inst.check(_e164(ZodE164, params)); + inst.datetime = (params) => inst.check(datetime2(params)); + inst.date = (params) => inst.check(date2(params)); + inst.time = (params) => inst.check(time2(params)); + inst.duration = (params) => inst.check(duration2(params)); }); -function isValidJWT(token, algorithm = null) { - try { - const tokensParts = token.split("."); - if (tokensParts.length !== 3) return false; - const [header] = tokensParts; - if (!header) return false; - const parsedHeader = JSON.parse(atob(header)); - if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false; - if (!parsedHeader.alg) return false; - if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false; - return true; - } catch { - return false; - } -} -const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { - $ZodStringFormat.init(inst, def); - inst._zod.check = (payload) => { - if (isValidJWT(payload.value, def.alg)) return; - payload.issues.push({ - code: "invalid_format", - format: "jwt", - input: payload.value, - inst, - continue: !def.abort - }); - }; -}); -const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.pattern = inst._zod.bag.pattern ?? number$1; - inst._zod.parse = (payload, _ctx) => { - if (def.coerce) try { - payload.value = Number(payload.value); - } catch (_) {} - const input = payload.value; - if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload; - const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0; - payload.issues.push({ - expected: "number", - code: "invalid_type", - input, - inst, - ...received ? { received } : {} - }); - return payload; - }; -}); -const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => { - $ZodCheckNumberFormat.init(inst, def); - $ZodNumber.init(inst, def); -}); -const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.pattern = boolean$1; - inst._zod.parse = (payload, _ctx) => { - if (def.coerce) try { - payload.value = Boolean(payload.value); - } catch (_) {} - const input = payload.value; - if (typeof input === "boolean") return payload; - payload.issues.push({ - expected: "boolean", - code: "invalid_type", - input, - inst - }); - return payload; - }; -}); -const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload) => payload; -}); -const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, _ctx) => { - payload.issues.push({ - expected: "never", - code: "invalid_type", - input: payload.value, - inst - }); - return payload; - }; +function string2(params) { + return _string(ZodString, params); +} +var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => { + $ZodStringFormat.init(inst, def); + _ZodString.init(inst, def); }); -function handleArrayResult(result, final, index) { - if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues)); - final.value[index] = result.value; -} -const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!Array.isArray(input)) { - payload.issues.push({ - expected: "array", - code: "invalid_type", - input, - inst - }); - return payload; - } - payload.value = Array(input.length); - const proms = []; - for (let i = 0; i < input.length; i++) { - const item = input[i]; - const result = def.element._zod.run({ - value: item, - issues: [] - }, ctx); - if (result instanceof Promise) proms.push(result.then((result$1) => handleArrayResult(result$1, payload, i))); - else handleArrayResult(result, payload, i); - } - if (proms.length) return Promise.all(proms).then(() => payload); - return payload; - }; +var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => { + $ZodEmail.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) { - const isPresent = key in input; - if (result.issues.length) { - if (isOptionalIn && isOptionalOut && !isPresent) return; - final.issues.push(...prefixIssues(key, result.issues)); - } - if (!isPresent && !isOptionalIn) { - if (!result.issues.length) final.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: void 0, - path: [key] - }); - return; - } - if (result.value === void 0) { - if (isPresent) final.value[key] = void 0; - } else final.value[key] = result.value; +function email2(params) { + return _email(ZodEmail, params); } -function normalizeDef(def) { - const keys = Object.keys(def.shape); - for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`); - const okeys = optionalKeys(def.shape); - return { - ...def, - keys, - keySet: new Set(keys), - numKeys: keys.length, - optionalKeys: new Set(okeys) - }; +var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => { + $ZodGUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function guid2(params) { + return _guid(ZodGUID, params); } -function handleCatchall(proms, input, payload, ctx, def, inst) { - const unrecognized = []; - const keySet = def.keySet; - const _catchall = def.catchall._zod; - const t = _catchall.def.type; - const isOptionalIn = _catchall.optin === "optional"; - const isOptionalOut = _catchall.optout === "optional"; - for (const key in input) { - if (key === "__proto__") continue; - if (keySet.has(key)) continue; - if (t === "never") { - unrecognized.push(key); - continue; - } - const r = _catchall.run({ - value: input[key], - issues: [] - }, ctx); - if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalIn, isOptionalOut))); - else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); - } - if (unrecognized.length) payload.issues.push({ - code: "unrecognized_keys", - keys: unrecognized, - input, - inst - }); - if (!proms.length) return payload; - return Promise.all(proms).then(() => { - return payload; - }); -} -const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { - $ZodType.init(inst, def); - if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) { - const sh = def.shape; - Object.defineProperty(def, "shape", { get: () => { - const newSh = { ...sh }; - Object.defineProperty(def, "shape", { value: newSh }); - return newSh; - } }); - } - const _normalized = cached(() => normalizeDef(def)); - defineLazy(inst._zod, "propValues", () => { - const shape = def.shape; - const propValues = {}; - for (const key in shape) { - const field = shape[key]._zod; - if (field.values) { - propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set()); - for (const v of field.values) propValues[key].add(v); - } - } - return propValues; - }); - const isObject$1 = isObject; - const catchall = def.catchall; - let value; - inst._zod.parse = (payload, ctx) => { - value ?? (value = _normalized.value); - const input = payload.value; - if (!isObject$1(input)) { - payload.issues.push({ - expected: "object", - code: "invalid_type", - input, - inst - }); - return payload; - } - payload.value = {}; - const proms = []; - const shape = value.shape; - for (const key of value.keys) { - const el = shape[key]; - const isOptionalIn = el._zod.optin === "optional"; - const isOptionalOut = el._zod.optout === "optional"; - const r = el._zod.run({ - value: input[key], - issues: [] - }, ctx); - if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalIn, isOptionalOut))); - else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); - } - if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload; - return handleCatchall(proms, input, payload, ctx, _normalized.value, inst); - }; -}); -const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => { - $ZodObject.init(inst, def); - const superParse = inst._zod.parse; - const _normalized = cached(() => normalizeDef(def)); - const generateFastpass = (shape) => { - const doc = new Doc([ - "shape", - "payload", - "ctx" - ]); - const normalized = _normalized.value; - const parseStr = (key) => { - const k = esc(key); - return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`; - }; - doc.write(`const input = payload.value;`); - const ids = Object.create(null); - let counter = 0; - for (const key of normalized.keys) ids[key] = `key_${counter++}`; - doc.write(`const newResult = {};`); - for (const key of normalized.keys) { - const id = ids[key]; - const k = esc(key); - const schema = shape[key]; - const isOptionalIn = schema?._zod?.optin === "optional"; - const isOptionalOut = schema?._zod?.optout === "optional"; - doc.write(`const ${id} = ${parseStr(key)};`); - if (isOptionalIn && isOptionalOut) doc.write(` - if (${id}.issues.length) { - if (${k} in input) { - payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${k}, ...iss.path] : [${k}] - }))); - } - } - - if (${id}.value === undefined) { - if (${k} in input) { - newResult[${k}] = undefined; - } - } else { - newResult[${k}] = ${id}.value; - } - - `); - else if (!isOptionalIn) doc.write(` - const ${id}_present = ${k} in input; - if (${id}.issues.length) { - payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${k}, ...iss.path] : [${k}] - }))); - } - if (!${id}_present && !${id}.issues.length) { - payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: undefined, - path: [${k}] - }); - } - - if (${id}_present) { - if (${id}.value === undefined) { - newResult[${k}] = undefined; - } else { - newResult[${k}] = ${id}.value; - } - } - - `); - else doc.write(` - if (${id}.issues.length) { - payload.issues = payload.issues.concat(${id}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${k}, ...iss.path] : [${k}] - }))); - } - - if (${id}.value === undefined) { - if (${k} in input) { - newResult[${k}] = undefined; - } - } else { - newResult[${k}] = ${id}.value; - } - - `); - } - doc.write(`payload.value = newResult;`); - doc.write(`return payload;`); - const fn = doc.compile(); - return (payload, ctx) => fn(shape, payload, ctx); - }; - let fastpass; - const isObject$1 = isObject; - const jit = !globalConfig.jitless; - const allowsEval$1 = allowsEval; - const fastEnabled = jit && allowsEval$1.value; - const catchall = def.catchall; - let value; - inst._zod.parse = (payload, ctx) => { - value ?? (value = _normalized.value); - const input = payload.value; - if (!isObject$1(input)) { - payload.issues.push({ - expected: "object", - code: "invalid_type", - input, - inst - }); - return payload; - } - if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) { - if (!fastpass) fastpass = generateFastpass(def.shape); - payload = fastpass(payload, ctx); - if (!catchall) return payload; - return handleCatchall([], input, payload, ctx, value, inst); - } - return superParse(payload, ctx); - }; +var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => { + $ZodUUID.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handleUnionResults(results, final, inst, ctx) { - for (const result of results) if (result.issues.length === 0) { - final.value = result.value; - return final; - } - const nonaborted = results.filter((r) => !aborted(r)); - if (nonaborted.length === 1) { - final.value = nonaborted[0].value; - return nonaborted[0]; - } - final.issues.push({ - code: "invalid_union", - input: final.value, - inst, - errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) - }); - return final; -} -const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0); - defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0); - defineLazy(inst._zod, "values", () => { - if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); - }); - defineLazy(inst._zod, "pattern", () => { - if (def.options.every((o) => o._zod.pattern)) { - const patterns = def.options.map((o) => o._zod.pattern); - return /* @__PURE__ */ new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); - } - }); - const first = def.options.length === 1 ? def.options[0]._zod.run : null; - inst._zod.parse = (payload, ctx) => { - if (first) return first(payload, ctx); - let async = false; - const results = []; - for (const option of def.options) { - const result = option._zod.run({ - value: payload.value, - issues: [] - }, ctx); - if (result instanceof Promise) { - results.push(result); - async = true; - } else { - if (result.issues.length === 0) return result; - results.push(result); - } - } - if (!async) return handleUnionResults(results, payload, inst, ctx); - return Promise.all(results).then((results$1) => { - return handleUnionResults(results$1, payload, inst, ctx); - }); - }; -}); -const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - const left = def.left._zod.run({ - value: input, - issues: [] - }, ctx); - const right = def.right._zod.run({ - value: input, - issues: [] - }, ctx); - if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left$1, right$1]) => { - return handleIntersectionResults(payload, left$1, right$1); - }); - return handleIntersectionResults(payload, left, right); - }; +function uuid2(params) { + return _uuid(ZodUUID, params); +} +function uuidv4(params) { + return _uuidv4(ZodUUID, params); +} +function uuidv6(params) { + return _uuidv6(ZodUUID, params); +} +function uuidv7(params) { + return _uuidv7(ZodUUID, params); +} +var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => { + $ZodURL.init(inst, def); + ZodStringFormat.init(inst, def); }); -function mergeValues(a, b) { - if (a === b) return { - valid: true, - data: a - }; - if (a instanceof Date && b instanceof Date && +a === +b) return { - valid: true, - data: a - }; - if (isPlainObject(a) && isPlainObject(b)) { - const bKeys = Object.keys(b); - const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { - ...a, - ...b - }; - for (const key of sharedKeys) { - const sharedValue = mergeValues(a[key], b[key]); - if (!sharedValue.valid) return { - valid: false, - mergeErrorPath: [key, ...sharedValue.mergeErrorPath] - }; - newObj[key] = sharedValue.data; - } - return { - valid: true, - data: newObj - }; - } - if (Array.isArray(a) && Array.isArray(b)) { - if (a.length !== b.length) return { - valid: false, - mergeErrorPath: [] - }; - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues(itemA, itemB); - if (!sharedValue.valid) return { - valid: false, - mergeErrorPath: [index, ...sharedValue.mergeErrorPath] - }; - newArray.push(sharedValue.data); - } - return { - valid: true, - data: newArray - }; - } - return { - valid: false, - mergeErrorPath: [] - }; +function url(params) { + return _url(ZodURL, params); +} +function httpUrl(params) { + return _url(ZodURL, { + protocol: exports_regexes.httpProtocol, + hostname: exports_regexes.domain, + ...exports_util.normalizeParams(params) + }); +} +var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => { + $ZodEmoji.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function emoji2(params) { + return _emoji2(ZodEmoji, params); } -function handleIntersectionResults(result, left, right) { - const unrecKeys = /* @__PURE__ */ new Map(); - let unrecIssue; - for (const iss of left.issues) if (iss.code === "unrecognized_keys") { - unrecIssue ?? (unrecIssue = iss); - for (const k of iss.keys) { - if (!unrecKeys.has(k)) unrecKeys.set(k, {}); - unrecKeys.get(k).l = true; - } - } else result.issues.push(iss); - for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) { - if (!unrecKeys.has(k)) unrecKeys.set(k, {}); - unrecKeys.get(k).r = true; - } - else result.issues.push(iss); - const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k); - if (bothKeys.length && unrecIssue) result.issues.push({ - ...unrecIssue, - keys: bothKeys - }); - if (aborted(result)) return result; - const merged = mergeValues(left.value, right.value); - if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`); - result.value = merged.data; - return result; -} -const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.parse = (payload, ctx) => { - const input = payload.value; - if (!isPlainObject(input)) { - payload.issues.push({ - expected: "record", - code: "invalid_type", - input, - inst - }); - return payload; - } - const proms = []; - const values = def.keyType._zod.values; - if (values) { - payload.value = {}; - const recordKeys = /* @__PURE__ */ new Set(); - for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { - recordKeys.add(typeof key === "number" ? key.toString() : key); - const keyResult = def.keyType._zod.run({ - value: key, - issues: [] - }, ctx); - if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); - if (keyResult.issues.length) { - payload.issues.push({ - code: "invalid_key", - origin: "record", - issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), - input: key, - path: [key], - inst - }); - continue; - } - const outKey = keyResult.value; - const result = def.valueType._zod.run({ - value: input[key], - issues: [] - }, ctx); - if (result instanceof Promise) proms.push(result.then((result$1) => { - if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues)); - payload.value[outKey] = result$1.value; - })); - else { - if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); - payload.value[outKey] = result.value; - } - } - let unrecognized; - for (const key in input) if (!recordKeys.has(key)) { - unrecognized = unrecognized ?? []; - unrecognized.push(key); - } - if (unrecognized && unrecognized.length > 0) payload.issues.push({ - code: "unrecognized_keys", - input, - inst, - keys: unrecognized - }); - } else { - payload.value = {}; - for (const key of Reflect.ownKeys(input)) { - if (key === "__proto__") continue; - if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue; - let keyResult = def.keyType._zod.run({ - value: key, - issues: [] - }, ctx); - if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); - if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) { - const retryResult = def.keyType._zod.run({ - value: Number(key), - issues: [] - }, ctx); - if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); - if (retryResult.issues.length === 0) keyResult = retryResult; - } - if (keyResult.issues.length) { - if (def.mode === "loose") payload.value[key] = input[key]; - else payload.issues.push({ - code: "invalid_key", - origin: "record", - issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), - input: key, - path: [key], - inst - }); - continue; - } - const result = def.valueType._zod.run({ - value: input[key], - issues: [] - }, ctx); - if (result instanceof Promise) proms.push(result.then((result$1) => { - if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues)); - payload.value[keyResult.value] = result$1.value; - })); - else { - if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); - payload.value[keyResult.value] = result.value; - } - } - } - if (proms.length) return Promise.all(proms).then(() => payload); - return payload; - }; -}); -const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { - $ZodType.init(inst, def); - const values = getEnumValues(def.entries); - const valuesSet = new Set(values); - inst._zod.values = valuesSet; - inst._zod.pattern = /* @__PURE__ */ new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); - inst._zod.parse = (payload, _ctx) => { - const input = payload.value; - if (valuesSet.has(input)) return payload; - payload.issues.push({ - code: "invalid_value", - values, - input, - inst - }); - return payload; - }; -}); -const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - inst._zod.parse = (payload, ctx) => { - if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name); - const _out = def.transform(payload.value, payload); - if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => { - payload.value = output; - payload.fallback = true; - return payload; - }); - if (_out instanceof Promise) throw new $ZodAsyncError(); - payload.value = _out; - payload.fallback = true; - return payload; - }; +var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { + $ZodNanoID.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handleOptionalResult(result, input) { - if (input === void 0 && (result.issues.length || result.fallback)) return { - issues: [], - value: void 0 - }; - return result; -} -const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - inst._zod.optout = "optional"; - defineLazy(inst._zod, "values", () => { - return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0; - }); - defineLazy(inst._zod, "pattern", () => { - const pattern = def.innerType._zod.pattern; - return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - if (def.innerType._zod.optin === "optional") { - const input = payload.value; - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input)); - return handleOptionalResult(result, input); - } - if (payload.value === void 0) return payload; - return def.innerType._zod.run(payload, ctx); - }; -}); -const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => { - $ZodOptional.init(inst, def); - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern); - inst._zod.parse = (payload, ctx) => { - return def.innerType._zod.run(payload, ctx); - }; -}); -const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); - defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); - defineLazy(inst._zod, "pattern", () => { - const pattern = def.innerType._zod.pattern; - return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; - }); - defineLazy(inst._zod, "values", () => { - return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - if (payload.value === null) return payload; - return def.innerType._zod.run(payload, ctx); - }; -}); -const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); - if (payload.value === void 0) { - payload.value = def.defaultValue; - /** - * $ZodDefault returns the default value immediately in forward direction. - * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */ - return payload; - } - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result$1) => handleDefaultResult(result$1, def)); - return handleDefaultResult(result, def); - }; +function nanoid2(params) { + return _nanoid(ZodNanoID, params); +} +var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => { + $ZodCUID.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handleDefaultResult(payload, def) { - if (payload.value === void 0) payload.value = def.defaultValue; - return payload; -} -const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); - if (payload.value === void 0) payload.value = def.defaultValue; - return def.innerType._zod.run(payload, ctx); - }; -}); -const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "values", () => { - const v = def.innerType._zod.values; - return v ? new Set([...v].filter((x) => x !== void 0)) : void 0; - }); - inst._zod.parse = (payload, ctx) => { - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result$1) => handleNonOptionalResult(result$1, inst)); - return handleNonOptionalResult(result, inst); - }; +function cuid3(params) { + return _cuid(ZodCUID, params); +} +var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => { + $ZodCUID2.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handleNonOptionalResult(payload, inst) { - if (!payload.issues.length && payload.value === void 0) payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: payload.value, - inst - }); - return payload; -} -const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { - $ZodType.init(inst, def); - inst._zod.optin = "optional"; - defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - inst._zod.parse = (payload, ctx) => { - if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result$1) => { - payload.value = result$1.value; - if (result$1.issues.length) { - payload.value = def.catchValue({ - ...payload, - error: { issues: result$1.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, - input: payload.value - }); - payload.issues = []; - payload.fallback = true; - } - return payload; - }); - payload.value = result.value; - if (result.issues.length) { - payload.value = def.catchValue({ - ...payload, - error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, - input: payload.value - }); - payload.issues = []; - payload.fallback = true; - } - return payload; - }; -}); -const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "values", () => def.in._zod.values); - defineLazy(inst._zod, "optin", () => def.in._zod.optin); - defineLazy(inst._zod, "optout", () => def.out._zod.optout); - defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); - inst._zod.parse = (payload, ctx) => { - if (ctx.direction === "backward") { - const right = def.out._zod.run(payload, ctx); - if (right instanceof Promise) return right.then((right$1) => handlePipeResult(right$1, def.in, ctx)); - return handlePipeResult(right, def.in, ctx); - } - const left = def.in._zod.run(payload, ctx); - if (left instanceof Promise) return left.then((left$1) => handlePipeResult(left$1, def.out, ctx)); - return handlePipeResult(left, def.out, ctx); - }; +function cuid22(params) { + return _cuid2(ZodCUID2, params); +} +var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => { + $ZodULID.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handlePipeResult(left, next, ctx) { - if (left.issues.length) { - left.aborted = true; - return left; - } - return next._zod.run({ - value: left.value, - issues: left.issues, - fallback: left.fallback - }, ctx); -} -const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => { - $ZodType.init(inst, def); - defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); - defineLazy(inst._zod, "values", () => def.innerType._zod.values); - defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin); - defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout); - inst._zod.parse = (payload, ctx) => { - if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); - const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then(handleReadonlyResult); - return handleReadonlyResult(result); - }; +function ulid2(params) { + return _ulid(ZodULID, params); +} +var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => { + $ZodXID.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handleReadonlyResult(payload) { - payload.value = Object.freeze(payload.value); - return payload; -} -const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { - $ZodCheck.init(inst, def); - $ZodType.init(inst, def); - inst._zod.parse = (payload, _) => { - return payload; - }; - inst._zod.check = (payload) => { - const input = payload.value; - const r = def.fn(input); - if (r instanceof Promise) return r.then((r$1) => handleRefineResult(r$1, payload, input, inst)); - handleRefineResult(r, payload, input, inst); - }; +function xid2(params) { + return _xid(ZodXID, params); +} +var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => { + $ZodKSUID.init(inst, def); + ZodStringFormat.init(inst, def); }); -function handleRefineResult(result, payload, input, inst) { - if (!result) { - const _iss = { - code: "custom", - input, - inst, - path: [...inst._zod.def.path ?? []], - continue: !inst._zod.def.abort - }; - if (inst._zod.def.params) _iss.params = inst._zod.def.params; - payload.issues.push(issue(_iss)); - } -} - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js -var _a$1; -var $ZodRegistry = class { - constructor() { - this._map = /* @__PURE__ */ new WeakMap(); - this._idmap = /* @__PURE__ */ new Map(); - } - add(schema, ..._meta) { - const meta$2 = _meta[0]; - this._map.set(schema, meta$2); - if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.set(meta$2.id, schema); - return this; - } - clear() { - this._map = /* @__PURE__ */ new WeakMap(); - this._idmap = /* @__PURE__ */ new Map(); - return this; - } - remove(schema) { - const meta$2 = this._map.get(schema); - if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.delete(meta$2.id); - this._map.delete(schema); - return this; - } - get(schema) { - const p = schema._zod.parent; - if (p) { - const pm = { ...this.get(p) ?? {} }; - delete pm.id; - const f = { - ...pm, - ...this._map.get(schema) - }; - return Object.keys(f).length ? f : void 0; - } - return this._map.get(schema); - } - has(schema) { - return this._map.has(schema); - } -}; -function registry() { - return new $ZodRegistry(); -} -(_a$1 = globalThis).__zod_globalRegistry ?? (_a$1.__zod_globalRegistry = registry()); -const globalRegistry = globalThis.__zod_globalRegistry; - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js -/* @__NO_SIDE_EFFECTS__ */ -function _string(Class, params) { - return new Class({ - type: "string", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _email(Class, params) { - return new Class({ - type: "string", - format: "email", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _guid(Class, params) { - return new Class({ - type: "string", - format: "guid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _uuid(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _uuidv4(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v4", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _uuidv6(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v6", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _uuidv7(Class, params) { - return new Class({ - type: "string", - format: "uuid", - check: "string_format", - abort: false, - version: "v7", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _url(Class, params) { - return new Class({ - type: "string", - format: "url", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _emoji(Class, params) { - return new Class({ - type: "string", - format: "emoji", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _nanoid(Class, params) { - return new Class({ - type: "string", - format: "nanoid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/** -* @deprecated CUID v1 is deprecated by its authors due to information leakage -* (timestamps embedded in the id). Use {@link _cuid2} instead. -* See https://github.com/paralleldrive/cuid. -*/ -/* @__NO_SIDE_EFFECTS__ */ -function _cuid(Class, params) { - return new Class({ - type: "string", - format: "cuid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _cuid2(Class, params) { - return new Class({ - type: "string", - format: "cuid2", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _ulid(Class, params) { - return new Class({ - type: "string", - format: "ulid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _xid(Class, params) { - return new Class({ - type: "string", - format: "xid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _ksuid(Class, params) { - return new Class({ - type: "string", - format: "ksuid", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _ipv4(Class, params) { - return new Class({ - type: "string", - format: "ipv4", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _ipv6(Class, params) { - return new Class({ - type: "string", - format: "ipv6", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _cidrv4(Class, params) { - return new Class({ - type: "string", - format: "cidrv4", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _cidrv6(Class, params) { - return new Class({ - type: "string", - format: "cidrv6", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _base64(Class, params) { - return new Class({ - type: "string", - format: "base64", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _base64url(Class, params) { - return new Class({ - type: "string", - format: "base64url", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _e164(Class, params) { - return new Class({ - type: "string", - format: "e164", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _jwt(Class, params) { - return new Class({ - type: "string", - format: "jwt", - check: "string_format", - abort: false, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _isoDateTime(Class, params) { - return new Class({ - type: "string", - format: "datetime", - check: "string_format", - offset: false, - local: false, - precision: null, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _isoDate(Class, params) { - return new Class({ - type: "string", - format: "date", - check: "string_format", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _isoTime(Class, params) { - return new Class({ - type: "string", - format: "time", - check: "string_format", - precision: null, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _isoDuration(Class, params) { - return new Class({ - type: "string", - format: "duration", - check: "string_format", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _number(Class, params) { - return new Class({ - type: "number", - checks: [], - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _int(Class, params) { - return new Class({ - type: "number", - check: "number_format", - abort: false, - format: "safeint", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _boolean(Class, params) { - return new Class({ - type: "boolean", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _unknown(Class) { - return new Class({ type: "unknown" }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _never(Class, params) { - return new Class({ - type: "never", - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _lt(value, params) { - return new $ZodCheckLessThan({ - check: "less_than", - ...normalizeParams(params), - value, - inclusive: false - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _lte(value, params) { - return new $ZodCheckLessThan({ - check: "less_than", - ...normalizeParams(params), - value, - inclusive: true - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _gt(value, params) { - return new $ZodCheckGreaterThan({ - check: "greater_than", - ...normalizeParams(params), - value, - inclusive: false - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _gte(value, params) { - return new $ZodCheckGreaterThan({ - check: "greater_than", - ...normalizeParams(params), - value, - inclusive: true - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _multipleOf(value, params) { - return new $ZodCheckMultipleOf({ - check: "multiple_of", - ...normalizeParams(params), - value - }); +function ksuid2(params) { + return _ksuid(ZodKSUID, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _maxLength(maximum, params) { - return new $ZodCheckMaxLength({ - check: "max_length", - ...normalizeParams(params), - maximum - }); +var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => { + $ZodIPv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function ipv42(params) { + return _ipv4(ZodIPv4, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _minLength(minimum, params) { - return new $ZodCheckMinLength({ - check: "min_length", - ...normalizeParams(params), - minimum - }); +var ZodMAC = /* @__PURE__ */ $constructor("ZodMAC", (inst, def) => { + $ZodMAC.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function mac2(params) { + return _mac(ZodMAC, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _length(length, params) { - return new $ZodCheckLengthEquals({ - check: "length_equals", - ...normalizeParams(params), - length - }); +var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => { + $ZodIPv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function ipv62(params) { + return _ipv6(ZodIPv6, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _regex(pattern, params) { - return new $ZodCheckRegex({ - check: "string_format", - format: "regex", - ...normalizeParams(params), - pattern - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _lowercase(params) { - return new $ZodCheckLowerCase({ - check: "string_format", - format: "lowercase", - ...normalizeParams(params) - }); +var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => { + $ZodCIDRv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function cidrv42(params) { + return _cidrv4(ZodCIDRv4, params); +} +var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => { + $ZodCIDRv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function cidrv62(params) { + return _cidrv6(ZodCIDRv6, params); +} +var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => { + $ZodBase64.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function base642(params) { + return _base64(ZodBase64, params); +} +var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => { + $ZodBase64URL.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function base64url2(params) { + return _base64url(ZodBase64URL, params); +} +var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => { + $ZodE164.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function e1642(params) { + return _e164(ZodE164, params); +} +var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => { + $ZodJWT.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function jwt(params) { + return _jwt(ZodJWT, params); +} +var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => { + $ZodCustomStringFormat.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function stringFormat(format, fnOrRegex, _params = {}) { + return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params); +} +function hostname2(_params) { + return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params); +} +function hex2(_params) { + return _stringFormat(ZodCustomStringFormat, "hex", exports_regexes.hex, _params); +} +function hash(alg, params) { + const enc = params?.enc ?? "hex"; + const format = `${alg}_${enc}`; + const regex = exports_regexes[format]; + if (!regex) + throw new Error(`Unrecognized hash format: ${format}`); + return _stringFormat(ZodCustomStringFormat, format, regex, params); +} +var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => { + $ZodNumber.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params); + _installLazyMethods(inst, "ZodNumber", { + gt(value, params) { + return this.check(_gt(value, params)); + }, + gte(value, params) { + return this.check(_gte(value, params)); + }, + min(value, params) { + return this.check(_gte(value, params)); + }, + lt(value, params) { + return this.check(_lt(value, params)); + }, + lte(value, params) { + return this.check(_lte(value, params)); + }, + max(value, params) { + return this.check(_lte(value, params)); + }, + int(params) { + return this.check(int(params)); + }, + safe(params) { + return this.check(int(params)); + }, + positive(params) { + return this.check(_gt(0, params)); + }, + nonnegative(params) { + return this.check(_gte(0, params)); + }, + negative(params) { + return this.check(_lt(0, params)); + }, + nonpositive(params) { + return this.check(_lte(0, params)); + }, + multipleOf(value, params) { + return this.check(_multipleOf(value, params)); + }, + step(value, params) { + return this.check(_multipleOf(value, params)); + }, + finite() { + return this; + } + }); + const bag = inst._zod.bag; + inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null; + inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null; + inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5); + inst.isFinite = true; + inst.format = bag.format ?? null; +}); +function number2(params) { + return _number(ZodNumber, params); +} +var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => { + $ZodNumberFormat.init(inst, def); + ZodNumber.init(inst, def); +}); +function int(params) { + return _int(ZodNumberFormat, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _uppercase(params) { - return new $ZodCheckUpperCase({ - check: "string_format", - format: "uppercase", - ...normalizeParams(params) - }); +function float32(params) { + return _float32(ZodNumberFormat, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _includes(includes, params) { - return new $ZodCheckIncludes({ - check: "string_format", - format: "includes", - ...normalizeParams(params), - includes - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _startsWith(prefix, params) { - return new $ZodCheckStartsWith({ - check: "string_format", - format: "starts_with", - ...normalizeParams(params), - prefix - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _endsWith(suffix, params) { - return new $ZodCheckEndsWith({ - check: "string_format", - format: "ends_with", - ...normalizeParams(params), - suffix - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _overwrite(tx) { - return new $ZodCheckOverwrite({ - check: "overwrite", - tx - }); +function float64(params) { + return _float64(ZodNumberFormat, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _normalize(form) { - return /* @__PURE__ */ _overwrite((input) => input.normalize(form)); +function int32(params) { + return _int32(ZodNumberFormat, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _trim() { - return /* @__PURE__ */ _overwrite((input) => input.trim()); +function uint32(params) { + return _uint32(ZodNumberFormat, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _toLowerCase() { - return /* @__PURE__ */ _overwrite((input) => input.toLowerCase()); +var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { + $ZodBoolean.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params); +}); +function boolean2(params) { + return _boolean(ZodBoolean, params); +} +var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => { + $ZodBigInt.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params); + inst.gte = (value, params) => inst.check(_gte(value, params)); + inst.min = (value, params) => inst.check(_gte(value, params)); + inst.gt = (value, params) => inst.check(_gt(value, params)); + inst.gte = (value, params) => inst.check(_gte(value, params)); + inst.min = (value, params) => inst.check(_gte(value, params)); + inst.lt = (value, params) => inst.check(_lt(value, params)); + inst.lte = (value, params) => inst.check(_lte(value, params)); + inst.max = (value, params) => inst.check(_lte(value, params)); + inst.positive = (params) => inst.check(_gt(BigInt(0), params)); + inst.negative = (params) => inst.check(_lt(BigInt(0), params)); + inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params)); + inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params)); + inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params)); + const bag = inst._zod.bag; + inst.minValue = bag.minimum ?? null; + inst.maxValue = bag.maximum ?? null; + inst.format = bag.format ?? null; +}); +function bigint2(params) { + return _bigint(ZodBigInt, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _toUpperCase() { - return /* @__PURE__ */ _overwrite((input) => input.toUpperCase()); +var ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => { + $ZodBigIntFormat.init(inst, def); + ZodBigInt.init(inst, def); +}); +function int64(params) { + return _int64(ZodBigIntFormat, params); } -/* @__NO_SIDE_EFFECTS__ */ -function _slugify() { - return /* @__PURE__ */ _overwrite((input) => slugify(input)); -} -/* @__NO_SIDE_EFFECTS__ */ -function _array(Class, element, params) { - return new Class({ - type: "array", - element, - ...normalizeParams(params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _refine(Class, fn, _params) { - return new Class({ - type: "custom", - check: "custom", - fn, - ...normalizeParams(_params) - }); -} -/* @__NO_SIDE_EFFECTS__ */ -function _superRefine(fn, params) { - const ch = /* @__PURE__ */ _check((payload) => { - payload.addIssue = (issue$1) => { - if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def)); - else { - const _issue = issue$1; - if (_issue.fatal) _issue.continue = false; - _issue.code ?? (_issue.code = "custom"); - _issue.input ?? (_issue.input = payload.value); - _issue.inst ?? (_issue.inst = ch); - _issue.continue ?? (_issue.continue = !ch._zod.def.abort); - payload.issues.push(issue(_issue)); - } - }; - return fn(payload.value, payload); - }, params); - return ch; -} -/* @__NO_SIDE_EFFECTS__ */ -function _check(fn, params) { - const ch = new $ZodCheck({ - check: "custom", - ...normalizeParams(params) - }); - ch._zod.check = fn; - return ch; -} -/* @__NO_SIDE_EFFECTS__ */ -function describe$1(description) { - const ch = new $ZodCheck({ check: "describe" }); - ch._zod.onattach = [(inst) => { - const existing = globalRegistry.get(inst) ?? {}; - globalRegistry.add(inst, { - ...existing, - description - }); - }]; - ch._zod.check = () => {}; - return ch; -} -/* @__NO_SIDE_EFFECTS__ */ -function meta$1(metadata) { - const ch = new $ZodCheck({ check: "meta" }); - ch._zod.onattach = [(inst) => { - const existing = globalRegistry.get(inst) ?? {}; - globalRegistry.add(inst, { - ...existing, - ...metadata - }); - }]; - ch._zod.check = () => {}; - return ch; -} - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js -function initializeContext(params) { - let target = params?.target ?? "draft-2020-12"; - if (target === "draft-4") target = "draft-04"; - if (target === "draft-7") target = "draft-07"; - return { - processors: params.processors ?? {}, - metadataRegistry: params?.metadata ?? globalRegistry, - target, - unrepresentable: params?.unrepresentable ?? "throw", - override: params?.override ?? (() => {}), - io: params?.io ?? "output", - counter: 0, - seen: /* @__PURE__ */ new Map(), - cycles: params?.cycles ?? "ref", - reused: params?.reused ?? "inline", - external: params?.external ?? void 0 - }; -} -function process$5(schema, ctx, _params = { - path: [], - schemaPath: [] -}) { - var _a$3; - const def = schema._zod.def; - const seen = ctx.seen.get(schema); - if (seen) { - seen.count++; - if (_params.schemaPath.includes(schema)) seen.cycle = _params.path; - return seen.schema; - } - const result = { - schema: {}, - count: 1, - cycle: void 0, - path: _params.path - }; - ctx.seen.set(schema, result); - const overrideSchema = schema._zod.toJSONSchema?.(); - if (overrideSchema) result.schema = overrideSchema; - else { - const params = { - ..._params, - schemaPath: [..._params.schemaPath, schema], - path: _params.path - }; - if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params); - else { - const _json = result.schema; - const processor = ctx.processors[def.type]; - if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`); - processor(schema, ctx, _json, params); - } - const parent = schema._zod.parent; - if (parent) { - if (!result.ref) result.ref = parent; - process$5(parent, ctx, params); - ctx.seen.get(parent).isParent = true; - } - } - const meta$2 = ctx.metadataRegistry.get(schema); - if (meta$2) Object.assign(result.schema, meta$2); - if (ctx.io === "input" && isTransforming(schema)) { - delete result.schema.examples; - delete result.schema.default; - } - if (ctx.io === "input" && "_prefault" in result.schema) (_a$3 = result.schema).default ?? (_a$3.default = result.schema._prefault); - delete result.schema._prefault; - return ctx.seen.get(schema).schema; +function uint64(params) { + return _uint64(ZodBigIntFormat, params); } -function extractDefs(ctx, schema) { - const root = ctx.seen.get(schema); - if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); - const idToSchema = /* @__PURE__ */ new Map(); - for (const entry of ctx.seen.entries()) { - const id = ctx.metadataRegistry.get(entry[0])?.id; - if (id) { - const existing = idToSchema.get(id); - if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`); - idToSchema.set(id, entry[0]); - } - } - const makeURI = (entry) => { - const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions"; - if (ctx.external) { - const externalId = ctx.external.registry.get(entry[0])?.id; - const uriGenerator = ctx.external.uri ?? ((id$1) => id$1); - if (externalId) return { ref: uriGenerator(externalId) }; - const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`; - entry[1].defId = id; - return { - defId: id, - ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` - }; - } - if (entry[1] === root) return { ref: "#" }; - const defUriPrefix = `#/${defsSegment}/`; - const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`; - return { - defId, - ref: defUriPrefix + defId - }; - }; - const extractToDef = (entry) => { - if (entry[1].schema.$ref) return; - const seen = entry[1]; - const { ref, defId } = makeURI(entry); - seen.def = { ...seen.schema }; - if (defId) seen.defId = defId; - const schema$1 = seen.schema; - for (const key in schema$1) delete schema$1[key]; - schema$1.$ref = ref; - }; - if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) { - const seen = entry[1]; - if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`); - } - for (const entry of ctx.seen.entries()) { - const seen = entry[1]; - if (schema === entry[0]) { - extractToDef(entry); - continue; - } - if (ctx.external) { - const ext = ctx.external.registry.get(entry[0])?.id; - if (schema !== entry[0] && ext) { - extractToDef(entry); - continue; - } - } - if (ctx.metadataRegistry.get(entry[0])?.id) { - extractToDef(entry); - continue; - } - if (seen.cycle) { - extractToDef(entry); - continue; - } - if (seen.count > 1) { - if (ctx.reused === "ref") { - extractToDef(entry); - continue; - } - } - } +var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => { + $ZodSymbol.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => symbolProcessor(inst, ctx, json, params); +}); +function symbol(params) { + return _symbol(ZodSymbol, params); } -function finalize(ctx, schema) { - const root = ctx.seen.get(schema); - if (!root) throw new Error("Unprocessed schema. This is a bug in Zod."); - const flattenRef = (zodSchema) => { - const seen = ctx.seen.get(zodSchema); - if (seen.ref === null) return; - const schema$1 = seen.def ?? seen.schema; - const _cached = { ...schema$1 }; - const ref = seen.ref; - seen.ref = null; - if (ref) { - flattenRef(ref); - const refSeen = ctx.seen.get(ref); - const refSchema = refSeen.schema; - if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) { - schema$1.allOf = schema$1.allOf ?? []; - schema$1.allOf.push(refSchema); - } else Object.assign(schema$1, refSchema); - Object.assign(schema$1, _cached); - if (zodSchema._zod.parent === ref) for (const key in schema$1) { - if (key === "$ref" || key === "allOf") continue; - if (!(key in _cached)) delete schema$1[key]; - } - if (refSchema.$ref && refSeen.def) for (const key in schema$1) { - if (key === "$ref" || key === "allOf") continue; - if (key in refSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(refSeen.def[key])) delete schema$1[key]; - } - } - const parent = zodSchema._zod.parent; - if (parent && parent !== ref) { - flattenRef(parent); - const parentSeen = ctx.seen.get(parent); - if (parentSeen?.schema.$ref) { - schema$1.$ref = parentSeen.schema.$ref; - if (parentSeen.def) for (const key in schema$1) { - if (key === "$ref" || key === "allOf") continue; - if (key in parentSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(parentSeen.def[key])) delete schema$1[key]; - } - } - } - ctx.override({ - zodSchema, - jsonSchema: schema$1, - path: seen.path ?? [] - }); - }; - for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]); - const result = {}; - if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema"; - else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#"; - else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#"; - else if (ctx.target === "openapi-3.0") {} - if (ctx.external?.uri) { - const id = ctx.external.registry.get(schema)?.id; - if (!id) throw new Error("Schema is missing an `id` property"); - result.$id = ctx.external.uri(id); - } - Object.assign(result, root.def ?? root.schema); - const rootMetaId = ctx.metadataRegistry.get(schema)?.id; - if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id; - const defs = ctx.external?.defs ?? {}; - for (const entry of ctx.seen.entries()) { - const seen = entry[1]; - if (seen.def && seen.defId) { - if (seen.def.id === seen.defId) delete seen.def.id; - defs[seen.defId] = seen.def; - } - } - if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs; - else result.definitions = defs; - try { - const finalized = JSON.parse(JSON.stringify(result)); - Object.defineProperty(finalized, "~standard", { - value: { - ...schema["~standard"], - jsonSchema: { - input: createStandardJSONSchemaMethod(schema, "input", ctx.processors), - output: createStandardJSONSchemaMethod(schema, "output", ctx.processors) - } - }, - enumerable: false, - writable: false - }); - return finalized; - } catch (_err) { - throw new Error("Error converting schema to JSON."); - } +var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => { + $ZodUndefined.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => undefinedProcessor(inst, ctx, json, params); +}); +function _undefined3(params) { + return _undefined2(ZodUndefined, params); } -function isTransforming(_schema, _ctx) { - const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() }; - if (ctx.seen.has(_schema)) return false; - ctx.seen.add(_schema); - const def = _schema._zod.def; - if (def.type === "transform") return true; - if (def.type === "array") return isTransforming(def.element, ctx); - if (def.type === "set") return isTransforming(def.valueType, ctx); - if (def.type === "lazy") return isTransforming(def.getter(), ctx); - if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx); - if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx); - if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx); - if (def.type === "pipe") { - if (_schema._zod.traits.has("$ZodCodec")) return true; - return isTransforming(def.in, ctx) || isTransforming(def.out, ctx); - } - if (def.type === "object") { - for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true; - return false; - } - if (def.type === "union") { - for (const option of def.options) if (isTransforming(option, ctx)) return true; - return false; - } - if (def.type === "tuple") { - for (const item of def.items) if (isTransforming(item, ctx)) return true; - if (def.rest && isTransforming(def.rest, ctx)) return true; - return false; - } - return false; -} -/** -* Creates a toJSONSchema method for a schema instance. -* This encapsulates the logic of initializing context, processing, extracting defs, and finalizing. -*/ -const createToJSONSchemaMethod = (schema, processors = {}) => (params) => { - const ctx = initializeContext({ - ...params, - processors - }); - process$5(schema, ctx); - extractDefs(ctx, schema); - return finalize(ctx, schema); -}; -const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => { - const { libraryOptions, target } = params ?? {}; - const ctx = initializeContext({ - ...libraryOptions ?? {}, - target, - io, - processors - }); - process$5(schema, ctx); - extractDefs(ctx, schema); - return finalize(ctx, schema); -}; - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js -const formatMap = { - guid: "uuid", - url: "uri", - datetime: "date-time", - json_string: "json-string", - regex: "" -}; -const stringProcessor = (schema, ctx, _json, _params) => { - const json = _json; - json.type = "string"; - const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag; - if (typeof minimum === "number") json.minLength = minimum; - if (typeof maximum === "number") json.maxLength = maximum; - if (format) { - json.format = formatMap[format] ?? format; - if (json.format === "") delete json.format; - if (format === "time") delete json.format; - } - if (contentEncoding) json.contentEncoding = contentEncoding; - if (patterns && patterns.size > 0) { - const regexes = [...patterns]; - if (regexes.length === 1) json.pattern = regexes[0].source; - else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({ - ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {}, - pattern: regex.source - }))]; - } -}; -const numberProcessor = (schema, ctx, _json, _params) => { - const json = _json; - const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag; - if (typeof format === "string" && format.includes("int")) json.type = "integer"; - else json.type = "number"; - const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY); - const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY); - const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0"; - if (exMin) if (legacy) { - json.minimum = exclusiveMinimum; - json.exclusiveMinimum = true; - } else json.exclusiveMinimum = exclusiveMinimum; - else if (typeof minimum === "number") json.minimum = minimum; - if (exMax) if (legacy) { - json.maximum = exclusiveMaximum; - json.exclusiveMaximum = true; - } else json.exclusiveMaximum = exclusiveMaximum; - else if (typeof maximum === "number") json.maximum = maximum; - if (typeof multipleOf === "number") json.multipleOf = multipleOf; -}; -const booleanProcessor = (_schema, _ctx, json, _params) => { - json.type = "boolean"; -}; -const neverProcessor = (_schema, _ctx, json, _params) => { - json.not = {}; -}; -const unknownProcessor = (_schema, _ctx, _json, _params) => {}; -const enumProcessor = (schema, _ctx, json, _params) => { - const def = schema._zod.def; - const values = getEnumValues(def.entries); - if (values.every((v) => typeof v === "number")) json.type = "number"; - if (values.every((v) => typeof v === "string")) json.type = "string"; - json.enum = values; -}; -const customProcessor = (_schema, ctx, _json, _params) => { - if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema"); -}; -const transformProcessor = (_schema, ctx, _json, _params) => { - if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema"); -}; -const arrayProcessor = (schema, ctx, _json, params) => { - const json = _json; - const def = schema._zod.def; - const { minimum, maximum } = schema._zod.bag; - if (typeof minimum === "number") json.minItems = minimum; - if (typeof maximum === "number") json.maxItems = maximum; - json.type = "array"; - json.items = process$5(def.element, ctx, { - ...params, - path: [...params.path, "items"] - }); -}; -const objectProcessor = (schema, ctx, _json, params) => { - const json = _json; - const def = schema._zod.def; - json.type = "object"; - json.properties = {}; - const shape = def.shape; - for (const key in shape) json.properties[key] = process$5(shape[key], ctx, { - ...params, - path: [ - ...params.path, - "properties", - key - ] - }); - const allKeys = new Set(Object.keys(shape)); - const requiredKeys = new Set([...allKeys].filter((key) => { - const v = def.shape[key]._zod; - if (ctx.io === "input") return v.optin === void 0; - else return v.optout === void 0; - })); - if (requiredKeys.size > 0) json.required = Array.from(requiredKeys); - if (def.catchall?._zod.def.type === "never") json.additionalProperties = false; - else if (!def.catchall) { - if (ctx.io === "output") json.additionalProperties = false; - } else if (def.catchall) json.additionalProperties = process$5(def.catchall, ctx, { - ...params, - path: [...params.path, "additionalProperties"] - }); -}; -const unionProcessor = (schema, ctx, json, params) => { - const def = schema._zod.def; - const isExclusive = def.inclusive === false; - const options = def.options.map((x, i) => process$5(x, ctx, { - ...params, - path: [ - ...params.path, - isExclusive ? "oneOf" : "anyOf", - i - ] - })); - if (isExclusive) json.oneOf = options; - else json.anyOf = options; -}; -const intersectionProcessor = (schema, ctx, json, params) => { - const def = schema._zod.def; - const a = process$5(def.left, ctx, { - ...params, - path: [ - ...params.path, - "allOf", - 0 - ] - }); - const b = process$5(def.right, ctx, { - ...params, - path: [ - ...params.path, - "allOf", - 1 - ] - }); - const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1; - json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]]; -}; -const recordProcessor = (schema, ctx, _json, params) => { - const json = _json; - const def = schema._zod.def; - json.type = "object"; - const keyType = def.keyType; - const patterns = keyType._zod.bag?.patterns; - if (def.mode === "loose" && patterns && patterns.size > 0) { - const valueSchema = process$5(def.valueType, ctx, { - ...params, - path: [ - ...params.path, - "patternProperties", - "*" - ] - }); - json.patternProperties = {}; - for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema; - } else { - if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$5(def.keyType, ctx, { - ...params, - path: [...params.path, "propertyNames"] - }); - json.additionalProperties = process$5(def.valueType, ctx, { - ...params, - path: [...params.path, "additionalProperties"] - }); - } - const keyValues = keyType._zod.values; - if (keyValues) { - const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number"); - if (validKeyValues.length > 0) json.required = validKeyValues; - } -}; -const nullableProcessor = (schema, ctx, json, params) => { - const def = schema._zod.def; - const inner = process$5(def.innerType, ctx, params); - const seen = ctx.seen.get(schema); - if (ctx.target === "openapi-3.0") { - seen.ref = def.innerType; - json.nullable = true; - } else json.anyOf = [inner, { type: "null" }]; -}; -const nonoptionalProcessor = (schema, ctx, _json, params) => { - const def = schema._zod.def; - process$5(def.innerType, ctx, params); - const seen = ctx.seen.get(schema); - seen.ref = def.innerType; -}; -const defaultProcessor = (schema, ctx, json, params) => { - const def = schema._zod.def; - process$5(def.innerType, ctx, params); - const seen = ctx.seen.get(schema); - seen.ref = def.innerType; - json.default = JSON.parse(JSON.stringify(def.defaultValue)); -}; -const prefaultProcessor = (schema, ctx, json, params) => { - const def = schema._zod.def; - process$5(def.innerType, ctx, params); - const seen = ctx.seen.get(schema); - seen.ref = def.innerType; - if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue)); -}; -const catchProcessor = (schema, ctx, json, params) => { - const def = schema._zod.def; - process$5(def.innerType, ctx, params); - const seen = ctx.seen.get(schema); - seen.ref = def.innerType; - let catchValue; - try { - catchValue = def.catchValue(void 0); - } catch { - throw new Error("Dynamic catch values are not supported in JSON Schema"); - } - json.default = catchValue; -}; -const pipeProcessor = (schema, ctx, _json, params) => { - const def = schema._zod.def; - const inIsTransform = def.in._zod.traits.has("$ZodTransform"); - const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out; - process$5(innerType, ctx, params); - const seen = ctx.seen.get(schema); - seen.ref = innerType; -}; -const readonlyProcessor = (schema, ctx, json, params) => { - const def = schema._zod.def; - process$5(def.innerType, ctx, params); - const seen = ctx.seen.get(schema); - seen.ref = def.innerType; - json.readOnly = true; -}; -const optionalProcessor = (schema, ctx, _json, params) => { - const def = schema._zod.def; - process$5(def.innerType, ctx, params); - const seen = ctx.seen.get(schema); - seen.ref = def.innerType; -}; - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js -const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => { - $ZodISODateTime.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function datetime(params) { - return _isoDateTime(ZodISODateTime, params); -} -const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => { - $ZodISODate.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function date(params) { - return _isoDate(ZodISODate, params); -} -const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => { - $ZodISOTime.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function time(params) { - return _isoTime(ZodISOTime, params); -} -const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => { - $ZodISODuration.init(inst, def); - ZodStringFormat.init(inst, def); -}); -function duration(params) { - return _isoDuration(ZodISODuration, params); -} - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js -const initializer = (inst, issues) => { - $ZodError.init(inst, issues); - inst.name = "ZodError"; - Object.defineProperties(inst, { - format: { value: (mapper) => formatError(inst, mapper) }, - flatten: { value: (mapper) => flattenError(inst, mapper) }, - addIssue: { value: (issue$1) => { - inst.issues.push(issue$1); - inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); - } }, - addIssues: { value: (issues$1) => { - inst.issues.push(...issues$1); - inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); - } }, - isEmpty: { get() { - return inst.issues.length === 0; - } } - }); -}; -const ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer, { Parent: Error }); - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js -const parse = /* @__PURE__ */ _parse(ZodRealError); -const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError); -const safeParse = /* @__PURE__ */ _safeParse(ZodRealError); -const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError); -const encode = /* @__PURE__ */ _encode(ZodRealError); -const decode = /* @__PURE__ */ _decode(ZodRealError); -const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError); -const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError); -const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError); -const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError); -const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError); -const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError); - -//#endregion -//#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js -const _installedGroups = /* @__PURE__ */ new WeakMap(); -function _installLazyMethods(inst, group, methods) { - const proto = Object.getPrototypeOf(inst); - let installed = _installedGroups.get(proto); - if (!installed) { - installed = /* @__PURE__ */ new Set(); - _installedGroups.set(proto, installed); - } - if (installed.has(group)) return; - installed.add(group); - for (const key in methods) { - const fn = methods[key]; - Object.defineProperty(proto, key, { - configurable: true, - enumerable: false, - get() { - const bound = fn.bind(this); - Object.defineProperty(this, key, { - configurable: true, - writable: true, - enumerable: true, - value: bound - }); - return bound; - }, - set(v) { - Object.defineProperty(this, key, { - configurable: true, - writable: true, - enumerable: true, - value: v - }); - } - }); - } -} -const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { - $ZodType.init(inst, def); - Object.assign(inst["~standard"], { jsonSchema: { - input: createStandardJSONSchemaMethod(inst, "input"), - output: createStandardJSONSchemaMethod(inst, "output") - } }); - inst.toJSONSchema = createToJSONSchemaMethod(inst, {}); - inst.def = def; - inst.type = def.type; - Object.defineProperty(inst, "_def", { value: def }); - inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse }); - inst.safeParse = (data, params) => safeParse(inst, data, params); - inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync }); - inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params); - inst.spa = inst.safeParseAsync; - inst.encode = (data, params) => encode(inst, data, params); - inst.decode = (data, params) => decode(inst, data, params); - inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params); - inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params); - inst.safeEncode = (data, params) => safeEncode(inst, data, params); - inst.safeDecode = (data, params) => safeDecode(inst, data, params); - inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params); - inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params); - _installLazyMethods(inst, "ZodType", { - check(...chks) { - const def$1 = this.def; - return this.clone(mergeDefs(def$1, { checks: [...def$1.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: { - check: ch, - def: { check: "custom" }, - onattach: [] - } } : ch)] }), { parent: true }); - }, - with(...chks) { - return this.check(...chks); - }, - clone(def$1, params) { - return clone(this, def$1, params); - }, - brand() { - return this; - }, - register(reg, meta$2) { - reg.add(this, meta$2); - return this; - }, - refine(check, params) { - return this.check(refine(check, params)); - }, - superRefine(refinement, params) { - return this.check(superRefine(refinement, params)); - }, - overwrite(fn) { - return this.check(_overwrite(fn)); - }, - optional() { - return optional(this); - }, - exactOptional() { - return exactOptional(this); - }, - nullable() { - return nullable(this); - }, - nullish() { - return optional(nullable(this)); - }, - nonoptional(params) { - return nonoptional(this, params); - }, - array() { - return array(this); - }, - or(arg) { - return union([this, arg]); - }, - and(arg) { - return intersection(this, arg); - }, - transform(tx) { - return pipe(this, transform(tx)); - }, - default(d) { - return _default(this, d); - }, - prefault(d) { - return prefault(this, d); - }, - catch(params) { - return _catch(this, params); - }, - pipe(target) { - return pipe(this, target); - }, - readonly() { - return readonly(this); - }, - describe(description) { - const cl = this.clone(); - globalRegistry.add(cl, { description }); - return cl; - }, - meta(...args) { - if (args.length === 0) return globalRegistry.get(this); - const cl = this.clone(); - globalRegistry.add(cl, args[0]); - return cl; - }, - isOptional() { - return this.safeParse(void 0).success; - }, - isNullable() { - return this.safeParse(null).success; - }, - apply(fn) { - return fn(this); - } - }); - Object.defineProperty(inst, "description", { - get() { - return globalRegistry.get(inst)?.description; - }, - configurable: true - }); - return inst; -}); -/** @internal */ -const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { - $ZodString.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params); - const bag = inst._zod.bag; - inst.format = bag.format ?? null; - inst.minLength = bag.minimum ?? null; - inst.maxLength = bag.maximum ?? null; - _installLazyMethods(inst, "_ZodString", { - regex(...args) { - return this.check(_regex(...args)); - }, - includes(...args) { - return this.check(_includes(...args)); - }, - startsWith(...args) { - return this.check(_startsWith(...args)); - }, - endsWith(...args) { - return this.check(_endsWith(...args)); - }, - min(...args) { - return this.check(_minLength(...args)); - }, - max(...args) { - return this.check(_maxLength(...args)); - }, - length(...args) { - return this.check(_length(...args)); - }, - nonempty(...args) { - return this.check(_minLength(1, ...args)); - }, - lowercase(params) { - return this.check(_lowercase(params)); - }, - uppercase(params) { - return this.check(_uppercase(params)); - }, - trim() { - return this.check(_trim()); - }, - normalize(...args) { - return this.check(_normalize(...args)); - }, - toLowerCase() { - return this.check(_toLowerCase()); - }, - toUpperCase() { - return this.check(_toUpperCase()); - }, - slugify() { - return this.check(_slugify()); - } - }); -}); -const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { - $ZodString.init(inst, def); - _ZodString.init(inst, def); - inst.email = (params) => inst.check(_email(ZodEmail, params)); - inst.url = (params) => inst.check(_url(ZodURL, params)); - inst.jwt = (params) => inst.check(_jwt(ZodJWT, params)); - inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params)); - inst.guid = (params) => inst.check(_guid(ZodGUID, params)); - inst.uuid = (params) => inst.check(_uuid(ZodUUID, params)); - inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params)); - inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params)); - inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params)); - inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params)); - inst.guid = (params) => inst.check(_guid(ZodGUID, params)); - inst.cuid = (params) => inst.check(_cuid(ZodCUID, params)); - inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params)); - inst.ulid = (params) => inst.check(_ulid(ZodULID, params)); - inst.base64 = (params) => inst.check(_base64(ZodBase64, params)); - inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params)); - inst.xid = (params) => inst.check(_xid(ZodXID, params)); - inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params)); - inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params)); - inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params)); - inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params)); - inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params)); - inst.e164 = (params) => inst.check(_e164(ZodE164, params)); - inst.datetime = (params) => inst.check(datetime(params)); - inst.date = (params) => inst.check(date(params)); - inst.time = (params) => inst.check(time(params)); - inst.duration = (params) => inst.check(duration(params)); -}); -function string(params) { - return _string(ZodString, params); -} -const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => { - $ZodStringFormat.init(inst, def); - _ZodString.init(inst, def); -}); -const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => { - $ZodEmail.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => { - $ZodGUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => { - $ZodUUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => { - $ZodURL.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => { - $ZodEmoji.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { - $ZodNanoID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -/** -* @deprecated CUID v1 is deprecated by its authors due to information leakage -* (timestamps embedded in the id). Use {@link ZodCUID2} instead. -* See https://github.com/paralleldrive/cuid. -*/ -const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => { - $ZodCUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => { - $ZodCUID2.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => { - $ZodULID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => { - $ZodXID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => { - $ZodKSUID.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => { - $ZodIPv4.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => { - $ZodIPv6.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => { - $ZodCIDRv4.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => { - $ZodCIDRv6.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => { - $ZodBase64.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => { - $ZodBase64URL.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => { - $ZodE164.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => { - $ZodJWT.init(inst, def); - ZodStringFormat.init(inst, def); -}); -const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => { - $ZodNumber.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params); - _installLazyMethods(inst, "ZodNumber", { - gt(value, params) { - return this.check(_gt(value, params)); - }, - gte(value, params) { - return this.check(_gte(value, params)); - }, - min(value, params) { - return this.check(_gte(value, params)); - }, - lt(value, params) { - return this.check(_lt(value, params)); - }, - lte(value, params) { - return this.check(_lte(value, params)); - }, - max(value, params) { - return this.check(_lte(value, params)); - }, - int(params) { - return this.check(int(params)); - }, - safe(params) { - return this.check(int(params)); - }, - positive(params) { - return this.check(_gt(0, params)); - }, - nonnegative(params) { - return this.check(_gte(0, params)); - }, - negative(params) { - return this.check(_lt(0, params)); - }, - nonpositive(params) { - return this.check(_lte(0, params)); - }, - multipleOf(value, params) { - return this.check(_multipleOf(value, params)); - }, - step(value, params) { - return this.check(_multipleOf(value, params)); - }, - finite() { - return this; - } - }); - const bag = inst._zod.bag; - inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null; - inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null; - inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5); - inst.isFinite = true; - inst.format = bag.format ?? null; -}); -function number(params) { - return _number(ZodNumber, params); -} -const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => { - $ZodNumberFormat.init(inst, def); - ZodNumber.init(inst, def); +var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => { + $ZodNull.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params); }); -function int(params) { - return _int(ZodNumberFormat, params); +function _null3(params) { + return _null2(ZodNull, params); } -const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { - $ZodBoolean.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params); +var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => { + $ZodAny.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor(inst, ctx, json, params); }); -function boolean(params) { - return _boolean(ZodBoolean, params); +function any() { + return _any(ZodAny); } -const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => { - $ZodUnknown.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params); +var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => { + $ZodUnknown.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params); }); function unknown() { - return _unknown(ZodUnknown); + return _unknown(ZodUnknown); } -const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => { - $ZodNever.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params); +var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => { + $ZodNever.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params); }); function never(params) { - return _never(ZodNever, params); -} -const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { - $ZodArray.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params); - inst.element = def.element; - _installLazyMethods(inst, "ZodArray", { - min(n, params) { - return this.check(_minLength(n, params)); - }, - nonempty(params) { - return this.check(_minLength(1, params)); - }, - max(n, params) { - return this.check(_maxLength(n, params)); - }, - length(n, params) { - return this.check(_length(n, params)); - }, - unwrap() { - return this.element; - } - }); + return _never(ZodNever, params); +} +var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => { + $ZodVoid.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => voidProcessor(inst, ctx, json, params); +}); +function _void2(params) { + return _void(ZodVoid, params); +} +var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => { + $ZodDate.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params); + inst.min = (value, params) => inst.check(_gte(value, params)); + inst.max = (value, params) => inst.check(_lte(value, params)); + const c = inst._zod.bag; + inst.minDate = c.minimum ? new Date(c.minimum) : null; + inst.maxDate = c.maximum ? new Date(c.maximum) : null; +}); +function date3(params) { + return _date(ZodDate, params); +} +var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { + $ZodArray.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params); + inst.element = def.element; + _installLazyMethods(inst, "ZodArray", { + min(n, params) { + return this.check(_minLength(n, params)); + }, + nonempty(params) { + return this.check(_minLength(1, params)); + }, + max(n, params) { + return this.check(_maxLength(n, params)); + }, + length(n, params) { + return this.check(_length(n, params)); + }, + unwrap() { + return this.element; + } + }); }); function array(element, params) { - return _array(ZodArray, element, params); -} -const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => { - $ZodObjectJIT.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params); - defineLazy(inst, "shape", () => { - return def.shape; - }); - _installLazyMethods(inst, "ZodObject", { - keyof() { - return _enum(Object.keys(this._zod.def.shape)); - }, - catchall(catchall) { - return this.clone({ - ...this._zod.def, - catchall - }); - }, - passthrough() { - return this.clone({ - ...this._zod.def, - catchall: unknown() - }); - }, - loose() { - return this.clone({ - ...this._zod.def, - catchall: unknown() - }); - }, - strict() { - return this.clone({ - ...this._zod.def, - catchall: never() - }); - }, - strip() { - return this.clone({ - ...this._zod.def, - catchall: void 0 - }); - }, - extend(incoming) { - return extend(this, incoming); - }, - safeExtend(incoming) { - return safeExtend(this, incoming); - }, - merge(other) { - return merge(this, other); - }, - pick(mask) { - return pick(this, mask); - }, - omit(mask) { - return omit(this, mask); - }, - partial(...args) { - return partial(ZodOptional, this, args[0]); - }, - required(...args) { - return required(ZodNonOptional, this, args[0]); - } - }); + return _array(ZodArray, element, params); +} +function keyof(schema) { + const shape = schema._zod.def.shape; + return _enum2(Object.keys(shape)); +} +var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => { + $ZodObjectJIT.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params); + exports_util.defineLazy(inst, "shape", () => { + return def.shape; + }); + _installLazyMethods(inst, "ZodObject", { + keyof() { + return _enum2(Object.keys(this._zod.def.shape)); + }, + catchall(catchall) { + return this.clone({ ...this._zod.def, catchall }); + }, + passthrough() { + return this.clone({ ...this._zod.def, catchall: unknown() }); + }, + loose() { + return this.clone({ ...this._zod.def, catchall: unknown() }); + }, + strict() { + return this.clone({ ...this._zod.def, catchall: never() }); + }, + strip() { + return this.clone({ ...this._zod.def, catchall: undefined }); + }, + extend(incoming) { + return exports_util.extend(this, incoming); + }, + safeExtend(incoming) { + return exports_util.safeExtend(this, incoming); + }, + merge(other) { + return exports_util.merge(this, other); + }, + pick(mask) { + return exports_util.pick(this, mask); + }, + omit(mask) { + return exports_util.omit(this, mask); + }, + partial(...args) { + return exports_util.partial(ZodOptional, this, args[0]); + }, + required(...args) { + return exports_util.required(ZodNonOptional, this, args[0]); + } + }); }); function object(shape, params) { - return new ZodObject({ - type: "object", - shape: shape ?? {}, - ...normalizeParams(params) - }); -} -const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => { - $ZodUnion.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params); - inst.options = def.options; + const def = { + type: "object", + shape: shape ?? {}, + ...exports_util.normalizeParams(params) + }; + return new ZodObject(def); +} +function strictObject(shape, params) { + return new ZodObject({ + type: "object", + shape, + catchall: never(), + ...exports_util.normalizeParams(params) + }); +} +function looseObject(shape, params) { + return new ZodObject({ + type: "object", + shape, + catchall: unknown(), + ...exports_util.normalizeParams(params) + }); +} +var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => { + $ZodUnion.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params); + inst.options = def.options; }); function union(options, params) { - return new ZodUnion({ - type: "union", - options, - ...normalizeParams(params) - }); -} -const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => { - $ZodIntersection.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params); + return new ZodUnion({ + type: "union", + options, + ...exports_util.normalizeParams(params) + }); +} +var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => { + ZodUnion.init(inst, def); + $ZodXor.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params); + inst.options = def.options; +}); +function xor(options, params) { + return new ZodXor({ + type: "union", + options, + inclusive: false, + ...exports_util.normalizeParams(params) + }); +} +var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => { + ZodUnion.init(inst, def); + $ZodDiscriminatedUnion.init(inst, def); +}); +function discriminatedUnion(discriminator, options, params) { + return new ZodDiscriminatedUnion({ + type: "union", + options, + discriminator, + ...exports_util.normalizeParams(params) + }); +} +var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => { + $ZodIntersection.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params); }); function intersection(left, right) { - return new ZodIntersection({ - type: "intersection", - left, - right - }); -} -const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => { - $ZodRecord.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params); - inst.keyType = def.keyType; - inst.valueType = def.valueType; + return new ZodIntersection({ + type: "intersection", + left, + right + }); +} +var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => { + $ZodTuple.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params); + inst.rest = (rest) => inst.clone({ + ...inst._zod.def, + rest + }); +}); +function tuple(items, _paramsOrRest, _params) { + const hasRest = _paramsOrRest instanceof $ZodType; + const params = hasRest ? _params : _paramsOrRest; + const rest = hasRest ? _paramsOrRest : null; + return new ZodTuple({ + type: "tuple", + items, + rest, + ...exports_util.normalizeParams(params) + }); +} +var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => { + $ZodRecord.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params); + inst.keyType = def.keyType; + inst.valueType = def.valueType; }); function record(keyType, valueType, params) { - if (!valueType || !valueType._zod) return new ZodRecord({ - type: "record", - keyType: string(), - valueType: keyType, - ...normalizeParams(valueType) - }); - return new ZodRecord({ - type: "record", - keyType, - valueType, - ...normalizeParams(params) - }); -} -const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { - $ZodEnum.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params); - inst.enum = def.entries; - inst.options = Object.values(def.entries); - const keys = new Set(Object.keys(def.entries)); - inst.extract = (values, params) => { - const newEntries = {}; - for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value]; - else throw new Error(`Key ${value} not found in enum`); - return new ZodEnum({ - ...def, - checks: [], - ...normalizeParams(params), - entries: newEntries - }); - }; - inst.exclude = (values, params) => { - const newEntries = { ...def.entries }; - for (const value of values) if (keys.has(value)) delete newEntries[value]; - else throw new Error(`Key ${value} not found in enum`); - return new ZodEnum({ - ...def, - checks: [], - ...normalizeParams(params), - entries: newEntries - }); - }; -}); -function _enum(values, params) { - return new ZodEnum({ - type: "enum", - entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values, - ...normalizeParams(params) - }); -} -const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { - $ZodTransform.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params); - inst._zod.parse = (payload, _ctx) => { - if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name); - payload.addIssue = (issue$1) => { - if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def)); - else { - const _issue = issue$1; - if (_issue.fatal) _issue.continue = false; - _issue.code ?? (_issue.code = "custom"); - _issue.input ?? (_issue.input = payload.value); - _issue.inst ?? (_issue.inst = inst); - payload.issues.push(issue(_issue)); - } - }; - const output = def.transform(payload.value, payload); - if (output instanceof Promise) return output.then((output$1) => { - payload.value = output$1; - payload.fallback = true; - return payload; - }); - payload.value = output; - payload.fallback = true; - return payload; - }; + if (!valueType || !valueType._zod) { + return new ZodRecord({ + type: "record", + keyType: string2(), + valueType: keyType, + ...exports_util.normalizeParams(valueType) + }); + } + return new ZodRecord({ + type: "record", + keyType, + valueType, + ...exports_util.normalizeParams(params) + }); +} +function partialRecord(keyType, valueType, params) { + const k = clone(keyType); + k._zod.values = undefined; + return new ZodRecord({ + type: "record", + keyType: k, + valueType, + ...exports_util.normalizeParams(params) + }); +} +function looseRecord(keyType, valueType, params) { + return new ZodRecord({ + type: "record", + keyType, + valueType, + mode: "loose", + ...exports_util.normalizeParams(params) + }); +} +var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => { + $ZodMap.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => mapProcessor(inst, ctx, json, params); + inst.keyType = def.keyType; + inst.valueType = def.valueType; + inst.min = (...args) => inst.check(_minSize(...args)); + inst.nonempty = (params) => inst.check(_minSize(1, params)); + inst.max = (...args) => inst.check(_maxSize(...args)); + inst.size = (...args) => inst.check(_size(...args)); +}); +function map(keyType, valueType, params) { + return new ZodMap({ + type: "map", + keyType, + valueType, + ...exports_util.normalizeParams(params) + }); +} +var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => { + $ZodSet.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => setProcessor(inst, ctx, json, params); + inst.min = (...args) => inst.check(_minSize(...args)); + inst.nonempty = (params) => inst.check(_minSize(1, params)); + inst.max = (...args) => inst.check(_maxSize(...args)); + inst.size = (...args) => inst.check(_size(...args)); +}); +function set(valueType, params) { + return new ZodSet({ + type: "set", + valueType, + ...exports_util.normalizeParams(params) + }); +} +var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { + $ZodEnum.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params); + inst.enum = def.entries; + inst.options = Object.values(def.entries); + const keys = new Set(Object.keys(def.entries)); + inst.extract = (values, params) => { + const newEntries = {}; + for (const value of values) { + if (keys.has(value)) { + newEntries[value] = def.entries[value]; + } else + throw new Error(`Key ${value} not found in enum`); + } + return new ZodEnum({ + ...def, + checks: [], + ...exports_util.normalizeParams(params), + entries: newEntries + }); + }; + inst.exclude = (values, params) => { + const newEntries = { ...def.entries }; + for (const value of values) { + if (keys.has(value)) { + delete newEntries[value]; + } else + throw new Error(`Key ${value} not found in enum`); + } + return new ZodEnum({ + ...def, + checks: [], + ...exports_util.normalizeParams(params), + entries: newEntries + }); + }; +}); +function _enum2(values, params) { + const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; + return new ZodEnum({ + type: "enum", + entries, + ...exports_util.normalizeParams(params) + }); +} +function nativeEnum(entries, params) { + return new ZodEnum({ + type: "enum", + entries, + ...exports_util.normalizeParams(params) + }); +} +var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => { + $ZodLiteral.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params); + inst.values = new Set(def.values); + Object.defineProperty(inst, "value", { + get() { + if (def.values.length > 1) { + throw new Error("This schema contains multiple valid literal values. Use `.values` instead."); + } + return def.values[0]; + } + }); +}); +function literal(value, params) { + return new ZodLiteral({ + type: "literal", + values: Array.isArray(value) ? value : [value], + ...exports_util.normalizeParams(params) + }); +} +var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => { + $ZodFile.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => fileProcessor(inst, ctx, json, params); + inst.min = (size, params) => inst.check(_minSize(size, params)); + inst.max = (size, params) => inst.check(_maxSize(size, params)); + inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params)); +}); +function file(params) { + return _file(ZodFile, params); +} +var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { + $ZodTransform.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params); + inst._zod.parse = (payload, _ctx) => { + if (_ctx.direction === "backward") { + throw new $ZodEncodeError(inst.constructor.name); + } + payload.addIssue = (issue2) => { + if (typeof issue2 === "string") { + payload.issues.push(exports_util.issue(issue2, payload.value, def)); + } else { + const _issue = issue2; + if (_issue.fatal) + _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = inst); + payload.issues.push(exports_util.issue(_issue)); + } + }; + const output = def.transform(payload.value, payload); + if (output instanceof Promise) { + return output.then((output2) => { + payload.value = output2; + payload.fallback = true; + return payload; + }); + } + payload.value = output; + payload.fallback = true; + return payload; + }; }); function transform(fn) { - return new ZodTransform({ - type: "transform", - transform: fn - }); -} -const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => { - $ZodOptional.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; + return new ZodTransform({ + type: "transform", + transform: fn + }); +} +var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => { + $ZodOptional.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; }); function optional(innerType) { - return new ZodOptional({ - type: "optional", - innerType - }); -} -const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => { - $ZodExactOptional.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; + return new ZodOptional({ + type: "optional", + innerType + }); +} +var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => { + $ZodExactOptional.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; }); function exactOptional(innerType) { - return new ZodExactOptional({ - type: "optional", - innerType - }); -} -const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => { - $ZodNullable.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; + return new ZodExactOptional({ + type: "optional", + innerType + }); +} +var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => { + $ZodNullable.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; }); function nullable(innerType) { - return new ZodNullable({ - type: "nullable", - innerType - }); -} -const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => { - $ZodDefault.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; - inst.removeDefault = inst.unwrap; -}); -function _default(innerType, defaultValue) { - return new ZodDefault({ - type: "default", - innerType, - get defaultValue() { - return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue); - } - }); -} -const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => { - $ZodPrefault.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; + return new ZodNullable({ + type: "nullable", + innerType + }); +} +function nullish2(innerType) { + return optional(nullable(innerType)); +} +var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => { + $ZodDefault.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeDefault = inst.unwrap; +}); +function _default2(innerType, defaultValue) { + return new ZodDefault({ + type: "default", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue); + } + }); +} +var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => { + $ZodPrefault.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; }); function prefault(innerType, defaultValue) { - return new ZodPrefault({ - type: "prefault", - innerType, - get defaultValue() { - return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue); - } - }); -} -const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => { - $ZodNonOptional.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; + return new ZodPrefault({ + type: "prefault", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue); + } + }); +} +var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => { + $ZodNonOptional.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; }); function nonoptional(innerType, params) { - return new ZodNonOptional({ - type: "nonoptional", - innerType, - ...normalizeParams(params) - }); -} -const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => { - $ZodCatch.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; - inst.removeCatch = inst.unwrap; -}); -function _catch(innerType, catchValue) { - return new ZodCatch({ - type: "catch", - innerType, - catchValue: typeof catchValue === "function" ? catchValue : () => catchValue - }); -} -const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => { - $ZodPipe.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params); - inst.in = def.in; - inst.out = def.out; + return new ZodNonOptional({ + type: "nonoptional", + innerType, + ...exports_util.normalizeParams(params) + }); +} +var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => { + $ZodSuccess.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => successProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function success(innerType) { + return new ZodSuccess({ + type: "success", + innerType + }); +} +var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => { + $ZodCatch.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeCatch = inst.unwrap; +}); +function _catch2(innerType, catchValue) { + return new ZodCatch({ + type: "catch", + innerType, + catchValue: typeof catchValue === "function" ? catchValue : () => catchValue + }); +} +var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => { + $ZodNaN.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => nanProcessor(inst, ctx, json, params); +}); +function nan(params) { + return _nan(ZodNaN, params); +} +var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => { + $ZodPipe.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params); + inst.in = def.in; + inst.out = def.out; }); function pipe(in_, out) { - return new ZodPipe({ - type: "pipe", - in: in_, - out - }); -} -const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => { - $ZodReadonly.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params); - inst.unwrap = () => inst._zod.def.innerType; + return new ZodPipe({ + type: "pipe", + in: in_, + out + }); +} +var ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => { + ZodPipe.init(inst, def); + $ZodCodec.init(inst, def); +}); +function codec(in_, out, params) { + return new ZodCodec({ + type: "pipe", + in: in_, + out, + transform: params.decode, + reverseTransform: params.encode + }); +} +function invertCodec(codec2) { + const def = codec2._zod.def; + return new ZodCodec({ + type: "pipe", + in: def.out, + out: def.in, + transform: def.reverseTransform, + reverseTransform: def.transform + }); +} +var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => { + ZodPipe.init(inst, def); + $ZodPreprocess.init(inst, def); +}); +var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => { + $ZodReadonly.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; }); function readonly(innerType) { - return new ZodReadonly({ - type: "readonly", - innerType - }); -} -const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => { - $ZodCustom.init(inst, def); - ZodType.init(inst, def); - inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params); + return new ZodReadonly({ + type: "readonly", + innerType + }); +} +var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => { + $ZodTemplateLiteral.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => templateLiteralProcessor(inst, ctx, json, params); +}); +function templateLiteral(parts, params) { + return new ZodTemplateLiteral({ + type: "template_literal", + parts, + ...exports_util.normalizeParams(params) + }); +} +var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => { + $ZodLazy.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.getter(); +}); +function lazy(getter) { + return new ZodLazy({ + type: "lazy", + getter + }); +} +var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => { + $ZodPromise.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => promiseProcessor(inst, ctx, json, params); + inst.unwrap = () => inst._zod.def.innerType; +}); +function promise(innerType) { + return new ZodPromise({ + type: "promise", + innerType + }); +} +var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => { + $ZodFunction.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => functionProcessor(inst, ctx, json, params); }); +function _function(params) { + return new ZodFunction({ + type: "function", + input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()), + output: params?.output ?? unknown() + }); +} +var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => { + $ZodCustom.init(inst, def); + ZodType.init(inst, def); + inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params); +}); +function check(fn) { + const ch = new $ZodCheck({ + check: "custom" + }); + ch._zod.check = fn; + return ch; +} +function custom(fn, _params) { + return _custom(ZodCustom, fn ?? (() => true), _params); +} function refine(fn, _params = {}) { - return _refine(ZodCustom, fn, _params); + return _refine(ZodCustom, fn, _params); } function superRefine(fn, params) { - return _superRefine(fn, params); -} -const describe = describe$1; -const meta = meta$1; - -//#endregion -//#region src/config.ts -/** -* Resolved tracer configuration. -* -* Resolution order (lowest → highest precedence): -* defaults → ~/.claude/langfuse.json → /.claude/langfuse.json → env -* -* Claude Code exposes a plugin's `userConfig` values as -* `CLAUDE_PLUGIN_OPTION_` environment variables. For every setting we -* read the `CLAUDE_PLUGIN_OPTION_` form first, then the plain `` -* environment variable, so the plugin works whether configured through the -* Claude Code install prompt or a shell export. -*/ -const ConfigSchema = object({ - public_key: string().optional(), - secret_key: string().optional(), - base_url: string(), - environment: string().optional(), - user_id: string().optional(), - tags: array(string()).optional(), - metadata: record(string(), string()).optional(), - max_chars: number().int().positive(), - debug: boolean(), - fail_on_error: boolean() -}); -const PartialConfigSchema = ConfigSchema.partial(); -const DEFAULTS = { - base_url: "https://us.cloud.langfuse.com", - max_chars: 2e4, - debug: false, - fail_on_error: false + return _superRefine(fn, params); +} +var describe2 = describe; +var meta2 = meta; +function _instanceof(cls, params = {}) { + const inst = new ZodCustom({ + type: "custom", + check: "custom", + fn: (data) => data instanceof cls, + abort: true, + ...exports_util.normalizeParams(params) + }); + inst._zod.bag.Class = cls; + inst._zod.check = (payload) => { + if (!(payload.value instanceof cls)) { + payload.issues.push({ + code: "invalid_type", + expected: cls.name, + input: payload.value, + inst, + path: [...inst._zod.def.path ?? []] + }); + } + }; + return inst; +} +var stringbool = (...args) => _stringbool({ + Codec: ZodCodec, + Boolean: ZodBoolean, + String: ZodString +}, ...args); +function json(params) { + const jsonSchema = lazy(() => { + return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]); + }); + return jsonSchema; +} +function preprocess(fn, schema) { + return new ZodPreprocess({ + type: "pipe", + in: transform(fn), + out: schema + }); +} +// node_modules/zod/v4/classic/compat.js +var ZodIssueCode = { + invalid_type: "invalid_type", + too_big: "too_big", + too_small: "too_small", + invalid_format: "invalid_format", + not_multiple_of: "not_multiple_of", + unrecognized_keys: "unrecognized_keys", + invalid_union: "invalid_union", + invalid_key: "invalid_key", + invalid_element: "invalid_element", + invalid_value: "invalid_value", + custom: "custom" +}; +function setErrorMap(map2) { + config({ + customError: map2 + }); +} +function getErrorMap() { + return config().customError; +} +var ZodFirstPartyTypeKind; +(function(ZodFirstPartyTypeKind2) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); +// node_modules/zod/v4/classic/from-json-schema.js +var z = { + ...exports_schemas2, + ...exports_checks2, + iso: exports_iso +}; +var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([ + "$schema", + "$ref", + "$defs", + "definitions", + "$id", + "id", + "$comment", + "$anchor", + "$vocabulary", + "$dynamicRef", + "$dynamicAnchor", + "type", + "enum", + "const", + "anyOf", + "oneOf", + "allOf", + "not", + "properties", + "required", + "additionalProperties", + "patternProperties", + "propertyNames", + "minProperties", + "maxProperties", + "items", + "prefixItems", + "additionalItems", + "minItems", + "maxItems", + "uniqueItems", + "contains", + "minContains", + "maxContains", + "minLength", + "maxLength", + "pattern", + "format", + "minimum", + "maximum", + "exclusiveMinimum", + "exclusiveMaximum", + "multipleOf", + "description", + "default", + "contentEncoding", + "contentMediaType", + "contentSchema", + "unevaluatedItems", + "unevaluatedProperties", + "if", + "then", + "else", + "dependentSchemas", + "dependentRequired", + "nullable", + "readOnly" +]); +function detectVersion(schema, defaultTarget) { + const $schema = schema.$schema; + if ($schema === "https://json-schema.org/draft/2020-12/schema") { + return "draft-2020-12"; + } + if ($schema === "http://json-schema.org/draft-07/schema#") { + return "draft-7"; + } + if ($schema === "http://json-schema.org/draft-04/schema#") { + return "draft-4"; + } + return defaultTarget ?? "draft-2020-12"; +} +function resolveRef(ref, ctx) { + if (!ref.startsWith("#")) { + throw new Error("External $ref is not supported, only local refs (#/...) are allowed"); + } + const path = ref.slice(1).split("/").filter(Boolean); + if (path.length === 0) { + return ctx.rootSchema; + } + const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions"; + if (path[0] === defsKey) { + const key = path[1]; + if (!key || !ctx.defs[key]) { + throw new Error(`Reference not found: ${ref}`); + } + return ctx.defs[key]; + } + throw new Error(`Reference not found: ${ref}`); +} +function convertBaseSchema(schema, ctx) { + if (schema.not !== undefined) { + if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) { + return z.never(); + } + throw new Error("not is not supported in Zod (except { not: {} } for never)"); + } + if (schema.unevaluatedItems !== undefined) { + throw new Error("unevaluatedItems is not supported"); + } + if (schema.unevaluatedProperties !== undefined) { + throw new Error("unevaluatedProperties is not supported"); + } + if (schema.if !== undefined || schema.then !== undefined || schema.else !== undefined) { + throw new Error("Conditional schemas (if/then/else) are not supported"); + } + if (schema.dependentSchemas !== undefined || schema.dependentRequired !== undefined) { + throw new Error("dependentSchemas and dependentRequired are not supported"); + } + if (schema.$ref) { + const refPath = schema.$ref; + if (ctx.refs.has(refPath)) { + return ctx.refs.get(refPath); + } + if (ctx.processing.has(refPath)) { + return z.lazy(() => { + if (!ctx.refs.has(refPath)) { + throw new Error(`Circular reference not resolved: ${refPath}`); + } + return ctx.refs.get(refPath); + }); + } + ctx.processing.add(refPath); + const resolved = resolveRef(refPath, ctx); + const zodSchema2 = convertSchema(resolved, ctx); + ctx.refs.set(refPath, zodSchema2); + ctx.processing.delete(refPath); + return zodSchema2; + } + if (schema.enum !== undefined) { + const enumValues = schema.enum; + if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) { + return z.null(); + } + if (enumValues.length === 0) { + return z.never(); + } + if (enumValues.length === 1) { + return z.literal(enumValues[0]); + } + if (enumValues.every((v) => typeof v === "string")) { + return z.enum(enumValues); + } + const literalSchemas = enumValues.map((v) => z.literal(v)); + if (literalSchemas.length < 2) { + return literalSchemas[0]; + } + return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]); + } + if (schema.const !== undefined) { + return z.literal(schema.const); + } + const type = schema.type; + if (Array.isArray(type)) { + const typeSchemas = type.map((t) => { + const typeSchema = { ...schema, type: t }; + return convertBaseSchema(typeSchema, ctx); + }); + if (typeSchemas.length === 0) { + return z.never(); + } + if (typeSchemas.length === 1) { + return typeSchemas[0]; + } + return z.union(typeSchemas); + } + if (!type) { + return z.any(); + } + let zodSchema; + switch (type) { + case "string": { + let stringSchema = z.string(); + if (schema.format) { + const format = schema.format; + if (format === "email") { + stringSchema = stringSchema.check(z.email()); + } else if (format === "uri" || format === "uri-reference") { + stringSchema = stringSchema.check(z.url()); + } else if (format === "uuid" || format === "guid") { + stringSchema = stringSchema.check(z.uuid()); + } else if (format === "date-time") { + stringSchema = stringSchema.check(z.iso.datetime()); + } else if (format === "date") { + stringSchema = stringSchema.check(z.iso.date()); + } else if (format === "time") { + stringSchema = stringSchema.check(z.iso.time()); + } else if (format === "duration") { + stringSchema = stringSchema.check(z.iso.duration()); + } else if (format === "ipv4") { + stringSchema = stringSchema.check(z.ipv4()); + } else if (format === "ipv6") { + stringSchema = stringSchema.check(z.ipv6()); + } else if (format === "mac") { + stringSchema = stringSchema.check(z.mac()); + } else if (format === "cidr") { + stringSchema = stringSchema.check(z.cidrv4()); + } else if (format === "cidr-v6") { + stringSchema = stringSchema.check(z.cidrv6()); + } else if (format === "base64") { + stringSchema = stringSchema.check(z.base64()); + } else if (format === "base64url") { + stringSchema = stringSchema.check(z.base64url()); + } else if (format === "e164") { + stringSchema = stringSchema.check(z.e164()); + } else if (format === "jwt") { + stringSchema = stringSchema.check(z.jwt()); + } else if (format === "emoji") { + stringSchema = stringSchema.check(z.emoji()); + } else if (format === "nanoid") { + stringSchema = stringSchema.check(z.nanoid()); + } else if (format === "cuid") { + stringSchema = stringSchema.check(z.cuid()); + } else if (format === "cuid2") { + stringSchema = stringSchema.check(z.cuid2()); + } else if (format === "ulid") { + stringSchema = stringSchema.check(z.ulid()); + } else if (format === "xid") { + stringSchema = stringSchema.check(z.xid()); + } else if (format === "ksuid") { + stringSchema = stringSchema.check(z.ksuid()); + } + } + if (typeof schema.minLength === "number") { + stringSchema = stringSchema.min(schema.minLength); + } + if (typeof schema.maxLength === "number") { + stringSchema = stringSchema.max(schema.maxLength); + } + if (schema.pattern) { + stringSchema = stringSchema.regex(new RegExp(schema.pattern)); + } + zodSchema = stringSchema; + break; + } + case "number": + case "integer": { + let numberSchema = type === "integer" ? z.number().int() : z.number(); + if (typeof schema.minimum === "number") { + numberSchema = numberSchema.min(schema.minimum); + } + if (typeof schema.maximum === "number") { + numberSchema = numberSchema.max(schema.maximum); + } + if (typeof schema.exclusiveMinimum === "number") { + numberSchema = numberSchema.gt(schema.exclusiveMinimum); + } else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") { + numberSchema = numberSchema.gt(schema.minimum); + } + if (typeof schema.exclusiveMaximum === "number") { + numberSchema = numberSchema.lt(schema.exclusiveMaximum); + } else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") { + numberSchema = numberSchema.lt(schema.maximum); + } + if (typeof schema.multipleOf === "number") { + numberSchema = numberSchema.multipleOf(schema.multipleOf); + } + zodSchema = numberSchema; + break; + } + case "boolean": { + zodSchema = z.boolean(); + break; + } + case "null": { + zodSchema = z.null(); + break; + } + case "object": { + const shape = {}; + const properties = schema.properties || {}; + const requiredSet = new Set(schema.required || []); + for (const [key, propSchema] of Object.entries(properties)) { + const propZodSchema = convertSchema(propSchema, ctx); + shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional(); + } + if (schema.propertyNames) { + const keySchema = convertSchema(schema.propertyNames, ctx); + const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any(); + if (Object.keys(shape).length === 0) { + zodSchema = z.record(keySchema, valueSchema); + break; + } + const objectSchema2 = z.object(shape).passthrough(); + const recordSchema = z.looseRecord(keySchema, valueSchema); + zodSchema = z.intersection(objectSchema2, recordSchema); + break; + } + if (schema.patternProperties) { + const patternProps = schema.patternProperties; + const patternKeys = Object.keys(patternProps); + const looseRecords = []; + for (const pattern of patternKeys) { + const patternValue = convertSchema(patternProps[pattern], ctx); + const keySchema = z.string().regex(new RegExp(pattern)); + looseRecords.push(z.looseRecord(keySchema, patternValue)); + } + const schemasToIntersect = []; + if (Object.keys(shape).length > 0) { + schemasToIntersect.push(z.object(shape).passthrough()); + } + schemasToIntersect.push(...looseRecords); + if (schemasToIntersect.length === 0) { + zodSchema = z.object({}).passthrough(); + } else if (schemasToIntersect.length === 1) { + zodSchema = schemasToIntersect[0]; + } else { + let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]); + for (let i = 2;i < schemasToIntersect.length; i++) { + result = z.intersection(result, schemasToIntersect[i]); + } + zodSchema = result; + } + break; + } + const objectSchema = z.object(shape); + if (schema.additionalProperties === false) { + zodSchema = objectSchema.strict(); + } else if (typeof schema.additionalProperties === "object") { + zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx)); + } else { + zodSchema = objectSchema.passthrough(); + } + break; + } + case "array": { + const prefixItems = schema.prefixItems; + const items = schema.items; + if (prefixItems && Array.isArray(prefixItems)) { + const tupleItems = prefixItems.map((item) => convertSchema(item, ctx)); + const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : undefined; + if (rest) { + zodSchema = z.tuple(tupleItems).rest(rest); + } else { + zodSchema = z.tuple(tupleItems); + } + if (typeof schema.minItems === "number") { + zodSchema = zodSchema.check(z.minLength(schema.minItems)); + } + if (typeof schema.maxItems === "number") { + zodSchema = zodSchema.check(z.maxLength(schema.maxItems)); + } + } else if (Array.isArray(items)) { + const tupleItems = items.map((item) => convertSchema(item, ctx)); + const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : undefined; + if (rest) { + zodSchema = z.tuple(tupleItems).rest(rest); + } else { + zodSchema = z.tuple(tupleItems); + } + if (typeof schema.minItems === "number") { + zodSchema = zodSchema.check(z.minLength(schema.minItems)); + } + if (typeof schema.maxItems === "number") { + zodSchema = zodSchema.check(z.maxLength(schema.maxItems)); + } + } else if (items !== undefined) { + const element = convertSchema(items, ctx); + let arraySchema = z.array(element); + if (typeof schema.minItems === "number") { + arraySchema = arraySchema.min(schema.minItems); + } + if (typeof schema.maxItems === "number") { + arraySchema = arraySchema.max(schema.maxItems); + } + zodSchema = arraySchema; + } else { + zodSchema = z.array(z.any()); + } + break; + } + default: + throw new Error(`Unsupported type: ${type}`); + } + return zodSchema; +} +function convertSchema(schema, ctx) { + if (typeof schema === "boolean") { + return schema ? z.any() : z.never(); + } + let baseSchema = convertBaseSchema(schema, ctx); + const hasExplicitType = schema.type || schema.enum !== undefined || schema.const !== undefined; + if (schema.anyOf && Array.isArray(schema.anyOf)) { + const options = schema.anyOf.map((s) => convertSchema(s, ctx)); + const anyOfUnion = z.union(options); + baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion; + } + if (schema.oneOf && Array.isArray(schema.oneOf)) { + const options = schema.oneOf.map((s) => convertSchema(s, ctx)); + const oneOfUnion = z.xor(options); + baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion; + } + if (schema.allOf && Array.isArray(schema.allOf)) { + if (schema.allOf.length === 0) { + baseSchema = hasExplicitType ? baseSchema : z.any(); + } else { + let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx); + const startIdx = hasExplicitType ? 0 : 1; + for (let i = startIdx;i < schema.allOf.length; i++) { + result = z.intersection(result, convertSchema(schema.allOf[i], ctx)); + } + baseSchema = result; + } + } + if (schema.nullable === true && ctx.version === "openapi-3.0") { + baseSchema = z.nullable(baseSchema); + } + if (schema.readOnly === true) { + baseSchema = z.readonly(baseSchema); + } + if (schema.default !== undefined) { + baseSchema = baseSchema.default(schema.default); + } + const extraMeta = {}; + const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"]; + for (const key of coreMetadataKeys) { + if (key in schema) { + extraMeta[key] = schema[key]; + } + } + const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"]; + for (const key of contentMetadataKeys) { + if (key in schema) { + extraMeta[key] = schema[key]; + } + } + for (const key of Object.keys(schema)) { + if (!RECOGNIZED_KEYS.has(key)) { + extraMeta[key] = schema[key]; + } + } + if (Object.keys(extraMeta).length > 0) { + ctx.registry.add(baseSchema, extraMeta); + } + if (schema.description) { + baseSchema = baseSchema.describe(schema.description); + } + return baseSchema; +} +function fromJSONSchema(schema, params) { + if (typeof schema === "boolean") { + return schema ? z.any() : z.never(); + } + let normalized; + try { + normalized = JSON.parse(JSON.stringify(schema)); + } catch { + throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas"); + } + const version2 = detectVersion(normalized, params?.defaultTarget); + const defs = normalized.$defs || normalized.definitions || {}; + const ctx = { + version: version2, + defs, + refs: new Map, + processing: new Set, + rootSchema: normalized, + registry: params?.registry ?? globalRegistry + }; + return convertSchema(normalized, ctx); +} +// node_modules/zod/v4/classic/coerce.js +var exports_coerce = {}; +__export(exports_coerce, { + string: () => string3, + number: () => number3, + date: () => date4, + boolean: () => boolean3, + bigint: () => bigint3 +}); +function string3(params) { + return _coercedString(ZodString, params); +} +function number3(params) { + return _coercedNumber(ZodNumber, params); +} +function boolean3(params) { + return _coercedBoolean(ZodBoolean, params); +} +function bigint3(params) { + return _coercedBigint(ZodBigInt, params); +} +function date4(params) { + return _coercedDate(ZodDate, params); +} + +// node_modules/zod/v4/classic/external.js +config(en_default()); +// src/config.ts +var ConfigSchema = exports_external.object({ + public_key: exports_external.string().optional(), + secret_key: exports_external.string().optional(), + base_url: exports_external.string(), + environment: exports_external.string().optional(), + user_id: exports_external.string().optional(), + tags: exports_external.array(exports_external.string()).optional(), + metadata: exports_external.record(exports_external.string(), exports_external.string()).optional(), + max_chars: exports_external.number().int().positive(), + debug: exports_external.boolean(), + fail_on_error: exports_external.boolean() +}); +var PartialConfigSchema = ConfigSchema.partial(); +var DEFAULTS = { + base_url: "https://us.cloud.langfuse.com", + max_chars: 20000, + debug: false, + fail_on_error: false }; -/** -* Shape of the parts of `~/.claude.json` we read. Claude Code stores the -* logged-in account (including the email) under `oauthAccount`. -*/ -const ClaudeAccountSchema = object({ oauthAccount: object({ emailAddress: string().optional() }).passthrough().optional() }).passthrough(); +var ClaudeAccountSchema = exports_external.object({ + oauthAccount: exports_external.object({ emailAddress: exports_external.string().optional() }).passthrough().optional() +}).passthrough(); function parseBoolean(value) { - if (typeof value === "boolean") return value; - if (typeof value !== "string") return void 0; - const normalized = value.trim().toLowerCase(); - if ([ - "1", - "true", - "yes", - "on" - ].includes(normalized)) return true; - if ([ - "0", - "false", - "no", - "off" - ].includes(normalized)) return false; + if (typeof value === "boolean") + return value; + if (typeof value !== "string") + return; + const normalized = value.trim().toLowerCase(); + if (["1", "true", "yes", "on"].includes(normalized)) + return true; + if (["0", "false", "no", "off"].includes(normalized)) + return false; + return; } function parseTags(value) { - if (Array.isArray(value)) return value.map(String); - if (typeof value !== "string" || value.trim().length === 0) return void 0; - const trimmed = value.trim(); - if (trimmed.startsWith("[")) try { - const parsed = JSON.parse(trimmed); - if (Array.isArray(parsed)) return parsed.map(String); - } catch {} - return trimmed.split(",").map((t) => t.trim()).filter(Boolean); + if (Array.isArray(value)) + return value.map(String); + if (typeof value !== "string" || value.trim().length === 0) + return; + const trimmed = value.trim(); + if (trimmed.startsWith("[")) { + try { + const parsed = JSON.parse(trimmed); + if (Array.isArray(parsed)) + return parsed.map(String); + } catch {} + } + return trimmed.split(",").map((t) => t.trim()).filter(Boolean); } function parseMetadata(value) { - let obj = value; - if (typeof value === "string") { - if (value.trim().length === 0) return void 0; - try { - obj = JSON.parse(value); - } catch { - return; - } - } - if (obj == null || typeof obj !== "object" || Array.isArray(obj)) return; - const out = {}; - for (const [k, v] of Object.entries(obj)) out[k] = typeof v === "string" ? v : JSON.stringify(v); - return out; + let obj = value; + if (typeof value === "string") { + if (value.trim().length === 0) + return; + try { + obj = JSON.parse(value); + } catch { + return; + } + } + if (obj == null || typeof obj !== "object" || Array.isArray(obj)) { + return; + } + const out = {}; + for (const [k, v] of Object.entries(obj)) { + out[k] = typeof v === "string" ? v : JSON.stringify(v); + } + return out; } function parseInteger(value) { - if (typeof value === "number" && Number.isFinite(value)) return value; - if (typeof value !== "string") return void 0; - const parsed = Number.parseInt(value.trim(), 10); - return Number.isFinite(parsed) ? parsed : void 0; + if (typeof value === "number" && Number.isFinite(value)) + return value; + if (typeof value !== "string") + return; + const parsed = Number.parseInt(value.trim(), 10); + return Number.isFinite(parsed) ? parsed : undefined; } function stripUndefined(value) { - return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0)); -} -async function readConfigFile(file) { - try { - const raw = JSON.parse(await fs.readFile(file, "utf-8")); - return PartialConfigSchema.parse(stripUndefined({ - ...raw, - tags: raw.tags != null ? parseTags(raw.tags) : void 0, - metadata: raw.metadata != null ? parseMetadata(raw.metadata) : void 0, - max_chars: raw.max_chars != null ? parseInteger(raw.max_chars) : void 0, - debug: raw.debug != null ? parseBoolean(raw.debug) : void 0, - fail_on_error: raw.fail_on_error != null ? parseBoolean(raw.fail_on_error) : void 0 - })); - } catch { - return; - } -} -/** -* Read an option, preferring the Claude Code plugin-config form -* (`CLAUDE_PLUGIN_OPTION_`) over the plain environment variable. -*/ + return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined)); +} +async function readConfigFile(file2) { + try { + const raw = JSON.parse(await fs.readFile(file2, "utf-8")); + return PartialConfigSchema.parse(stripUndefined({ + ...raw, + tags: raw.tags != null ? parseTags(raw.tags) : undefined, + metadata: raw.metadata != null ? parseMetadata(raw.metadata) : undefined, + max_chars: raw.max_chars != null ? parseInteger(raw.max_chars) : undefined, + debug: raw.debug != null ? parseBoolean(raw.debug) : undefined, + fail_on_error: raw.fail_on_error != null ? parseBoolean(raw.fail_on_error) : undefined + })); + } catch { + return; + } +} function opt(name, env) { - return env[`CLAUDE_PLUGIN_OPTION_${name}`] ?? env[name]; + return env[`CLAUDE_PLUGIN_OPTION_${name}`] ?? env[name]; } -/** Resolve `LANGFUSE_` with a `CC_LANGFUSE_` fallback. */ function getVar(suffix, env) { - return opt(`LANGFUSE_${suffix}`, env) ?? opt(`CC_LANGFUSE_${suffix}`, env); + return opt(`LANGFUSE_${suffix}`, env) ?? opt(`CC_LANGFUSE_${suffix}`, env); } function readEnvConfig(env) { - return PartialConfigSchema.parse(stripUndefined({ - public_key: getVar("PUBLIC_KEY", env), - secret_key: getVar("SECRET_KEY", env), - base_url: getVar("BASE_URL", env), - environment: opt("LANGFUSE_TRACING_ENVIRONMENT", env) ?? opt("CC_LANGFUSE_ENVIRONMENT", env), - user_id: opt("CC_LANGFUSE_USER_ID", env), - tags: parseTags(opt("CC_LANGFUSE_TAGS", env)), - metadata: parseMetadata(opt("CC_LANGFUSE_METADATA", env)), - max_chars: parseInteger(opt("CC_LANGFUSE_MAX_CHARS", env)), - debug: parseBoolean(opt("CC_LANGFUSE_DEBUG", env)), - fail_on_error: parseBoolean(opt("CC_LANGFUSE_FAIL_ON_ERROR", env)) - })); -} -/** -* Read the logged-in Claude Code user's email from `~/.claude.json`, used as a -* `user_id` fallback when one isn't explicitly configured. Returns undefined if -* the file is missing/unreadable or has no account email. -*/ + return PartialConfigSchema.parse(stripUndefined({ + public_key: getVar("PUBLIC_KEY", env), + secret_key: getVar("SECRET_KEY", env), + base_url: getVar("BASE_URL", env), + environment: opt("LANGFUSE_TRACING_ENVIRONMENT", env) ?? opt("CC_LANGFUSE_ENVIRONMENT", env), + user_id: opt("CC_LANGFUSE_USER_ID", env), + tags: parseTags(opt("CC_LANGFUSE_TAGS", env)), + metadata: parseMetadata(opt("CC_LANGFUSE_METADATA", env)), + max_chars: parseInteger(opt("CC_LANGFUSE_MAX_CHARS", env)), + debug: parseBoolean(opt("CC_LANGFUSE_DEBUG", env)), + fail_on_error: parseBoolean(opt("CC_LANGFUSE_FAIL_ON_ERROR", env)) + })); +} async function readClaudeUserEmail(claudeJsonFile) { - try { - const raw = JSON.parse(await fs.readFile(claudeJsonFile, "utf-8")); - const email$1 = ClaudeAccountSchema.parse(raw).oauthAccount?.emailAddress?.trim(); - return email$1 && email$1.length > 0 ? email$1 : void 0; - } catch { - return; - } -} -const getHomeDir = () => process.env.HOME ?? os$2.homedir(); + try { + const raw = JSON.parse(await fs.readFile(claudeJsonFile, "utf-8")); + const email3 = ClaudeAccountSchema.parse(raw).oauthAccount?.emailAddress?.trim(); + return email3 && email3.length > 0 ? email3 : undefined; + } catch { + return; + } +} +var getHomeDir = () => process.env.HOME ?? os.homedir(); async function getConfig(options) { - const home = options?.home ?? getHomeDir(); - const cwd = options?.cwd ?? process.cwd(); - const env = options?.env ?? process.env; - const [globalConfig$1, localConfig] = await Promise.all([readConfigFile(path.join(home, ".claude", "langfuse.json")), readConfigFile(path.join(cwd, ".claude", "langfuse.json"))]); - const envConfig = readEnvConfig(env); - const claudeUserId = globalConfig$1?.user_id ?? localConfig?.user_id ?? envConfig.user_id ? void 0 : await readClaudeUserEmail(path.join(home, ".claude.json")); - return ConfigSchema.parse({ - ...DEFAULTS, - ...claudeUserId ? { user_id: claudeUserId } : {}, - ...globalConfig$1, - ...localConfig, - ...envConfig - }); -} - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js -var VERSION; -var init_version = __esmMin((() => { - VERSION = "1.9.1"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js -/** -* Create a function to test an API version to see if it is compatible with the provided ownVersion. -* -* The returned function has the following semantics: -* - Exact match is always compatible -* - Major versions must match exactly -* - 1.x package cannot use global 2.x package -* - 2.x package cannot use global 1.x package -* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API -* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects -* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 -* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor -* - Patch and build tag differences are not considered at this time -* -* @param ownVersion version which should be checked against -*/ -function _makeCompatibilityCheck(ownVersion) { - const acceptedVersions = new Set([ownVersion]); - const rejectedVersions = /* @__PURE__ */ new Set(); - const myVersionMatch = ownVersion.match(re); - if (!myVersionMatch) return () => false; - const ownVersionParsed = { - major: +myVersionMatch[1], - minor: +myVersionMatch[2], - patch: +myVersionMatch[3], - prerelease: myVersionMatch[4] - }; - if (ownVersionParsed.prerelease != null) return function isExactmatch(globalVersion) { - return globalVersion === ownVersion; - }; - function _reject(v) { - rejectedVersions.add(v); - return false; - } - function _accept(v) { - acceptedVersions.add(v); - return true; - } - return function isCompatible$1(globalVersion) { - if (acceptedVersions.has(globalVersion)) return true; - if (rejectedVersions.has(globalVersion)) return false; - const globalVersionMatch = globalVersion.match(re); - if (!globalVersionMatch) return _reject(globalVersion); - const globalVersionParsed = { - major: +globalVersionMatch[1], - minor: +globalVersionMatch[2], - patch: +globalVersionMatch[3], - prerelease: globalVersionMatch[4] - }; - if (globalVersionParsed.prerelease != null) return _reject(globalVersion); - if (ownVersionParsed.major !== globalVersionParsed.major) return _reject(globalVersion); - if (ownVersionParsed.major === 0) { - if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) return _accept(globalVersion); - return _reject(globalVersion); - } - if (ownVersionParsed.minor <= globalVersionParsed.minor) return _accept(globalVersion); - return _reject(globalVersion); - }; -} -var re, isCompatible; -var init_semver = __esmMin((() => { - init_version(); - re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; - isCompatible = _makeCompatibilityCheck(VERSION); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js -function registerGlobal(type, instance, diag$2, allowOverride = false) { - var _a$3; - const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a$3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a$3 !== void 0 ? _a$3 : { version: VERSION }; - if (!allowOverride && api[type]) { - const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); - diag$2.error(err.stack || err.message); - return false; - } - if (api.version !== VERSION) { - const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`); - diag$2.error(err.stack || err.message); - return false; - } - api[type] = instance; - diag$2.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`); - return true; -} -function getGlobal(type) { - var _a$3, _b; - const globalVersion = (_a$3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a$3 === void 0 ? void 0 : _a$3.version; - if (!globalVersion || !isCompatible(globalVersion)) return; - return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; -} -function unregisterGlobal(type, diag$2) { - diag$2.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`); - const api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; - if (api) delete api[type]; -} -var major, GLOBAL_OPENTELEMETRY_API_KEY, _global; -var init_global_utils = __esmMin((() => { - init_version(); - init_semver(); - major = VERSION.split(".")[0]; - GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); - _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {}; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js -function logProxy(funcName, namespace, args) { - const logger = getGlobal("diag"); - if (!logger) return; - return logger[funcName](namespace, ...args); -} -var DiagComponentLogger; -var init_ComponentLogger = __esmMin((() => { - init_global_utils(); - DiagComponentLogger = class { - constructor(props) { - this._namespace = props.namespace || "DiagComponentLogger"; - } - debug(...args) { - return logProxy("debug", this._namespace, args); - } - error(...args) { - return logProxy("error", this._namespace, args); - } - info(...args) { - return logProxy("info", this._namespace, args); - } - warn(...args) { - return logProxy("warn", this._namespace, args); - } - verbose(...args) { - return logProxy("verbose", this._namespace, args); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js -var DiagLogLevel; -var init_types$1 = __esmMin((() => { - ; - (function(DiagLogLevel$1) { - /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ - DiagLogLevel$1[DiagLogLevel$1["NONE"] = 0] = "NONE"; - /** Identifies an error scenario */ - DiagLogLevel$1[DiagLogLevel$1["ERROR"] = 30] = "ERROR"; - /** Identifies a warning scenario */ - DiagLogLevel$1[DiagLogLevel$1["WARN"] = 50] = "WARN"; - /** General informational log message */ - DiagLogLevel$1[DiagLogLevel$1["INFO"] = 60] = "INFO"; - /** General debug log message */ - DiagLogLevel$1[DiagLogLevel$1["DEBUG"] = 70] = "DEBUG"; - /** - * Detailed trace level logging should only be used for development, should only be set - * in a development environment. - */ - DiagLogLevel$1[DiagLogLevel$1["VERBOSE"] = 80] = "VERBOSE"; - /** Used to set the logging level to include all logging */ - DiagLogLevel$1[DiagLogLevel$1["ALL"] = 9999] = "ALL"; - })(DiagLogLevel || (DiagLogLevel = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js -function createLogLevelDiagLogger(maxLevel, logger) { - if (maxLevel < DiagLogLevel.NONE) maxLevel = DiagLogLevel.NONE; - else if (maxLevel > DiagLogLevel.ALL) maxLevel = DiagLogLevel.ALL; - logger = logger || {}; - function _filterFunc(funcName, theLevel) { - const theFunc = logger[funcName]; - if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger); - return function() {}; - } - return { - error: _filterFunc("error", DiagLogLevel.ERROR), - warn: _filterFunc("warn", DiagLogLevel.WARN), - info: _filterFunc("info", DiagLogLevel.INFO), - debug: _filterFunc("debug", DiagLogLevel.DEBUG), - verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE) - }; -} -var init_logLevelLogger = __esmMin((() => { - init_types$1(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js -var API_NAME$4, DiagAPI; -var init_diag = __esmMin((() => { - init_ComponentLogger(); - init_logLevelLogger(); - init_types$1(); - init_global_utils(); - API_NAME$4 = "diag"; - DiagAPI = class DiagAPI { - /** Get the singleton instance of the DiagAPI API */ - static instance() { - if (!this._instance) this._instance = new DiagAPI(); - return this._instance; - } - /** - * Private internal constructor - * @private - */ - constructor() { - function _logProxy(funcName) { - return function(...args) { - const logger = getGlobal("diag"); - if (!logger) return; - return logger[funcName](...args); - }; - } - const self$1 = this; - const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => { - var _a$3, _b, _c; - if (logger === self$1) { - const err = /* @__PURE__ */ new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); - self$1.error((_a$3 = err.stack) !== null && _a$3 !== void 0 ? _a$3 : err.message); - return false; - } - if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel }; - const oldLogger = getGlobal("diag"); - const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger); - if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { - const stack = (_c = (/* @__PURE__ */ new Error()).stack) !== null && _c !== void 0 ? _c : ""; - oldLogger.warn(`Current logger will be overwritten from ${stack}`); - newLogger.warn(`Current logger will overwrite one already registered from ${stack}`); - } - return registerGlobal("diag", newLogger, self$1, true); - }; - self$1.setLogger = setLogger; - self$1.disable = () => { - unregisterGlobal(API_NAME$4, self$1); - }; - self$1.createComponentLogger = (options) => { - return new DiagComponentLogger(options); - }; - self$1.verbose = _logProxy("verbose"); - self$1.debug = _logProxy("debug"); - self$1.info = _logProxy("info"); - self$1.warn = _logProxy("warn"); - self$1.error = _logProxy("error"); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js -var BaggageImpl; -var init_baggage_impl = __esmMin((() => { - BaggageImpl = class BaggageImpl { - constructor(entries) { - this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map(); - } - getEntry(key) { - const entry = this._entries.get(key); - if (!entry) return; - return Object.assign({}, entry); - } - getAllEntries() { - return Array.from(this._entries.entries()); - } - setEntry(key, entry) { - const newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.set(key, entry); - return newBaggage; - } - removeEntry(key) { - const newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.delete(key); - return newBaggage; - } - removeEntries(...keys) { - const newBaggage = new BaggageImpl(this._entries); - for (const key of keys) newBaggage._entries.delete(key); - return newBaggage; - } - clear() { - return new BaggageImpl(); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js -var baggageEntryMetadataSymbol; -var init_symbol = __esmMin((() => { - baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata"); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/utils.js -/** -* Create a new Baggage with optional entries -* -* @param entries An array of baggage entries the new baggage should contain -*/ -function createBaggage(entries = {}) { - return new BaggageImpl(new Map(Object.entries(entries))); -} -/** -* Create a serializable BaggageEntryMetadata object from a string. -* -* @param str string metadata. Format is currently not defined by the spec and has no special meaning. -* -* @since 1.0.0 -*/ -function baggageEntryMetadataFromString(str) { - if (typeof str !== "string") { - diag$1.error(`Cannot create baggage metadata from unknown type: ${typeof str}`); - str = ""; - } - return { - __TYPE__: baggageEntryMetadataSymbol, - toString() { - return str; - } - }; -} -var diag$1; -var init_utils$2 = __esmMin((() => { - init_diag(); - init_baggage_impl(); - init_symbol(); - diag$1 = DiagAPI.instance(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js -/** -* Get a key to uniquely identify a context value -* -* @since 1.0.0 -*/ -function createContextKey(description) { - return Symbol.for(description); -} -var BaseContext, ROOT_CONTEXT; -var init_context$1 = __esmMin((() => { - BaseContext = class BaseContext { - /** - * Construct a new context which inherits values from an optional parent context. - * - * @param parentContext a context from which to inherit values - */ - constructor(parentContext) { - const self$1 = this; - self$1._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map(); - self$1.getValue = (key) => self$1._currentContext.get(key); - self$1.setValue = (key, value) => { - const context$1 = new BaseContext(self$1._currentContext); - context$1._currentContext.set(key, value); - return context$1; - }; - self$1.deleteValue = (key) => { - const context$1 = new BaseContext(self$1._currentContext); - context$1._currentContext.delete(key); - return context$1; - }; - } - }; - ROOT_CONTEXT = new BaseContext(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js -var consoleMap, _originalConsoleMethods, DiagConsoleLogger; -var init_consoleLogger = __esmMin((() => { - consoleMap = [ - { - n: "error", - c: "error" - }, - { - n: "warn", - c: "warn" - }, - { - n: "info", - c: "info" - }, - { - n: "debug", - c: "debug" - }, - { - n: "verbose", - c: "trace" - } - ]; - _originalConsoleMethods = {}; - if (typeof console !== "undefined") { - for (const key of [ - "error", - "warn", - "info", - "debug", - "trace", - "log" - ]) if (typeof console[key] === "function") _originalConsoleMethods[key] = console[key]; - } - DiagConsoleLogger = class { - constructor() { - function _consoleFunc(funcName) { - return function(...args) { - let theFunc = _originalConsoleMethods[funcName]; - if (typeof theFunc !== "function") theFunc = _originalConsoleMethods["log"]; - if (typeof theFunc !== "function" && console) { - theFunc = console[funcName]; - if (typeof theFunc !== "function") theFunc = console.log; - } - if (typeof theFunc === "function") return theFunc.apply(console, args); - }; - } - for (let i = 0; i < consoleMap.length; i++) this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js -/** -* Create a no-op Meter -* -* @since 1.3.0 -*/ -function createNoopMeter() { - return NOOP_METER; -} -var NoopMeter, NoopMetric, NoopCounterMetric, NoopUpDownCounterMetric, NoopGaugeMetric, NoopHistogramMetric, NoopObservableMetric, NoopObservableCounterMetric, NoopObservableGaugeMetric, NoopObservableUpDownCounterMetric, NOOP_METER, NOOP_COUNTER_METRIC, NOOP_GAUGE_METRIC, NOOP_HISTOGRAM_METRIC, NOOP_UP_DOWN_COUNTER_METRIC, NOOP_OBSERVABLE_COUNTER_METRIC, NOOP_OBSERVABLE_GAUGE_METRIC, NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; -var init_NoopMeter = __esmMin((() => { - NoopMeter = class { - constructor() {} - /** - * @see {@link Meter.createGauge} - */ - createGauge(_name, _options) { - return NOOP_GAUGE_METRIC; - } - /** - * @see {@link Meter.createHistogram} - */ - createHistogram(_name, _options) { - return NOOP_HISTOGRAM_METRIC; - } - /** - * @see {@link Meter.createCounter} - */ - createCounter(_name, _options) { - return NOOP_COUNTER_METRIC; - } - /** - * @see {@link Meter.createUpDownCounter} - */ - createUpDownCounter(_name, _options) { - return NOOP_UP_DOWN_COUNTER_METRIC; - } - /** - * @see {@link Meter.createObservableGauge} - */ - createObservableGauge(_name, _options) { - return NOOP_OBSERVABLE_GAUGE_METRIC; - } - /** - * @see {@link Meter.createObservableCounter} - */ - createObservableCounter(_name, _options) { - return NOOP_OBSERVABLE_COUNTER_METRIC; - } - /** - * @see {@link Meter.createObservableUpDownCounter} - */ - createObservableUpDownCounter(_name, _options) { - return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; - } - /** - * @see {@link Meter.addBatchObservableCallback} - */ - addBatchObservableCallback(_callback, _observables) {} - /** - * @see {@link Meter.removeBatchObservableCallback} - */ - removeBatchObservableCallback(_callback) {} - }; - NoopMetric = class {}; - NoopCounterMetric = class extends NoopMetric { - add(_value, _attributes) {} - }; - NoopUpDownCounterMetric = class extends NoopMetric { - add(_value, _attributes) {} - }; - NoopGaugeMetric = class extends NoopMetric { - record(_value, _attributes) {} - }; - NoopHistogramMetric = class extends NoopMetric { - record(_value, _attributes) {} - }; - NoopObservableMetric = class { - addCallback(_callback) {} - removeCallback(_callback) {} - }; - NoopObservableCounterMetric = class extends NoopObservableMetric {}; - NoopObservableGaugeMetric = class extends NoopObservableMetric {}; - NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {}; - NOOP_METER = new NoopMeter(); - NOOP_COUNTER_METRIC = new NoopCounterMetric(); - NOOP_GAUGE_METRIC = new NoopGaugeMetric(); - NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric(); - NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric(); - NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric(); - NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric(); - NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/Metric.js -var ValueType; -var init_Metric = __esmMin((() => { - ; - (function(ValueType$1) { - ValueType$1[ValueType$1["INT"] = 0] = "INT"; - ValueType$1[ValueType$1["DOUBLE"] = 1] = "DOUBLE"; - })(ValueType || (ValueType = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js -var defaultTextMapGetter, defaultTextMapSetter; -var init_TextMapPropagator = __esmMin((() => { - defaultTextMapGetter = { - get(carrier, key) { - if (carrier == null) return; - return carrier[key]; - }, - keys(carrier) { - if (carrier == null) return []; - return Object.keys(carrier); - } - }; - defaultTextMapSetter = { set(carrier, key, value) { - if (carrier == null) return; - carrier[key] = value; - } }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js -var NoopContextManager; -var init_NoopContextManager = __esmMin((() => { - init_context$1(); - NoopContextManager = class { - active() { - return ROOT_CONTEXT; - } - with(_context, fn, thisArg, ...args) { - return fn.call(thisArg, ...args); - } - bind(_context, target) { - return target; - } - enable() { - return this; - } - disable() { - return this; - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js -var API_NAME$3, NOOP_CONTEXT_MANAGER, ContextAPI; -var init_context = __esmMin((() => { - init_NoopContextManager(); - init_global_utils(); - init_diag(); - API_NAME$3 = "context"; - NOOP_CONTEXT_MANAGER = new NoopContextManager(); - ContextAPI = class ContextAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() {} - /** Get the singleton instance of the Context API */ - static getInstance() { - if (!this._instance) this._instance = new ContextAPI(); - return this._instance; - } - /** - * Set the current context manager. - * - * @returns true if the context manager was successfully registered, else false - */ - setGlobalContextManager(contextManager) { - return registerGlobal(API_NAME$3, contextManager, DiagAPI.instance()); - } - /** - * Get the currently active context - */ - active() { - return this._getContextManager().active(); - } - /** - * Execute a function with an active context - * - * @param context context to be active during function execution - * @param fn function to execute in a context - * @param thisArg optional receiver to be used for calling fn - * @param args optional arguments forwarded to fn - */ - with(context$1, fn, thisArg, ...args) { - return this._getContextManager().with(context$1, fn, thisArg, ...args); - } - /** - * Bind a context to a target function or event emitter - * - * @param context context to bind to the event emitter or function. Defaults to the currently active context - * @param target function or event emitter to bind - */ - bind(context$1, target) { - return this._getContextManager().bind(context$1, target); - } - _getContextManager() { - return getGlobal(API_NAME$3) || NOOP_CONTEXT_MANAGER; - } - /** Disable and remove the global context manager */ - disable() { - this._getContextManager().disable(); - unregisterGlobal(API_NAME$3, DiagAPI.instance()); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js -var TraceFlags; -var init_trace_flags = __esmMin((() => { - ; - (function(TraceFlags$1) { - /** Represents no flag set. */ - TraceFlags$1[TraceFlags$1["NONE"] = 0] = "NONE"; - /** Bit to represent whether trace is sampled in trace flags. */ - TraceFlags$1[TraceFlags$1["SAMPLED"] = 1] = "SAMPLED"; - })(TraceFlags || (TraceFlags = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js -var INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT; -var init_invalid_span_constants = __esmMin((() => { - init_trace_flags(); - INVALID_SPANID = "0000000000000000"; - INVALID_TRACEID = "00000000000000000000000000000000"; - INVALID_SPAN_CONTEXT = { - traceId: INVALID_TRACEID, - spanId: INVALID_SPANID, - traceFlags: TraceFlags.NONE - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js -var NonRecordingSpan; -var init_NonRecordingSpan = __esmMin((() => { - init_invalid_span_constants(); - NonRecordingSpan = class { - constructor(spanContext = INVALID_SPAN_CONTEXT) { - this._spanContext = spanContext; - } - spanContext() { - return this._spanContext; - } - setAttribute(_key, _value) { - return this; - } - setAttributes(_attributes) { - return this; - } - addEvent(_name, _attributes) { - return this; - } - addLink(_link) { - return this; - } - addLinks(_links) { - return this; - } - setStatus(_status) { - return this; - } - updateName(_name) { - return this; - } - end(_endTime) {} - isRecording() { - return false; - } - recordException(_exception, _time) {} - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js -/** -* Return the span if one exists -* -* @param context context to get span from -*/ -function getSpan(context$1) { - return context$1.getValue(SPAN_KEY) || void 0; -} -/** -* Gets the span from the current context, if one exists. -*/ -function getActiveSpan() { - return getSpan(ContextAPI.getInstance().active()); -} -/** -* Set the span on a context -* -* @param context context to use as parent -* @param span span to set active -*/ -function setSpan(context$1, span) { - return context$1.setValue(SPAN_KEY, span); -} -/** -* Remove current span stored in the context -* -* @param context context to delete span from -*/ -function deleteSpan(context$1) { - return context$1.deleteValue(SPAN_KEY); -} -/** -* Wrap span context in a NoopSpan and set as span in a new -* context -* -* @param context context to set active span on -* @param spanContext span context to be wrapped -*/ -function setSpanContext(context$1, spanContext) { - return setSpan(context$1, new NonRecordingSpan(spanContext)); -} -/** -* Get the span context of the span if it exists. -* -* @param context context to get values from -*/ -function getSpanContext(context$1) { - var _a$3; - return (_a$3 = getSpan(context$1)) === null || _a$3 === void 0 ? void 0 : _a$3.spanContext(); -} -var SPAN_KEY; -var init_context_utils = __esmMin((() => { - init_context$1(); - init_NonRecordingSpan(); - init_context(); - SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN"); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js -function isValidHex(id, length) { - if (typeof id !== "string" || id.length !== length) return false; - let r = 0; - for (let i = 0; i < id.length; i += 4) r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0); - return r === length; -} -/** -* @since 1.0.0 -*/ -function isValidTraceId(traceId) { - return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID; -} -/** -* @since 1.0.0 -*/ -function isValidSpanId(spanId) { - return isValidHex(spanId, 16) && spanId !== INVALID_SPANID; -} -/** -* Returns true if this {@link SpanContext} is valid. -* @return true if this {@link SpanContext} is valid. -* -* @since 1.0.0 -*/ -function isSpanContextValid(spanContext) { - return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId); -} -/** -* Wrap the given {@link SpanContext} in a new non-recording {@link Span} -* -* @param spanContext span context to be wrapped -* @returns a new non-recording {@link Span} with the provided context -*/ -function wrapSpanContext(spanContext) { - return new NonRecordingSpan(spanContext); -} -var isHex; -var init_spancontext_utils = __esmMin((() => { - init_invalid_span_constants(); - init_NonRecordingSpan(); - isHex = new Uint8Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1 - ]); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js -function isSpanContext(spanContext) { - return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number"; -} -var contextApi, NoopTracer; -var init_NoopTracer = __esmMin((() => { - init_context(); - init_context_utils(); - init_NonRecordingSpan(); - init_spancontext_utils(); - contextApi = ContextAPI.getInstance(); - NoopTracer = class { - startSpan(name, options, context$1 = contextApi.active()) { - if (Boolean(options === null || options === void 0 ? void 0 : options.root)) return new NonRecordingSpan(); - const parentFromContext = context$1 && getSpanContext(context$1); - if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext); - else return new NonRecordingSpan(); - } - startActiveSpan(name, arg2, arg3, arg4) { - let opts; - let ctx; - let fn; - if (arguments.length < 2) return; - else if (arguments.length === 2) fn = arg2; - else if (arguments.length === 3) { - opts = arg2; - fn = arg3; - } else { - opts = arg2; - ctx = arg3; - fn = arg4; - } - const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active(); - const span = this.startSpan(name, opts, parentContext); - const contextWithSpanSet = setSpan(parentContext, span); - return contextApi.with(contextWithSpanSet, fn, void 0, span); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js -var NOOP_TRACER, ProxyTracer; -var init_ProxyTracer = __esmMin((() => { - init_NoopTracer(); - NOOP_TRACER = new NoopTracer(); - ProxyTracer = class { - constructor(provider, name, version$1, options) { - this._provider = provider; - this.name = name; - this.version = version$1; - this.options = options; - } - startSpan(name, options, context$1) { - return this._getTracer().startSpan(name, options, context$1); - } - startActiveSpan(_name, _options, _context, _fn) { - const tracer = this._getTracer(); - return Reflect.apply(tracer.startActiveSpan, tracer, arguments); - } - /** - * Try to get a tracer from the proxy tracer provider. - * If the proxy tracer provider has no delegate, return a noop tracer. - */ - _getTracer() { - if (this._delegate) return this._delegate; - const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); - if (!tracer) return NOOP_TRACER; - this._delegate = tracer; - return this._delegate; - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js -var NoopTracerProvider; -var init_NoopTracerProvider = __esmMin((() => { - init_NoopTracer(); - NoopTracerProvider = class { - getTracer(_name, _version, _options) { - return new NoopTracer(); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js -var NOOP_TRACER_PROVIDER, ProxyTracerProvider; -var init_ProxyTracerProvider = __esmMin((() => { - init_ProxyTracer(); - init_NoopTracerProvider(); - NOOP_TRACER_PROVIDER = new NoopTracerProvider(); - ProxyTracerProvider = class { - /** - * Get a {@link ProxyTracer} - */ - getTracer(name, version$1, options) { - var _a$3; - return (_a$3 = this.getDelegateTracer(name, version$1, options)) !== null && _a$3 !== void 0 ? _a$3 : new ProxyTracer(this, name, version$1, options); - } - getDelegate() { - var _a$3; - return (_a$3 = this._delegate) !== null && _a$3 !== void 0 ? _a$3 : NOOP_TRACER_PROVIDER; - } - /** - * Set the delegate tracer provider - */ - setDelegate(delegate) { - this._delegate = delegate; - } - getDelegateTracer(name, version$1, options) { - var _a$3; - return (_a$3 = this._delegate) === null || _a$3 === void 0 ? void 0 : _a$3.getTracer(name, version$1, options); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js -var SamplingDecision; -var init_SamplingResult = __esmMin((() => { - ; - (function(SamplingDecision$1) { - /** - * `Span.isRecording() === false`, span will not be recorded and all events - * and attributes will be dropped. - */ - SamplingDecision$1[SamplingDecision$1["NOT_RECORD"] = 0] = "NOT_RECORD"; - /** - * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} - * MUST NOT be set. - */ - SamplingDecision$1[SamplingDecision$1["RECORD"] = 1] = "RECORD"; - /** - * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} - * MUST be set. - */ - SamplingDecision$1[SamplingDecision$1["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; - })(SamplingDecision || (SamplingDecision = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js -var SpanKind; -var init_span_kind = __esmMin((() => { - ; - (function(SpanKind$1) { - /** Default value. Indicates that the span is used internally. */ - SpanKind$1[SpanKind$1["INTERNAL"] = 0] = "INTERNAL"; - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SpanKind$1[SpanKind$1["SERVER"] = 1] = "SERVER"; - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - SpanKind$1[SpanKind$1["CLIENT"] = 2] = "CLIENT"; - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind$1[SpanKind$1["PRODUCER"] = 3] = "PRODUCER"; - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind$1[SpanKind$1["CONSUMER"] = 4] = "CONSUMER"; - })(SpanKind || (SpanKind = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js -var SpanStatusCode; -var init_status = __esmMin((() => { - ; - (function(SpanStatusCode$1) { - /** - * The default status. - */ - SpanStatusCode$1[SpanStatusCode$1["UNSET"] = 0] = "UNSET"; - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - SpanStatusCode$1[SpanStatusCode$1["OK"] = 1] = "OK"; - /** - * The operation contains an error. - */ - SpanStatusCode$1[SpanStatusCode$1["ERROR"] = 2] = "ERROR"; - })(SpanStatusCode || (SpanStatusCode = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js -/** -* Key is opaque string up to 256 characters printable. It MUST begin with a -* lowercase letter, and can only contain lowercase letters a-z, digits 0-9, -* underscores _, dashes -, asterisks *, and forward slashes /. -* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the -* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. -* see https://www.w3.org/TR/trace-context/#key -*/ -function validateKey(key) { - return VALID_KEY_REGEX.test(key); -} -/** -* Value is opaque string up to 256 characters printable ASCII RFC0020 -* characters (i.e., the range 0x20 to 0x7E) except comma , and =. -*/ -function validateValue(value) { - return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); -} -var VALID_KEY_CHAR_RANGE, VALID_KEY, VALID_VENDOR_KEY, VALID_KEY_REGEX, VALID_VALUE_BASE_REGEX, INVALID_VALUE_COMMA_EQUAL_REGEX; -var init_tracestate_validators = __esmMin((() => { - VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; - VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; - VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; - VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); - VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; - INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js -var MAX_TRACE_STATE_ITEMS, MAX_TRACE_STATE_LEN, LIST_MEMBERS_SEPARATOR, LIST_MEMBER_KEY_VALUE_SPLITTER, TraceStateImpl; -var init_tracestate_impl = __esmMin((() => { - init_tracestate_validators(); - MAX_TRACE_STATE_ITEMS = 32; - MAX_TRACE_STATE_LEN = 512; - LIST_MEMBERS_SEPARATOR = ","; - LIST_MEMBER_KEY_VALUE_SPLITTER = "="; - TraceStateImpl = class TraceStateImpl { - constructor(rawTraceState) { - this._internalState = /* @__PURE__ */ new Map(); - if (rawTraceState) this._parse(rawTraceState); - } - set(key, value) { - const traceState = this._clone(); - if (traceState._internalState.has(key)) traceState._internalState.delete(key); - traceState._internalState.set(key, value); - return traceState; - } - unset(key) { - const traceState = this._clone(); - traceState._internalState.delete(key); - return traceState; - } - get(key) { - return this._internalState.get(key); - } - serialize() { - return Array.from(this._internalState.keys()).reduceRight((agg, key) => { - agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); - return agg; - }, []).join(LIST_MEMBERS_SEPARATOR); - } - _parse(rawTraceState) { - if (rawTraceState.length > MAX_TRACE_STATE_LEN) return; - this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reduceRight((agg, part) => { - const listMember = part.trim(); - const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); - if (i !== -1) { - const key = listMember.slice(0, i); - const value = listMember.slice(i + 1, part.length); - if (validateKey(key) && validateValue(value)) agg.set(key, value); - } - return agg; - }, /* @__PURE__ */ new Map()); - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); - } - _keys() { - return Array.from(this._internalState.keys()).reverse(); - } - _clone() { - const traceState = new TraceStateImpl(); - traceState._internalState = new Map(this._internalState); - return traceState; - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js -/** -* @since 1.1.0 -*/ -function createTraceState(rawTraceState) { - return new TraceStateImpl(rawTraceState); -} -var init_utils$1 = __esmMin((() => { - init_tracestate_impl(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js -var context; -var init_context_api = __esmMin((() => { - init_context(); - context = ContextAPI.getInstance(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag-api.js -var diag; -var init_diag_api = __esmMin((() => { - init_diag(); - diag = DiagAPI.instance(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js -var NoopMeterProvider, NOOP_METER_PROVIDER; -var init_NoopMeterProvider = __esmMin((() => { - init_NoopMeter(); - NoopMeterProvider = class { - getMeter(_name, _version, _options) { - return NOOP_METER; - } - }; - NOOP_METER_PROVIDER = new NoopMeterProvider(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/metrics.js -var API_NAME$2, MetricsAPI; -var init_metrics = __esmMin((() => { - init_NoopMeterProvider(); - init_global_utils(); - init_diag(); - API_NAME$2 = "metrics"; - MetricsAPI = class MetricsAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() {} - /** Get the singleton instance of the Metrics API */ - static getInstance() { - if (!this._instance) this._instance = new MetricsAPI(); - return this._instance; - } - /** - * Set the current global meter provider. - * Returns true if the meter provider was successfully registered, else false. - */ - setGlobalMeterProvider(provider) { - return registerGlobal(API_NAME$2, provider, DiagAPI.instance()); - } - /** - * Returns the global meter provider. - */ - getMeterProvider() { - return getGlobal(API_NAME$2) || NOOP_METER_PROVIDER; - } - /** - * Returns a meter from the global meter provider. - */ - getMeter(name, version$1, options) { - return this.getMeterProvider().getMeter(name, version$1, options); - } - /** Remove the global meter provider */ - disable() { - unregisterGlobal(API_NAME$2, DiagAPI.instance()); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics-api.js -var metrics; -var init_metrics_api = __esmMin((() => { - init_metrics(); - metrics = MetricsAPI.getInstance(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js -var NoopTextMapPropagator; -var init_NoopTextMapPropagator = __esmMin((() => { - NoopTextMapPropagator = class { - /** Noop inject function does nothing */ - inject(_context, _carrier) {} - /** Noop extract function does nothing and returns the input context */ - extract(context$1, _carrier) { - return context$1; - } - fields() { - return []; - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js -/** -* Retrieve the current baggage from the given context -* -* @param {Context} Context that manage all context values -* @returns {Baggage} Extracted baggage from the context -*/ -function getBaggage(context$1) { - return context$1.getValue(BAGGAGE_KEY) || void 0; -} -/** -* Retrieve the current baggage from the active/current context -* -* @returns {Baggage} Extracted baggage from the context -*/ -function getActiveBaggage() { - return getBaggage(ContextAPI.getInstance().active()); -} -/** -* Store a baggage in the given context -* -* @param {Context} Context that manage all context values -* @param {Baggage} baggage that will be set in the actual context -*/ -function setBaggage(context$1, baggage) { - return context$1.setValue(BAGGAGE_KEY, baggage); -} -/** -* Delete the baggage stored in the given context -* -* @param {Context} Context that manage all context values -*/ -function deleteBaggage(context$1) { - return context$1.deleteValue(BAGGAGE_KEY); -} -var BAGGAGE_KEY; -var init_context_helpers = __esmMin((() => { - init_context(); - init_context$1(); - BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key"); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/propagation.js -var API_NAME$1, NOOP_TEXT_MAP_PROPAGATOR, PropagationAPI; -var init_propagation = __esmMin((() => { - init_global_utils(); - init_NoopTextMapPropagator(); - init_TextMapPropagator(); - init_context_helpers(); - init_utils$2(); - init_diag(); - API_NAME$1 = "propagation"; - NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); - PropagationAPI = class PropagationAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this.createBaggage = createBaggage; - this.getBaggage = getBaggage; - this.getActiveBaggage = getActiveBaggage; - this.setBaggage = setBaggage; - this.deleteBaggage = deleteBaggage; - } - /** Get the singleton instance of the Propagator API */ - static getInstance() { - if (!this._instance) this._instance = new PropagationAPI(); - return this._instance; - } - /** - * Set the current propagator. - * - * @returns true if the propagator was successfully registered, else false - */ - setGlobalPropagator(propagator) { - return registerGlobal(API_NAME$1, propagator, DiagAPI.instance()); - } - /** - * Inject context into a carrier to be propagated inter-process - * - * @param context Context carrying tracing data to inject - * @param carrier carrier to inject context into - * @param setter Function used to set values on the carrier - */ - inject(context$1, carrier, setter = defaultTextMapSetter) { - return this._getGlobalPropagator().inject(context$1, carrier, setter); - } - /** - * Extract context from a carrier - * - * @param context Context which the newly created context will inherit from - * @param carrier Carrier to extract context from - * @param getter Function used to extract keys from a carrier - */ - extract(context$1, carrier, getter = defaultTextMapGetter) { - return this._getGlobalPropagator().extract(context$1, carrier, getter); - } - /** - * Return a list of all fields which may be used by the propagator. - */ - fields() { - return this._getGlobalPropagator().fields(); - } - /** Remove the global propagator */ - disable() { - unregisterGlobal(API_NAME$1, DiagAPI.instance()); - } - _getGlobalPropagator() { - return getGlobal(API_NAME$1) || NOOP_TEXT_MAP_PROPAGATOR; - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation-api.js -var propagation; -var init_propagation_api = __esmMin((() => { - init_propagation(); - propagation = PropagationAPI.getInstance(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js -var API_NAME, TraceAPI; -var init_trace$1 = __esmMin((() => { - init_global_utils(); - init_ProxyTracerProvider(); - init_spancontext_utils(); - init_context_utils(); - init_diag(); - API_NAME = "trace"; - TraceAPI = class TraceAPI { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - constructor() { - this._proxyTracerProvider = new ProxyTracerProvider(); - this.wrapSpanContext = wrapSpanContext; - this.isSpanContextValid = isSpanContextValid; - this.deleteSpan = deleteSpan; - this.getSpan = getSpan; - this.getActiveSpan = getActiveSpan; - this.getSpanContext = getSpanContext; - this.setSpan = setSpan; - this.setSpanContext = setSpanContext; - } - /** Get the singleton instance of the Trace API */ - static getInstance() { - if (!this._instance) this._instance = new TraceAPI(); - return this._instance; - } - /** - * Set the current global tracer. - * - * @returns true if the tracer provider was successfully registered, else false - */ - setGlobalTracerProvider(provider) { - const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance()); - if (success) this._proxyTracerProvider.setDelegate(provider); - return success; - } - /** - * Returns the global tracer provider. - */ - getTracerProvider() { - return getGlobal(API_NAME) || this._proxyTracerProvider; - } - /** - * Returns a tracer from the global tracer provider. - */ - getTracer(name, version$1) { - return this.getTracerProvider().getTracer(name, version$1); - } - /** Remove the global tracer provider */ - disable() { - unregisterGlobal(API_NAME, DiagAPI.instance()); - this._proxyTracerProvider = new ProxyTracerProvider(); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js -var trace; -var init_trace_api = __esmMin((() => { - init_trace$1(); - trace = TraceAPI.getInstance(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/index.js -var esm_exports$2 = /* @__PURE__ */ __exportAll({ - DiagConsoleLogger: () => DiagConsoleLogger, - DiagLogLevel: () => DiagLogLevel, - INVALID_SPANID: () => INVALID_SPANID, - INVALID_SPAN_CONTEXT: () => INVALID_SPAN_CONTEXT, - INVALID_TRACEID: () => INVALID_TRACEID, - ProxyTracer: () => ProxyTracer, - ProxyTracerProvider: () => ProxyTracerProvider, - ROOT_CONTEXT: () => ROOT_CONTEXT, - SamplingDecision: () => SamplingDecision, - SpanKind: () => SpanKind, - SpanStatusCode: () => SpanStatusCode, - TraceFlags: () => TraceFlags, - ValueType: () => ValueType, - baggageEntryMetadataFromString: () => baggageEntryMetadataFromString, - context: () => context, - createContextKey: () => createContextKey, - createNoopMeter: () => createNoopMeter, - createTraceState: () => createTraceState, - default: () => esm_default, - defaultTextMapGetter: () => defaultTextMapGetter, - defaultTextMapSetter: () => defaultTextMapSetter, - diag: () => diag, - isSpanContextValid: () => isSpanContextValid, - isValidSpanId: () => isValidSpanId, - isValidTraceId: () => isValidTraceId, - metrics: () => metrics, - propagation: () => propagation, - trace: () => trace -}); -var esm_default; -var init_esm$2 = __esmMin((() => { - init_utils$2(); - init_context$1(); - init_consoleLogger(); - init_types$1(); - init_NoopMeter(); - init_Metric(); - init_TextMapPropagator(); - init_ProxyTracer(); - init_ProxyTracerProvider(); - init_SamplingResult(); - init_span_kind(); - init_status(); - init_trace_flags(); - init_utils$1(); - init_spancontext_utils(); - init_invalid_span_constants(); - init_context_api(); - init_diag_api(); - init_metrics_api(); - init_propagation_api(); - init_trace_api(); - esm_default = { - context, - diag, - metrics, - propagation, - trace - }; -})); - -//#endregion -//#region node_modules/.pnpm/@langfuse+core@5.4.1_@opentelemetry+api@1.9.1/node_modules/@langfuse/core/dist/index.mjs -init_esm$2(); -var __defProp = Object.defineProperty; -var __export = (target, all) => { - for (var name in all) __defProp(target, name, { - get: all[name], - enumerable: true - }); + const home = options?.home ?? getHomeDir(); + const cwd = options?.cwd ?? process.cwd(); + const env = options?.env ?? process.env; + const [globalConfig2, localConfig] = await Promise.all([ + readConfigFile(path.join(home, ".claude", "langfuse.json")), + readConfigFile(path.join(cwd, ".claude", "langfuse.json")) + ]); + const envConfig = readEnvConfig(env); + const explicitUserId = globalConfig2?.user_id ?? localConfig?.user_id ?? envConfig.user_id; + const claudeUserId = explicitUserId ? undefined : await readClaudeUserEmail(path.join(home, ".claude.json")); + return ConfigSchema.parse({ + ...DEFAULTS, + ...claudeUserId ? { user_id: claudeUserId } : {}, + ...globalConfig2, + ...localConfig, + ...envConfig + }); +} + +// node_modules/@langfuse/core/dist/index.mjs +var import_api = __toESM(require_src(), 1); +var __defProp2 = Object.defineProperty; +var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); }; function getEnv(key) { - if (typeof process !== "undefined" && process.env[key]) return process.env[key]; - else if (typeof globalThis !== "undefined") return globalThis[key]; + if (typeof process !== "undefined" && process.env[key]) { + return process.env[key]; + } else if (typeof globalThis !== "undefined") { + return globalThis[key]; + } + return; } -function base64ToBytes(base64$1) { - const binString = atob(base64$1); - return Uint8Array.from(binString, (m) => m.codePointAt(0)); +function base64ToBytes(base643) { + const binString = atob(base643); + return Uint8Array.from(binString, (m) => m.codePointAt(0)); } function bytesToBase64(bytes) { - const binString = Array.from(bytes, (byte) => String.fromCharCode(byte)).join(""); - return btoa(binString); + const binString = Array.from(bytes, (byte) => String.fromCharCode(byte)).join(""); + return btoa(binString); } function base64Encode(input) { - if (typeof Buffer !== "undefined") return Buffer.from(input, "utf8").toString("base64"); - return bytesToBase64(new TextEncoder().encode(input)); + if (typeof Buffer !== "undefined") { + return Buffer.from(input, "utf8").toString("base64"); + } + const bytes = new TextEncoder().encode(input); + return bytesToBase64(bytes); } var LogLevel = /* @__PURE__ */ ((LogLevel2) => { - LogLevel2[LogLevel2["NONE"] = 4] = "NONE"; - LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR"; - LogLevel2[LogLevel2["WARN"] = 2] = "WARN"; - LogLevel2[LogLevel2["INFO"] = 1] = "INFO"; - LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG"; - return LogLevel2; + LogLevel2[LogLevel2["NONE"] = 4] = "NONE"; + LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR"; + LogLevel2[LogLevel2["WARN"] = 2] = "WARN"; + LogLevel2[LogLevel2["INFO"] = 1] = "INFO"; + LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG"; + return LogLevel2; })(LogLevel || {}); function parseLogLevelFromEnv() { - var _a2; - if (typeof process === "object" && "env" in process) { - if (((_a2 = getEnv("LANGFUSE_DEBUG")) == null ? void 0 : _a2.toLowerCase()) === "true") return 0; - const envValue = getEnv("LANGFUSE_LOG_LEVEL"); - switch ((envValue != null ? envValue : "").toUpperCase()) { - case "NONE": return 4; - case "ERROR": return 3; - case "WARN": return 2; - case "INFO": return 1; - case "DEBUG": return 0; - default: return; - } - } + var _a22; + if (typeof process === "object" && "env" in process) { + if (((_a22 = getEnv("LANGFUSE_DEBUG")) == null ? undefined : _a22.toLowerCase()) === "true") + return 0; + const envValue = getEnv("LANGFUSE_LOG_LEVEL"); + const value = (envValue != null ? envValue : "").toUpperCase(); + switch (value) { + case "NONE": + return 4; + case "ERROR": + return 3; + case "WARN": + return 2; + case "INFO": + return 1; + case "DEBUG": + return 0; + default: + return; + } + } + return; } var Logger = class { - /** - * Creates a new Logger instance. - * - * @param config - Configuration options for the logger - */ - constructor(config$1 = { level: 1 }) { - this.config = { - enableTimestamp: true, - ...config$1 - }; - } - /** - * Determines if a message should be logged based on the current log level. - * - * @param level - The log level to check - * @returns True if the message should be logged, false otherwise - */ - shouldLog(level) { - return level >= this.config.level; - } - /** - * Formats a log message with timestamp, prefix, and log level. - * - * @param level - The log level string - * @param message - The message to format - * @returns The formatted message string - */ - formatMessage(level, message) { - return [ - this.config.enableTimestamp ? (/* @__PURE__ */ new Date()).toISOString() : "", - this.config.prefix || "[Langfuse SDK]", - `[${level}]`, - message - ].filter(Boolean).join(" "); - } - /** - * Logs an error message. - * - * @param message - The error message to log - * @param args - Additional arguments to pass to console.error - */ - error(message, ...args) { - if (this.shouldLog(3)) console.error(this.formatMessage("ERROR", message), ...args); - } - /** - * Logs a warning message. - * - * @param message - The warning message to log - * @param args - Additional arguments to pass to console.warn - */ - warn(message, ...args) { - if (this.shouldLog(2)) console.warn(this.formatMessage("WARN", message), ...args); - } - /** - * Logs an informational message. - * - * @param message - The info message to log - * @param args - Additional arguments to pass to console.info - */ - info(message, ...args) { - if (this.shouldLog(1)) console.info(this.formatMessage("INFO", message), ...args); - } - /** - * Logs a debug message. - * - * @param message - The debug message to log - * @param args - Additional arguments to pass to console.debug - */ - debug(message, ...args) { - if (this.shouldLog(0)) console.debug(this.formatMessage("DEBUG", message), ...args); - } - /** - * Sets the minimum log level. - * - * @param level - The new log level - */ - setLevel(level) { - this.config.level = level; - } - /** - * Gets the current log level. - * - * @returns The current log level - */ - getLevel() { - return this.config.level; - } - /** - * Checks if a given log level is enabled. - * Use this to guard expensive operations (like JSON.stringify) before debug logging. - * - * @param level - The log level to check - * @returns True if the level is enabled, false otherwise - * - * @example - * ```typescript - * if (logger.isLevelEnabled(LogLevel.DEBUG)) { - * logger.debug('Expensive data:', JSON.stringify(largeObject)); - * } - * ``` - */ - isLevelEnabled(level) { - return this.shouldLog(level); - } + constructor(config2 = { level: 1 }) { + this.config = { + enableTimestamp: true, + ...config2 + }; + } + shouldLog(level) { + return level >= this.config.level; + } + formatMessage(level, message) { + const timestamp = this.config.enableTimestamp ? (/* @__PURE__ */ new Date()).toISOString() : ""; + const prefix = this.config.prefix || "[Langfuse SDK]"; + const parts = [timestamp, prefix, `[${level}]`, message].filter(Boolean); + return parts.join(" "); + } + error(message, ...args) { + if (this.shouldLog(3)) { + console.error(this.formatMessage("ERROR", message), ...args); + } + } + warn(message, ...args) { + if (this.shouldLog(2)) { + console.warn(this.formatMessage("WARN", message), ...args); + } + } + info(message, ...args) { + if (this.shouldLog(1)) { + console.info(this.formatMessage("INFO", message), ...args); + } + } + debug(message, ...args) { + if (this.shouldLog(0)) { + console.debug(this.formatMessage("DEBUG", message), ...args); + } + } + setLevel(level) { + this.config.level = level; + } + getLevel() { + return this.config.level; + } + isLevelEnabled(level) { + return this.shouldLog(level); + } }; -var _a; -var _LoggerSingleton = class _LoggerSingleton$1 { - /** - * Gets the singleton logger instance, creating it if it doesn't exist. - * - * @returns The singleton logger instance - */ - static getInstance() { - if (!_LoggerSingleton$1.instance) _LoggerSingleton$1.instance = new Logger(_LoggerSingleton$1.defaultConfig); - return _LoggerSingleton$1.instance; - } - /** - * Configures the global logger with new settings. - * This will replace the existing logger instance. - * - * @param config - The new logger configuration - */ - static configure(config$1) { - _LoggerSingleton$1.defaultConfig = config$1; - _LoggerSingleton$1.instance = new Logger(config$1); - } - /** - * Resets the singleton logger instance and configuration. - * Useful for testing or reinitializing the logger. - */ - static reset() { - _LoggerSingleton$1.instance = null; - _LoggerSingleton$1.defaultConfig = { level: 1 }; - } +var _a3; +var _LoggerSingleton = class _LoggerSingleton2 { + static getInstance() { + if (!_LoggerSingleton2.instance) { + _LoggerSingleton2.instance = new Logger(_LoggerSingleton2.defaultConfig); + } + return _LoggerSingleton2.instance; + } + static configure(config2) { + _LoggerSingleton2.defaultConfig = config2; + _LoggerSingleton2.instance = new Logger(config2); + } + static reset() { + _LoggerSingleton2.instance = null; + _LoggerSingleton2.defaultConfig = { level: 1 }; + } }; _LoggerSingleton.instance = null; -_LoggerSingleton.defaultConfig = { level: (_a = parseLogLevelFromEnv()) != null ? _a : 1 }; +_LoggerSingleton.defaultConfig = { + level: (_a3 = parseLogLevelFromEnv()) != null ? _a3 : 1 +}; var LoggerSingleton = _LoggerSingleton; var getGlobalLogger = () => { - return LoggerSingleton.getInstance(); + return LoggerSingleton.getInstance(); }; var package_default = { - name: "@langfuse/core", - version: "5.4.1", - description: "Core functions and utilities for Langfuse packages", - type: "module", - sideEffects: false, - main: "./dist/index.cjs", - module: "./dist/index.mjs", - types: "./dist/index.d.ts", - exports: { ".": { - types: "./dist/index.d.ts", - import: "./dist/index.mjs", - require: "./dist/index.cjs" - } }, - scripts: { - build: "tsup", - test: "vitest run", - "test:watch": "vitest", - format: "prettier --write \"src/**/*.ts\"", - "format:check": "prettier --check \"src/**/*.ts\"", - clean: "rm -rf dist" - }, - author: "Langfuse", - license: "MIT", - repository: { - type: "git", - url: "https://github.com/langfuse/langfuse-js.git", - directory: "packages/core" - }, - files: ["dist"], - peerDependencies: { "@opentelemetry/api": "^1.9.0" }, - devDependencies: { "@types/node": "^24.1.0" } + name: "@langfuse/core", + version: "5.4.1", + description: "Core functions and utilities for Langfuse packages", + type: "module", + sideEffects: false, + main: "./dist/index.cjs", + module: "./dist/index.mjs", + types: "./dist/index.d.ts", + exports: { + ".": { + types: "./dist/index.d.ts", + import: "./dist/index.mjs", + require: "./dist/index.cjs" + } + }, + scripts: { + build: "tsup", + test: "vitest run", + "test:watch": "vitest", + format: 'prettier --write "src/**/*.ts"', + "format:check": 'prettier --check "src/**/*.ts"', + clean: "rm -rf dist" + }, + author: "Langfuse", + license: "MIT", + repository: { + type: "git", + url: "https://github.com/langfuse/langfuse-js.git", + directory: "packages/core" + }, + files: [ + "dist" + ], + peerDependencies: { + "@opentelemetry/api": "^1.9.0" + }, + devDependencies: { + "@types/node": "^24.1.0" + } }; var LANGFUSE_TRACER_NAME = "langfuse-sdk"; var LANGFUSE_SDK_VERSION = package_default.version; var LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT = "sdk-experiment"; var LangfuseOtelSpanAttributes = /* @__PURE__ */ ((LangfuseOtelSpanAttributes2) => { - LangfuseOtelSpanAttributes2["TRACE_NAME"] = "langfuse.trace.name"; - LangfuseOtelSpanAttributes2["TRACE_USER_ID"] = "user.id"; - LangfuseOtelSpanAttributes2["TRACE_SESSION_ID"] = "session.id"; - LangfuseOtelSpanAttributes2["TRACE_TAGS"] = "langfuse.trace.tags"; - LangfuseOtelSpanAttributes2["TRACE_PUBLIC"] = "langfuse.trace.public"; - LangfuseOtelSpanAttributes2["TRACE_METADATA"] = "langfuse.trace.metadata"; - LangfuseOtelSpanAttributes2["TRACE_INPUT"] = "langfuse.trace.input"; - LangfuseOtelSpanAttributes2["TRACE_OUTPUT"] = "langfuse.trace.output"; - LangfuseOtelSpanAttributes2["OBSERVATION_TYPE"] = "langfuse.observation.type"; - LangfuseOtelSpanAttributes2["OBSERVATION_METADATA"] = "langfuse.observation.metadata"; - LangfuseOtelSpanAttributes2["OBSERVATION_LEVEL"] = "langfuse.observation.level"; - LangfuseOtelSpanAttributes2["OBSERVATION_STATUS_MESSAGE"] = "langfuse.observation.status_message"; - LangfuseOtelSpanAttributes2["OBSERVATION_INPUT"] = "langfuse.observation.input"; - LangfuseOtelSpanAttributes2["OBSERVATION_OUTPUT"] = "langfuse.observation.output"; - LangfuseOtelSpanAttributes2["OBSERVATION_COMPLETION_START_TIME"] = "langfuse.observation.completion_start_time"; - LangfuseOtelSpanAttributes2["OBSERVATION_MODEL"] = "langfuse.observation.model.name"; - LangfuseOtelSpanAttributes2["OBSERVATION_MODEL_PARAMETERS"] = "langfuse.observation.model.parameters"; - LangfuseOtelSpanAttributes2["OBSERVATION_USAGE_DETAILS"] = "langfuse.observation.usage_details"; - LangfuseOtelSpanAttributes2["OBSERVATION_COST_DETAILS"] = "langfuse.observation.cost_details"; - LangfuseOtelSpanAttributes2["OBSERVATION_PROMPT_NAME"] = "langfuse.observation.prompt.name"; - LangfuseOtelSpanAttributes2["OBSERVATION_PROMPT_VERSION"] = "langfuse.observation.prompt.version"; - LangfuseOtelSpanAttributes2["ENVIRONMENT"] = "langfuse.environment"; - LangfuseOtelSpanAttributes2["RELEASE"] = "langfuse.release"; - LangfuseOtelSpanAttributes2["VERSION"] = "langfuse.version"; - LangfuseOtelSpanAttributes2["AS_ROOT"] = "langfuse.internal.as_root"; - LangfuseOtelSpanAttributes2["IS_APP_ROOT"] = "langfuse.internal.is_app_root"; - LangfuseOtelSpanAttributes2["EXPERIMENT_ID"] = "langfuse.experiment.id"; - LangfuseOtelSpanAttributes2["EXPERIMENT_NAME"] = "langfuse.experiment.name"; - LangfuseOtelSpanAttributes2["EXPERIMENT_DESCRIPTION"] = "langfuse.experiment.description"; - LangfuseOtelSpanAttributes2["EXPERIMENT_METADATA"] = "langfuse.experiment.metadata"; - LangfuseOtelSpanAttributes2["EXPERIMENT_DATASET_ID"] = "langfuse.experiment.dataset.id"; - LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_ID"] = "langfuse.experiment.item.id"; - LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_EXPECTED_OUTPUT"] = "langfuse.experiment.item.expected_output"; - LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_METADATA"] = "langfuse.experiment.item.metadata"; - LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_ROOT_OBSERVATION_ID"] = "langfuse.experiment.item.root_observation_id"; - LangfuseOtelSpanAttributes2["TRACE_COMPAT_USER_ID"] = "langfuse.user.id"; - LangfuseOtelSpanAttributes2["TRACE_COMPAT_SESSION_ID"] = "langfuse.session.id"; - return LangfuseOtelSpanAttributes2; + LangfuseOtelSpanAttributes2["TRACE_NAME"] = "langfuse.trace.name"; + LangfuseOtelSpanAttributes2["TRACE_USER_ID"] = "user.id"; + LangfuseOtelSpanAttributes2["TRACE_SESSION_ID"] = "session.id"; + LangfuseOtelSpanAttributes2["TRACE_TAGS"] = "langfuse.trace.tags"; + LangfuseOtelSpanAttributes2["TRACE_PUBLIC"] = "langfuse.trace.public"; + LangfuseOtelSpanAttributes2["TRACE_METADATA"] = "langfuse.trace.metadata"; + LangfuseOtelSpanAttributes2["TRACE_INPUT"] = "langfuse.trace.input"; + LangfuseOtelSpanAttributes2["TRACE_OUTPUT"] = "langfuse.trace.output"; + LangfuseOtelSpanAttributes2["OBSERVATION_TYPE"] = "langfuse.observation.type"; + LangfuseOtelSpanAttributes2["OBSERVATION_METADATA"] = "langfuse.observation.metadata"; + LangfuseOtelSpanAttributes2["OBSERVATION_LEVEL"] = "langfuse.observation.level"; + LangfuseOtelSpanAttributes2["OBSERVATION_STATUS_MESSAGE"] = "langfuse.observation.status_message"; + LangfuseOtelSpanAttributes2["OBSERVATION_INPUT"] = "langfuse.observation.input"; + LangfuseOtelSpanAttributes2["OBSERVATION_OUTPUT"] = "langfuse.observation.output"; + LangfuseOtelSpanAttributes2["OBSERVATION_COMPLETION_START_TIME"] = "langfuse.observation.completion_start_time"; + LangfuseOtelSpanAttributes2["OBSERVATION_MODEL"] = "langfuse.observation.model.name"; + LangfuseOtelSpanAttributes2["OBSERVATION_MODEL_PARAMETERS"] = "langfuse.observation.model.parameters"; + LangfuseOtelSpanAttributes2["OBSERVATION_USAGE_DETAILS"] = "langfuse.observation.usage_details"; + LangfuseOtelSpanAttributes2["OBSERVATION_COST_DETAILS"] = "langfuse.observation.cost_details"; + LangfuseOtelSpanAttributes2["OBSERVATION_PROMPT_NAME"] = "langfuse.observation.prompt.name"; + LangfuseOtelSpanAttributes2["OBSERVATION_PROMPT_VERSION"] = "langfuse.observation.prompt.version"; + LangfuseOtelSpanAttributes2["ENVIRONMENT"] = "langfuse.environment"; + LangfuseOtelSpanAttributes2["RELEASE"] = "langfuse.release"; + LangfuseOtelSpanAttributes2["VERSION"] = "langfuse.version"; + LangfuseOtelSpanAttributes2["AS_ROOT"] = "langfuse.internal.as_root"; + LangfuseOtelSpanAttributes2["IS_APP_ROOT"] = "langfuse.internal.is_app_root"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ID"] = "langfuse.experiment.id"; + LangfuseOtelSpanAttributes2["EXPERIMENT_NAME"] = "langfuse.experiment.name"; + LangfuseOtelSpanAttributes2["EXPERIMENT_DESCRIPTION"] = "langfuse.experiment.description"; + LangfuseOtelSpanAttributes2["EXPERIMENT_METADATA"] = "langfuse.experiment.metadata"; + LangfuseOtelSpanAttributes2["EXPERIMENT_DATASET_ID"] = "langfuse.experiment.dataset.id"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_ID"] = "langfuse.experiment.item.id"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_EXPECTED_OUTPUT"] = "langfuse.experiment.item.expected_output"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_METADATA"] = "langfuse.experiment.item.metadata"; + LangfuseOtelSpanAttributes2["EXPERIMENT_ITEM_ROOT_OBSERVATION_ID"] = "langfuse.experiment.item.root_observation_id"; + LangfuseOtelSpanAttributes2["TRACE_COMPAT_USER_ID"] = "langfuse.user.id"; + LangfuseOtelSpanAttributes2["TRACE_COMPAT_SESSION_ID"] = "langfuse.session.id"; + return LangfuseOtelSpanAttributes2; })(LangfuseOtelSpanAttributes || {}); var annotationQueues_exports = {}; -__export(annotationQueues_exports, { - AnnotationQueueObjectType: () => AnnotationQueueObjectType, - AnnotationQueueStatus: () => AnnotationQueueStatus +__export2(annotationQueues_exports, { + AnnotationQueueObjectType: () => AnnotationQueueObjectType, + AnnotationQueueStatus: () => AnnotationQueueStatus }); var AnnotationQueueStatus = { - Pending: "PENDING", - Completed: "COMPLETED" + Pending: "PENDING", + Completed: "COMPLETED" }; var AnnotationQueueObjectType = { - Trace: "TRACE", - Observation: "OBSERVATION", - Session: "SESSION" + Trace: "TRACE", + Observation: "OBSERVATION", + Session: "SESSION" }; var blobStorageIntegrations_exports = {}; -__export(blobStorageIntegrations_exports, { - BlobStorageExportFieldGroup: () => BlobStorageExportFieldGroup, - BlobStorageExportFrequency: () => BlobStorageExportFrequency, - BlobStorageExportMode: () => BlobStorageExportMode, - BlobStorageExportSource: () => BlobStorageExportSource, - BlobStorageIntegrationFileType: () => BlobStorageIntegrationFileType, - BlobStorageIntegrationType: () => BlobStorageIntegrationType, - BlobStorageSyncStatus: () => BlobStorageSyncStatus +__export2(blobStorageIntegrations_exports, { + BlobStorageExportFieldGroup: () => BlobStorageExportFieldGroup, + BlobStorageExportFrequency: () => BlobStorageExportFrequency, + BlobStorageExportMode: () => BlobStorageExportMode, + BlobStorageExportSource: () => BlobStorageExportSource, + BlobStorageIntegrationFileType: () => BlobStorageIntegrationFileType, + BlobStorageIntegrationType: () => BlobStorageIntegrationType, + BlobStorageSyncStatus: () => BlobStorageSyncStatus }); var BlobStorageIntegrationType = { - S3: "S3", - S3Compatible: "S3_COMPATIBLE", - AzureBlobStorage: "AZURE_BLOB_STORAGE" + S3: "S3", + S3Compatible: "S3_COMPATIBLE", + AzureBlobStorage: "AZURE_BLOB_STORAGE" }; var BlobStorageIntegrationFileType = { - Json: "JSON", - Csv: "CSV", - Jsonl: "JSONL" + Json: "JSON", + Csv: "CSV", + Jsonl: "JSONL" }; var BlobStorageExportMode = { - FullHistory: "FULL_HISTORY", - FromToday: "FROM_TODAY", - FromCustomDate: "FROM_CUSTOM_DATE" + FullHistory: "FULL_HISTORY", + FromToday: "FROM_TODAY", + FromCustomDate: "FROM_CUSTOM_DATE" }; var BlobStorageExportFrequency = { - Every20Minutes: "every_20_minutes", - Hourly: "hourly", - Daily: "daily", - Weekly: "weekly" + Every20Minutes: "every_20_minutes", + Hourly: "hourly", + Daily: "daily", + Weekly: "weekly" }; var BlobStorageExportSource = { - LegacyTracesObservations: "LEGACY_TRACES_OBSERVATIONS", - ObservationsV2: "OBSERVATIONS_V2", - LegacyTracesAndEnrichedObservations: "LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS" + LegacyTracesObservations: "LEGACY_TRACES_OBSERVATIONS", + ObservationsV2: "OBSERVATIONS_V2", + LegacyTracesAndEnrichedObservations: "LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS" }; var BlobStorageExportFieldGroup = { - Core: "core", - Basic: "basic", - Time: "time", - Io: "io", - Metadata: "metadata", - Model: "model", - Usage: "usage", - Prompt: "prompt", - Metrics: "metrics", - Tools: "tools", - TraceContext: "trace_context" + Core: "core", + Basic: "basic", + Time: "time", + Io: "io", + Metadata: "metadata", + Model: "model", + Usage: "usage", + Prompt: "prompt", + Metrics: "metrics", + Tools: "tools", + TraceContext: "trace_context" }; var BlobStorageSyncStatus = { - Idle: "idle", - Queued: "queued", - UpToDate: "up_to_date", - Disabled: "disabled", - Error: "error" + Idle: "idle", + Queued: "queued", + UpToDate: "up_to_date", + Disabled: "disabled", + Error: "error" }; var commons_exports = {}; -__export(commons_exports, { - AccessDeniedError: () => AccessDeniedError, - CommentObjectType: () => CommentObjectType, - DatasetStatus: () => DatasetStatus, - Error: () => Error2, - MethodNotAllowedError: () => MethodNotAllowedError, - ModelUsageUnit: () => ModelUsageUnit, - NotFoundError: () => NotFoundError, - ObservationLevel: () => ObservationLevel, - PricingTierOperator: () => PricingTierOperator, - ScoreConfigDataType: () => ScoreConfigDataType, - ScoreDataType: () => ScoreDataType, - ScoreSource: () => ScoreSource, - UnauthorizedError: () => UnauthorizedError +__export2(commons_exports, { + AccessDeniedError: () => AccessDeniedError, + CommentObjectType: () => CommentObjectType, + DatasetStatus: () => DatasetStatus, + Error: () => Error2, + MethodNotAllowedError: () => MethodNotAllowedError, + ModelUsageUnit: () => ModelUsageUnit, + NotFoundError: () => NotFoundError, + ObservationLevel: () => ObservationLevel, + PricingTierOperator: () => PricingTierOperator, + ScoreConfigDataType: () => ScoreConfigDataType, + ScoreDataType: () => ScoreDataType, + ScoreSource: () => ScoreSource, + UnauthorizedError: () => UnauthorizedError }); var PricingTierOperator = { - Gt: "gt", - Gte: "gte", - Lt: "lt", - Lte: "lte", - Eq: "eq", - Neq: "neq" + Gt: "gt", + Gte: "gte", + Lt: "lt", + Lte: "lte", + Eq: "eq", + Neq: "neq" }; var ModelUsageUnit = { - Characters: "CHARACTERS", - Tokens: "TOKENS", - Milliseconds: "MILLISECONDS", - Seconds: "SECONDS", - Images: "IMAGES", - Requests: "REQUESTS" + Characters: "CHARACTERS", + Tokens: "TOKENS", + Milliseconds: "MILLISECONDS", + Seconds: "SECONDS", + Images: "IMAGES", + Requests: "REQUESTS" }; var ObservationLevel = { - Debug: "DEBUG", - Default: "DEFAULT", - Warning: "WARNING", - Error: "ERROR" + Debug: "DEBUG", + Default: "DEFAULT", + Warning: "WARNING", + Error: "ERROR" }; var CommentObjectType = { - Trace: "TRACE", - Observation: "OBSERVATION", - Session: "SESSION", - Prompt: "PROMPT" + Trace: "TRACE", + Observation: "OBSERVATION", + Session: "SESSION", + Prompt: "PROMPT" }; var DatasetStatus = { - Active: "ACTIVE", - Archived: "ARCHIVED" + Active: "ACTIVE", + Archived: "ARCHIVED" }; var ScoreSource = { - Annotation: "ANNOTATION", - Api: "API", - Eval: "EVAL" + Annotation: "ANNOTATION", + Api: "API", + Eval: "EVAL" }; var ScoreConfigDataType = { - Numeric: "NUMERIC", - Boolean: "BOOLEAN", - Categorical: "CATEGORICAL", - Text: "TEXT" + Numeric: "NUMERIC", + Boolean: "BOOLEAN", + Categorical: "CATEGORICAL", + Text: "TEXT" }; var ScoreDataType = { - Numeric: "NUMERIC", - Boolean: "BOOLEAN", - Categorical: "CATEGORICAL", - Correction: "CORRECTION", - Text: "TEXT" + Numeric: "NUMERIC", + Boolean: "BOOLEAN", + Categorical: "CATEGORICAL", + Correction: "CORRECTION", + Text: "TEXT" }; var toJson = (value, replacer, space) => { - return JSON.stringify(value, replacer, space); + return JSON.stringify(value, replacer, space); }; function fromJson(text, reviver) { - return JSON.parse(text, reviver); + return JSON.parse(text, reviver); } var LangfuseAPIError = class _LangfuseAPIError extends Error { - constructor({ message, statusCode, body, rawResponse }) { - super(buildMessage({ - message, - statusCode, - body - })); - Object.setPrototypeOf(this, _LangfuseAPIError.prototype); - this.statusCode = statusCode; - this.body = body; - this.rawResponse = rawResponse; - } + constructor({ + message, + statusCode, + body, + rawResponse + }) { + super(buildMessage({ message, statusCode, body })); + Object.setPrototypeOf(this, _LangfuseAPIError.prototype); + this.statusCode = statusCode; + this.body = body; + this.rawResponse = rawResponse; + } }; -function buildMessage({ message, statusCode, body }) { - let lines = []; - if (message != null) lines.push(message); - if (statusCode != null) lines.push(`Status code: ${statusCode.toString()}`); - if (body != null) lines.push(`Body: ${toJson(body, void 0, 2)}`); - return lines.join("\n"); +function buildMessage({ + message, + statusCode, + body +}) { + let lines = []; + if (message != null) { + lines.push(message); + } + if (statusCode != null) { + lines.push(`Status code: ${statusCode.toString()}`); + } + if (body != null) { + lines.push(`Body: ${toJson(body, undefined, 2)}`); + } + return lines.join(` +`); } var LangfuseAPITimeoutError = class _LangfuseAPITimeoutError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, _LangfuseAPITimeoutError.prototype); - } + constructor(message) { + super(message); + Object.setPrototypeOf(this, _LangfuseAPITimeoutError.prototype); + } }; var Error2 = class _Error extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "Error", - statusCode: 400, - body, - rawResponse - }); - Object.setPrototypeOf(this, _Error.prototype); - } + constructor(body, rawResponse) { + super({ + message: "Error", + statusCode: 400, + body, + rawResponse + }); + Object.setPrototypeOf(this, _Error.prototype); + } }; var UnauthorizedError = class _UnauthorizedError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "UnauthorizedError", - statusCode: 401, - body, - rawResponse - }); - Object.setPrototypeOf(this, _UnauthorizedError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "UnauthorizedError", + statusCode: 401, + body, + rawResponse + }); + Object.setPrototypeOf(this, _UnauthorizedError.prototype); + } }; var AccessDeniedError = class _AccessDeniedError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "AccessDeniedError", - statusCode: 403, - body, - rawResponse - }); - Object.setPrototypeOf(this, _AccessDeniedError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "AccessDeniedError", + statusCode: 403, + body, + rawResponse + }); + Object.setPrototypeOf(this, _AccessDeniedError.prototype); + } }; var NotFoundError = class _NotFoundError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "NotFoundError", - statusCode: 404, - body, - rawResponse - }); - Object.setPrototypeOf(this, _NotFoundError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "NotFoundError", + statusCode: 404, + body, + rawResponse + }); + Object.setPrototypeOf(this, _NotFoundError.prototype); + } }; var MethodNotAllowedError = class _MethodNotAllowedError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "MethodNotAllowedError", - statusCode: 405, - body, - rawResponse - }); - Object.setPrototypeOf(this, _MethodNotAllowedError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "MethodNotAllowedError", + statusCode: 405, + body, + rawResponse + }); + Object.setPrototypeOf(this, _MethodNotAllowedError.prototype); + } }; var health_exports = {}; -__export(health_exports, { ServiceUnavailableError: () => ServiceUnavailableError }); +__export2(health_exports, { + ServiceUnavailableError: () => ServiceUnavailableError +}); var ServiceUnavailableError = class _ServiceUnavailableError extends LangfuseAPIError { - constructor(rawResponse) { - super({ - message: "ServiceUnavailableError", - statusCode: 503, - rawResponse - }); - Object.setPrototypeOf(this, _ServiceUnavailableError.prototype); - } + constructor(rawResponse) { + super({ + message: "ServiceUnavailableError", + statusCode: 503, + rawResponse + }); + Object.setPrototypeOf(this, _ServiceUnavailableError.prototype); + } }; var ingestion_exports = {}; -__export(ingestion_exports, { ObservationType: () => ObservationType }); +__export2(ingestion_exports, { + ObservationType: () => ObservationType +}); var ObservationType = { - Span: "SPAN", - Generation: "GENERATION", - Event: "EVENT", - Agent: "AGENT", - Tool: "TOOL", - Chain: "CHAIN", - Retriever: "RETRIEVER", - Evaluator: "EVALUATOR", - Embedding: "EMBEDDING", - Guardrail: "GUARDRAIL" + Span: "SPAN", + Generation: "GENERATION", + Event: "EVENT", + Agent: "AGENT", + Tool: "TOOL", + Chain: "CHAIN", + Retriever: "RETRIEVER", + Evaluator: "EVALUATOR", + Embedding: "EMBEDDING", + Guardrail: "GUARDRAIL" }; var legacy_exports = {}; -__export(legacy_exports, { - CreateScoreSource: () => CreateScoreSource, - metricsV1: () => metricsV1_exports, - observationsV1: () => observationsV1_exports, - scoreV1: () => scoreV1_exports +__export2(legacy_exports, { + CreateScoreSource: () => CreateScoreSource, + metricsV1: () => metricsV1_exports, + observationsV1: () => observationsV1_exports, + scoreV1: () => scoreV1_exports }); var metricsV1_exports = {}; var observationsV1_exports = {}; var scoreV1_exports = {}; -__export(scoreV1_exports, { CreateScoreSource: () => CreateScoreSource }); +__export2(scoreV1_exports, { + CreateScoreSource: () => CreateScoreSource +}); var CreateScoreSource = { - Api: "API", - Annotation: "ANNOTATION" + Api: "API", + Annotation: "ANNOTATION" }; var llmConnections_exports = {}; -__export(llmConnections_exports, { LlmAdapter: () => LlmAdapter }); +__export2(llmConnections_exports, { + LlmAdapter: () => LlmAdapter +}); var LlmAdapter = { - Anthropic: "anthropic", - OpenAi: "openai", - Azure: "azure", - Bedrock: "bedrock", - GoogleVertexAi: "google-vertex-ai", - GoogleAiStudio: "google-ai-studio" + Anthropic: "anthropic", + OpenAi: "openai", + Azure: "azure", + Bedrock: "bedrock", + GoogleVertexAi: "google-vertex-ai", + GoogleAiStudio: "google-ai-studio" }; var media_exports = {}; -__export(media_exports, { MediaContentType: () => MediaContentType }); +__export2(media_exports, { + MediaContentType: () => MediaContentType +}); var MediaContentType = { - ImagePng: "image/png", - ImageJpeg: "image/jpeg", - ImageJpg: "image/jpg", - ImageWebp: "image/webp", - ImageGif: "image/gif", - ImageSvgXml: "image/svg+xml", - ImageTiff: "image/tiff", - ImageBmp: "image/bmp", - ImageAvif: "image/avif", - ImageHeic: "image/heic", - AudioMpeg: "audio/mpeg", - AudioMp3: "audio/mp3", - AudioWav: "audio/wav", - AudioOgg: "audio/ogg", - AudioOga: "audio/oga", - AudioAac: "audio/aac", - AudioMp4: "audio/mp4", - AudioFlac: "audio/flac", - AudioOpus: "audio/opus", - AudioWebm: "audio/webm", - VideoMp4: "video/mp4", - VideoWebm: "video/webm", - VideoOgg: "video/ogg", - VideoMpeg: "video/mpeg", - VideoQuicktime: "video/quicktime", - VideoXMsvideo: "video/x-msvideo", - VideoXMatroska: "video/x-matroska", - TextPlain: "text/plain", - TextHtml: "text/html", - TextCss: "text/css", - TextCsv: "text/csv", - TextMarkdown: "text/markdown", - TextXPython: "text/x-python", - ApplicationJavascript: "application/javascript", - TextXTypescript: "text/x-typescript", - ApplicationXYaml: "application/x-yaml", - ApplicationPdf: "application/pdf", - ApplicationMsword: "application/msword", - ApplicationMsExcel: "application/vnd.ms-excel", - ApplicationOpenxmlSpreadsheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - ApplicationZip: "application/zip", - ApplicationJson: "application/json", - ApplicationXml: "application/xml", - ApplicationOctetStream: "application/octet-stream", - ApplicationOpenxmlWord: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", - ApplicationOpenxmlPresentation: "application/vnd.openxmlformats-officedocument.presentationml.presentation", - ApplicationRtf: "application/rtf", - ApplicationXNdjson: "application/x-ndjson", - ApplicationParquet: "application/vnd.apache.parquet", - ApplicationGzip: "application/gzip", - ApplicationXTar: "application/x-tar", - ApplicationX7ZCompressed: "application/x-7z-compressed" + ImagePng: "image/png", + ImageJpeg: "image/jpeg", + ImageJpg: "image/jpg", + ImageWebp: "image/webp", + ImageGif: "image/gif", + ImageSvgXml: "image/svg+xml", + ImageTiff: "image/tiff", + ImageBmp: "image/bmp", + ImageAvif: "image/avif", + ImageHeic: "image/heic", + AudioMpeg: "audio/mpeg", + AudioMp3: "audio/mp3", + AudioWav: "audio/wav", + AudioOgg: "audio/ogg", + AudioOga: "audio/oga", + AudioAac: "audio/aac", + AudioMp4: "audio/mp4", + AudioFlac: "audio/flac", + AudioOpus: "audio/opus", + AudioWebm: "audio/webm", + VideoMp4: "video/mp4", + VideoWebm: "video/webm", + VideoOgg: "video/ogg", + VideoMpeg: "video/mpeg", + VideoQuicktime: "video/quicktime", + VideoXMsvideo: "video/x-msvideo", + VideoXMatroska: "video/x-matroska", + TextPlain: "text/plain", + TextHtml: "text/html", + TextCss: "text/css", + TextCsv: "text/csv", + TextMarkdown: "text/markdown", + TextXPython: "text/x-python", + ApplicationJavascript: "application/javascript", + TextXTypescript: "text/x-typescript", + ApplicationXYaml: "application/x-yaml", + ApplicationPdf: "application/pdf", + ApplicationMsword: "application/msword", + ApplicationMsExcel: "application/vnd.ms-excel", + ApplicationOpenxmlSpreadsheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + ApplicationZip: "application/zip", + ApplicationJson: "application/json", + ApplicationXml: "application/xml", + ApplicationOctetStream: "application/octet-stream", + ApplicationOpenxmlWord: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + ApplicationOpenxmlPresentation: "application/vnd.openxmlformats-officedocument.presentationml.presentation", + ApplicationRtf: "application/rtf", + ApplicationXNdjson: "application/x-ndjson", + ApplicationParquet: "application/vnd.apache.parquet", + ApplicationGzip: "application/gzip", + ApplicationXTar: "application/x-tar", + ApplicationX7ZCompressed: "application/x-7z-compressed" }; var organizations_exports = {}; -__export(organizations_exports, { MembershipRole: () => MembershipRole }); +__export2(organizations_exports, { + MembershipRole: () => MembershipRole +}); var MembershipRole = { - Owner: "OWNER", - Admin: "ADMIN", - Member: "MEMBER", - Viewer: "VIEWER" + Owner: "OWNER", + Admin: "ADMIN", + Member: "MEMBER", + Viewer: "VIEWER" }; var prompts_exports = {}; -__export(prompts_exports, { - ChatMessageType: () => ChatMessageType, - CreateChatPromptType: () => CreateChatPromptType, - CreateTextPromptType: () => CreateTextPromptType, - PlaceholderMessageType: () => PlaceholderMessageType, - PromptType: () => PromptType +__export2(prompts_exports, { + ChatMessageType: () => ChatMessageType, + CreateChatPromptType: () => CreateChatPromptType, + CreateTextPromptType: () => CreateTextPromptType, + PlaceholderMessageType: () => PlaceholderMessageType, + PromptType: () => PromptType }); var PromptType = { - Chat: "chat", - Text: "text" + Chat: "chat", + Text: "text" +}; +var ChatMessageType = { + Chatmessage: "chatmessage" +}; +var PlaceholderMessageType = { + Placeholder: "placeholder" +}; +var CreateChatPromptType = { + Chat: "chat" +}; +var CreateTextPromptType = { + Text: "text" }; -var ChatMessageType = { Chatmessage: "chatmessage" }; -var PlaceholderMessageType = { Placeholder: "placeholder" }; -var CreateChatPromptType = { Chat: "chat" }; -var CreateTextPromptType = { Text: "text" }; var unstable_exports = {}; -__export(unstable_exports, { - AccessDeniedError: () => AccessDeniedError2, - BadRequestError: () => BadRequestError, - ConflictError: () => ConflictError, - EvaluationRuleArrayOptionsFilterOperator: () => EvaluationRuleArrayOptionsFilterOperator, - EvaluationRuleBooleanFilterOperator: () => EvaluationRuleBooleanFilterOperator, - EvaluationRuleMappingSource: () => EvaluationRuleMappingSource, - EvaluationRuleNullFilterOperator: () => EvaluationRuleNullFilterOperator, - EvaluationRuleNumberFilterOperator: () => EvaluationRuleNumberFilterOperator, - EvaluationRuleOptionsFilterOperator: () => EvaluationRuleOptionsFilterOperator, - EvaluationRuleStatus: () => EvaluationRuleStatus, - EvaluationRuleStringFilterOperator: () => EvaluationRuleStringFilterOperator, - EvaluationRuleTarget: () => EvaluationRuleTarget, - EvaluatorOutputDataType: () => EvaluatorOutputDataType, - EvaluatorScope: () => EvaluatorScope, - EvaluatorType: () => EvaluatorType, - InternalServerError: () => InternalServerError, - MethodNotAllowedError: () => MethodNotAllowedError2, - NotFoundError: () => NotFoundError2, - PublicApiErrorCode: () => PublicApiErrorCode, - TooManyRequestsError: () => TooManyRequestsError, - UnauthorizedError: () => UnauthorizedError2, - UnprocessableContentError: () => UnprocessableContentError, - commons: () => commons_exports2, - errors: () => errors_exports2, - evaluationRules: () => evaluationRules_exports, - evaluators: () => evaluators_exports +__export2(unstable_exports, { + AccessDeniedError: () => AccessDeniedError2, + BadRequestError: () => BadRequestError, + ConflictError: () => ConflictError, + EvaluationRuleArrayOptionsFilterOperator: () => EvaluationRuleArrayOptionsFilterOperator, + EvaluationRuleBooleanFilterOperator: () => EvaluationRuleBooleanFilterOperator, + EvaluationRuleMappingSource: () => EvaluationRuleMappingSource, + EvaluationRuleNullFilterOperator: () => EvaluationRuleNullFilterOperator, + EvaluationRuleNumberFilterOperator: () => EvaluationRuleNumberFilterOperator, + EvaluationRuleOptionsFilterOperator: () => EvaluationRuleOptionsFilterOperator, + EvaluationRuleStatus: () => EvaluationRuleStatus, + EvaluationRuleStringFilterOperator: () => EvaluationRuleStringFilterOperator, + EvaluationRuleTarget: () => EvaluationRuleTarget, + EvaluatorOutputDataType: () => EvaluatorOutputDataType, + EvaluatorScope: () => EvaluatorScope, + EvaluatorType: () => EvaluatorType, + InternalServerError: () => InternalServerError, + MethodNotAllowedError: () => MethodNotAllowedError2, + NotFoundError: () => NotFoundError2, + PublicApiErrorCode: () => PublicApiErrorCode, + TooManyRequestsError: () => TooManyRequestsError, + UnauthorizedError: () => UnauthorizedError2, + UnprocessableContentError: () => UnprocessableContentError, + commons: () => commons_exports2, + errors: () => errors_exports2, + evaluationRules: () => evaluationRules_exports, + evaluators: () => evaluators_exports }); var commons_exports2 = {}; -__export(commons_exports2, { - EvaluationRuleArrayOptionsFilterOperator: () => EvaluationRuleArrayOptionsFilterOperator, - EvaluationRuleBooleanFilterOperator: () => EvaluationRuleBooleanFilterOperator, - EvaluationRuleMappingSource: () => EvaluationRuleMappingSource, - EvaluationRuleNullFilterOperator: () => EvaluationRuleNullFilterOperator, - EvaluationRuleNumberFilterOperator: () => EvaluationRuleNumberFilterOperator, - EvaluationRuleOptionsFilterOperator: () => EvaluationRuleOptionsFilterOperator, - EvaluationRuleStatus: () => EvaluationRuleStatus, - EvaluationRuleStringFilterOperator: () => EvaluationRuleStringFilterOperator, - EvaluationRuleTarget: () => EvaluationRuleTarget, - EvaluatorOutputDataType: () => EvaluatorOutputDataType, - EvaluatorScope: () => EvaluatorScope, - EvaluatorType: () => EvaluatorType -}); -var EvaluatorType = { LlmAsJudge: "llm_as_judge" }; +__export2(commons_exports2, { + EvaluationRuleArrayOptionsFilterOperator: () => EvaluationRuleArrayOptionsFilterOperator, + EvaluationRuleBooleanFilterOperator: () => EvaluationRuleBooleanFilterOperator, + EvaluationRuleMappingSource: () => EvaluationRuleMappingSource, + EvaluationRuleNullFilterOperator: () => EvaluationRuleNullFilterOperator, + EvaluationRuleNumberFilterOperator: () => EvaluationRuleNumberFilterOperator, + EvaluationRuleOptionsFilterOperator: () => EvaluationRuleOptionsFilterOperator, + EvaluationRuleStatus: () => EvaluationRuleStatus, + EvaluationRuleStringFilterOperator: () => EvaluationRuleStringFilterOperator, + EvaluationRuleTarget: () => EvaluationRuleTarget, + EvaluatorOutputDataType: () => EvaluatorOutputDataType, + EvaluatorScope: () => EvaluatorScope, + EvaluatorType: () => EvaluatorType +}); +var EvaluatorType = { + LlmAsJudge: "llm_as_judge" +}; var EvaluatorScope = { - Project: "project", - Managed: "managed" + Project: "project", + Managed: "managed" }; var EvaluationRuleTarget = { - Observation: "observation", - Experiment: "experiment" + Observation: "observation", + Experiment: "experiment" }; var EvaluationRuleStatus = { - Active: "active", - Inactive: "inactive", - Paused: "paused" + Active: "active", + Inactive: "inactive", + Paused: "paused" }; var EvaluationRuleMappingSource = { - Input: "input", - Output: "output", - Metadata: "metadata", - ExpectedOutput: "expected_output", - ExperimentItemMetadata: "experiment_item_metadata" + Input: "input", + Output: "output", + Metadata: "metadata", + ExpectedOutput: "expected_output", + ExperimentItemMetadata: "experiment_item_metadata" }; var EvaluatorOutputDataType = { - Numeric: "NUMERIC", - Boolean: "BOOLEAN", - Categorical: "CATEGORICAL" + Numeric: "NUMERIC", + Boolean: "BOOLEAN", + Categorical: "CATEGORICAL" }; var EvaluationRuleStringFilterOperator = { - Equals: "=", - Contains: "contains", - DoesNotContain: "does not contain", - StartsWith: "starts with", - EndsWith: "ends with" + Equals: "=", + Contains: "contains", + DoesNotContain: "does not contain", + StartsWith: "starts with", + EndsWith: "ends with" }; var EvaluationRuleNumberFilterOperator = { - Equals: "=", - GreaterThan: ">", - LessThan: "<", - GreaterThanOrEqual: ">=", - LessThanOrEqual: "<=" + Equals: "=", + GreaterThan: ">", + LessThan: "<", + GreaterThanOrEqual: ">=", + LessThanOrEqual: "<=" }; var EvaluationRuleOptionsFilterOperator = { - AnyOf: "any of", - NoneOf: "none of" + AnyOf: "any of", + NoneOf: "none of" }; var EvaluationRuleArrayOptionsFilterOperator = { - AnyOf: "any of", - NoneOf: "none of", - AllOf: "all of" + AnyOf: "any of", + NoneOf: "none of", + AllOf: "all of" }; var EvaluationRuleBooleanFilterOperator = { - Equals: "=", - NotEquals: "<>" + Equals: "=", + NotEquals: "<>" }; var EvaluationRuleNullFilterOperator = { - IsNull: "is null", - IsNotNull: "is not null" + IsNull: "is null", + IsNotNull: "is not null" }; var errors_exports2 = {}; -__export(errors_exports2, { - AccessDeniedError: () => AccessDeniedError2, - BadRequestError: () => BadRequestError, - ConflictError: () => ConflictError, - InternalServerError: () => InternalServerError, - MethodNotAllowedError: () => MethodNotAllowedError2, - NotFoundError: () => NotFoundError2, - PublicApiErrorCode: () => PublicApiErrorCode, - TooManyRequestsError: () => TooManyRequestsError, - UnauthorizedError: () => UnauthorizedError2, - UnprocessableContentError: () => UnprocessableContentError +__export2(errors_exports2, { + AccessDeniedError: () => AccessDeniedError2, + BadRequestError: () => BadRequestError, + ConflictError: () => ConflictError, + InternalServerError: () => InternalServerError, + MethodNotAllowedError: () => MethodNotAllowedError2, + NotFoundError: () => NotFoundError2, + PublicApiErrorCode: () => PublicApiErrorCode, + TooManyRequestsError: () => TooManyRequestsError, + UnauthorizedError: () => UnauthorizedError2, + UnprocessableContentError: () => UnprocessableContentError }); var PublicApiErrorCode = { - AuthenticationFailed: "authentication_failed", - AccessDenied: "access_denied", - InvalidRequest: "invalid_request", - InvalidQuery: "invalid_query", - InvalidBody: "invalid_body", - InvalidFilterValue: "invalid_filter_value", - InvalidJsonPath: "invalid_json_path", - InvalidVariableMapping: "invalid_variable_mapping", - MissingVariableMapping: "missing_variable_mapping", - DuplicateVariableMapping: "duplicate_variable_mapping", - ResourceNotFound: "resource_not_found", - NameConflict: "name_conflict", - EvaluatorPreflightFailed: "evaluator_preflight_failed", - Conflict: "conflict", - UnprocessableContent: "unprocessable_content", - RateLimited: "rate_limited", - MethodNotAllowed: "method_not_allowed", - InternalError: "internal_error" + AuthenticationFailed: "authentication_failed", + AccessDenied: "access_denied", + InvalidRequest: "invalid_request", + InvalidQuery: "invalid_query", + InvalidBody: "invalid_body", + InvalidFilterValue: "invalid_filter_value", + InvalidJsonPath: "invalid_json_path", + InvalidVariableMapping: "invalid_variable_mapping", + MissingVariableMapping: "missing_variable_mapping", + DuplicateVariableMapping: "duplicate_variable_mapping", + ResourceNotFound: "resource_not_found", + NameConflict: "name_conflict", + EvaluatorPreflightFailed: "evaluator_preflight_failed", + Conflict: "conflict", + UnprocessableContent: "unprocessable_content", + RateLimited: "rate_limited", + MethodNotAllowed: "method_not_allowed", + InternalError: "internal_error" }; var BadRequestError = class _BadRequestError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "BadRequestError", - statusCode: 400, - body, - rawResponse - }); - Object.setPrototypeOf(this, _BadRequestError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "BadRequestError", + statusCode: 400, + body, + rawResponse + }); + Object.setPrototypeOf(this, _BadRequestError.prototype); + } }; -var UnauthorizedError2 = class _UnauthorizedError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "UnauthorizedError", - statusCode: 401, - body, - rawResponse - }); - Object.setPrototypeOf(this, _UnauthorizedError.prototype); - } +var UnauthorizedError2 = class _UnauthorizedError2 extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "UnauthorizedError", + statusCode: 401, + body, + rawResponse + }); + Object.setPrototypeOf(this, _UnauthorizedError2.prototype); + } }; -var AccessDeniedError2 = class _AccessDeniedError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "AccessDeniedError", - statusCode: 403, - body, - rawResponse - }); - Object.setPrototypeOf(this, _AccessDeniedError.prototype); - } +var AccessDeniedError2 = class _AccessDeniedError2 extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "AccessDeniedError", + statusCode: 403, + body, + rawResponse + }); + Object.setPrototypeOf(this, _AccessDeniedError2.prototype); + } }; -var NotFoundError2 = class _NotFoundError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "NotFoundError", - statusCode: 404, - body, - rawResponse - }); - Object.setPrototypeOf(this, _NotFoundError.prototype); - } +var NotFoundError2 = class _NotFoundError2 extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "NotFoundError", + statusCode: 404, + body, + rawResponse + }); + Object.setPrototypeOf(this, _NotFoundError2.prototype); + } }; -var MethodNotAllowedError2 = class _MethodNotAllowedError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "MethodNotAllowedError", - statusCode: 405, - body, - rawResponse - }); - Object.setPrototypeOf(this, _MethodNotAllowedError.prototype); - } +var MethodNotAllowedError2 = class _MethodNotAllowedError2 extends LangfuseAPIError { + constructor(body, rawResponse) { + super({ + message: "MethodNotAllowedError", + statusCode: 405, + body, + rawResponse + }); + Object.setPrototypeOf(this, _MethodNotAllowedError2.prototype); + } }; var ConflictError = class _ConflictError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "ConflictError", - statusCode: 409, - body, - rawResponse - }); - Object.setPrototypeOf(this, _ConflictError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "ConflictError", + statusCode: 409, + body, + rawResponse + }); + Object.setPrototypeOf(this, _ConflictError.prototype); + } }; var UnprocessableContentError = class _UnprocessableContentError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "UnprocessableContentError", - statusCode: 422, - body, - rawResponse - }); - Object.setPrototypeOf(this, _UnprocessableContentError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "UnprocessableContentError", + statusCode: 422, + body, + rawResponse + }); + Object.setPrototypeOf(this, _UnprocessableContentError.prototype); + } }; var TooManyRequestsError = class _TooManyRequestsError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "TooManyRequestsError", - statusCode: 429, - body, - rawResponse - }); - Object.setPrototypeOf(this, _TooManyRequestsError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "TooManyRequestsError", + statusCode: 429, + body, + rawResponse + }); + Object.setPrototypeOf(this, _TooManyRequestsError.prototype); + } }; var InternalServerError = class _InternalServerError extends LangfuseAPIError { - constructor(body, rawResponse) { - super({ - message: "InternalServerError", - statusCode: 500, - body, - rawResponse - }); - Object.setPrototypeOf(this, _InternalServerError.prototype); - } + constructor(body, rawResponse) { + super({ + message: "InternalServerError", + statusCode: 500, + body, + rawResponse + }); + Object.setPrototypeOf(this, _InternalServerError.prototype); + } }; var evaluationRules_exports = {}; var evaluators_exports = {}; var utils_exports = {}; -__export(utils_exports, { pagination: () => pagination_exports }); +__export2(utils_exports, { + pagination: () => pagination_exports +}); var pagination_exports = {}; -function mergeHeaders$1(...headersArray) { - const result = {}; - for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) if (value != null) result[key] = value; - else if (key in result) delete result[key]; - return result; +function mergeHeaders(...headersArray) { + const result = {}; + for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) { + if (value != null) { + result[key] = value; + } else if (key in result) { + delete result[key]; + } + } + return result; } function mergeOnlyDefinedHeaders(...headersArray) { - const result = {}; - for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) if (value != null) result[key] = value; - return result; + const result = {}; + for (const [key, value] of headersArray.filter((headers) => headers != null).flatMap((headers) => Object.entries(headers))) { + if (value != null) { + result[key] = value; + } + } + return result; } var defaultQsOptions = { - arrayFormat: "indices", - encode: true + arrayFormat: "indices", + encode: true }; function encodeValue(value, shouldEncode) { - if (value === void 0) return ""; - if (value === null) return ""; - const stringValue = String(value); - return shouldEncode ? encodeURIComponent(stringValue) : stringValue; + if (value === undefined) { + return ""; + } + if (value === null) { + return ""; + } + const stringValue = String(value); + return shouldEncode ? encodeURIComponent(stringValue) : stringValue; } function stringifyObject(obj, prefix = "", options) { - const parts = []; - for (const [key, value] of Object.entries(obj)) { - const fullKey = prefix ? `${prefix}[${key}]` : key; - if (value === void 0) continue; - if (Array.isArray(value)) { - if (value.length === 0) continue; - for (let i = 0; i < value.length; i++) { - const item = value[i]; - if (item === void 0) continue; - if (typeof item === "object" && !Array.isArray(item) && item !== null) { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - parts.push(...stringifyObject(item, arrayKey, options)); - } else { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; - parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); - } - } - } else if (typeof value === "object" && value !== null) { - if (Object.keys(value).length === 0) continue; - parts.push(...stringifyObject(value, fullKey, options)); - } else { - const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; - parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`); - } - } - return parts; + const parts = []; + for (const [key, value] of Object.entries(obj)) { + const fullKey = prefix ? `${prefix}[${key}]` : key; + if (value === undefined) { + continue; + } + if (Array.isArray(value)) { + if (value.length === 0) { + continue; + } + for (let i = 0;i < value.length; i++) { + const item = value[i]; + if (item === undefined) { + continue; + } + if (typeof item === "object" && !Array.isArray(item) && item !== null) { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + parts.push(...stringifyObject(item, arrayKey, options)); + } else { + const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; + parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } + } + } else if (typeof value === "object" && value !== null) { + if (Object.keys(value).length === 0) { + continue; + } + parts.push(...stringifyObject(value, fullKey, options)); + } else { + const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; + parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`); + } + } + return parts; } function toQueryString(obj, options) { - if (obj == null || typeof obj !== "object") return ""; - return stringifyObject(obj, "", { - ...defaultQsOptions, - ...options - }).join("&"); + if (obj == null || typeof obj !== "object") { + return ""; + } + const parts = stringifyObject(obj, "", { + ...defaultQsOptions, + ...options + }); + return parts.join("&"); } function createRequestUrl(baseUrl, queryParameters) { - const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" }); - return queryString ? `${baseUrl}?${queryString}` : baseUrl; + const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" }); + return queryString ? `${baseUrl}?${queryString}` : baseUrl; } function getBinaryResponse(response) { - const binaryResponse = { - get bodyUsed() { - return response.bodyUsed; - }, - stream: () => response.body, - arrayBuffer: response.arrayBuffer.bind(response), - blob: response.blob.bind(response) - }; - if ("bytes" in response && typeof response.bytes === "function") binaryResponse.bytes = response.bytes.bind(response); - return binaryResponse; + const binaryResponse = { + get bodyUsed() { + return response.bodyUsed; + }, + stream: () => response.body, + arrayBuffer: response.arrayBuffer.bind(response), + blob: response.blob.bind(response) + }; + if ("bytes" in response && typeof response.bytes === "function") { + binaryResponse.bytes = response.bytes.bind(response); + } + return binaryResponse; } function isResponseWithBody(response) { - return response.body != null; + return response.body != null; } async function getResponseBody(response, responseType) { - if (!isResponseWithBody(response)) return; - switch (responseType) { - case "binary-response": return getBinaryResponse(response); - case "blob": return await response.blob(); - case "arrayBuffer": return await response.arrayBuffer(); - case "sse": return response.body; - case "streaming": return response.body; - case "text": return await response.text(); - } - const text = await response.text(); - if (text.length > 0) try { - return fromJson(text); - } catch (err) { - return { - ok: false, - error: { - reason: "non-json", - statusCode: response.status, - rawBody: text - } - }; - } + if (!isResponseWithBody(response)) { + return; + } + switch (responseType) { + case "binary-response": + return getBinaryResponse(response); + case "blob": + return await response.blob(); + case "arrayBuffer": + return await response.arrayBuffer(); + case "sse": + return response.body; + case "streaming": + return response.body; + case "text": + return await response.text(); + } + const text = await response.text(); + if (text.length > 0) { + try { + let responseBody = fromJson(text); + return responseBody; + } catch (err) { + return { + ok: false, + error: { + reason: "non-json", + statusCode: response.status, + rawBody: text + } + }; + } + } + return; } async function getErrorResponseBody(response) { - var _a2, _b, _c; - let contentType = (_a2 = response.headers.get("Content-Type")) == null ? void 0 : _a2.toLowerCase(); - if (contentType == null || contentType.length === 0) return getResponseBody(response); - if (contentType.indexOf(";") !== -1) contentType = (_c = (_b = contentType.split(";")[0]) == null ? void 0 : _b.trim()) != null ? _c : ""; - switch (contentType) { - case "application/hal+json": - case "application/json": - case "application/ld+json": - case "application/problem+json": - case "application/vnd.api+json": - case "text/json": - const text = await response.text(); - return text.length > 0 ? fromJson(text) : void 0; - default: - if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { - const text2 = await response.text(); - return text2.length > 0 ? fromJson(text2) : void 0; - } - return await response.text(); - } + var _a22, _b, _c; + let contentType = (_a22 = response.headers.get("Content-Type")) == null ? undefined : _a22.toLowerCase(); + if (contentType == null || contentType.length === 0) { + return getResponseBody(response); + } + if (contentType.indexOf(";") !== -1) { + contentType = (_c = (_b = contentType.split(";")[0]) == null ? undefined : _b.trim()) != null ? _c : ""; + } + switch (contentType) { + case "application/hal+json": + case "application/json": + case "application/ld+json": + case "application/problem+json": + case "application/vnd.api+json": + case "text/json": + const text = await response.text(); + return text.length > 0 ? fromJson(text) : undefined; + default: + if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { + const text2 = await response.text(); + return text2.length > 0 ? fromJson(text2) : undefined; + } + return await response.text(); + } } async function getFetchFn() { - return fetch; + return fetch; } -async function getRequestBody({ body, type }) { - if (type.includes("json")) return toJson(body); - else return body; +async function getRequestBody({ + body, + type +}) { + if (type.includes("json")) { + return toJson(body); + } else { + return body; + } } var TIMEOUT = "timeout"; function getTimeoutSignal(timeoutMs) { - const controller = new AbortController(); - const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs); - return { - signal: controller.signal, - abortId - }; + const controller = new AbortController; + const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs); + return { signal: controller.signal, abortId }; } function anySignal(...args) { - const signals = args.length === 1 && Array.isArray(args[0]) ? args[0] : args; - const controller = new AbortController(); - for (const signal of signals) { - if (signal.aborted) { - controller.abort(signal == null ? void 0 : signal.reason); - break; - } - signal.addEventListener("abort", () => controller.abort(signal == null ? void 0 : signal.reason), { signal: controller.signal }); - } - return controller.signal; -} -var makeRequest = async (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex) => { - const signals = []; - let timeoutAbortId = void 0; - if (timeoutMs != null) { - const { signal, abortId } = getTimeoutSignal(timeoutMs); - timeoutAbortId = abortId; - signals.push(signal); - } - if (abortSignal != null) signals.push(abortSignal); - const response = await fetchFn(url, { - method, - headers, - body: requestBody, - signal: anySignal(signals), - credentials: withCredentials ? "include" : void 0, - duplex - }); - if (timeoutAbortId != null) clearTimeout(timeoutAbortId); - return response; + const signals = args.length === 1 && Array.isArray(args[0]) ? args[0] : args; + const controller = new AbortController; + for (const signal of signals) { + if (signal.aborted) { + controller.abort(signal == null ? undefined : signal.reason); + break; + } + signal.addEventListener("abort", () => controller.abort(signal == null ? undefined : signal.reason), { + signal: controller.signal + }); + } + return controller.signal; +} +var makeRequest = async (fetchFn, url2, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex) => { + const signals = []; + let timeoutAbortId = undefined; + if (timeoutMs != null) { + const { signal, abortId } = getTimeoutSignal(timeoutMs); + timeoutAbortId = abortId; + signals.push(signal); + } + if (abortSignal != null) { + signals.push(abortSignal); + } + let newSignals = anySignal(signals); + const response = await fetchFn(url2, { + method, + headers, + body: requestBody, + signal: newSignals, + credentials: withCredentials ? "include" : undefined, + duplex + }); + if (timeoutAbortId != null) { + clearTimeout(timeoutAbortId); + } + return response; }; var Headers; -if (typeof globalThis.Headers !== "undefined") Headers = globalThis.Headers; -else Headers = class Headers2 { - constructor(init) { - this.headers = /* @__PURE__ */ new Map(); - if (init) if (init instanceof Headers2) init.forEach((value, key) => this.append(key, value)); - else if (Array.isArray(init)) for (const [key, value] of init) if (typeof key === "string" && typeof value === "string") this.append(key, value); - else throw new TypeError("Each header entry must be a [string, string] tuple"); - else for (const [key, value] of Object.entries(init)) if (typeof value === "string") this.append(key, value); - else throw new TypeError("Header values must be strings"); - } - append(name, value) { - const key = name.toLowerCase(); - const existing = this.headers.get(key) || []; - this.headers.set(key, [...existing, value]); - } - delete(name) { - const key = name.toLowerCase(); - this.headers.delete(key); - } - get(name) { - const key = name.toLowerCase(); - const values = this.headers.get(key); - return values ? values.join(", ") : null; - } - has(name) { - const key = name.toLowerCase(); - return this.headers.has(key); - } - set(name, value) { - const key = name.toLowerCase(); - this.headers.set(key, [value]); - } - forEach(callbackfn, thisArg) { - const boundCallback = thisArg ? callbackfn.bind(thisArg) : callbackfn; - this.headers.forEach((values, key) => boundCallback(values.join(", "), key, this)); - } - getSetCookie() { - return this.headers.get("set-cookie") || []; - } - *entries() { - for (const [key, values] of this.headers.entries()) yield [key, values.join(", ")]; - } - *keys() { - yield* this.headers.keys(); - } - *values() { - for (const values of this.headers.values()) yield values.join(", "); - } - [Symbol.iterator]() { - return this.entries(); - } -}; +if (typeof globalThis.Headers !== "undefined") { + Headers = globalThis.Headers; +} else { + Headers = class Headers2 { + constructor(init) { + this.headers = /* @__PURE__ */ new Map; + if (init) { + if (init instanceof Headers2) { + init.forEach((value, key) => this.append(key, value)); + } else if (Array.isArray(init)) { + for (const [key, value] of init) { + if (typeof key === "string" && typeof value === "string") { + this.append(key, value); + } else { + throw new TypeError("Each header entry must be a [string, string] tuple"); + } + } + } else { + for (const [key, value] of Object.entries(init)) { + if (typeof value === "string") { + this.append(key, value); + } else { + throw new TypeError("Header values must be strings"); + } + } + } + } + } + append(name, value) { + const key = name.toLowerCase(); + const existing = this.headers.get(key) || []; + this.headers.set(key, [...existing, value]); + } + delete(name) { + const key = name.toLowerCase(); + this.headers.delete(key); + } + get(name) { + const key = name.toLowerCase(); + const values = this.headers.get(key); + return values ? values.join(", ") : null; + } + has(name) { + const key = name.toLowerCase(); + return this.headers.has(key); + } + set(name, value) { + const key = name.toLowerCase(); + this.headers.set(key, [value]); + } + forEach(callbackfn, thisArg) { + const boundCallback = thisArg ? callbackfn.bind(thisArg) : callbackfn; + this.headers.forEach((values, key) => boundCallback(values.join(", "), key, this)); + } + getSetCookie() { + return this.headers.get("set-cookie") || []; + } + *entries() { + for (const [key, values] of this.headers.entries()) { + yield [key, values.join(", ")]; + } + } + *keys() { + yield* this.headers.keys(); + } + *values() { + for (const values of this.headers.values()) { + yield values.join(", "); + } + } + [Symbol.iterator]() { + return this.entries(); + } + }; +} var abortRawResponse = { - headers: new Headers(), - redirected: false, - status: 499, - statusText: "Client Closed Request", - type: "error", - url: "" + headers: new Headers, + redirected: false, + status: 499, + statusText: "Client Closed Request", + type: "error", + url: "" }; var unknownRawResponse = { - headers: new Headers(), - redirected: false, - status: 0, - statusText: "Unknown Error", - type: "error", - url: "" + headers: new Headers, + redirected: false, + status: 0, + statusText: "Unknown Error", + type: "error", + url: "" }; function toRawResponse(response) { - return { - headers: response.headers, - redirected: response.redirected, - status: response.status, - statusText: response.statusText, - type: response.type, - url: response.url - }; -} -var INITIAL_RETRY_DELAY = 1e3; -var MAX_RETRY_DELAY = 6e4; + return { + headers: response.headers, + redirected: response.redirected, + status: response.status, + statusText: response.statusText, + type: response.type, + url: response.url + }; +} +var INITIAL_RETRY_DELAY = 1000; +var MAX_RETRY_DELAY = 60000; var DEFAULT_MAX_RETRIES = 2; -var JITTER_FACTOR = .2; +var JITTER_FACTOR = 0.2; function addPositiveJitter(delay) { - return delay * (1 + Math.random() * JITTER_FACTOR); + const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; + return delay * jitterMultiplier; } function addSymmetricJitter(delay) { - return delay * (1 + (Math.random() - .5) * JITTER_FACTOR); + const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR; + return delay * jitterMultiplier; } function getRetryDelayFromHeaders(response, retryAttempt) { - const retryAfter = response.headers.get("Retry-After"); - if (retryAfter) { - const retryAfterSeconds = parseInt(retryAfter, 10); - if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) return Math.min(retryAfterSeconds * 1e3, MAX_RETRY_DELAY); - const retryAfterDate = new Date(retryAfter); - if (!isNaN(retryAfterDate.getTime())) { - const delay = retryAfterDate.getTime() - Date.now(); - if (delay > 0) return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); - } - } - const rateLimitReset = response.headers.get("X-RateLimit-Reset"); - if (rateLimitReset) { - const resetTime = parseInt(rateLimitReset, 10); - if (!isNaN(resetTime)) { - const delay = resetTime * 1e3 - Date.now(); - if (delay > 0) return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); - } - } - return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY)); + const retryAfter = response.headers.get("Retry-After"); + if (retryAfter) { + const retryAfterSeconds = parseInt(retryAfter, 10); + if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) { + return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY); + } + const retryAfterDate = new Date(retryAfter); + if (!isNaN(retryAfterDate.getTime())) { + const delay = retryAfterDate.getTime() - Date.now(); + if (delay > 0) { + return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); + } + } + } + const rateLimitReset = response.headers.get("X-RateLimit-Reset"); + if (rateLimitReset) { + const resetTime = parseInt(rateLimitReset, 10); + if (!isNaN(resetTime)) { + const delay = resetTime * 1000 - Date.now(); + if (delay > 0) { + return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); + } + } + } + return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY)); } async function requestWithRetries(requestFn, maxRetries = DEFAULT_MAX_RETRIES) { - let response = await requestFn(); - for (let i = 0; i < maxRetries; ++i) if ([408, 429].includes(response.status) || response.status >= 500) { - const delay = getRetryDelayFromHeaders(response, i); - await new Promise((resolve) => setTimeout(resolve, delay)); - response = await requestFn(); - } else break; - return response; -} -var Supplier = { get: async (supplier) => { - if (typeof supplier === "function") return supplier(); - else return supplier; -} }; + let response = await requestFn(); + for (let i = 0;i < maxRetries; ++i) { + if ([408, 429].includes(response.status) || response.status >= 500) { + const delay = getRetryDelayFromHeaders(response, i); + await new Promise((resolve) => setTimeout(resolve, delay)); + response = await requestFn(); + } else { + break; + } + } + return response; +} +var Supplier = { + get: async (supplier) => { + if (typeof supplier === "function") { + return supplier(); + } else { + return supplier; + } + } +}; async function getHeaders(args) { - const newHeaders = {}; - if (args.body !== void 0 && args.contentType != null) newHeaders["Content-Type"] = args.contentType; - if (args.headers == null) return newHeaders; - for (const [key, value] of Object.entries(args.headers)) { - const result = await Supplier.get(value); - if (typeof result === "string") { - newHeaders[key] = result; - continue; - } - if (result == null) continue; - newHeaders[key] = `${result}`; - } - return newHeaders; + const newHeaders = {}; + if (args.body !== undefined && args.contentType != null) { + newHeaders["Content-Type"] = args.contentType; + } + if (args.headers == null) { + return newHeaders; + } + for (const [key, value] of Object.entries(args.headers)) { + const result = await Supplier.get(value); + if (typeof result === "string") { + newHeaders[key] = result; + continue; + } + if (result == null) { + continue; + } + newHeaders[key] = `${result}`; + } + return newHeaders; } async function fetcherImpl(args) { - const url = createRequestUrl(args.url, args.queryParameters); - const requestBody = await getRequestBody({ - body: args.body, - type: args.requestType === "json" ? "json" : "other" - }); - const fetchFn = await getFetchFn(); - try { - const response = await requestWithRetries(async () => makeRequest(fetchFn, url, args.method, await getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex), args.maxRetries); - if (response.status >= 200 && response.status < 400) return { - ok: true, - body: await getResponseBody(response, args.responseType), - headers: response.headers, - rawResponse: toRawResponse(response) - }; - else return { - ok: false, - error: { - reason: "status-code", - statusCode: response.status, - body: await getErrorResponseBody(response) - }, - rawResponse: toRawResponse(response) - }; - } catch (error) { - if (args.abortSignal != null && args.abortSignal.aborted) return { - ok: false, - error: { - reason: "unknown", - errorMessage: "The user aborted a request" - }, - rawResponse: abortRawResponse - }; - else if (error instanceof Error && error.name === "AbortError") return { - ok: false, - error: { reason: "timeout" }, - rawResponse: abortRawResponse - }; - else if (error instanceof Error) return { - ok: false, - error: { - reason: "unknown", - errorMessage: error.message - }, - rawResponse: unknownRawResponse - }; - return { - ok: false, - error: { - reason: "unknown", - errorMessage: toJson(error) - }, - rawResponse: unknownRawResponse - }; - } + const url2 = createRequestUrl(args.url, args.queryParameters); + const requestBody = await getRequestBody({ + body: args.body, + type: args.requestType === "json" ? "json" : "other" + }); + const fetchFn = await getFetchFn(); + try { + const response = await requestWithRetries(async () => makeRequest(fetchFn, url2, args.method, await getHeaders(args), requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex), args.maxRetries); + if (response.status >= 200 && response.status < 400) { + return { + ok: true, + body: await getResponseBody(response, args.responseType), + headers: response.headers, + rawResponse: toRawResponse(response) + }; + } else { + return { + ok: false, + error: { + reason: "status-code", + statusCode: response.status, + body: await getErrorResponseBody(response) + }, + rawResponse: toRawResponse(response) + }; + } + } catch (error51) { + if (args.abortSignal != null && args.abortSignal.aborted) { + return { + ok: false, + error: { + reason: "unknown", + errorMessage: "The user aborted a request" + }, + rawResponse: abortRawResponse + }; + } else if (error51 instanceof Error && error51.name === "AbortError") { + return { + ok: false, + error: { + reason: "timeout" + }, + rawResponse: abortRawResponse + }; + } else if (error51 instanceof Error) { + return { + ok: false, + error: { + reason: "unknown", + errorMessage: error51.message + }, + rawResponse: unknownRawResponse + }; + } + return { + ok: false, + error: { + reason: "unknown", + errorMessage: toJson(error51) + }, + rawResponse: unknownRawResponse + }; + } } var fetcher = fetcherImpl; var HttpResponsePromise = class _HttpResponsePromise extends Promise { - constructor(promise) { - super((resolve) => { - resolve(void 0); - }); - this.innerPromise = promise; - } - /** - * Creates an `HttpResponsePromise` from a function that returns a promise. - * - * @param fn - A function that returns a promise resolving to a `WithRawResponse` object. - * @param args - Arguments to pass to the function. - * @returns An `HttpResponsePromise` instance. - */ - static fromFunction(fn, ...args) { - return new _HttpResponsePromise(fn(...args)); - } - /** - * Creates a function that returns an `HttpResponsePromise` from a function that returns a promise. - * - * @param fn - A function that returns a promise resolving to a `WithRawResponse` object. - * @returns A function that returns an `HttpResponsePromise` instance. - */ - static interceptFunction(fn) { - return (...args) => { - return _HttpResponsePromise.fromPromise(fn(...args)); - }; - } - /** - * Creates an `HttpResponsePromise` from an existing promise. - * - * @param promise - A promise resolving to a `WithRawResponse` object. - * @returns An `HttpResponsePromise` instance. - */ - static fromPromise(promise) { - return new _HttpResponsePromise(promise); - } - /** - * Creates an `HttpResponsePromise` from an executor function. - * - * @param executor - A function that takes resolve and reject callbacks to create a promise. - * @returns An `HttpResponsePromise` instance. - */ - static fromExecutor(executor) { - return new _HttpResponsePromise(new Promise(executor)); - } - /** - * Creates an `HttpResponsePromise` from a resolved result. - * - * @param result - A `WithRawResponse` object to resolve immediately. - * @returns An `HttpResponsePromise` instance. - */ - static fromResult(result) { - return new _HttpResponsePromise(Promise.resolve(result)); - } - unwrap() { - if (!this.unwrappedPromise) this.unwrappedPromise = this.innerPromise.then(({ data }) => data); - return this.unwrappedPromise; - } - /** @inheritdoc */ - then(onfulfilled, onrejected) { - return this.unwrap().then(onfulfilled, onrejected); - } - /** @inheritdoc */ - catch(onrejected) { - return this.unwrap().catch(onrejected); - } - /** @inheritdoc */ - finally(onfinally) { - return this.unwrap().finally(onfinally); - } - /** - * Retrieves the data and raw response. - * - * @returns A promise resolving to a `WithRawResponse` object. - */ - async withRawResponse() { - return await this.innerPromise; - } + constructor(promise2) { + super((resolve) => { + resolve(undefined); + }); + this.innerPromise = promise2; + } + static fromFunction(fn, ...args) { + return new _HttpResponsePromise(fn(...args)); + } + static interceptFunction(fn) { + return (...args) => { + return _HttpResponsePromise.fromPromise(fn(...args)); + }; + } + static fromPromise(promise2) { + return new _HttpResponsePromise(promise2); + } + static fromExecutor(executor) { + const promise2 = new Promise(executor); + return new _HttpResponsePromise(promise2); + } + static fromResult(result) { + const promise2 = Promise.resolve(result); + return new _HttpResponsePromise(promise2); + } + unwrap() { + if (!this.unwrappedPromise) { + this.unwrappedPromise = this.innerPromise.then(({ data }) => data); + } + return this.unwrappedPromise; + } + then(onfulfilled, onrejected) { + return this.unwrap().then(onfulfilled, onrejected); + } + catch(onrejected) { + return this.unwrap().catch(onrejected); + } + finally(onfinally) { + return this.unwrap().finally(onfinally); + } + async withRawResponse() { + return await this.innerPromise; + } }; var url_exports = {}; -__export(url_exports, { - join: () => join, - toQueryString: () => toQueryString -}); -function join(base, ...segments) { - if (!base) return ""; - if (segments.length === 0) return base; - if (base.includes("://")) { - let url; - try { - url = new URL(base); - } catch { - return joinPath(base, ...segments); - } - const lastSegment = segments[segments.length - 1]; - const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/"); - for (const segment of segments) { - const cleanSegment = trimSlashes(segment); - if (cleanSegment) url.pathname = joinPathSegments(url.pathname, cleanSegment); - } - if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) url.pathname += "/"; - return url.toString(); - } - return joinPath(base, ...segments); +__export2(url_exports, { + join: () => join2, + toQueryString: () => toQueryString +}); +function join2(base, ...segments) { + if (!base) { + return ""; + } + if (segments.length === 0) { + return base; + } + if (base.includes("://")) { + let url2; + try { + url2 = new URL(base); + } catch { + return joinPath(base, ...segments); + } + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/"); + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) { + url2.pathname = joinPathSegments(url2.pathname, cleanSegment); + } + } + if (shouldPreserveTrailingSlash && !url2.pathname.endsWith("/")) { + url2.pathname += "/"; + } + return url2.toString(); + } + return joinPath(base, ...segments); } function joinPath(base, ...segments) { - if (segments.length === 0) return base; - let result = base; - const lastSegment = segments[segments.length - 1]; - const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/"); - for (const segment of segments) { - const cleanSegment = trimSlashes(segment); - if (cleanSegment) result = joinPathSegments(result, cleanSegment); - } - if (shouldPreserveTrailingSlash && !result.endsWith("/")) result += "/"; - return result; + if (segments.length === 0) { + return base; + } + let result = base; + const lastSegment = segments[segments.length - 1]; + const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/"); + for (const segment of segments) { + const cleanSegment = trimSlashes(segment); + if (cleanSegment) { + result = joinPathSegments(result, cleanSegment); + } + } + if (shouldPreserveTrailingSlash && !result.endsWith("/")) { + result += "/"; + } + return result; } function joinPathSegments(left, right) { - if (left.endsWith("/")) return left + right; - return left + "/" + right; + if (left.endsWith("/")) { + return left + right; + } + return left + "/" + right; } function trimSlashes(str) { - if (!str) return str; - let start = 0; - let end = str.length; - if (str.startsWith("/")) start = 1; - if (str.endsWith("/")) end = str.length - 1; - return start === 0 && end === str.length ? str : str.slice(start, end); -} -function base64ToBytes2(base64$1) { - const binString = atob(base64$1); - return Uint8Array.from(binString, (m) => m.codePointAt(0)); + if (!str) + return str; + let start = 0; + let end = str.length; + if (str.startsWith("/")) + start = 1; + if (str.endsWith("/")) + end = str.length - 1; + return start === 0 && end === str.length ? str : str.slice(start, end); +} +function base64ToBytes2(base643) { + const binString = atob(base643); + return Uint8Array.from(binString, (m) => m.codePointAt(0)); } function bytesToBase642(bytes) { - const binString = String.fromCodePoint(...bytes); - return btoa(binString); + const binString = String.fromCodePoint(...bytes); + return btoa(binString); } function base64Encode2(input) { - if (typeof Buffer !== "undefined") return Buffer.from(input, "utf8").toString("base64"); - return bytesToBase642(new TextEncoder().encode(input)); + if (typeof Buffer !== "undefined") { + return Buffer.from(input, "utf8").toString("base64"); + } + const bytes = new TextEncoder().encode(input); + return bytesToBase642(bytes); } function base64Decode2(input) { - if (typeof Buffer !== "undefined") return Buffer.from(input, "base64").toString("utf8"); - const bytes = base64ToBytes2(input); - return new TextDecoder().decode(bytes); + if (typeof Buffer !== "undefined") { + return Buffer.from(input, "base64").toString("utf8"); + } + const bytes = base64ToBytes2(input); + return new TextDecoder().decode(bytes); } var BASIC_AUTH_HEADER_PREFIX = /^Basic /i; var BasicAuth = { - toAuthorizationHeader: (basicAuth) => { - if (basicAuth == null) return; - return `Basic ${base64Encode2(`${basicAuth.username}:${basicAuth.password}`)}`; - }, - fromAuthorizationHeader: (header) => { - const [username, password] = base64Decode2(header.replace(BASIC_AUTH_HEADER_PREFIX, "")).split(":", 2); - if (username == null || password == null) throw new Error("Invalid basic auth"); - return { - username, - password - }; - } + toAuthorizationHeader: (basicAuth) => { + if (basicAuth == null) { + return; + } + const token = base64Encode2(`${basicAuth.username}:${basicAuth.password}`); + return `Basic ${token}`; + }, + fromAuthorizationHeader: (header) => { + const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); + const decoded = base64Decode2(credentials); + const [username, password] = decoded.split(":", 2); + if (username == null || password == null) { + throw new Error("Invalid basic auth"); + } + return { + username, + password + }; + } }; var AnnotationQueues = class { - constructor(_options) { - this._options = _options; - } - /** - * Get all annotation queues - * - * @param {LangfuseAPI.GetAnnotationQueuesRequest} request - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.listQueues() - */ - listQueues(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__listQueues(request, requestOptions)); - } - async __listQueues(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/annotation-queues"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create an annotation queue - * - * @param {LangfuseAPI.CreateAnnotationQueueRequest} request - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.createQueue({ - * name: "name", - * description: undefined, - * scoreConfigIds: ["scoreConfigIds", "scoreConfigIds"] - * }) - */ - createQueue(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__createQueue(request, requestOptions)); - } - async __createQueue(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/annotation-queues"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get an annotation queue by ID - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.getQueue("queueId") - */ - getQueue(queueId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getQueue(queueId, requestOptions)); - } - async __getQueue(queueId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get items for a specific annotation queue - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {LangfuseAPI.GetAnnotationQueueItemsRequest} request - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.listQueueItems("queueId") - */ - listQueueItems(queueId, request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__listQueueItems(queueId, request, requestOptions)); - } - async __listQueueItems(queueId, request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { status, page, limit } = request; - const _queryParams = {}; - if (status != null) _queryParams["status"] = status; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items`), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}/items."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a specific item from an annotation queue - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {string} itemId - The unique identifier of the annotation queue item - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.getQueueItem("queueId", "itemId") - */ - getQueueItem(queueId, itemId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getQueueItem(queueId, itemId, requestOptions)); - } - async __getQueueItem(queueId, itemId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}/items/{itemId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Add an item to an annotation queue - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {LangfuseAPI.CreateAnnotationQueueItemRequest} request - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.createQueueItem("queueId", { - * objectId: "objectId", - * objectType: "TRACE", - * status: undefined - * }) - */ - createQueueItem(queueId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__createQueueItem(queueId, request, requestOptions)); - } - async __createQueueItem(queueId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items`), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues/{queueId}/items."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Update an annotation queue item - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {string} itemId - The unique identifier of the annotation queue item - * @param {LangfuseAPI.UpdateAnnotationQueueItemRequest} request - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.updateQueueItem("queueId", "itemId", { - * status: undefined - * }) - */ - updateQueueItem(queueId, itemId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__updateQueueItem(queueId, itemId, request, requestOptions)); - } - async __updateQueueItem(queueId, itemId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), - method: "PATCH", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/annotation-queues/{queueId}/items/{itemId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Remove an item from an annotation queue - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {string} itemId - The unique identifier of the annotation queue item - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.deleteQueueItem("queueId", "itemId") - */ - deleteQueueItem(queueId, itemId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteQueueItem(queueId, itemId, requestOptions)); - } - async __deleteQueueItem(queueId, itemId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/annotation-queues/{queueId}/items/{itemId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create an assignment for a user to an annotation queue - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {LangfuseAPI.AnnotationQueueAssignmentRequest} request - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.createQueueAssignment("queueId", { - * userId: "userId" - * }) - */ - createQueueAssignment(queueId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__createQueueAssignment(queueId, request, requestOptions)); - } - async __createQueueAssignment(queueId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/assignments`), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues/{queueId}/assignments."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete an assignment for a user to an annotation queue - * - * @param {string} queueId - The unique identifier of the annotation queue - * @param {LangfuseAPI.AnnotationQueueAssignmentRequest} request - * @param {AnnotationQueues.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.annotationQueues.deleteQueueAssignment("queueId", { - * userId: "userId" - * }) - */ - deleteQueueAssignment(queueId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteQueueAssignment(queueId, request, requestOptions)); - } - async __deleteQueueAssignment(queueId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/assignments`), - method: "DELETE", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/annotation-queues/{queueId}/assignments."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + listQueues(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__listQueues(request, requestOptions)); + } + async __listQueues(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/annotation-queues"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + createQueue(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createQueue(request, requestOptions)); + } + async __createQueue(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/annotation-queues"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getQueue(queueId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getQueue(queueId, requestOptions)); + } + async __getQueue(queueId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + listQueueItems(queueId, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__listQueueItems(queueId, request, requestOptions)); + } + async __listQueueItems(queueId, request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { status, page, limit } = request; + const _queryParams = {}; + if (status != null) { + _queryParams["status"] = status; + } + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items`), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}/items."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getQueueItem(queueId, itemId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getQueueItem(queueId, itemId, requestOptions)); + } + async __getQueueItem(queueId, itemId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/annotation-queues/{queueId}/items/{itemId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + createQueueItem(queueId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createQueueItem(queueId, request, requestOptions)); + } + async __createQueueItem(queueId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items`), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues/{queueId}/items."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + updateQueueItem(queueId, itemId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__updateQueueItem(queueId, itemId, request, requestOptions)); + } + async __updateQueueItem(queueId, itemId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/annotation-queues/{queueId}/items/{itemId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteQueueItem(queueId, itemId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteQueueItem(queueId, itemId, requestOptions)); + } + async __deleteQueueItem(queueId, itemId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/items/${encodeURIComponent(itemId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/annotation-queues/{queueId}/items/{itemId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + createQueueAssignment(queueId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createQueueAssignment(queueId, request, requestOptions)); + } + async __createQueueAssignment(queueId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/assignments`), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/annotation-queues/{queueId}/assignments."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteQueueAssignment(queueId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteQueueAssignment(queueId, request, requestOptions)); + } + async __deleteQueueAssignment(queueId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/annotation-queues/${encodeURIComponent(queueId)}/assignments`), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/annotation-queues/{queueId}/assignments."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var BlobStorageIntegrations = class { - constructor(_options) { - this._options = _options; - } - /** - * Get all blob storage integrations for the organization (requires organization-scoped API key) - * - * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.blobStorageIntegrations.getBlobStorageIntegrations() - */ - getBlobStorageIntegrations(requestOptions) { - return HttpResponsePromise.fromPromise(this.__getBlobStorageIntegrations(requestOptions)); - } - async __getBlobStorageIntegrations(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/integrations/blob-storage"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/integrations/blob-storage."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create or update a blob storage integration for a specific project (requires organization-scoped API key). The configuration is validated by performing a test upload to the bucket. - * - * @param {LangfuseAPI.CreateBlobStorageIntegrationRequest} request - * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.blobStorageIntegrations.upsertBlobStorageIntegration({ - * projectId: "projectId", - * type: "S3", - * bucketName: "bucketName", - * endpoint: undefined, - * region: "region", - * accessKeyId: undefined, - * secretAccessKey: undefined, - * prefix: undefined, - * exportFrequency: "every_20_minutes", - * enabled: true, - * forcePathStyle: true, - * fileType: "JSON", - * exportMode: "FULL_HISTORY", - * exportStartDate: undefined, - * compressed: undefined, - * exportSource: undefined, - * exportFieldGroups: undefined - * }) - */ - upsertBlobStorageIntegration(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__upsertBlobStorageIntegration(request, requestOptions)); - } - async __upsertBlobStorageIntegration(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/integrations/blob-storage"), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/integrations/blob-storage."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get the sync status of a blob storage integration by integration ID (requires organization-scoped API key) - * - * @param {string} id - * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.blobStorageIntegrations.getBlobStorageIntegrationStatus("id") - */ - getBlobStorageIntegrationStatus(id, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getBlobStorageIntegrationStatus(id, requestOptions)); - } - async __getBlobStorageIntegrationStatus(id, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/integrations/blob-storage/${encodeURIComponent(id)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/integrations/blob-storage/{id}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a blob storage integration by ID (requires organization-scoped API key) - * - * @param {string} id - * @param {BlobStorageIntegrations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.blobStorageIntegrations.deleteBlobStorageIntegration("id") - */ - deleteBlobStorageIntegration(id, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteBlobStorageIntegration(id, requestOptions)); - } - async __deleteBlobStorageIntegration(id, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/integrations/blob-storage/${encodeURIComponent(id)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/integrations/blob-storage/{id}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + getBlobStorageIntegrations(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getBlobStorageIntegrations(requestOptions)); + } + async __getBlobStorageIntegrations(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/integrations/blob-storage"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/integrations/blob-storage."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + upsertBlobStorageIntegration(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__upsertBlobStorageIntegration(request, requestOptions)); + } + async __upsertBlobStorageIntegration(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/integrations/blob-storage"), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/integrations/blob-storage."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getBlobStorageIntegrationStatus(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getBlobStorageIntegrationStatus(id, requestOptions)); + } + async __getBlobStorageIntegrationStatus(id, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/integrations/blob-storage/${encodeURIComponent(id)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/integrations/blob-storage/{id}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteBlobStorageIntegration(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteBlobStorageIntegration(id, requestOptions)); + } + async __deleteBlobStorageIntegration(id, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/integrations/blob-storage/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/integrations/blob-storage/{id}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Comments = class { - constructor(_options) { - this._options = _options; - } - /** - * Create a comment. Comments may be attached to different object types (trace, observation, session, prompt). - * - * @param {LangfuseAPI.CreateCommentRequest} request - * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.comments.create({ - * projectId: "projectId", - * objectType: "objectType", - * objectId: "objectId", - * content: "content", - * authorUserId: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/comments"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/comments."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get all comments - * - * @param {LangfuseAPI.GetCommentsRequest} request - * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.comments.get() - */ - get(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); - } - async __get(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit, objectType, objectId, authorUserId } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - if (objectType != null) _queryParams["objectType"] = objectType; - if (objectId != null) _queryParams["objectId"] = objectId; - if (authorUserId != null) _queryParams["authorUserId"] = authorUserId; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/comments"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/comments."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a comment by id - * - * @param {string} commentId - The unique langfuse identifier of a comment - * @param {Comments.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.comments.getById("commentId") - */ - getById(commentId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getById(commentId, requestOptions)); - } - async __getById(commentId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/comments/${encodeURIComponent(commentId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/comments/{commentId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/comments"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/comments."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); + } + async __get(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit, objectType, objectId, authorUserId } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + if (objectType != null) { + _queryParams["objectType"] = objectType; + } + if (objectId != null) { + _queryParams["objectId"] = objectId; + } + if (authorUserId != null) { + _queryParams["authorUserId"] = authorUserId; + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/comments"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/comments."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getById(commentId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getById(commentId, requestOptions)); + } + async __getById(commentId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/comments/${encodeURIComponent(commentId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/comments/{commentId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var DatasetItems = class { - constructor(_options) { - this._options = _options; - } - /** - * Create a dataset item - * - * @param {LangfuseAPI.CreateDatasetItemRequest} request - * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasetItems.create({ - * datasetName: "datasetName", - * input: undefined, - * expectedOutput: undefined, - * metadata: undefined, - * sourceTraceId: undefined, - * sourceObservationId: undefined, - * id: undefined, - * status: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-items"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/dataset-items."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a dataset item - * - * @param {string} id - * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasetItems.get("id") - */ - get(id, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); - } - async __get(id, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/dataset-items/${encodeURIComponent(id)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-items/{id}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get dataset items. Optionally specify a version to get the items as they existed at that point in time. - * Note: If version parameter is provided, datasetName must also be provided. - * - * @param {LangfuseAPI.GetDatasetItemsRequest} request - * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasetItems.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { datasetName, sourceTraceId, sourceObservationId, version: version$1, page, limit } = request; - const _queryParams = {}; - if (datasetName != null) _queryParams["datasetName"] = datasetName; - if (sourceTraceId != null) _queryParams["sourceTraceId"] = sourceTraceId; - if (sourceObservationId != null) _queryParams["sourceObservationId"] = sourceObservationId; - if (version$1 != null) _queryParams["version"] = version$1; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-items"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-items."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a dataset item and all its run items. This action is irreversible. - * - * @param {string} id - * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasetItems.delete("id") - */ - delete(id, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); - } - async __delete(id, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/dataset-items/${encodeURIComponent(id)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/dataset-items/{id}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-items"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/dataset-items."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); + } + async __get(id, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/dataset-items/${encodeURIComponent(id)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-items/{id}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { + datasetName, + sourceTraceId, + sourceObservationId, + version: version2, + page, + limit + } = request; + const _queryParams = {}; + if (datasetName != null) { + _queryParams["datasetName"] = datasetName; + } + if (sourceTraceId != null) { + _queryParams["sourceTraceId"] = sourceTraceId; + } + if (sourceObservationId != null) { + _queryParams["sourceObservationId"] = sourceObservationId; + } + if (version2 != null) { + _queryParams["version"] = version2; + } + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-items"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-items."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + } + async __delete(id, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/dataset-items/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/dataset-items/{id}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var DatasetRunItems = class { - constructor(_options) { - this._options = _options; - } - /** - * Create a dataset run item - * - * @param {LangfuseAPI.CreateDatasetRunItemRequest} request - * @param {DatasetRunItems.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasetRunItems.create({ - * runName: "runName", - * runDescription: undefined, - * metadata: undefined, - * datasetItemId: "datasetItemId", - * observationId: undefined, - * traceId: undefined, - * datasetVersion: undefined, - * createdAt: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-run-items"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/dataset-run-items."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * List dataset run items - * - * @param {LangfuseAPI.ListDatasetRunItemsRequest} request - * @param {DatasetRunItems.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasetRunItems.list({ - * datasetId: "datasetId", - * runName: "runName" - * }) - */ - list(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { datasetId, runName, page, limit } = request; - const _queryParams = {}; - _queryParams["datasetId"] = datasetId; - _queryParams["runName"] = runName; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-run-items"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-run-items."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-run-items"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/dataset-run-items."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + list(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { datasetId, runName, page, limit } = request; + const _queryParams = {}; + _queryParams["datasetId"] = datasetId; + _queryParams["runName"] = runName; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/dataset-run-items"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/dataset-run-items."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Datasets = class { - constructor(_options) { - this._options = _options; - } - /** - * Get all datasets - * - * @param {LangfuseAPI.GetDatasetsRequest} request - * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasets.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/datasets"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/datasets."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a dataset - * - * @param {string} datasetName - * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasets.get("datasetName") - */ - get(datasetName, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(datasetName, requestOptions)); - } - async __get(datasetName, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/datasets/${encodeURIComponent(datasetName)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/datasets/{datasetName}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create a dataset - * - * @param {LangfuseAPI.CreateDatasetRequest} request - * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasets.create({ - * name: "name", - * description: undefined, - * metadata: undefined, - * inputSchema: undefined, - * expectedOutputSchema: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/datasets"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/v2/datasets."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a dataset run and its items - * - * @param {string} datasetName - * @param {string} runName - * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasets.getRun("datasetName", "runName") - */ - getRun(datasetName, runName, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getRun(datasetName, runName, requestOptions)); - } - async __getRun(datasetName, runName, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/datasets/{datasetName}/runs/{runName}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a dataset run and all its run items. This action is irreversible. - * - * @param {string} datasetName - * @param {string} runName - * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasets.deleteRun("datasetName", "runName") - */ - deleteRun(datasetName, runName, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteRun(datasetName, runName, requestOptions)); - } - async __deleteRun(datasetName, runName, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/datasets/{datasetName}/runs/{runName}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get dataset runs - * - * @param {string} datasetName - * @param {LangfuseAPI.GetDatasetRunsRequest} request - * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.datasets.getRuns("datasetName") - */ - getRuns(datasetName, request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getRuns(datasetName, request, requestOptions)); - } - async __getRuns(datasetName, request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs`), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/datasets/{datasetName}/runs."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/datasets"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/datasets."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(datasetName, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(datasetName, requestOptions)); + } + async __get(datasetName, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/datasets/${encodeURIComponent(datasetName)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/datasets/{datasetName}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/datasets"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/v2/datasets."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getRun(datasetName, runName, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getRun(datasetName, runName, requestOptions)); + } + async __getRun(datasetName, runName, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/datasets/{datasetName}/runs/{runName}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteRun(datasetName, runName, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteRun(datasetName, runName, requestOptions)); + } + async __deleteRun(datasetName, runName, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/datasets/{datasetName}/runs/{runName}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getRuns(datasetName, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getRuns(datasetName, request, requestOptions)); + } + async __getRuns(datasetName, request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/datasets/${encodeURIComponent(datasetName)}/runs`), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/datasets/{datasetName}/runs."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Health = class { - constructor(_options) { - this._options = _options; - } - /** - * Check health of API and database - * - * @param {Health.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.ServiceUnavailableError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.health.health() - */ - health(requestOptions) { - return HttpResponsePromise.fromPromise(this.__health(requestOptions)); - } - async __health(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/health"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 503: throw new ServiceUnavailableError(_response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/health."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + health(requestOptions) { + return HttpResponsePromise.fromPromise(this.__health(requestOptions)); + } + async __health(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/health"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 503: + throw new ServiceUnavailableError(_response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/health."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Ingestion = class { - constructor(_options) { - this._options = _options; - } - /** - * **Legacy endpoint for batch ingestion for Langfuse Observability.** - * - * -> Please use the OpenTelemetry endpoint (`/api/public/otel/v1/traces`). Learn more: https://langfuse.com/integrations/native/opentelemetry - * - * Within each batch, there can be multiple events. - * Each event has a type, an id, a timestamp, metadata and a body. - * Internally, we refer to this as the "event envelope" as it tells us something about the event but not the trace. - * We use the event id within this envelope to deduplicate messages to avoid processing the same event twice, i.e. the event id should be unique per request. - * The event.body.id is the ID of the actual trace and will be used for updates and will be visible within the Langfuse App. - * I.e. if you want to update a trace, you'd use the same body id, but separate event IDs. - * - * Notes: - * - Introduction to data model: https://langfuse.com/docs/observability/data-model - * - Batch sizes are limited to 3.5 MB in total. You need to adjust the number of events per batch accordingly. - * - The API does not return a 4xx status code for input errors. Instead, it responds with a 207 status code, which includes a list of the encountered errors. - * - * @param {LangfuseAPI.IngestionRequest} request - * @param {Ingestion.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.ingestion.batch({ - * batch: [{ - * type: "trace-create", - * id: "abcdef-1234-5678-90ab", - * timestamp: "2022-01-01T00:00:00.000Z", - * body: { - * id: "abcdef-1234-5678-90ab", - * timestamp: "2022-01-01T00:00:00.000Z", - * environment: "production", - * name: "My Trace", - * userId: "1234-5678-90ab-cdef", - * input: "My input", - * output: "My output", - * sessionId: "1234-5678-90ab-cdef", - * release: "1.0.0", - * version: "1.0.0", - * metadata: "My metadata", - * tags: ["tag1", "tag2"], - * "public": true - * } - * }] - * }) - * - * @example - * await client.ingestion.batch({ - * batch: [{ - * type: "span-create", - * id: "abcdef-1234-5678-90ab", - * timestamp: "2022-01-01T00:00:00.000Z", - * body: { - * id: "abcdef-1234-5678-90ab", - * traceId: "1234-5678-90ab-cdef", - * startTime: "2022-01-01T00:00:00.000Z", - * environment: "test" - * } - * }] - * }) - * - * @example - * await client.ingestion.batch({ - * batch: [{ - * type: "score-create", - * id: "abcdef-1234-5678-90ab", - * timestamp: "2022-01-01T00:00:00.000Z", - * body: { - * id: "abcdef-1234-5678-90ab", - * traceId: "1234-5678-90ab-cdef", - * name: "My Score", - * value: 0.9, - * environment: "default" - * } - * }] - * }) - */ - batch(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__batch(request, requestOptions)); - } - async __batch(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/ingestion"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/ingestion."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + batch(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__batch(request, requestOptions)); + } + async __batch(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/ingestion"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/ingestion."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var MetricsV1 = class { - constructor(_options) { - this._options = _options; - } - /** - * Get metrics from the Langfuse project using a query object. - * - * Consider using the [v2 metrics endpoint](/api-reference#tag/metricsv2/GET/api/public/v2/metrics) for better performance. - * - * For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api). - * - * @param {LangfuseAPI.legacy.GetMetricsRequest} request - * @param {MetricsV1.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.legacy.metricsV1.metrics({ - * query: "query" - * }) - */ - metrics(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__metrics(request, requestOptions)); - } - async __metrics(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { query } = request; - const _queryParams = {}; - _queryParams["query"] = query; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/metrics"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/metrics."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + metrics(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__metrics(request, requestOptions)); + } + async __metrics(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { query } = request; + const _queryParams = {}; + _queryParams["query"] = query; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/metrics"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/metrics."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var ObservationsV1 = class { - constructor(_options) { - this._options = _options; - } - /** - * Get a observation - * - * @param {string} observationId - The unique langfuse identifier of an observation, can be an event, span or generation - * @param {ObservationsV1.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.legacy.observationsV1.get("observationId") - */ - get(observationId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(observationId, requestOptions)); - } - async __get(observationId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/observations/${encodeURIComponent(observationId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/observations/{observationId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a list of observations. - * - * Consider using the [v2 observations endpoint](/api-reference#tag/observationsv2/GET/api/public/v2/observations) for cursor-based pagination and field selection. - * - * @param {LangfuseAPI.legacy.GetObservationsRequest} request - * @param {ObservationsV1.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.legacy.observationsV1.getMany() - */ - getMany(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); - } - async __getMany(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version: version$1, filter } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - if (name != null) _queryParams["name"] = name; - if (userId != null) _queryParams["userId"] = userId; - if (type_ != null) _queryParams["type"] = type_; - if (traceId != null) _queryParams["traceId"] = traceId; - if (level != null) _queryParams["level"] = level; - if (parentObservationId != null) _queryParams["parentObservationId"] = parentObservationId; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; - if (fromStartTime != null) _queryParams["fromStartTime"] = fromStartTime; - if (toStartTime != null) _queryParams["toStartTime"] = toStartTime; - if (version$1 != null) _queryParams["version"] = version$1; - if (filter != null) _queryParams["filter"] = filter; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/observations"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/observations."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + get(observationId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(observationId, requestOptions)); + } + async __get(observationId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/observations/${encodeURIComponent(observationId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/observations/{observationId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getMany(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); + } + async __getMany(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { + page, + limit, + name, + userId, + type: type_, + traceId, + level, + parentObservationId, + environment, + fromStartTime, + toStartTime, + version: version2, + filter + } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + if (name != null) { + _queryParams["name"] = name; + } + if (userId != null) { + _queryParams["userId"] = userId; + } + if (type_ != null) { + _queryParams["type"] = type_; + } + if (traceId != null) { + _queryParams["traceId"] = traceId; + } + if (level != null) { + _queryParams["level"] = level; + } + if (parentObservationId != null) { + _queryParams["parentObservationId"] = parentObservationId; + } + if (environment != null) { + if (Array.isArray(environment)) { + _queryParams["environment"] = environment.map((item) => item); + } else { + _queryParams["environment"] = environment; + } + } + if (fromStartTime != null) { + _queryParams["fromStartTime"] = fromStartTime; + } + if (toStartTime != null) { + _queryParams["toStartTime"] = toStartTime; + } + if (version2 != null) { + _queryParams["version"] = version2; + } + if (filter != null) { + _queryParams["filter"] = filter; + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/observations"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/observations."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var ScoreV1 = class { - constructor(_options) { - this._options = _options; - } - /** - * Create a score (supports both trace and session scores) - * - * @param {LangfuseAPI.legacy.CreateScoreRequest} request - * @param {ScoreV1.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.legacy.scoreV1.create({ - * id: undefined, - * traceId: undefined, - * sessionId: undefined, - * observationId: undefined, - * datasetRunId: undefined, - * name: "name", - * value: 1.1, - * comment: undefined, - * metadata: undefined, - * environment: undefined, - * queueId: undefined, - * dataType: undefined, - * configId: undefined, - * source: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scores"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/scores."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a score (supports both trace and session scores) - * - * @param {string} scoreId - The unique langfuse identifier of a score - * @param {ScoreV1.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.legacy.scoreV1.delete("scoreId") - */ - delete(scoreId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(scoreId, requestOptions)); - } - async __delete(scoreId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scores/${encodeURIComponent(scoreId)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: void 0, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/scores/{scoreId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scores"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/scores."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(scoreId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(scoreId, requestOptions)); + } + async __delete(scoreId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scores/${encodeURIComponent(scoreId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/scores/{scoreId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Legacy = class { - constructor(_options) { - this._options = _options; - } - get metricsV1() { - var _a2; - return (_a2 = this._metricsV1) != null ? _a2 : this._metricsV1 = new MetricsV1(this._options); - } - get observationsV1() { - var _a2; - return (_a2 = this._observationsV1) != null ? _a2 : this._observationsV1 = new ObservationsV1(this._options); - } - get scoreV1() { - var _a2; - return (_a2 = this._scoreV1) != null ? _a2 : this._scoreV1 = new ScoreV1(this._options); - } + constructor(_options) { + this._options = _options; + } + get metricsV1() { + var _a22; + return (_a22 = this._metricsV1) != null ? _a22 : this._metricsV1 = new MetricsV1(this._options); + } + get observationsV1() { + var _a22; + return (_a22 = this._observationsV1) != null ? _a22 : this._observationsV1 = new ObservationsV1(this._options); + } + get scoreV1() { + var _a22; + return (_a22 = this._scoreV1) != null ? _a22 : this._scoreV1 = new ScoreV1(this._options); + } }; var LlmConnections = class { - constructor(_options) { - this._options = _options; - } - /** - * Get all LLM connections in a project - * - * @param {LangfuseAPI.GetLlmConnectionsRequest} request - * @param {LlmConnections.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.llmConnections.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/llm-connections"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/llm-connections."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create or update an LLM connection. The connection is upserted on provider. - * - * @param {LangfuseAPI.UpsertLlmConnectionRequest} request - * @param {LlmConnections.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.llmConnections.upsert({ - * provider: "provider", - * adapter: "anthropic", - * secretKey: "secretKey", - * baseURL: undefined, - * customModels: undefined, - * withDefaultModels: undefined, - * extraHeaders: undefined, - * config: undefined - * }) - */ - upsert(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); - } - async __upsert(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/llm-connections"), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/llm-connections."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete an LLM connection by id. Evaluators that depend on the deleted connection are automatically paused. - * - * @param {string} id - * @param {LlmConnections.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.llmConnections.delete("id") - */ - delete(id, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); - } - async __delete(id, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/llm-connections/${encodeURIComponent(id)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/llm-connections/{id}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/llm-connections"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/llm-connections."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + upsert(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); + } + async __upsert(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/llm-connections"), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/llm-connections."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + } + async __delete(id, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/llm-connections/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/llm-connections/{id}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Media = class { - constructor(_options) { - this._options = _options; - } - /** - * Get a media record - * - * @param {string} mediaId - The unique langfuse identifier of a media record - * @param {Media.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.media.get("mediaId") - */ - get(mediaId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(mediaId, requestOptions)); - } - async __get(mediaId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/media/${encodeURIComponent(mediaId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/media/{mediaId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Patch a media record - * - * @param {string} mediaId - The unique langfuse identifier of a media record - * @param {LangfuseAPI.PatchMediaBody} request - * @param {Media.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.media.patch("mediaId", { - * uploadedAt: "2024-01-15T09:30:00Z", - * uploadHttpStatus: 1, - * uploadHttpError: undefined, - * uploadTimeMs: undefined - * }) - */ - patch(mediaId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__patch(mediaId, request, requestOptions)); - } - async __patch(mediaId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/media/${encodeURIComponent(mediaId)}`), - method: "PATCH", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: void 0, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/media/{mediaId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a presigned upload URL for a media record - * - * @param {LangfuseAPI.GetMediaUploadUrlRequest} request - * @param {Media.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.media.getUploadUrl({ - * traceId: "traceId", - * observationId: undefined, - * contentType: "image/png", - * contentLength: 1, - * sha256Hash: "sha256Hash", - * field: "field" - * }) - */ - getUploadUrl(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getUploadUrl(request, requestOptions)); - } - async __getUploadUrl(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/media"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/media."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + get(mediaId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(mediaId, requestOptions)); + } + async __get(mediaId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/media/${encodeURIComponent(mediaId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/media/{mediaId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + patch(mediaId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__patch(mediaId, request, requestOptions)); + } + async __patch(mediaId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/media/${encodeURIComponent(mediaId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/media/{mediaId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getUploadUrl(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getUploadUrl(request, requestOptions)); + } + async __getUploadUrl(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/media"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/media."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Metrics = class { - constructor(_options) { - this._options = _options; - } - /** - * Get metrics from the Langfuse project using a query object. V2 endpoint with optimized performance. - * - * ## V2 Differences - * - Supports `observations`, `scores-numeric`, and `scores-categorical` views only (traces view not supported) - * - Direct access to tags and release fields on observations - * - Backwards-compatible: traceName, traceRelease, traceVersion dimensions are still available on observations view - * - High cardinality dimensions are not supported and will return a 400 error (see below) - * - * For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api). - * - * ## Available Views - * - * ### observations - * Query observation-level data (spans, generations, events). - * - * **Dimensions:** - * - `environment` - Deployment environment (e.g., production, staging) - * - `type` - Type of observation (SPAN, GENERATION, EVENT) - * - `name` - Name of the observation - * - `level` - Logging level of the observation - * - `version` - Version of the observation - * - `tags` - User-defined tags - * - `release` - Release version - * - `traceName` - Name of the parent trace (backwards-compatible) - * - `traceRelease` - Release version of the parent trace (backwards-compatible, maps to release) - * - `traceVersion` - Version of the parent trace (backwards-compatible, maps to version) - * - `providedModelName` - Name of the model used - * - `promptName` - Name of the prompt used - * - `promptVersion` - Version of the prompt used - * - `startTimeMonth` - Month of start_time in YYYY-MM format - * - * **Measures:** - * - `count` - Total number of observations - * - `latency` - Observation latency (milliseconds) - * - `streamingLatency` - Generation latency from completion start to end (milliseconds) - * - `inputTokens` - Sum of input tokens consumed - * - `outputTokens` - Sum of output tokens produced - * - `totalTokens` - Sum of all tokens consumed - * - `outputTokensPerSecond` - Output tokens per second - * - `tokensPerSecond` - Total tokens per second - * - `inputCost` - Input cost (USD) - * - `outputCost` - Output cost (USD) - * - `totalCost` - Total cost (USD) - * - `timeToFirstToken` - Time to first token (milliseconds) - * - `countScores` - Number of scores attached to the observation - * - * ### scores-numeric - * Query numeric and boolean score data. - * - * **Dimensions:** - * - `environment` - Deployment environment - * - `name` - Name of the score (e.g., accuracy, toxicity) - * - `source` - Origin of the score (API, ANNOTATION, EVAL) - * - `dataType` - Data type (NUMERIC, BOOLEAN) - * - `configId` - Identifier of the score config - * - `timestampMonth` - Month in YYYY-MM format - * - `timestampDay` - Day in YYYY-MM-DD format - * - `value` - Numeric value of the score - * - `traceName` - Name of the parent trace - * - `tags` - Tags - * - `traceRelease` - Release version - * - `traceVersion` - Version - * - `observationName` - Name of the associated observation - * - `observationModelName` - Model name of the associated observation - * - `observationPromptName` - Prompt name of the associated observation - * - `observationPromptVersion` - Prompt version of the associated observation - * - * **Measures:** - * - `count` - Total number of scores - * - `value` - Score value (for aggregations) - * - * ### scores-categorical - * Query categorical score data. Same dimensions as scores-numeric except uses `stringValue` instead of `value`. - * - * **Measures:** - * - `count` - Total number of scores - * - * ## High Cardinality Dimensions - * The following dimensions cannot be used as grouping dimensions in v2 metrics API as they can cause performance issues. - * Use them in filters instead. - * - * **observations view:** - * - `id` - Use traceId filter to narrow down results - * - `traceId` - Use traceId filter instead - * - `userId` - Use userId filter instead - * - `sessionId` - Use sessionId filter instead - * - `parentObservationId` - Use parentObservationId filter instead - * - * **scores-numeric / scores-categorical views:** - * - `id` - Use specific filters to narrow down results - * - `traceId` - Use traceId filter instead - * - `userId` - Use userId filter instead - * - `sessionId` - Use sessionId filter instead - * - `observationId` - Use observationId filter instead - * - * ## Aggregations - * Available aggregation functions: `sum`, `avg`, `count`, `max`, `min`, `p50`, `p75`, `p90`, `p95`, `p99`, `histogram` - * - * ## Time Granularities - * Available granularities for timeDimension: `auto`, `minute`, `hour`, `day`, `week`, `month` - * - `auto` bins the data into approximately 50 buckets based on the time range - * - * @param {LangfuseAPI.GetMetricsV2Request} request - * @param {Metrics.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.metrics.metrics({ - * query: "query" - * }) - */ - metrics(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__metrics(request, requestOptions)); - } - async __metrics(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { query } = request; - const _queryParams = {}; - _queryParams["query"] = query; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/metrics"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/metrics."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + metrics(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__metrics(request, requestOptions)); + } + async __metrics(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { query } = request; + const _queryParams = {}; + _queryParams["query"] = query; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/metrics"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/metrics."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Models = class { - constructor(_options) { - this._options = _options; - } - /** - * Create a model - * - * @param {LangfuseAPI.CreateModelRequest} request - * @param {Models.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.models.create({ - * modelName: "modelName", - * matchPattern: "matchPattern", - * startDate: undefined, - * unit: undefined, - * inputPrice: undefined, - * outputPrice: undefined, - * totalPrice: undefined, - * pricingTiers: undefined, - * tokenizerId: undefined, - * tokenizerConfig: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/models"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/models."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get all models - * - * @param {LangfuseAPI.GetModelsRequest} request - * @param {Models.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.models.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/models"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/models."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a model - * - * @param {string} id - * @param {Models.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.models.get("id") - */ - get(id, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); - } - async __get(id, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/models/${encodeURIComponent(id)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/models/{id}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a model. Cannot delete models managed by Langfuse. You can create your own definition with the same modelName to override the definition though. - * - * @param {string} id - * @param {Models.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.models.delete("id") - */ - delete(id, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); - } - async __delete(id, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/models/${encodeURIComponent(id)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: void 0, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/models/{id}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/models"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/models."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/models"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/models."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(id, requestOptions)); + } + async __get(id, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/models/${encodeURIComponent(id)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/models/{id}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(id, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions)); + } + async __delete(id, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/models/${encodeURIComponent(id)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/models/{id}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Observations = class { - constructor(_options) { - this._options = _options; - } - /** - * Get a list of observations with cursor-based pagination and flexible field selection. - * - * ## Cursor-based Pagination - * This endpoint uses cursor-based pagination for efficient traversal of large datasets. - * The cursor is returned in the response metadata and should be passed in subsequent requests - * to retrieve the next page of results. - * - * ## Field Selection - * Use the `fields` parameter to control which observation fields are returned: - * - `core` - Always included: id, traceId, startTime, endTime, projectId, parentObservationId, type - * - `basic` - name, level, statusMessage, version, environment, bookmarked, public, userId, sessionId - * - `time` - completionStartTime, createdAt, updatedAt - * - `io` - input, output - * - `metadata` - metadata (truncated to 200 chars by default, use `expandMetadata` to get full values) - * - `model` - providedModelName, internalModelId, modelParameters - * - `usage` - usageDetails, costDetails, totalCost, usagePricingTierName - * - `prompt` - promptId, promptName, promptVersion - * - `metrics` - latency, timeToFirstToken - * - `trace_context` - tags, release, traceName - * - * If not specified, `core` and `basic` field groups are returned. - * - * ## Filters - * Multiple filtering options are available via query parameters or the structured `filter` parameter. - * When using the `filter` parameter, it takes precedence over individual query parameter filters. - * - * @param {LangfuseAPI.GetObservationsV2Request} request - * @param {Observations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.observations.getMany() - */ - getMany(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); - } - async __getMany(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { fields, expandMetadata, limit, cursor, parseIoAsJson, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version: version$1, filter } = request; - const _queryParams = {}; - if (fields != null) _queryParams["fields"] = fields; - if (expandMetadata != null) _queryParams["expandMetadata"] = expandMetadata; - if (limit != null) _queryParams["limit"] = limit.toString(); - if (cursor != null) _queryParams["cursor"] = cursor; - if (parseIoAsJson != null) _queryParams["parseIoAsJson"] = parseIoAsJson.toString(); - if (name != null) _queryParams["name"] = name; - if (userId != null) _queryParams["userId"] = userId; - if (type_ != null) _queryParams["type"] = type_; - if (traceId != null) _queryParams["traceId"] = traceId; - if (level != null) _queryParams["level"] = level; - if (parentObservationId != null) _queryParams["parentObservationId"] = parentObservationId; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; - if (fromStartTime != null) _queryParams["fromStartTime"] = fromStartTime; - if (toStartTime != null) _queryParams["toStartTime"] = toStartTime; - if (version$1 != null) _queryParams["version"] = version$1; - if (filter != null) _queryParams["filter"] = filter; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/observations"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/observations."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + getMany(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); + } + async __getMany(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { + fields, + expandMetadata, + limit, + cursor, + parseIoAsJson, + name, + userId, + type: type_, + traceId, + level, + parentObservationId, + environment, + fromStartTime, + toStartTime, + version: version2, + filter + } = request; + const _queryParams = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + if (expandMetadata != null) { + _queryParams["expandMetadata"] = expandMetadata; + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + if (cursor != null) { + _queryParams["cursor"] = cursor; + } + if (parseIoAsJson != null) { + _queryParams["parseIoAsJson"] = parseIoAsJson.toString(); + } + if (name != null) { + _queryParams["name"] = name; + } + if (userId != null) { + _queryParams["userId"] = userId; + } + if (type_ != null) { + _queryParams["type"] = type_; + } + if (traceId != null) { + _queryParams["traceId"] = traceId; + } + if (level != null) { + _queryParams["level"] = level; + } + if (parentObservationId != null) { + _queryParams["parentObservationId"] = parentObservationId; + } + if (environment != null) { + if (Array.isArray(environment)) { + _queryParams["environment"] = environment.map((item) => item); + } else { + _queryParams["environment"] = environment; + } + } + if (fromStartTime != null) { + _queryParams["fromStartTime"] = fromStartTime; + } + if (toStartTime != null) { + _queryParams["toStartTime"] = toStartTime; + } + if (version2 != null) { + _queryParams["version"] = version2; + } + if (filter != null) { + _queryParams["filter"] = filter; + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/observations"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/observations."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Opentelemetry = class { - constructor(_options) { - this._options = _options; - } - /** - * **OpenTelemetry Traces Ingestion Endpoint** - * - * This endpoint implements the OTLP/HTTP specification for trace ingestion, providing native OpenTelemetry integration for Langfuse Observability. - * - * **Supported Formats:** - * - Binary Protobuf: `Content-Type: application/x-protobuf` - * - JSON Protobuf: `Content-Type: application/json` - * - Supports gzip compression via `Content-Encoding: gzip` header - * - * **Specification Compliance:** - * - Conforms to [OTLP/HTTP Trace Export](https://opentelemetry.io/docs/specs/otlp/#otlphttp) - * - Implements `ExportTraceServiceRequest` message format - * - * **Documentation:** - * - Integration guide: https://langfuse.com/integrations/native/opentelemetry - * - Data model: https://langfuse.com/docs/observability/data-model - * - * @param {LangfuseAPI.OtelTraceRequest} request - * @param {Opentelemetry.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.opentelemetry.exportTraces({ - * resourceSpans: [{ - * resource: { - * attributes: [{ - * key: "service.name", - * value: { - * stringValue: "my-service" - * } - * }, { - * key: "service.version", - * value: { - * stringValue: "1.0.0" - * } - * }] - * }, - * scopeSpans: [{ - * scope: { - * name: "langfuse-sdk", - * version: "2.60.3" - * }, - * spans: [{ - * traceId: "0123456789abcdef0123456789abcdef", - * spanId: "0123456789abcdef", - * name: "my-operation", - * kind: 1, - * startTimeUnixNano: "1747872000000000000", - * endTimeUnixNano: "1747872001000000000", - * attributes: [{ - * key: "langfuse.observation.type", - * value: { - * stringValue: "generation" - * } - * }], - * status: {} - * }] - * }] - * }] - * }) - */ - exportTraces(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__exportTraces(request, requestOptions)); - } - async __exportTraces(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/otel/v1/traces"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/otel/v1/traces."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + exportTraces(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__exportTraces(request, requestOptions)); + } + async __exportTraces(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/otel/v1/traces"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/otel/v1/traces."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Organizations = class { - constructor(_options) { - this._options = _options; - } - /** - * Get all memberships for the organization associated with the API key (requires organization-scoped API key) - * - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.getOrganizationMemberships() - */ - getOrganizationMemberships(requestOptions) { - return HttpResponsePromise.fromPromise(this.__getOrganizationMemberships(requestOptions)); - } - async __getOrganizationMemberships(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/memberships."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create or update a membership for the organization associated with the API key (requires organization-scoped API key) - * - * @param {LangfuseAPI.MembershipRequest} request - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.updateOrganizationMembership({ - * userId: "userId", - * role: "OWNER" - * }) - */ - updateOrganizationMembership(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__updateOrganizationMembership(request, requestOptions)); - } - async __updateOrganizationMembership(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/organizations/memberships."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a membership from the organization associated with the API key (requires organization-scoped API key) - * - * @param {LangfuseAPI.DeleteMembershipRequest} request - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.deleteOrganizationMembership({ - * userId: "userId" - * }) - */ - deleteOrganizationMembership(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteOrganizationMembership(request, requestOptions)); - } - async __deleteOrganizationMembership(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), - method: "DELETE", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/organizations/memberships."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get all memberships for a specific project (requires organization-scoped API key) - * - * @param {string} projectId - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.getProjectMemberships("projectId") - */ - getProjectMemberships(projectId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getProjectMemberships(projectId, requestOptions)); - } - async __getProjectMemberships(projectId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects/{projectId}/memberships."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create or update a membership for a specific project (requires organization-scoped API key). The user must already be a member of the organization. - * - * @param {string} projectId - * @param {LangfuseAPI.MembershipRequest} request - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.updateProjectMembership("projectId", { - * userId: "userId", - * role: "OWNER" - * }) - */ - updateProjectMembership(projectId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__updateProjectMembership(projectId, request, requestOptions)); - } - async __updateProjectMembership(projectId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/projects/{projectId}/memberships."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a membership from a specific project (requires organization-scoped API key). The user must be a member of the organization. - * - * @param {string} projectId - * @param {LangfuseAPI.DeleteMembershipRequest} request - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.deleteProjectMembership("projectId", { - * userId: "userId" - * }) - */ - deleteProjectMembership(projectId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteProjectMembership(projectId, request, requestOptions)); - } - async __deleteProjectMembership(projectId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), - method: "DELETE", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}/memberships."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get all projects for the organization associated with the API key (requires organization-scoped API key) - * - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.getOrganizationProjects() - */ - getOrganizationProjects(requestOptions) { - return HttpResponsePromise.fromPromise(this.__getOrganizationProjects(requestOptions)); - } - async __getOrganizationProjects(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/projects"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/projects."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get all API keys for the organization associated with the API key (requires organization-scoped API key) - * - * @param {Organizations.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.organizations.getOrganizationApiKeys() - */ - getOrganizationApiKeys(requestOptions) { - return HttpResponsePromise.fromPromise(this.__getOrganizationApiKeys(requestOptions)); - } - async __getOrganizationApiKeys(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/apiKeys"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/apiKeys."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + getOrganizationMemberships(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getOrganizationMemberships(requestOptions)); + } + async __getOrganizationMemberships(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/memberships."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + updateOrganizationMembership(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__updateOrganizationMembership(request, requestOptions)); + } + async __updateOrganizationMembership(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/organizations/memberships."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteOrganizationMembership(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteOrganizationMembership(request, requestOptions)); + } + async __deleteOrganizationMembership(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/memberships"), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/organizations/memberships."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getProjectMemberships(projectId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getProjectMemberships(projectId, requestOptions)); + } + async __getProjectMemberships(projectId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects/{projectId}/memberships."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + updateProjectMembership(projectId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__updateProjectMembership(projectId, request, requestOptions)); + } + async __updateProjectMembership(projectId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/projects/{projectId}/memberships."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteProjectMembership(projectId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteProjectMembership(projectId, request, requestOptions)); + } + async __deleteProjectMembership(projectId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/memberships`), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}/memberships."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getOrganizationProjects(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getOrganizationProjects(requestOptions)); + } + async __getOrganizationProjects(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/projects"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/projects."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getOrganizationApiKeys(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getOrganizationApiKeys(requestOptions)); + } + async __getOrganizationApiKeys(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/organizations/apiKeys"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/organizations/apiKeys."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Projects = class { - constructor(_options) { - this._options = _options; - } - /** - * Get Project associated with API key (requires project-scoped API key). You can use GET /api/public/organizations/projects to get all projects with an organization-scoped key. - * - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.projects.get() - */ - get(requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(requestOptions)); - } - async __get(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/projects"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create a new project (requires organization-scoped API key) - * - * @param {LangfuseAPI.CreateProjectRequest} request - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.projects.create({ - * name: "name", - * metadata: undefined, - * retention: 1 - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/projects"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/projects."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Update a project by ID (requires organization-scoped API key). - * - * @param {string} projectId - * @param {LangfuseAPI.UpdateProjectRequest} request - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.projects.update("projectId", { - * name: "name", - * metadata: undefined, - * retention: undefined - * }) - */ - update(projectId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__update(projectId, request, requestOptions)); - } - async __update(projectId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}`), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/projects/{projectId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a project by ID (requires organization-scoped API key). Project deletion is processed asynchronously. - * - * @param {string} projectId - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.projects.delete("projectId") - */ - delete(projectId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(projectId, requestOptions)); - } - async __delete(projectId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get all API keys for a project (requires organization-scoped API key) - * - * @param {string} projectId - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.projects.getApiKeys("projectId") - */ - getApiKeys(projectId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getApiKeys(projectId, requestOptions)); - } - async __getApiKeys(projectId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects/{projectId}/apiKeys."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create a new API key for a project (requires organization-scoped API key) - * - * @param {string} projectId - * @param {LangfuseAPI.CreateApiKeyRequest} request - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.projects.createApiKey("projectId", { - * note: undefined, - * publicKey: undefined, - * secretKey: undefined - * }) - */ - createApiKey(projectId, request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__createApiKey(projectId, request, requestOptions)); - } - async __createApiKey(projectId, request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys`), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/projects/{projectId}/apiKeys."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete an API key for a project (requires organization-scoped API key) - * - * @param {string} projectId - * @param {string} apiKeyId - * @param {Projects.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.projects.deleteApiKey("projectId", "apiKeyId") - */ - deleteApiKey(projectId, apiKeyId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteApiKey(projectId, apiKeyId, requestOptions)); - } - async __deleteApiKey(projectId, apiKeyId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys/${encodeURIComponent(apiKeyId)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}/apiKeys/{apiKeyId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + get(requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(requestOptions)); + } + async __get(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/projects"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/projects"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/projects."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + update(projectId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(projectId, request, requestOptions)); + } + async __update(projectId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}`), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PUT /api/public/projects/{projectId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(projectId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(projectId, requestOptions)); + } + async __delete(projectId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getApiKeys(projectId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getApiKeys(projectId, requestOptions)); + } + async __getApiKeys(projectId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/projects/{projectId}/apiKeys."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + createApiKey(projectId, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createApiKey(projectId, request, requestOptions)); + } + async __createApiKey(projectId, request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys`), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/projects/{projectId}/apiKeys."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteApiKey(projectId, apiKeyId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteApiKey(projectId, apiKeyId, requestOptions)); + } + async __deleteApiKey(projectId, apiKeyId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/projects/${encodeURIComponent(projectId)}/apiKeys/${encodeURIComponent(apiKeyId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/projects/{projectId}/apiKeys/{apiKeyId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var PromptVersion = class { - constructor(_options) { - this._options = _options; - } - /** - * Update labels for a specific prompt version - * - * @param {string} name - The name of the prompt. If the prompt is in a folder (e.g., "folder/subfolder/prompt-name"), - * the folder path must be URL encoded. - * @param {number} version - Version of the prompt to update - * @param {LangfuseAPI.UpdatePromptRequest} request - * @param {PromptVersion.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.promptVersion.update("name", 1, { - * newLabels: ["newLabels", "newLabels"] - * }) - */ - update(name, version$1, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__update(name, version$1, request, requestOptions)); - } - async __update(name, version$1, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(name)}/versions/${encodeURIComponent(version$1)}`), - method: "PATCH", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/v2/prompts/{name}/versions/{version}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + update(name, version2, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(name, version2, request, requestOptions)); + } + async __update(name, version2, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(name)}/versions/${encodeURIComponent(version2)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/v2/prompts/{name}/versions/{version}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Prompts = class { - constructor(_options) { - this._options = _options; - } - /** - * Get a prompt - * - * @param {string} promptName - The name of the prompt. If the prompt is in a folder (e.g., "folder/subfolder/prompt-name"), - * the folder path must be URL encoded. - * @param {LangfuseAPI.GetPromptRequest} request - * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.prompts.get("promptName") - */ - get(promptName, request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(promptName, request, requestOptions)); - } - async __get(promptName, request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { version: version$1, label, resolve } = request; - const _queryParams = {}; - if (version$1 != null) _queryParams["version"] = version$1.toString(); - if (label != null) _queryParams["label"] = label; - if (resolve != null) _queryParams["resolve"] = resolve.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(promptName)}`), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/prompts/{promptName}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a list of prompt names with versions and labels - * - * @param {LangfuseAPI.ListPromptsMetaRequest} request - * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.prompts.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { name, label, tag, page, limit, fromUpdatedAt, toUpdatedAt } = request; - const _queryParams = {}; - if (name != null) _queryParams["name"] = name; - if (label != null) _queryParams["label"] = label; - if (tag != null) _queryParams["tag"] = tag; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - if (fromUpdatedAt != null) _queryParams["fromUpdatedAt"] = fromUpdatedAt; - if (toUpdatedAt != null) _queryParams["toUpdatedAt"] = toUpdatedAt; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/prompts"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/prompts."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create a new version for the prompt with the given `name` - * - * @param {LangfuseAPI.CreatePromptRequest} request - * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.prompts.create({ - * name: "name", - * prompt: [{ - * role: "role", - * content: "content", - * type: undefined - * }, { - * role: "role", - * content: "content", - * type: undefined - * }], - * config: undefined, - * type: "chat", - * labels: undefined, - * tags: undefined, - * commitMessage: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/prompts"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/v2/prompts."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted. - * - * @param {string} promptName - The name of the prompt - * @param {LangfuseAPI.DeletePromptRequest} request - * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.prompts.delete("promptName") - */ - delete(promptName, request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(promptName, request, requestOptions)); - } - async __delete(promptName, request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { label, version: version$1 } = request; - const _queryParams = {}; - if (label != null) _queryParams["label"] = label; - if (version$1 != null) _queryParams["version"] = version$1.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(promptName)}`), - method: "DELETE", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: void 0, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/v2/prompts/{promptName}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + get(promptName, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(promptName, request, requestOptions)); + } + async __get(promptName, request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { version: version2, label, resolve } = request; + const _queryParams = {}; + if (version2 != null) { + _queryParams["version"] = version2.toString(); + } + if (label != null) { + _queryParams["label"] = label; + } + if (resolve != null) { + _queryParams["resolve"] = resolve.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(promptName)}`), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/prompts/{promptName}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { name, label, tag, page, limit, fromUpdatedAt, toUpdatedAt } = request; + const _queryParams = {}; + if (name != null) { + _queryParams["name"] = name; + } + if (label != null) { + _queryParams["label"] = label; + } + if (tag != null) { + _queryParams["tag"] = tag; + } + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + if (fromUpdatedAt != null) { + _queryParams["fromUpdatedAt"] = fromUpdatedAt; + } + if (toUpdatedAt != null) { + _queryParams["toUpdatedAt"] = toUpdatedAt; + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/prompts"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/prompts."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/prompts"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/v2/prompts."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(promptName, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(promptName, request, requestOptions)); + } + async __delete(promptName, request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { label, version: version2 } = request; + const _queryParams = {}; + if (label != null) { + _queryParams["label"] = label; + } + if (version2 != null) { + _queryParams["version"] = version2.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(promptName)}`), + method: "DELETE", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { data: undefined, rawResponse: _response.rawResponse }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/v2/prompts/{promptName}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Scim = class { - constructor(_options) { - this._options = _options; - } - /** - * Get SCIM Service Provider Configuration (requires organization-scoped API key) - * - * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scim.getServiceProviderConfig() - */ - getServiceProviderConfig(requestOptions) { - return HttpResponsePromise.fromPromise(this.__getServiceProviderConfig(requestOptions)); - } - async __getServiceProviderConfig(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/ServiceProviderConfig"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/ServiceProviderConfig."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get SCIM Resource Types (requires organization-scoped API key) - * - * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scim.getResourceTypes() - */ - getResourceTypes(requestOptions) { - return HttpResponsePromise.fromPromise(this.__getResourceTypes(requestOptions)); - } - async __getResourceTypes(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/ResourceTypes"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/ResourceTypes."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get SCIM Schemas (requires organization-scoped API key) - * - * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scim.getSchemas() - */ - getSchemas(requestOptions) { - return HttpResponsePromise.fromPromise(this.__getSchemas(requestOptions)); - } - async __getSchemas(requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Schemas"), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Schemas."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * List users in the organization (requires organization-scoped API key) - * - * @param {LangfuseAPI.ListUsersRequest} request - * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scim.listUsers() - */ - listUsers(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__listUsers(request, requestOptions)); - } - async __listUsers(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { filter, startIndex, count } = request; - const _queryParams = {}; - if (filter != null) _queryParams["filter"] = filter; - if (startIndex != null) _queryParams["startIndex"] = startIndex.toString(); - if (count != null) _queryParams["count"] = count.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Users"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Users."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Create a new user in the organization (requires organization-scoped API key) - * - * @param {LangfuseAPI.CreateUserRequest} request - * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scim.createUser({ - * userName: "userName", - * name: { - * formatted: undefined - * }, - * emails: undefined, - * active: undefined, - * password: undefined - * }) - */ - createUser(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions)); - } - async __createUser(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Users"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/scim/Users."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a specific user by ID (requires organization-scoped API key) - * - * @param {string} userId - * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scim.getUser("userId") - */ - getUser(userId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getUser(userId, requestOptions)); - } - async __getUser(userId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scim/Users/${encodeURIComponent(userId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Users/{userId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Remove a user from the organization (requires organization-scoped API key). Note that this only removes the user from the organization but does not delete the user entity itself. - * - * @param {string} userId - * @param {Scim.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scim.deleteUser("userId") - */ - deleteUser(userId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteUser(userId, requestOptions)); - } - async __deleteUser(userId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scim/Users/${encodeURIComponent(userId)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/scim/Users/{userId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + getServiceProviderConfig(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getServiceProviderConfig(requestOptions)); + } + async __getServiceProviderConfig(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/ServiceProviderConfig"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/ServiceProviderConfig."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getResourceTypes(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getResourceTypes(requestOptions)); + } + async __getResourceTypes(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/ResourceTypes"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/ResourceTypes."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getSchemas(requestOptions) { + return HttpResponsePromise.fromPromise(this.__getSchemas(requestOptions)); + } + async __getSchemas(requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Schemas"), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Schemas."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + listUsers(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__listUsers(request, requestOptions)); + } + async __listUsers(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { filter, startIndex, count } = request; + const _queryParams = {}; + if (filter != null) { + _queryParams["filter"] = filter; + } + if (startIndex != null) { + _queryParams["startIndex"] = startIndex.toString(); + } + if (count != null) { + _queryParams["count"] = count.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Users"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Users."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + createUser(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions)); + } + async __createUser(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/scim/Users"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/scim/Users."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getUser(userId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getUser(userId, requestOptions)); + } + async __getUser(userId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scim/Users/${encodeURIComponent(userId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/scim/Users/{userId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteUser(userId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteUser(userId, requestOptions)); + } + async __deleteUser(userId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/scim/Users/${encodeURIComponent(userId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/scim/Users/{userId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var ScoreConfigs = class { - constructor(_options) { - this._options = _options; - } - /** - * Create a score configuration (config). Score configs are used to define the structure of scores - * - * @param {LangfuseAPI.CreateScoreConfigRequest} request - * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scoreConfigs.create({ - * name: "name", - * dataType: "NUMERIC", - * categories: undefined, - * minValue: undefined, - * maxValue: undefined, - * description: undefined - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/score-configs"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/score-configs."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get all score configs - * - * @param {LangfuseAPI.GetScoreConfigsRequest} request - * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scoreConfigs.get() - */ - get(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); - } - async __get(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/score-configs"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/score-configs."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a score config - * - * @param {string} configId - The unique langfuse identifier of a score config - * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scoreConfigs.getById("configId") - */ - getById(configId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getById(configId, requestOptions)); - } - async __getById(configId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/score-configs/${encodeURIComponent(configId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/score-configs/{configId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Update a score config - * - * @param {string} configId - The unique langfuse identifier of a score config - * @param {LangfuseAPI.UpdateScoreConfigRequest} request - * @param {ScoreConfigs.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scoreConfigs.update("configId", { - * isArchived: undefined, - * name: undefined, - * categories: undefined, - * minValue: undefined, - * maxValue: undefined, - * description: undefined - * }) - */ - update(configId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__update(configId, request, requestOptions)); - } - async __update(configId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/score-configs/${encodeURIComponent(configId)}`), - method: "PATCH", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/score-configs/{configId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/score-configs"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/score-configs."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); + } + async __get(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/score-configs"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/score-configs."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getById(configId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getById(configId, requestOptions)); + } + async __getById(configId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/score-configs/${encodeURIComponent(configId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/score-configs/{configId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + update(configId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(configId, request, requestOptions)); + } + async __update(configId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/score-configs/${encodeURIComponent(configId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/score-configs/{configId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Scores = class { - constructor(_options) { - this._options = _options; - } - /** - * Get a list of scores (supports both trace and session scores) - * - * @param {LangfuseAPI.GetScoresRequest} request - * @param {Scores.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scores.getMany() - */ - getMany(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); - } - async __getMany(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit, userId, name, fromTimestamp, toTimestamp, environment, source, operator, value, scoreIds, configId, sessionId, datasetRunId, traceId, observationId, queueId, dataType, traceTags, fields, filter } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - if (userId != null) _queryParams["userId"] = userId; - if (name != null) _queryParams["name"] = name; - if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; - if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; - if (source != null) _queryParams["source"] = source; - if (operator != null) _queryParams["operator"] = operator; - if (value != null) _queryParams["value"] = value.toString(); - if (scoreIds != null) _queryParams["scoreIds"] = scoreIds; - if (configId != null) _queryParams["configId"] = configId; - if (sessionId != null) _queryParams["sessionId"] = sessionId; - if (datasetRunId != null) _queryParams["datasetRunId"] = datasetRunId; - if (traceId != null) _queryParams["traceId"] = traceId; - if (observationId != null) _queryParams["observationId"] = observationId; - if (queueId != null) _queryParams["queueId"] = queueId; - if (dataType != null) _queryParams["dataType"] = dataType; - if (traceTags != null) if (Array.isArray(traceTags)) _queryParams["traceTags"] = traceTags.map((item) => item); - else _queryParams["traceTags"] = traceTags; - if (fields != null) _queryParams["fields"] = fields; - if (filter != null) _queryParams["filter"] = filter; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/scores"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/scores."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a score (supports both trace and session scores) - * - * @param {string} scoreId - The unique langfuse identifier of a score - * @param {Scores.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.scores.getById("scoreId") - */ - getById(scoreId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__getById(scoreId, requestOptions)); - } - async __getById(scoreId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/scores/${encodeURIComponent(scoreId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/scores/{scoreId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + getMany(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getMany(request, requestOptions)); + } + async __getMany(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { + page, + limit, + userId, + name, + fromTimestamp, + toTimestamp, + environment, + source, + operator, + value, + scoreIds, + configId, + sessionId, + datasetRunId, + traceId, + observationId, + queueId, + dataType, + traceTags, + fields, + filter + } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + if (userId != null) { + _queryParams["userId"] = userId; + } + if (name != null) { + _queryParams["name"] = name; + } + if (fromTimestamp != null) { + _queryParams["fromTimestamp"] = fromTimestamp; + } + if (toTimestamp != null) { + _queryParams["toTimestamp"] = toTimestamp; + } + if (environment != null) { + if (Array.isArray(environment)) { + _queryParams["environment"] = environment.map((item) => item); + } else { + _queryParams["environment"] = environment; + } + } + if (source != null) { + _queryParams["source"] = source; + } + if (operator != null) { + _queryParams["operator"] = operator; + } + if (value != null) { + _queryParams["value"] = value.toString(); + } + if (scoreIds != null) { + _queryParams["scoreIds"] = scoreIds; + } + if (configId != null) { + _queryParams["configId"] = configId; + } + if (sessionId != null) { + _queryParams["sessionId"] = sessionId; + } + if (datasetRunId != null) { + _queryParams["datasetRunId"] = datasetRunId; + } + if (traceId != null) { + _queryParams["traceId"] = traceId; + } + if (observationId != null) { + _queryParams["observationId"] = observationId; + } + if (queueId != null) { + _queryParams["queueId"] = queueId; + } + if (dataType != null) { + _queryParams["dataType"] = dataType; + } + if (traceTags != null) { + if (Array.isArray(traceTags)) { + _queryParams["traceTags"] = traceTags.map((item) => item); + } else { + _queryParams["traceTags"] = traceTags; + } + } + if (fields != null) { + _queryParams["fields"] = fields; + } + if (filter != null) { + _queryParams["filter"] = filter; + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/v2/scores"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/scores."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + getById(scoreId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__getById(scoreId, requestOptions)); + } + async __getById(scoreId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/scores/${encodeURIComponent(scoreId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/v2/scores/{scoreId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Sessions = class { - constructor(_options) { - this._options = _options; - } - /** - * Get sessions - * - * @param {LangfuseAPI.GetSessionsRequest} request - * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.sessions.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit, fromTimestamp, toTimestamp, environment } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; - if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/sessions"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/sessions."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=` - * - * @param {string} sessionId - The unique id of a session - * @param {Sessions.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.sessions.get("sessionId") - */ - get(sessionId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(sessionId, requestOptions)); - } - async __get(sessionId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/sessions/${encodeURIComponent(sessionId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/sessions/{sessionId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit, fromTimestamp, toTimestamp, environment } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + if (fromTimestamp != null) { + _queryParams["fromTimestamp"] = fromTimestamp; + } + if (toTimestamp != null) { + _queryParams["toTimestamp"] = toTimestamp; + } + if (environment != null) { + if (Array.isArray(environment)) { + _queryParams["environment"] = environment.map((item) => item); + } else { + _queryParams["environment"] = environment; + } + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/sessions"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/sessions."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(sessionId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(sessionId, requestOptions)); + } + async __get(sessionId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/sessions/${encodeURIComponent(sessionId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/sessions/{sessionId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Trace = class { - constructor(_options) { - this._options = _options; - } - /** - * Get a specific trace - * - * @param {string} traceId - The unique langfuse identifier of a trace - * @param {LangfuseAPI.GetTraceRequest} request - * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.trace.get("traceId") - */ - get(traceId, request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(traceId, request, requestOptions)); - } - async __get(traceId, request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { fields } = request; - const _queryParams = {}; - if (fields != null) _queryParams["fields"] = fields; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/traces/${encodeURIComponent(traceId)}`), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/traces/{traceId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete a specific trace - * - * @param {string} traceId - The unique langfuse identifier of the trace to delete - * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.trace.delete("traceId") - */ - delete(traceId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(traceId, requestOptions)); - } - async __delete(traceId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/traces/${encodeURIComponent(traceId)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/traces/{traceId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get list of traces - * - * @param {LangfuseAPI.GetTracesRequest} request - * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.trace.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit, userId, name, sessionId, fromTimestamp, toTimestamp, orderBy, tags, version: version$1, release, environment, fields, filter } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - if (userId != null) _queryParams["userId"] = userId; - if (name != null) _queryParams["name"] = name; - if (sessionId != null) _queryParams["sessionId"] = sessionId; - if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; - if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; - if (orderBy != null) _queryParams["orderBy"] = orderBy; - if (tags != null) if (Array.isArray(tags)) _queryParams["tags"] = tags.map((item) => item); - else _queryParams["tags"] = tags; - if (version$1 != null) _queryParams["version"] = version$1; - if (release != null) _queryParams["release"] = release; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; - if (fields != null) _queryParams["fields"] = fields; - if (filter != null) _queryParams["filter"] = filter; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/traces"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/traces."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete multiple traces - * - * @param {LangfuseAPI.DeleteTracesRequest} request - * @param {Trace.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.trace.deleteMultiple({ - * traceIds: ["traceIds", "traceIds"] - * }) - */ - deleteMultiple(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__deleteMultiple(request, requestOptions)); - } - async __deleteMultiple(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/traces"), - method: "DELETE", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/traces."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + get(traceId, request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(traceId, request, requestOptions)); + } + async __get(traceId, request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { fields } = request; + const _queryParams = {}; + if (fields != null) { + _queryParams["fields"] = fields; + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/traces/${encodeURIComponent(traceId)}`), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/traces/{traceId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(traceId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(traceId, requestOptions)); + } + async __delete(traceId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/traces/${encodeURIComponent(traceId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/traces/{traceId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { + page, + limit, + userId, + name, + sessionId, + fromTimestamp, + toTimestamp, + orderBy, + tags, + version: version2, + release, + environment, + fields, + filter + } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + if (userId != null) { + _queryParams["userId"] = userId; + } + if (name != null) { + _queryParams["name"] = name; + } + if (sessionId != null) { + _queryParams["sessionId"] = sessionId; + } + if (fromTimestamp != null) { + _queryParams["fromTimestamp"] = fromTimestamp; + } + if (toTimestamp != null) { + _queryParams["toTimestamp"] = toTimestamp; + } + if (orderBy != null) { + _queryParams["orderBy"] = orderBy; + } + if (tags != null) { + if (Array.isArray(tags)) { + _queryParams["tags"] = tags.map((item) => item); + } else { + _queryParams["tags"] = tags; + } + } + if (version2 != null) { + _queryParams["version"] = version2; + } + if (release != null) { + _queryParams["release"] = release; + } + if (environment != null) { + if (Array.isArray(environment)) { + _queryParams["environment"] = environment.map((item) => item); + } else { + _queryParams["environment"] = environment; + } + } + if (fields != null) { + _queryParams["fields"] = fields; + } + if (filter != null) { + _queryParams["filter"] = filter; + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/traces"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/traces."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + deleteMultiple(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__deleteMultiple(request, requestOptions)); + } + async __deleteMultiple(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/traces"), + method: "DELETE", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/traces."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var EvaluationRules = class { - constructor(_options) { - this._options = _options; - } - /** - * Create an evaluation rule. - * - * An evaluation rule defines **what** incoming data should be evaluated and **how prompt variables should be populated** from that data. - * - * Use this resource after choosing an evaluator from the evaluator endpoints. - * - * Key rules: - * - `name` must be unique within the project for public evaluation rules - * - `target` must be `observation` or `experiment` - * - `evaluator.name` + `evaluator.scope` must identify an existing evaluator family returned by the evaluator endpoints - * - Langfuse resolves that family to its latest version before saving the evaluation rule - * - for `target=experiment`, use dataset `id` values from `GET /api/public/v2/datasets` when filtering by `datasetId` - * - every evaluator prompt variable must be mapped exactly once - * - `expected_output` and `experiment_item_metadata` mappings are only valid for `target=experiment` - * - if `enabled=true`, Langfuse validates that the referenced evaluator can currently run - * - at most 50 evaluation rules can be effectively active in one project at the same time - * - * If an evaluation rule with the same `name` already exists in the project, the API returns `409`. - * In that case, update the existing resource with `PATCH /api/public/unstable/evaluation-rules/{evaluationRuleId}` instead of creating a second one. - * - * If enabling this resource would exceed the 50-active limit, the API also returns `409`. - * In that case, disable or pause another active evaluation rule before enabling a new one. - * - * Current scope: - * - evaluation rules are live-ingestion rules only - * - they do not trigger historical backfills - * - * Recovery guidance: - * - `400 invalid_filter_value`: fix the filter `column` or `value` using `details.column`, `details.invalidValues`, and `details.allowedValues` - * - `400 invalid_filter_value` with `details.column=datasetId`: call `GET /api/public/v2/datasets`, then retry with dataset `id` values from that response - * - `400 missing_variable_mapping`: fetch the evaluator again and make sure every variable in `variables` appears exactly once in `mapping` - * - `400 duplicate_variable_mapping`: remove repeated mappings for the same variable - * - `400 invalid_variable_mapping`: switch to a valid `source` for the selected `target`, or fix the variable name - * - `400 invalid_json_path`: remove or correct the `jsonPath` - * - `422 evaluator_preflight_failed`: the selected evaluator cannot run with the resolved model configuration. Fix the evaluator/default model setup, then retry the create request. - * - * @param {LangfuseAPI.unstable.CreateEvaluationRuleRequest} request - * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.NotFoundError} - * @throws {@link LangfuseAPI.unstable.ConflictError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.UnprocessableContentError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluationRules.create({ - * name: "answer-correctness-live", - * evaluator: { - * name: "answer-correctness", - * scope: "project" - * }, - * target: "observation", - * enabled: true, - * sampling: 1, - * filter: [{ - * type: "stringOptions", - * column: "type", - * operator: "any of", - * value: ["GENERATION"] - * }], - * mapping: [{ - * variable: "input", - * source: "input" - * }, { - * variable: "output", - * source: "output" - * }] - * }) - * - * @example - * await client.unstable.evaluationRules.create({ - * name: "experiment-expected-output-match", - * evaluator: { - * name: "expected-output-match", - * scope: "project" - * }, - * target: "experiment", - * enabled: true, - * sampling: 0.5, - * filter: [{ - * type: "stringOptions", - * column: "datasetId", - * operator: "any of", - * value: ["550e8400-e29b-41d4-a716-446655440000"] - * }], - * mapping: [{ - * variable: "output", - * source: "output" - * }, { - * variable: "expected_output", - * source: "expected_output" - * }] - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluation-rules"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); - case 409: throw new unstable_exports.ConflictError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 422: throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/unstable/evaluation-rules."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * List evaluation rules in the authenticated project. - * - * Each item describes one live evaluation rule and its effective runtime status. - * - * @param {LangfuseAPI.unstable.ListEvaluationRulesRequest} request - * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluationRules.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluation-rules"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluation-rules."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get one evaluation rule by its identifier. - * - * Use this endpoint to inspect the current evaluator, target, mapping, filters, and effective runtime status. - * - * @param {string} evaluationRuleId - Evaluation rule identifier returned by the evaluation rule endpoints. - * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.NotFoundError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluationRules.get("evaluationRuleId") - */ - get(evaluationRuleId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(evaluationRuleId, requestOptions)); - } - async __get(evaluationRuleId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluation-rules/{evaluationRuleId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Update an evaluation rule. - * - * Typical uses: - * - enable or disable live execution - * - switch to another evaluator - * - adjust sampling - * - change filters - * - update variable mappings - * - * Important behavior: - * - provide only the fields you want to change - * - if you provide `evaluator`, Langfuse resolves that evaluator family to its latest version before saving - * - changing `target`, `filter`, or `mapping` must still produce a valid target-specific configuration - * - if you change `target`, also send a compatible `filter` and `mapping` in the same request unless the existing ones are still valid for the new target - * - if the resulting config is enabled, Langfuse re-validates that the selected evaluator can run - * - if the update would move a non-active evaluation rule into the active state and the project already has 50 active evaluation rules, the API returns `409` - * - * Recovery guidance: - * - if the update fails with `missing_variable_mapping` or `invalid_variable_mapping` after changing `evaluator` or `target`, resend the request with a complete new `mapping` - * - if the update fails with `invalid_filter_value` after changing `target`, resend the request with a target-compatible `filter` - * - * @param {string} evaluationRuleId - Evaluation rule identifier. - * @param {LangfuseAPI.unstable.UpdateEvaluationRuleRequest} request - * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.NotFoundError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.UnprocessableContentError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluationRules.update("evaluationRuleId", { - * name: undefined, - * evaluator: undefined, - * target: undefined, - * enabled: undefined, - * sampling: undefined, - * filter: undefined, - * mapping: undefined - * }) - */ - update(evaluationRuleId, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__update(evaluationRuleId, request, requestOptions)); - } - async __update(evaluationRuleId, request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), - method: "PATCH", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 422: throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/unstable/evaluation-rules/{evaluationRuleId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Delete an evaluation rule. - * - * This removes the live-ingestion rule only. It does not delete the referenced evaluator. - * - * @param {string} evaluationRuleId - Evaluation rule identifier. - * @param {EvaluationRules.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.NotFoundError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluationRules.delete("evaluationRuleId") - */ - delete(evaluationRuleId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__delete(evaluationRuleId, requestOptions)); - } - async __delete(evaluationRuleId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/unstable/evaluation-rules/{evaluationRuleId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluation-rules"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: + throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 409: + throw new unstable_exports.ConflictError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 422: + throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/unstable/evaluation-rules."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluation-rules"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluation-rules."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(evaluationRuleId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(evaluationRuleId, requestOptions)); + } + async __get(evaluationRuleId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: + throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluation-rules/{evaluationRuleId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + update(evaluationRuleId, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(evaluationRuleId, request, requestOptions)); + } + async __update(evaluationRuleId, request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), + method: "PATCH", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: + throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 422: + throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling PATCH /api/public/unstable/evaluation-rules/{evaluationRuleId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + delete(evaluationRuleId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__delete(evaluationRuleId, requestOptions)); + } + async __delete(evaluationRuleId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluation-rules/${encodeURIComponent(evaluationRuleId)}`), + method: "DELETE", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: + throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling DELETE /api/public/unstable/evaluation-rules/{evaluationRuleId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Evaluators = class { - constructor(_options) { - this._options = _options; - } - /** - * Create an evaluator in the authenticated project. - * - * Use evaluators to define **how** Langfuse should score data: the prompt, the expected structured output, and the optional model configuration. - * - * Naming behavior: - * - If this is a new evaluator name in your project, Langfuse creates version `1`. - * - If the name already exists in your project, Langfuse creates the next version and returns it. - * - When a new project version is created, existing evaluation rules in that project automatically move to the newest version for that evaluator name. - * - * Recommended workflow: - * 1. Create the evaluator. - * 2. Read the returned `variables` array. - * 3. Read the returned `outputDefinition.dataType` so the client knows whether future scores will be numeric, boolean, or categorical. - * 4. Create one or more evaluation rules that reference the returned evaluator family using `name` and `scope`. - * - * Recovery guidance: - * - `422` with `code=evaluator_preflight_failed`: the evaluator cannot run with the resolved model configuration. Add a valid explicit `modelConfig`, or configure the project's default evaluation model, then retry the same request. - * - `400` with `code=invalid_body`: the request shape is malformed. Use the structured `details.issues` array to fix the specific fields and retry. - * - `400` with `code=invalid_body` on `outputDefinition`: send `dataType`, `reasoning.description`, and `score.description`. Do not send `version`; it is not part of the public request shape. - * - * Unstable API note: - * - This surface may evolve while the underlying evaluation data model is being redesigned. - * - * @param {LangfuseAPI.unstable.CreateEvaluatorRequest} request - * @param {Evaluators.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.ConflictError} - * @throws {@link LangfuseAPI.unstable.UnprocessableContentError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluators.create({ - * name: "answer-correctness", - * prompt: "You are grading an answer.\n\nInput:\n{{input}}\n\nOutput:\n{{output}}\n\nReturn a score between 0 and 1.\n", - * outputDefinition: { - * dataType: "NUMERIC", - * dataType: "NUMERIC", - * reasoning: { - * description: "Explain why the score was assigned." - * }, - * score: { - * description: "Correctness score between 0 and 1." - * } - * }, - * modelConfig: { - * provider: "openai", - * model: "gpt-4.1-mini" - * } - * }) - */ - create(request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - async __create(request, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluators"), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - requestType: "json", - body: request, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 409: throw new unstable_exports.ConflictError(_response.error.body, _response.rawResponse); - case 422: throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/unstable/evaluators."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * List the evaluators available to the authenticated project. - * - * Important behavior: - * - This endpoint returns the latest version of each available evaluator. - * - Results can include evaluators from your project and Langfuse-managed evaluators. - * - If the same evaluator name exists in both places, both are returned as separate items with different `scope` values. - * - * @param {LangfuseAPI.unstable.ListEvaluatorsRequest} request - * @param {Evaluators.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluators.list() - */ - list(request = {}, requestOptions) { - return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); - } - async __list(request = {}, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit } = request; - const _queryParams = {}; - if (page != null) _queryParams["page"] = page.toString(); - if (limit != null) _queryParams["limit"] = limit.toString(); - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluators"), - method: "GET", - headers: _headers, - queryParameters: { - ..._queryParams, - ...requestOptions == null ? void 0 : requestOptions.queryParams - }, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluators."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - /** - * Get one evaluator by `id`. - * - * Use this endpoint when you want the prompt, output definition, model configuration, and derived variables for the evaluator you plan to use in an evaluation rule. - * - * @param {string} evaluatorId - Evaluator identifier returned by the evaluator endpoints. - * @param {Evaluators.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link LangfuseAPI.unstable.BadRequestError} - * @throws {@link LangfuseAPI.unstable.UnauthorizedError} - * @throws {@link LangfuseAPI.unstable.AccessDeniedError} - * @throws {@link LangfuseAPI.unstable.NotFoundError} - * @throws {@link LangfuseAPI.unstable.MethodNotAllowedError} - * @throws {@link LangfuseAPI.unstable.TooManyRequestsError} - * @throws {@link LangfuseAPI.unstable.InternalServerError} - * @throws {@link LangfuseAPI.Error} - * @throws {@link LangfuseAPI.UnauthorizedError} - * @throws {@link LangfuseAPI.AccessDeniedError} - * @throws {@link LangfuseAPI.MethodNotAllowedError} - * @throws {@link LangfuseAPI.NotFoundError} - * - * @example - * await client.unstable.evaluators.get("evaluatorId") - */ - get(evaluatorId, requestOptions) { - return HttpResponsePromise.fromPromise(this.__get(evaluatorId, requestOptions)); - } - async __get(evaluatorId, requestOptions) { - var _a2, _b, _c, _d, _e, _f, _g, _h; - let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? void 0 : _d.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey - }), requestOptions == null ? void 0 : requestOptions.headers); - const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluators/${encodeURIComponent(evaluatorId)}`), - method: "GET", - headers: _headers, - queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams, - timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4, - maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries, - abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal - }); - if (_response.ok) return { - data: _response.body, - rawResponse: _response.rawResponse - }; - if (_response.error.reason === "status-code") switch (_response.error.statusCode) { - case 400: throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); - case 401: throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); - case 404: throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); - case 405: throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 429: throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); - case 500: throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); - case 400: throw new Error2(_response.error.body, _response.rawResponse); - case 401: throw new UnauthorizedError(_response.error.body, _response.rawResponse); - case 403: throw new AccessDeniedError(_response.error.body, _response.rawResponse); - case 405: throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); - case 404: throw new NotFoundError(_response.error.body, _response.rawResponse); - default: throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse - }); - } - switch (_response.error.reason) { - case "non-json": throw new LangfuseAPIError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse - }); - case "timeout": throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluators/{evaluatorId}."); - case "unknown": throw new LangfuseAPIError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse - }); - } - } - async _getAuthorizationHeader() { - const username = await Supplier.get(this._options.username); - const password = await Supplier.get(this._options.password); - if (username != null && password != null) return BasicAuth.toAuthorizationHeader({ - username, - password - }); - } + constructor(_options) { + this._options = _options; + } + create(request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); + } + async __create(request, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluators"), + method: "POST", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + requestType: "json", + body: request, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 409: + throw new unstable_exports.ConflictError(_response.error.body, _response.rawResponse); + case 422: + throw new unstable_exports.UnprocessableContentError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling POST /api/public/unstable/evaluators."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + list(request = {}, requestOptions) { + return HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); + } + async __list(request = {}, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + const { page, limit } = request; + const _queryParams = {}; + if (page != null) { + _queryParams["page"] = page.toString(); + } + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), "/api/public/unstable/evaluators"), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions == null ? undefined : requestOptions.queryParams }, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluators."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + get(evaluatorId, requestOptions) { + return HttpResponsePromise.fromPromise(this.__get(evaluatorId, requestOptions)); + } + async __get(evaluatorId, requestOptions) { + var _a22, _b, _c, _d, _e, _f, _g, _h; + let _headers = mergeHeaders((_a22 = this._options) == null ? undefined : _a22.headers, mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? undefined : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? undefined : _b.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": (_e = requestOptions == null ? undefined : requestOptions.xLangfuseSdkVersion) != null ? _e : (_d = this._options) == null ? undefined : _d.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": (_g = requestOptions == null ? undefined : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? undefined : _f.xLangfusePublicKey + }), requestOptions == null ? undefined : requestOptions.headers); + const _response = await fetcher({ + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/unstable/evaluators/${encodeURIComponent(evaluatorId)}`), + method: "GET", + headers: _headers, + queryParameters: requestOptions == null ? undefined : requestOptions.queryParams, + timeoutMs: (requestOptions == null ? undefined : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions == null ? undefined : requestOptions.maxRetries, + abortSignal: requestOptions == null ? undefined : requestOptions.abortSignal + }); + if (_response.ok) { + return { + data: _response.body, + rawResponse: _response.rawResponse + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new unstable_exports.BadRequestError(_response.error.body, _response.rawResponse); + case 401: + throw new unstable_exports.UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new unstable_exports.AccessDeniedError(_response.error.body, _response.rawResponse); + case 404: + throw new unstable_exports.NotFoundError(_response.error.body, _response.rawResponse); + case 405: + throw new unstable_exports.MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 429: + throw new unstable_exports.TooManyRequestsError(_response.error.body, _response.rawResponse); + case 500: + throw new unstable_exports.InternalServerError(_response.error.body, _response.rawResponse); + case 400: + throw new Error2(_response.error.body, _response.rawResponse); + case 401: + throw new UnauthorizedError(_response.error.body, _response.rawResponse); + case 403: + throw new AccessDeniedError(_response.error.body, _response.rawResponse); + case 405: + throw new MethodNotAllowedError(_response.error.body, _response.rawResponse); + case 404: + throw new NotFoundError(_response.error.body, _response.rawResponse); + default: + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse + }); + } + } + switch (_response.error.reason) { + case "non-json": + throw new LangfuseAPIError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + rawResponse: _response.rawResponse + }); + case "timeout": + throw new LangfuseAPITimeoutError("Timeout exceeded when calling GET /api/public/unstable/evaluators/{evaluatorId}."); + case "unknown": + throw new LangfuseAPIError({ + message: _response.error.errorMessage, + rawResponse: _response.rawResponse + }); + } + } + async _getAuthorizationHeader() { + const username = await Supplier.get(this._options.username); + const password = await Supplier.get(this._options.password); + if (username != null && password != null) { + return BasicAuth.toAuthorizationHeader({ + username, + password + }); + } + return; + } }; var Unstable = class { - constructor(_options) { - this._options = _options; - } - get evaluationRules() { - var _a2; - return (_a2 = this._evaluationRules) != null ? _a2 : this._evaluationRules = new EvaluationRules(this._options); - } - get evaluators() { - var _a2; - return (_a2 = this._evaluators) != null ? _a2 : this._evaluators = new Evaluators(this._options); - } + constructor(_options) { + this._options = _options; + } + get evaluationRules() { + var _a22; + return (_a22 = this._evaluationRules) != null ? _a22 : this._evaluationRules = new EvaluationRules(this._options); + } + get evaluators() { + var _a22; + return (_a22 = this._evaluators) != null ? _a22 : this._evaluators = new Evaluators(this._options); + } }; var LangfuseAPIClient = class { - constructor(_options) { - this._options = { - ..._options, - headers: mergeHeaders$1({ - "X-Langfuse-Sdk-Name": _options == null ? void 0 : _options.xLangfuseSdkName, - "X-Langfuse-Sdk-Version": _options == null ? void 0 : _options.xLangfuseSdkVersion, - "X-Langfuse-Public-Key": _options == null ? void 0 : _options.xLangfusePublicKey - }, _options == null ? void 0 : _options.headers) - }; - } - get annotationQueues() { - var _a2; - return (_a2 = this._annotationQueues) != null ? _a2 : this._annotationQueues = new AnnotationQueues(this._options); - } - get blobStorageIntegrations() { - var _a2; - return (_a2 = this._blobStorageIntegrations) != null ? _a2 : this._blobStorageIntegrations = new BlobStorageIntegrations(this._options); - } - get comments() { - var _a2; - return (_a2 = this._comments) != null ? _a2 : this._comments = new Comments(this._options); - } - get datasetItems() { - var _a2; - return (_a2 = this._datasetItems) != null ? _a2 : this._datasetItems = new DatasetItems(this._options); - } - get datasetRunItems() { - var _a2; - return (_a2 = this._datasetRunItems) != null ? _a2 : this._datasetRunItems = new DatasetRunItems(this._options); - } - get datasets() { - var _a2; - return (_a2 = this._datasets) != null ? _a2 : this._datasets = new Datasets(this._options); - } - get health() { - var _a2; - return (_a2 = this._health) != null ? _a2 : this._health = new Health(this._options); - } - get ingestion() { - var _a2; - return (_a2 = this._ingestion) != null ? _a2 : this._ingestion = new Ingestion(this._options); - } - get legacy() { - var _a2; - return (_a2 = this._legacy) != null ? _a2 : this._legacy = new Legacy(this._options); - } - get llmConnections() { - var _a2; - return (_a2 = this._llmConnections) != null ? _a2 : this._llmConnections = new LlmConnections(this._options); - } - get media() { - var _a2; - return (_a2 = this._media) != null ? _a2 : this._media = new Media(this._options); - } - get metrics() { - var _a2; - return (_a2 = this._metrics) != null ? _a2 : this._metrics = new Metrics(this._options); - } - get models() { - var _a2; - return (_a2 = this._models) != null ? _a2 : this._models = new Models(this._options); - } - get observations() { - var _a2; - return (_a2 = this._observations) != null ? _a2 : this._observations = new Observations(this._options); - } - get opentelemetry() { - var _a2; - return (_a2 = this._opentelemetry) != null ? _a2 : this._opentelemetry = new Opentelemetry(this._options); - } - get organizations() { - var _a2; - return (_a2 = this._organizations) != null ? _a2 : this._organizations = new Organizations(this._options); - } - get projects() { - var _a2; - return (_a2 = this._projects) != null ? _a2 : this._projects = new Projects(this._options); - } - get promptVersion() { - var _a2; - return (_a2 = this._promptVersion) != null ? _a2 : this._promptVersion = new PromptVersion(this._options); - } - get prompts() { - var _a2; - return (_a2 = this._prompts) != null ? _a2 : this._prompts = new Prompts(this._options); - } - get scim() { - var _a2; - return (_a2 = this._scim) != null ? _a2 : this._scim = new Scim(this._options); - } - get scoreConfigs() { - var _a2; - return (_a2 = this._scoreConfigs) != null ? _a2 : this._scoreConfigs = new ScoreConfigs(this._options); - } - get scores() { - var _a2; - return (_a2 = this._scores) != null ? _a2 : this._scores = new Scores(this._options); - } - get sessions() { - var _a2; - return (_a2 = this._sessions) != null ? _a2 : this._sessions = new Sessions(this._options); - } - get trace() { - var _a2; - return (_a2 = this._trace) != null ? _a2 : this._trace = new Trace(this._options); - } - get unstable() { - var _a2; - return (_a2 = this._unstable) != null ? _a2 : this._unstable = new Unstable(this._options); - } + constructor(_options) { + this._options = { + ..._options, + headers: mergeHeaders({ + "X-Langfuse-Sdk-Name": _options == null ? undefined : _options.xLangfuseSdkName, + "X-Langfuse-Sdk-Version": _options == null ? undefined : _options.xLangfuseSdkVersion, + "X-Langfuse-Public-Key": _options == null ? undefined : _options.xLangfusePublicKey + }, _options == null ? undefined : _options.headers) + }; + } + get annotationQueues() { + var _a22; + return (_a22 = this._annotationQueues) != null ? _a22 : this._annotationQueues = new AnnotationQueues(this._options); + } + get blobStorageIntegrations() { + var _a22; + return (_a22 = this._blobStorageIntegrations) != null ? _a22 : this._blobStorageIntegrations = new BlobStorageIntegrations(this._options); + } + get comments() { + var _a22; + return (_a22 = this._comments) != null ? _a22 : this._comments = new Comments(this._options); + } + get datasetItems() { + var _a22; + return (_a22 = this._datasetItems) != null ? _a22 : this._datasetItems = new DatasetItems(this._options); + } + get datasetRunItems() { + var _a22; + return (_a22 = this._datasetRunItems) != null ? _a22 : this._datasetRunItems = new DatasetRunItems(this._options); + } + get datasets() { + var _a22; + return (_a22 = this._datasets) != null ? _a22 : this._datasets = new Datasets(this._options); + } + get health() { + var _a22; + return (_a22 = this._health) != null ? _a22 : this._health = new Health(this._options); + } + get ingestion() { + var _a22; + return (_a22 = this._ingestion) != null ? _a22 : this._ingestion = new Ingestion(this._options); + } + get legacy() { + var _a22; + return (_a22 = this._legacy) != null ? _a22 : this._legacy = new Legacy(this._options); + } + get llmConnections() { + var _a22; + return (_a22 = this._llmConnections) != null ? _a22 : this._llmConnections = new LlmConnections(this._options); + } + get media() { + var _a22; + return (_a22 = this._media) != null ? _a22 : this._media = new Media(this._options); + } + get metrics() { + var _a22; + return (_a22 = this._metrics) != null ? _a22 : this._metrics = new Metrics(this._options); + } + get models() { + var _a22; + return (_a22 = this._models) != null ? _a22 : this._models = new Models(this._options); + } + get observations() { + var _a22; + return (_a22 = this._observations) != null ? _a22 : this._observations = new Observations(this._options); + } + get opentelemetry() { + var _a22; + return (_a22 = this._opentelemetry) != null ? _a22 : this._opentelemetry = new Opentelemetry(this._options); + } + get organizations() { + var _a22; + return (_a22 = this._organizations) != null ? _a22 : this._organizations = new Organizations(this._options); + } + get projects() { + var _a22; + return (_a22 = this._projects) != null ? _a22 : this._projects = new Projects(this._options); + } + get promptVersion() { + var _a22; + return (_a22 = this._promptVersion) != null ? _a22 : this._promptVersion = new PromptVersion(this._options); + } + get prompts() { + var _a22; + return (_a22 = this._prompts) != null ? _a22 : this._prompts = new Prompts(this._options); + } + get scim() { + var _a22; + return (_a22 = this._scim) != null ? _a22 : this._scim = new Scim(this._options); + } + get scoreConfigs() { + var _a22; + return (_a22 = this._scoreConfigs) != null ? _a22 : this._scoreConfigs = new ScoreConfigs(this._options); + } + get scores() { + var _a22; + return (_a22 = this._scores) != null ? _a22 : this._scores = new Scores(this._options); + } + get sessions() { + var _a22; + return (_a22 = this._sessions) != null ? _a22 : this._sessions = new Sessions(this._options); + } + get trace() { + var _a22; + return (_a22 = this._trace) != null ? _a22 : this._trace = new Trace(this._options); + } + get unstable() { + var _a22; + return (_a22 = this._unstable) != null ? _a22 : this._unstable = new Unstable(this._options); + } }; var LangfuseMedia = class { - /** - * Creates a new LangfuseMedia instance. - * - * @param params - Media parameters specifying the source and content - * - * @example - * ```typescript - * // Create from base64 data URI - * const media = new LangfuseMedia({ - * source: "base64_data_uri", - * base64DataUri: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..." - * }); - * ``` - */ - constructor(params) { - const { source } = params; - this._source = source; - if (source === "base64_data_uri") { - const [contentBytesParsed, contentTypeParsed] = this.parseBase64DataUri(params.base64DataUri); - this._contentBytes = contentBytesParsed; - this._contentType = contentTypeParsed; - } else { - this._contentBytes = params.contentBytes; - this._contentType = params.contentType; - } - } - /** - * Parses a base64 data URI to extract content bytes and type. - * - * @param data - The base64 data URI string - * @returns Tuple of [contentBytes, contentType] or [undefined, undefined] on error - * @private - */ - parseBase64DataUri(data) { - try { - if (!data || typeof data !== "string") throw new Error("Data URI is not a string"); - if (!data.startsWith("data:")) throw new Error("Data URI does not start with 'data:'"); - const [header, actualData] = data.slice(5).split(",", 2); - if (!header || !actualData) throw new Error("Invalid URI"); - const headerParts = header.split(";"); - if (!headerParts.includes("base64")) throw new Error("Data is not base64 encoded"); - const contentType = headerParts[0]; - if (!contentType) throw new Error("Content type is empty"); - return [base64ToBytes(actualData), contentType]; - } catch (error) { - getGlobalLogger().error("Error parsing base64 data URI", error); - return [void 0, void 0]; - } - } - /** - * Gets a unique identifier for this media based on its content hash. - * - * The ID is derived from the first 22 characters of the URL-safe base64-encoded - * SHA-256 hash of the content. - * - * @returns The unique media ID, or null if hash generation failed - * - * @example - * ```typescript - * const media = new LangfuseMedia({...}); - * console.log(media.id); // "A1B2C3D4E5F6G7H8I9J0K1" - * ``` - */ - async getId() { - const contentSha256Hash = await this.getSha256Hash(); - if (!contentSha256Hash) return null; - return contentSha256Hash.replaceAll("+", "-").replaceAll("/", "_").slice(0, 22); - } - /** - * Gets the length of the media content in bytes. - * - * @returns The content length in bytes, or undefined if no content is available - */ - get contentLength() { - var _a2; - return (_a2 = this._contentBytes) == null ? void 0 : _a2.length; - } - /** - * Gets the SHA-256 hash of the media content. - * - * The hash is used for content integrity verification and generating unique media IDs. - * Returns undefined if crypto is not available or hash generation fails. - * - * @returns The base64-encoded SHA-256 hash, or undefined if unavailable - */ - async getSha256Hash() { - if (!this._contentBytes) return; - try { - const hash = await crypto.subtle.digest("SHA-256", this._contentBytes); - return bytesToBase64(new Uint8Array(hash)); - } catch (error) { - getGlobalLogger().warn("[Langfuse] Failed to generate SHA-256 hash for media content:", error); - return; - } - } - /** - * Gets the media reference tag for embedding in trace data. - * - * The tag format is: `@@@langfuseMedia:type=|id=|source=@@@` - * This tag can be embedded in trace attributes and will be replaced with actual - * media content when the trace is viewed in Langfuse. - * - * @returns The media reference tag, or null if required data is missing - * - * @example - * ```typescript - * const media = new LangfuseMedia({...}); - * console.log(media.tag); - * // "@@@langfuseMedia:type=image/png|id=A1B2C3D4E5F6G7H8I9J0K1|source=base64_data_uri@@@" - * ``` - */ - async getTag() { - const id = await this.getId(); - if (!this._contentType || !this._source || !id) return null; - return `@@@langfuseMedia:type=${this._contentType}|id=${id}|source=${this._source}@@@`; - } - /** - * Gets the media content as a base64 data URI. - * - * @returns The complete data URI string, or null if no content is available - * - * @example - * ```typescript - * const media = new LangfuseMedia({...}); - * console.log(media.base64DataUri); - * // "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..." - * ``` - */ - get base64DataUri() { - if (!this._contentBytes) return null; - return `data:${this._contentType};base64,${bytesToBase64(this._contentBytes)}`; - } - /** - * Serializes the media to JSON (returns the base64 data URI). - * - * @returns The base64 data URI, or null if no content is available - */ - toJSON() { - return this.base64DataUri; - } + constructor(params) { + const { source } = params; + this._source = source; + if (source === "base64_data_uri") { + const [contentBytesParsed, contentTypeParsed] = this.parseBase64DataUri(params.base64DataUri); + this._contentBytes = contentBytesParsed; + this._contentType = contentTypeParsed; + } else { + this._contentBytes = params.contentBytes; + this._contentType = params.contentType; + } + } + parseBase64DataUri(data) { + try { + if (!data || typeof data !== "string") { + throw new Error("Data URI is not a string"); + } + if (!data.startsWith("data:")) { + throw new Error("Data URI does not start with 'data:'"); + } + const [header, actualData] = data.slice(5).split(",", 2); + if (!header || !actualData) { + throw new Error("Invalid URI"); + } + const headerParts = header.split(";"); + if (!headerParts.includes("base64")) { + throw new Error("Data is not base64 encoded"); + } + const contentType = headerParts[0]; + if (!contentType) { + throw new Error("Content type is empty"); + } + return [base64ToBytes(actualData), contentType]; + } catch (error51) { + getGlobalLogger().error("Error parsing base64 data URI", error51); + return [undefined, undefined]; + } + } + async getId() { + const contentSha256Hash = await this.getSha256Hash(); + if (!contentSha256Hash) + return null; + const urlSafeContentHash = contentSha256Hash.replaceAll("+", "-").replaceAll("/", "_"); + return urlSafeContentHash.slice(0, 22); + } + get contentLength() { + var _a22; + return (_a22 = this._contentBytes) == null ? undefined : _a22.length; + } + async getSha256Hash() { + if (!this._contentBytes) { + return; + } + try { + const hash2 = await crypto.subtle.digest("SHA-256", this._contentBytes); + return bytesToBase64(new Uint8Array(hash2)); + } catch (error51) { + getGlobalLogger().warn("[Langfuse] Failed to generate SHA-256 hash for media content:", error51); + return; + } + } + async getTag() { + const id = await this.getId(); + if (!this._contentType || !this._source || !id) + return null; + return `@@@langfuseMedia:type=${this._contentType}|id=${id}|source=${this._source}@@@`; + } + get base64DataUri() { + if (!this._contentBytes) + return null; + return `data:${this._contentType};base64,${bytesToBase64(this._contentBytes)}`; + } + toJSON() { + return this.base64DataUri; + } }; var experimentKeys = [ - "experimentId", - "experimentName", - "experimentMetadata", - "experimentDatasetId", - "experimentItemId", - "experimentItemMetadata", - "experimentItemRootObservationId" + "experimentId", + "experimentName", + "experimentMetadata", + "experimentDatasetId", + "experimentItemId", + "experimentItemMetadata", + "experimentItemRootObservationId" ]; var LangfuseOtelContextKeys = { - userId: createContextKey("langfuse_user_id"), - sessionId: createContextKey("langfuse_session_id"), - metadata: createContextKey("langfuse_metadata"), - version: createContextKey("langfuse_version"), - tags: createContextKey("langfuse_tags"), - traceName: createContextKey("langfuse_trace_name"), - experimentId: createContextKey("langfuse_experiment_id"), - experimentName: createContextKey("langfuse_experiment_name"), - experimentMetadata: createContextKey("langfuse_experiment_metadata"), - experimentDatasetId: createContextKey("langfuse_experiment_dataset_id"), - experimentItemId: createContextKey("langfuse_experiment_item_id"), - experimentItemMetadata: createContextKey("langfuse_experiment_item_metadata"), - experimentItemRootObservationId: createContextKey("langfuse_experiment_item_root_observation_id") + userId: import_api.createContextKey("langfuse_user_id"), + sessionId: import_api.createContextKey("langfuse_session_id"), + metadata: import_api.createContextKey("langfuse_metadata"), + version: import_api.createContextKey("langfuse_version"), + tags: import_api.createContextKey("langfuse_tags"), + traceName: import_api.createContextKey("langfuse_trace_name"), + experimentId: import_api.createContextKey("langfuse_experiment_id"), + experimentName: import_api.createContextKey("langfuse_experiment_name"), + experimentMetadata: import_api.createContextKey("langfuse_experiment_metadata"), + experimentDatasetId: import_api.createContextKey("langfuse_experiment_dataset_id"), + experimentItemId: import_api.createContextKey("langfuse_experiment_item_id"), + experimentItemMetadata: import_api.createContextKey("langfuse_experiment_item_metadata"), + experimentItemRootObservationId: import_api.createContextKey("langfuse_experiment_item_root_observation_id") }; var LANGFUSE_BAGGAGE_PREFIX = "langfuse_"; var LANGFUSE_BAGGAGE_TAGS_SEPARATOR = ","; var LANGFUSE_TRACE_ID_BAGGAGE_KEY = "langfuse_trace_id"; -function getLangfuseTraceIdFromBaggage(context$1) { - const baggage = propagation.getBaggage(context$1); - const entry = baggage == null ? void 0 : baggage.getEntry(LANGFUSE_TRACE_ID_BAGGAGE_KEY); - if (!(entry == null ? void 0 : entry.value)) return void 0; - return entry.value.toLowerCase(); +function getLangfuseTraceIdFromBaggage(context) { + const baggage = import_api.propagation.getBaggage(context); + const entry = baggage == null ? undefined : baggage.getEntry(LANGFUSE_TRACE_ID_BAGGAGE_KEY); + if (!(entry == null ? undefined : entry.value)) + return; + return entry.value.toLowerCase(); } function propagateAttributes(params, fn) { - var _a2; - let context$1 = context.active(); - const span = trace.getActiveSpan(); - const asBaggage = (_a2 = params.asBaggage) != null ? _a2 : false; - const { userId, sessionId, metadata, version: version$1, tags, traceName, _internalExperiment } = params; - if (userId) { - if (isValidPropagatedString({ - value: userId, - attributeName: "userId" - })) context$1 = setPropagatedAttribute({ - key: "userId", - value: userId, - context: context$1, - span, - asBaggage - }); - } - if (sessionId) { - if (isValidPropagatedString({ - value: sessionId, - attributeName: "sessionId" - })) context$1 = setPropagatedAttribute({ - key: "sessionId", - value: sessionId, - context: context$1, - span, - asBaggage - }); - } - if (version$1) { - if (isValidPropagatedString({ - value: version$1, - attributeName: "version" - })) context$1 = setPropagatedAttribute({ - key: "version", - value: version$1, - context: context$1, - span, - asBaggage - }); - } - if (traceName) { - if (isValidPropagatedString({ - value: traceName, - attributeName: "traceName" - })) context$1 = setPropagatedAttribute({ - key: "traceName", - value: traceName, - context: context$1, - span, - asBaggage - }); - } - if (tags && tags.length > 0) { - const validTags = tags.filter((tag) => isValidPropagatedString({ - value: tag, - attributeName: "tag" - })); - if (validTags.length > 0) context$1 = setPropagatedAttribute({ - key: "tags", - value: validTags, - context: context$1, - span, - asBaggage - }); - } - if (metadata) { - const validatedMetadata = {}; - for (const [key, value] of Object.entries(metadata)) if (isValidPropagatedString({ - value, - attributeName: `metadata.${key}` - })) validatedMetadata[key] = value; - if (Object.keys(validatedMetadata).length > 0) context$1 = setPropagatedAttribute({ - key: "metadata", - value: validatedMetadata, - context: context$1, - span, - asBaggage - }); - } - if (_internalExperiment) { - for (const [key, value] of Object.entries(_internalExperiment)) if (value !== void 0) context$1 = setPropagatedAttribute({ - key, - value, - context: context$1, - span, - asBaggage - }); - } - return context.with(context$1, fn); -} -function getPropagatedAttributesFromContext(context$1) { - const propagatedAttributes = {}; - const baggage = propagation.getBaggage(context$1); - if (baggage) baggage.getAllEntries().forEach(([baggageKey, baggageEntry]) => { - if (baggageKey === LANGFUSE_TRACE_ID_BAGGAGE_KEY) return; - if (baggageKey.startsWith(LANGFUSE_BAGGAGE_PREFIX)) { - const spanKey = getSpanKeyFromBaggageKey(baggageKey); - if (spanKey) propagatedAttributes[spanKey] = baggageKey == getBaggageKeyForPropagatedKey("tags") ? baggageEntry.value.split(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) : baggageEntry.value; - } - }); - const userId = context$1.getValue(LangfuseOtelContextKeys["userId"]); - if (userId && typeof userId === "string") { - const spanKey = getSpanKeyForPropagatedKey("userId"); - propagatedAttributes[spanKey] = userId; - } - const sessionId = context$1.getValue(LangfuseOtelContextKeys["sessionId"]); - if (sessionId && typeof sessionId === "string") { - const spanKey = getSpanKeyForPropagatedKey("sessionId"); - propagatedAttributes[spanKey] = sessionId; - } - const version$1 = context$1.getValue(LangfuseOtelContextKeys["version"]); - if (version$1 && typeof version$1 === "string") { - const spanKey = getSpanKeyForPropagatedKey("version"); - propagatedAttributes[spanKey] = version$1; - } - const traceName = context$1.getValue(LangfuseOtelContextKeys["traceName"]); - if (traceName && typeof traceName === "string") { - const spanKey = getSpanKeyForPropagatedKey("traceName"); - propagatedAttributes[spanKey] = traceName; - } - const tags = context$1.getValue(LangfuseOtelContextKeys["tags"]); - if (tags && Array.isArray(tags)) { - const spanKey = getSpanKeyForPropagatedKey("tags"); - propagatedAttributes[spanKey] = tags; - } - const metadata = context$1.getValue(LangfuseOtelContextKeys["metadata"]); - if (metadata && typeof metadata === "object" && metadata !== null) for (const [k, v] of Object.entries(metadata)) { - const spanKey = `langfuse.trace.metadata.${k}`; - propagatedAttributes[spanKey] = String(v); - } - for (const key of experimentKeys) { - const contextKey = LangfuseOtelContextKeys[key]; - const value = context$1.getValue(contextKey); - if (value && typeof value === "string") { - const spanKey = getSpanKeyForPropagatedKey(key); - propagatedAttributes[spanKey] = value; - } - } - if (propagatedAttributes[getSpanKeyForPropagatedKey("experimentItemRootObservationId")]) propagatedAttributes["langfuse.environment"] = LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT; - return propagatedAttributes; + var _a22; + let context = import_api.context.active(); + const span = import_api.trace.getActiveSpan(); + const asBaggage = (_a22 = params.asBaggage) != null ? _a22 : false; + const { + userId, + sessionId, + metadata, + version: version2, + tags, + traceName, + _internalExperiment + } = params; + if (userId) { + if (isValidPropagatedString({ value: userId, attributeName: "userId" })) { + context = setPropagatedAttribute({ + key: "userId", + value: userId, + context, + span, + asBaggage + }); + } + } + if (sessionId) { + if (isValidPropagatedString({ + value: sessionId, + attributeName: "sessionId" + })) { + context = setPropagatedAttribute({ + key: "sessionId", + value: sessionId, + context, + span, + asBaggage + }); + } + } + if (version2) { + if (isValidPropagatedString({ + value: version2, + attributeName: "version" + })) { + context = setPropagatedAttribute({ + key: "version", + value: version2, + context, + span, + asBaggage + }); + } + } + if (traceName) { + if (isValidPropagatedString({ + value: traceName, + attributeName: "traceName" + })) { + context = setPropagatedAttribute({ + key: "traceName", + value: traceName, + context, + span, + asBaggage + }); + } + } + if (tags && tags.length > 0) { + const validTags = tags.filter((tag) => isValidPropagatedString({ + value: tag, + attributeName: "tag" + })); + if (validTags.length > 0) { + context = setPropagatedAttribute({ + key: "tags", + value: validTags, + context, + span, + asBaggage + }); + } + } + if (metadata) { + const validatedMetadata = {}; + for (const [key, value] of Object.entries(metadata)) { + if (isValidPropagatedString({ + value, + attributeName: `metadata.${key}` + })) { + validatedMetadata[key] = value; + } + } + if (Object.keys(validatedMetadata).length > 0) { + context = setPropagatedAttribute({ + key: "metadata", + value: validatedMetadata, + context, + span, + asBaggage + }); + } + } + if (_internalExperiment) { + for (const [key, value] of Object.entries(_internalExperiment)) { + if (value !== undefined) { + context = setPropagatedAttribute({ + key, + value, + context, + span, + asBaggage + }); + } + } + } + return import_api.context.with(context, fn); +} +function getPropagatedAttributesFromContext(context) { + const propagatedAttributes = {}; + const baggage = import_api.propagation.getBaggage(context); + if (baggage) { + baggage.getAllEntries().forEach(([baggageKey, baggageEntry]) => { + if (baggageKey === LANGFUSE_TRACE_ID_BAGGAGE_KEY) + return; + if (baggageKey.startsWith(LANGFUSE_BAGGAGE_PREFIX)) { + const spanKey = getSpanKeyFromBaggageKey(baggageKey); + if (spanKey) { + const isMergedTags = baggageKey == getBaggageKeyForPropagatedKey("tags"); + propagatedAttributes[spanKey] = isMergedTags ? baggageEntry.value.split(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) : baggageEntry.value; + } + } + }); + } + const userId = context.getValue(LangfuseOtelContextKeys["userId"]); + if (userId && typeof userId === "string") { + const spanKey = getSpanKeyForPropagatedKey("userId"); + propagatedAttributes[spanKey] = userId; + } + const sessionId = context.getValue(LangfuseOtelContextKeys["sessionId"]); + if (sessionId && typeof sessionId === "string") { + const spanKey = getSpanKeyForPropagatedKey("sessionId"); + propagatedAttributes[spanKey] = sessionId; + } + const version2 = context.getValue(LangfuseOtelContextKeys["version"]); + if (version2 && typeof version2 === "string") { + const spanKey = getSpanKeyForPropagatedKey("version"); + propagatedAttributes[spanKey] = version2; + } + const traceName = context.getValue(LangfuseOtelContextKeys["traceName"]); + if (traceName && typeof traceName === "string") { + const spanKey = getSpanKeyForPropagatedKey("traceName"); + propagatedAttributes[spanKey] = traceName; + } + const tags = context.getValue(LangfuseOtelContextKeys["tags"]); + if (tags && Array.isArray(tags)) { + const spanKey = getSpanKeyForPropagatedKey("tags"); + propagatedAttributes[spanKey] = tags; + } + const metadata = context.getValue(LangfuseOtelContextKeys["metadata"]); + if (metadata && typeof metadata === "object" && metadata !== null) { + for (const [k, v] of Object.entries(metadata)) { + const spanKey = `${"langfuse.trace.metadata"}.${k}`; + propagatedAttributes[spanKey] = String(v); + } + } + for (const key of experimentKeys) { + const contextKey = LangfuseOtelContextKeys[key]; + const value = context.getValue(contextKey); + if (value && typeof value === "string") { + const spanKey = getSpanKeyForPropagatedKey(key); + propagatedAttributes[spanKey] = value; + } + } + if (propagatedAttributes[getSpanKeyForPropagatedKey("experimentItemRootObservationId")]) { + propagatedAttributes["langfuse.environment"] = LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT; + } + return propagatedAttributes; } function setPropagatedAttribute(params) { - const { key, value, span, asBaggage } = params; - let context$1 = params.context; - let mergedMetadata = key === "metadata" ? getContextMergedMetadata(context$1, value) : {}; - let mergedTags = key === "tags" ? getContextMergedTags(context$1, value) : []; - const contextKey = getContextKeyForPropagatedKey(key); - if (key === "metadata") context$1 = context$1.setValue(contextKey, mergedMetadata); - else if (key === "tags") context$1 = context$1.setValue(contextKey, mergedTags); - else context$1 = context$1.setValue(contextKey, value); - if (span && span.isRecording()) if (key === "metadata") for (const [k, v] of Object.entries(mergedMetadata)) span.setAttribute(`langfuse.trace.metadata.${k}`, v); - else if (key === "tags") { - const spanKey = getSpanKeyForPropagatedKey(key); - span.setAttribute(spanKey, mergedTags); - } else { - const spanKey = getSpanKeyForPropagatedKey(key); - span.setAttribute(spanKey, value); - } - if (asBaggage) { - const baggageKey = getBaggageKeyForPropagatedKey(key); - let baggage = propagation.getBaggage(context$1) || propagation.createBaggage(); - if (key === "metadata") for (const [k, v] of Object.entries(mergedMetadata)) baggage = baggage.setEntry(`${baggageKey}_${k}`, { value: v }); - else if (key === "tags") baggage = baggage.setEntry(baggageKey, { value: mergedTags.join(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) }); - else baggage = baggage.setEntry(baggageKey, { value }); - context$1 = propagation.setBaggage(context$1, baggage); - } - return context$1; -} -function getContextMergedTags(context$1, newTags) { - const existingTags = context$1.getValue(LangfuseOtelContextKeys["tags"]); - if (existingTags && Array.isArray(existingTags)) return [.../* @__PURE__ */ new Set([...existingTags, ...newTags])]; - else return newTags; -} -function getContextMergedMetadata(context$1, newMetadata) { - const existingMetadata = context$1.getValue(LangfuseOtelContextKeys["metadata"]); - if (existingMetadata && typeof existingMetadata === "object" && existingMetadata !== null && !Array.isArray(existingMetadata)) return { - ...existingMetadata, - ...newMetadata - }; - else return newMetadata; + const { key, value, span, asBaggage } = params; + let context = params.context; + let mergedMetadata = key === "metadata" ? getContextMergedMetadata(context, value) : {}; + let mergedTags = key === "tags" ? getContextMergedTags(context, value) : []; + const contextKey = getContextKeyForPropagatedKey(key); + if (key === "metadata") { + context = context.setValue(contextKey, mergedMetadata); + } else if (key === "tags") { + context = context.setValue(contextKey, mergedTags); + } else { + context = context.setValue(contextKey, value); + } + if (span && span.isRecording()) { + if (key === "metadata") { + for (const [k, v] of Object.entries(mergedMetadata)) { + span.setAttribute(`${"langfuse.trace.metadata"}.${k}`, v); + } + } else if (key === "tags") { + const spanKey = getSpanKeyForPropagatedKey(key); + span.setAttribute(spanKey, mergedTags); + } else { + const spanKey = getSpanKeyForPropagatedKey(key); + span.setAttribute(spanKey, value); + } + } + if (asBaggage) { + const baggageKey = getBaggageKeyForPropagatedKey(key); + let baggage = import_api.propagation.getBaggage(context) || import_api.propagation.createBaggage(); + if (key === "metadata") { + for (const [k, v] of Object.entries(mergedMetadata)) { + baggage = baggage.setEntry(`${baggageKey}_${k}`, { value: v }); + } + } else if (key === "tags") { + baggage = baggage.setEntry(baggageKey, { + value: mergedTags.join(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) + }); + } else { + baggage = baggage.setEntry(baggageKey, { value }); + } + context = import_api.propagation.setBaggage(context, baggage); + } + return context; +} +function getContextMergedTags(context, newTags) { + const existingTags = context.getValue(LangfuseOtelContextKeys["tags"]); + if (existingTags && Array.isArray(existingTags)) { + return [.../* @__PURE__ */ new Set([...existingTags, ...newTags])]; + } else { + return newTags; + } +} +function getContextMergedMetadata(context, newMetadata) { + const existingMetadata = context.getValue(LangfuseOtelContextKeys["metadata"]); + if (existingMetadata && typeof existingMetadata === "object" && existingMetadata !== null && !Array.isArray(existingMetadata)) { + return { ...existingMetadata, ...newMetadata }; + } else { + return newMetadata; + } } function isValidPropagatedString(params) { - const logger = getGlobalLogger(); - const { value, attributeName } = params; - if (typeof value !== "string") { - logger.warn(`Propagated attribute '${attributeName}' must be a string. Dropping value.`); - return false; - } - if (value.length > 200) { - logger.warn(`Propagated attribute '${attributeName}' value is over 200 characters (${value.length} chars). Dropping value.`); - return false; - } - return true; + const logger = getGlobalLogger(); + const { value, attributeName } = params; + if (typeof value !== "string") { + logger.warn(`Propagated attribute '${attributeName}' must be a string. Dropping value.`); + return false; + } + if (value.length > 200) { + logger.warn(`Propagated attribute '${attributeName}' value is over 200 characters (${value.length} chars). Dropping value.`); + return false; + } + return true; } function getContextKeyForPropagatedKey(key) { - return LangfuseOtelContextKeys[key]; + return LangfuseOtelContextKeys[key]; } function getSpanKeyForPropagatedKey(key) { - switch (key) { - case "userId": return "user.id"; - case "sessionId": return "session.id"; - case "version": return "langfuse.version"; - case "traceName": return "langfuse.trace.name"; - case "metadata": return "langfuse.trace.metadata"; - case "tags": return "langfuse.trace.tags"; - case "experimentId": return "langfuse.experiment.id"; - case "experimentName": return "langfuse.experiment.name"; - case "experimentMetadata": return "langfuse.experiment.metadata"; - case "experimentDatasetId": return "langfuse.experiment.dataset.id"; - case "experimentItemId": return "langfuse.experiment.item.id"; - case "experimentItemMetadata": return "langfuse.experiment.item.metadata"; - case "experimentItemRootObservationId": return "langfuse.experiment.item.root_observation_id"; - default: { - const fallback = key; - throw Error("Unhandled propagated key", fallback); - } - } + switch (key) { + case "userId": + return "user.id"; + case "sessionId": + return "session.id"; + case "version": + return "langfuse.version"; + case "traceName": + return "langfuse.trace.name"; + case "metadata": + return "langfuse.trace.metadata"; + case "tags": + return "langfuse.trace.tags"; + case "experimentId": + return "langfuse.experiment.id"; + case "experimentName": + return "langfuse.experiment.name"; + case "experimentMetadata": + return "langfuse.experiment.metadata"; + case "experimentDatasetId": + return "langfuse.experiment.dataset.id"; + case "experimentItemId": + return "langfuse.experiment.item.id"; + case "experimentItemMetadata": + return "langfuse.experiment.item.metadata"; + case "experimentItemRootObservationId": + return "langfuse.experiment.item.root_observation_id"; + default: { + const fallback = key; + throw Error("Unhandled propagated key", fallback); + } + } } function getBaggageKeyForPropagatedKey(key) { - switch (key) { - case "userId": return `${LANGFUSE_BAGGAGE_PREFIX}user_id`; - case "sessionId": return `${LANGFUSE_BAGGAGE_PREFIX}session_id`; - case "version": return `${LANGFUSE_BAGGAGE_PREFIX}version`; - case "traceName": return `${LANGFUSE_BAGGAGE_PREFIX}trace_name`; - case "metadata": return `${LANGFUSE_BAGGAGE_PREFIX}metadata`; - case "tags": return `${LANGFUSE_BAGGAGE_PREFIX}tags`; - case "experimentId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_id`; - case "experimentName": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_name`; - case "experimentMetadata": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_metadata`; - case "experimentDatasetId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_dataset_id`; - case "experimentItemId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_id`; - case "experimentItemMetadata": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_metadata`; - case "experimentItemRootObservationId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_root_observation_id`; - default: { - const fallback = key; - throw Error("Unhandled propagated key", fallback); - } - } + switch (key) { + case "userId": + return `${LANGFUSE_BAGGAGE_PREFIX}user_id`; + case "sessionId": + return `${LANGFUSE_BAGGAGE_PREFIX}session_id`; + case "version": + return `${LANGFUSE_BAGGAGE_PREFIX}version`; + case "traceName": + return `${LANGFUSE_BAGGAGE_PREFIX}trace_name`; + case "metadata": + return `${LANGFUSE_BAGGAGE_PREFIX}metadata`; + case "tags": + return `${LANGFUSE_BAGGAGE_PREFIX}tags`; + case "experimentId": + return `${LANGFUSE_BAGGAGE_PREFIX}experiment_id`; + case "experimentName": + return `${LANGFUSE_BAGGAGE_PREFIX}experiment_name`; + case "experimentMetadata": + return `${LANGFUSE_BAGGAGE_PREFIX}experiment_metadata`; + case "experimentDatasetId": + return `${LANGFUSE_BAGGAGE_PREFIX}experiment_dataset_id`; + case "experimentItemId": + return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_id`; + case "experimentItemMetadata": + return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_metadata`; + case "experimentItemRootObservationId": + return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_root_observation_id`; + default: { + const fallback = key; + throw Error("Unhandled propagated key", fallback); + } + } } function getSpanKeyFromBaggageKey(baggageKey) { - if (!baggageKey.startsWith(LANGFUSE_BAGGAGE_PREFIX)) return; - const suffix = baggageKey.slice(LANGFUSE_BAGGAGE_PREFIX.length); - if (suffix.startsWith("metadata_")) return `langfuse.trace.metadata.${suffix.slice(9)}`; - switch (suffix) { - case "user_id": return getSpanKeyForPropagatedKey("userId"); - case "session_id": return getSpanKeyForPropagatedKey("sessionId"); - case "version": return getSpanKeyForPropagatedKey("version"); - case "trace_name": return getSpanKeyForPropagatedKey("traceName"); - case "tags": return getSpanKeyForPropagatedKey("tags"); - case "experiment_id": return getSpanKeyForPropagatedKey("experimentId"); - case "experiment_name": return getSpanKeyForPropagatedKey("experimentName"); - case "experiment_metadata": return getSpanKeyForPropagatedKey("experimentMetadata"); - case "experiment_dataset_id": return getSpanKeyForPropagatedKey("experimentDatasetId"); - case "experiment_item_id": return getSpanKeyForPropagatedKey("experimentItemId"); - case "experiment_item_metadata": return getSpanKeyForPropagatedKey("experimentItemMetadata"); - case "experiment_item_root_observation_id": return getSpanKeyForPropagatedKey("experimentItemRootObservationId"); - } -} - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js -var require_suppress_tracing$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; - const SUPPRESS_TRACING_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); - function suppressTracing(context$1) { - return context$1.setValue(SUPPRESS_TRACING_KEY, true); - } - exports.suppressTracing = suppressTracing; - function unsuppressTracing(context$1) { - return context$1.deleteValue(SUPPRESS_TRACING_KEY); - } - exports.unsuppressTracing = unsuppressTracing; - function isTracingSuppressed(context$1) { - return context$1.getValue(SUPPRESS_TRACING_KEY) === true; - } - exports.isTracingSuppressed = isTracingSuppressed; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/constants.js -var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; - exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; - exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; - exports.BAGGAGE_ITEMS_SEPARATOR = ","; - exports.BAGGAGE_HEADER = "baggage"; - exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; - exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; - exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js -var require_utils$7 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const constants_1 = require_constants$1(); - function serializeKeyPairs(keyPairs) { - return keyPairs.reduce((hValue, current) => { - const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; - return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; - }, ""); - } - exports.serializeKeyPairs = serializeKeyPairs; - function getKeyPairs(baggage) { - return baggage.getAllEntries().map(([key, value]) => { - let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; - if (value.metadata !== void 0) entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); - return entry; - }); - } - exports.getKeyPairs = getKeyPairs; - function parsePairKeyValue(entry) { - if (!entry) return; - const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); - const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex); - const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); - if (separatorIndex <= 0) return; - const rawKey = keyPairPart.substring(0, separatorIndex).trim(); - const rawValue = keyPairPart.substring(separatorIndex + 1).trim(); - if (!rawKey || !rawValue) return; - let key; - let value; - try { - key = decodeURIComponent(rawKey); - value = decodeURIComponent(rawValue); - } catch { - return; - } - let metadata; - if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) { - const metadataString = entry.substring(metadataSeparatorIndex + 1); - metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString); - } - return { - key, - value, - metadata - }; - } - exports.parsePairKeyValue = parsePairKeyValue; - /** - * Parse a string serialized in the baggage HTTP Format (without metadata): - * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md - */ - function parseKeyPairsIntoRecord(value) { - const result = {}; - if (typeof value === "string" && value.length > 0) value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { - const keyPair = parsePairKeyValue(entry); - if (keyPair !== void 0 && keyPair.value.length > 0) result[keyPair.key] = keyPair.value; - }); - return result; - } - exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js -var require_W3CBaggagePropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.W3CBaggagePropagator = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing$1(); - const constants_1 = require_constants$1(); - const utils_1 = require_utils$7(); - /** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ - */ - var W3CBaggagePropagator = class { - inject(context$1, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context$1); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context$1)) return; - const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); - if (headerValue.length > 0) setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - extract(context$1, carrier, getter) { - const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); - const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; - if (!baggageString) return context$1; - const baggage = {}; - if (baggageString.length === 0) return context$1; - baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { - const keyPair = (0, utils_1.parsePairKeyValue)(entry); - if (keyPair) { - const baggageEntry = { value: keyPair.value }; - if (keyPair.metadata) baggageEntry.metadata = keyPair.metadata; - baggage[keyPair.key] = baggageEntry; - } - }); - if (Object.entries(baggage).length === 0) return context$1; - return api_1.propagation.setBaggage(context$1, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } - }; - exports.W3CBaggagePropagator = W3CBaggagePropagator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js -var require_anchored_clock$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AnchoredClock = void 0; - /** - * A utility for returning wall times anchored to a given point in time. Wall time measurements will - * not be taken from the system, but instead are computed by adding a monotonic clock time - * to the anchor point. - * - * This is needed because the system time can change and result in unexpected situations like - * spans ending before they are started. Creating an anchored clock for each local root span - * ensures that span timings and durations are accurate while preventing span times from drifting - * too far from the system clock. - * - * Only creating an anchored clock once per local trace ensures span times are correct relative - * to each other. For example, a child span will never have a start time before its parent even - * if the system clock is corrected during the local trace. - * - * Heavily inspired by the OTel Java anchored clock - * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java - */ - var AnchoredClock = class { - _monotonicClock; - _epochMillis; - _performanceMillis; - /** - * Create a new AnchoredClock anchored to the current time returned by systemClock. - * - * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date - * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance - */ - constructor(systemClock, monotonicClock) { - this._monotonicClock = monotonicClock; - this._epochMillis = systemClock.now(); - this._performanceMillis = monotonicClock.now(); - } - /** - * Returns the current time by adding the number of milliseconds since the - * AnchoredClock was created to the creation epoch time - */ - now() { - const delta = this._monotonicClock.now() - this._performanceMillis; - return this._epochMillis + delta; - } - }; - exports.AnchoredClock = AnchoredClock; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/attributes.js -var require_attributes$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - function sanitizeAttributes(attributes) { - const out = {}; - if (typeof attributes !== "object" || attributes == null) return out; - for (const key in attributes) { - if (!Object.prototype.hasOwnProperty.call(attributes, key)) continue; - if (!isAttributeKey(key)) { - api_1.diag.warn(`Invalid attribute key: ${key}`); - continue; - } - const val = attributes[key]; - if (!isAttributeValue(val)) { - api_1.diag.warn(`Invalid attribute value set for key: ${key}`); - continue; - } - if (Array.isArray(val)) out[key] = val.slice(); - else out[key] = val; - } - return out; - } - exports.sanitizeAttributes = sanitizeAttributes; - function isAttributeKey(key) { - return typeof key === "string" && key !== ""; - } - exports.isAttributeKey = isAttributeKey; - function isAttributeValue(val) { - if (val == null) return true; - if (Array.isArray(val)) return isHomogeneousAttributeValueArray(val); - return isValidPrimitiveAttributeValueType(typeof val); - } - exports.isAttributeValue = isAttributeValue; - function isHomogeneousAttributeValueArray(arr) { - let type; - for (const element of arr) { - if (element == null) continue; - const elementType = typeof element; - if (elementType === type) continue; - if (!type) { - if (isValidPrimitiveAttributeValueType(elementType)) { - type = elementType; - continue; - } - return false; - } - return false; - } - return true; - } - function isValidPrimitiveAttributeValueType(valType) { - switch (valType) { - case "number": - case "boolean": - case "string": return true; - } - return false; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js -var require_logging_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.loggingErrorHandler = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - /** - * Returns a function that logs an error using the provided logger, or a - * console logger if one was not provided. - */ - function loggingErrorHandler() { - return (ex) => { - api_1.diag.error(stringifyException(ex)); - }; - } - exports.loggingErrorHandler = loggingErrorHandler; - /** - * Converts an exception into a string representation - * @param {Exception} ex - */ - function stringifyException(ex) { - if (typeof ex === "string") return ex; - else return JSON.stringify(flattenException(ex)); - } - /** - * Flattens an exception into key-value pairs by traversing the prototype chain - * and coercing values to strings. Duplicate properties will not be overwritten; - * the first insert wins. - */ - function flattenException(ex) { - const result = {}; - let current = ex; - while (current !== null) { - Object.getOwnPropertyNames(current).forEach((propertyName) => { - if (result[propertyName]) return; - const value = current[propertyName]; - if (value) result[propertyName] = String(value); - }); - current = Object.getPrototypeOf(current); - } - return result; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js -var require_global_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; - /** The global error handler delegate */ - let delegateHandler = (0, require_logging_error_handler$1().loggingErrorHandler)(); - /** - * Set the global error handler - * @param {ErrorHandler} handler - */ - function setGlobalErrorHandler(handler) { - delegateHandler = handler; - } - exports.setGlobalErrorHandler = setGlobalErrorHandler; - /** - * Return the global error handler - * @param {Exception} ex - */ - function globalErrorHandler(ex) { - try { - delegateHandler(ex); - } catch {} - } - exports.globalErrorHandler = globalErrorHandler; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/environment.js -var require_environment$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const util_1$1 = __require("util"); - /** - * Retrieves a number from an environment variable. - * - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number. - * - Returns a number in all other cases. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {number | undefined} - The number value or `undefined`. - */ - function getNumberFromEnv(key) { - const raw = process.env[key]; - if (raw == null || raw.trim() === "") return; - const value = Number(raw); - if (isNaN(value)) { - api_1.diag.warn(`Unknown value ${(0, util_1$1.inspect)(raw)} for ${key}, expected a number, using defaults`); - return; - } - return value; - } - exports.getNumberFromEnv = getNumberFromEnv; - /** - * Retrieves a string from an environment variable. - * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {string | undefined} - The string value or `undefined`. - */ - function getStringFromEnv(key) { - const raw = process.env[key]; - if (raw == null || raw.trim() === "") return; - return raw; - } - exports.getStringFromEnv = getStringFromEnv; - /** - * Retrieves a boolean value from an environment variable. - * - Trims leading and trailing whitespace and ignores casing. - * - Returns `false` if the environment variable is empty, unset, or contains only whitespace. - * - Returns `false` for strings that cannot be mapped to a boolean. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace. - */ - function getBooleanFromEnv(key) { - const raw = process.env[key]?.trim().toLowerCase(); - if (raw == null || raw === "") return false; - if (raw === "true") return true; - else if (raw === "false") return false; - else { - api_1.diag.warn(`Unknown value ${(0, util_1$1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); - return false; - } - } - exports.getBooleanFromEnv = getBooleanFromEnv; - /** - * Retrieves a list of strings from an environment variable. - * - Uses ',' as the delimiter. - * - Trims leading and trailing whitespace from each entry. - * - Excludes empty entries. - * - Returns `undefined` if the environment variable is empty or contains only whitespace. - * - Returns an empty array if all entries are empty or whitespace. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {string[] | undefined} - The list of strings or `undefined`. - */ - function getStringListFromEnv(key) { - return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); - } - exports.getStringListFromEnv = getStringListFromEnv; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/globalThis.js -var require_globalThis$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports._globalThis = void 0; - /** - * @deprecated Use globalThis directly instead. - */ - exports._globalThis = globalThis; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js -var require_version$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.VERSION = void 0; - exports.VERSION = "2.7.1"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js -/** -* Creates a const map from the given values -* @param values - An array of values to be used as keys and values in the map. -* @returns A populated version of the map with the values and keys derived from the values. -*/ -/* @__NO_SIDE_EFFECTS__ */ -function createConstMap(values) { - let res = {}; - const len = values.length; - for (let lp = 0; lp < len; lp++) { - const val = values[lp]; - if (val) res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; - } - return res; -} -var init_utils = __esmMin((() => {})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js -var TMP_AWS_LAMBDA_INVOKED_ARN, TMP_DB_SYSTEM, TMP_DB_CONNECTION_STRING, TMP_DB_USER, TMP_DB_JDBC_DRIVER_CLASSNAME, TMP_DB_NAME, TMP_DB_STATEMENT, TMP_DB_OPERATION, TMP_DB_MSSQL_INSTANCE_NAME, TMP_DB_CASSANDRA_KEYSPACE, TMP_DB_CASSANDRA_PAGE_SIZE, TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, TMP_DB_CASSANDRA_TABLE, TMP_DB_CASSANDRA_IDEMPOTENCE, TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, TMP_DB_CASSANDRA_COORDINATOR_ID, TMP_DB_CASSANDRA_COORDINATOR_DC, TMP_DB_HBASE_NAMESPACE, TMP_DB_REDIS_DATABASE_INDEX, TMP_DB_MONGODB_COLLECTION, TMP_DB_SQL_TABLE, TMP_EXCEPTION_TYPE, TMP_EXCEPTION_MESSAGE, TMP_EXCEPTION_STACKTRACE, TMP_EXCEPTION_ESCAPED, TMP_FAAS_TRIGGER, TMP_FAAS_EXECUTION, TMP_FAAS_DOCUMENT_COLLECTION, TMP_FAAS_DOCUMENT_OPERATION, TMP_FAAS_DOCUMENT_TIME, TMP_FAAS_DOCUMENT_NAME, TMP_FAAS_TIME, TMP_FAAS_CRON, TMP_FAAS_COLDSTART, TMP_FAAS_INVOKED_NAME, TMP_FAAS_INVOKED_PROVIDER, TMP_FAAS_INVOKED_REGION, TMP_NET_TRANSPORT, TMP_NET_PEER_IP, TMP_NET_PEER_PORT, TMP_NET_PEER_NAME, TMP_NET_HOST_IP, TMP_NET_HOST_PORT, TMP_NET_HOST_NAME, TMP_NET_HOST_CONNECTION_TYPE, TMP_NET_HOST_CONNECTION_SUBTYPE, TMP_NET_HOST_CARRIER_NAME, TMP_NET_HOST_CARRIER_MCC, TMP_NET_HOST_CARRIER_MNC, TMP_NET_HOST_CARRIER_ICC, TMP_PEER_SERVICE, TMP_ENDUSER_ID, TMP_ENDUSER_ROLE, TMP_ENDUSER_SCOPE, TMP_THREAD_ID, TMP_THREAD_NAME, TMP_CODE_FUNCTION, TMP_CODE_NAMESPACE, TMP_CODE_FILEPATH, TMP_CODE_LINENO, TMP_HTTP_METHOD, TMP_HTTP_URL, TMP_HTTP_TARGET, TMP_HTTP_HOST, TMP_HTTP_SCHEME, TMP_HTTP_STATUS_CODE, TMP_HTTP_FLAVOR, TMP_HTTP_USER_AGENT, TMP_HTTP_REQUEST_CONTENT_LENGTH, TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, TMP_HTTP_RESPONSE_CONTENT_LENGTH, TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, TMP_HTTP_SERVER_NAME, TMP_HTTP_ROUTE, TMP_HTTP_CLIENT_IP, TMP_AWS_DYNAMODB_TABLE_NAMES, TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, TMP_AWS_DYNAMODB_CONSISTENT_READ, TMP_AWS_DYNAMODB_PROJECTION, TMP_AWS_DYNAMODB_LIMIT, TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, TMP_AWS_DYNAMODB_INDEX_NAME, TMP_AWS_DYNAMODB_SELECT, TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, TMP_AWS_DYNAMODB_TABLE_COUNT, TMP_AWS_DYNAMODB_SCAN_FORWARD, TMP_AWS_DYNAMODB_SEGMENT, TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, TMP_AWS_DYNAMODB_COUNT, TMP_AWS_DYNAMODB_SCANNED_COUNT, TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, TMP_MESSAGING_SYSTEM, TMP_MESSAGING_DESTINATION, TMP_MESSAGING_DESTINATION_KIND, TMP_MESSAGING_TEMP_DESTINATION, TMP_MESSAGING_PROTOCOL, TMP_MESSAGING_PROTOCOL_VERSION, TMP_MESSAGING_URL, TMP_MESSAGING_MESSAGE_ID, TMP_MESSAGING_CONVERSATION_ID, TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, TMP_MESSAGING_OPERATION, TMP_MESSAGING_CONSUMER_ID, TMP_MESSAGING_RABBITMQ_ROUTING_KEY, TMP_MESSAGING_KAFKA_MESSAGE_KEY, TMP_MESSAGING_KAFKA_CONSUMER_GROUP, TMP_MESSAGING_KAFKA_CLIENT_ID, TMP_MESSAGING_KAFKA_PARTITION, TMP_MESSAGING_KAFKA_TOMBSTONE, TMP_RPC_SYSTEM, TMP_RPC_SERVICE, TMP_RPC_METHOD, TMP_RPC_GRPC_STATUS_CODE, TMP_RPC_JSONRPC_VERSION, TMP_RPC_JSONRPC_REQUEST_ID, TMP_RPC_JSONRPC_ERROR_CODE, TMP_RPC_JSONRPC_ERROR_MESSAGE, TMP_MESSAGE_TYPE, TMP_MESSAGE_ID, TMP_MESSAGE_COMPRESSED_SIZE, TMP_MESSAGE_UNCOMPRESSED_SIZE, SEMATTRS_AWS_LAMBDA_INVOKED_ARN, SEMATTRS_DB_SYSTEM, SEMATTRS_DB_CONNECTION_STRING, SEMATTRS_DB_USER, SEMATTRS_DB_JDBC_DRIVER_CLASSNAME, SEMATTRS_DB_NAME, SEMATTRS_DB_STATEMENT, SEMATTRS_DB_OPERATION, SEMATTRS_DB_MSSQL_INSTANCE_NAME, SEMATTRS_DB_CASSANDRA_KEYSPACE, SEMATTRS_DB_CASSANDRA_PAGE_SIZE, SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL, SEMATTRS_DB_CASSANDRA_TABLE, SEMATTRS_DB_CASSANDRA_IDEMPOTENCE, SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, SEMATTRS_DB_CASSANDRA_COORDINATOR_ID, SEMATTRS_DB_CASSANDRA_COORDINATOR_DC, SEMATTRS_DB_HBASE_NAMESPACE, SEMATTRS_DB_REDIS_DATABASE_INDEX, SEMATTRS_DB_MONGODB_COLLECTION, SEMATTRS_DB_SQL_TABLE, SEMATTRS_EXCEPTION_TYPE, SEMATTRS_EXCEPTION_MESSAGE, SEMATTRS_EXCEPTION_STACKTRACE, SEMATTRS_EXCEPTION_ESCAPED, SEMATTRS_FAAS_TRIGGER, SEMATTRS_FAAS_EXECUTION, SEMATTRS_FAAS_DOCUMENT_COLLECTION, SEMATTRS_FAAS_DOCUMENT_OPERATION, SEMATTRS_FAAS_DOCUMENT_TIME, SEMATTRS_FAAS_DOCUMENT_NAME, SEMATTRS_FAAS_TIME, SEMATTRS_FAAS_CRON, SEMATTRS_FAAS_COLDSTART, SEMATTRS_FAAS_INVOKED_NAME, SEMATTRS_FAAS_INVOKED_PROVIDER, SEMATTRS_FAAS_INVOKED_REGION, SEMATTRS_NET_TRANSPORT, SEMATTRS_NET_PEER_IP, SEMATTRS_NET_PEER_PORT, SEMATTRS_NET_PEER_NAME, SEMATTRS_NET_HOST_IP, SEMATTRS_NET_HOST_PORT, SEMATTRS_NET_HOST_NAME, SEMATTRS_NET_HOST_CONNECTION_TYPE, SEMATTRS_NET_HOST_CONNECTION_SUBTYPE, SEMATTRS_NET_HOST_CARRIER_NAME, SEMATTRS_NET_HOST_CARRIER_MCC, SEMATTRS_NET_HOST_CARRIER_MNC, SEMATTRS_NET_HOST_CARRIER_ICC, SEMATTRS_PEER_SERVICE, SEMATTRS_ENDUSER_ID, SEMATTRS_ENDUSER_ROLE, SEMATTRS_ENDUSER_SCOPE, SEMATTRS_THREAD_ID, SEMATTRS_THREAD_NAME, SEMATTRS_CODE_FUNCTION, SEMATTRS_CODE_NAMESPACE, SEMATTRS_CODE_FILEPATH, SEMATTRS_CODE_LINENO, SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_URL, SEMATTRS_HTTP_TARGET, SEMATTRS_HTTP_HOST, SEMATTRS_HTTP_SCHEME, SEMATTRS_HTTP_STATUS_CODE, SEMATTRS_HTTP_FLAVOR, SEMATTRS_HTTP_USER_AGENT, SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH, SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, SEMATTRS_HTTP_SERVER_NAME, SEMATTRS_HTTP_ROUTE, SEMATTRS_HTTP_CLIENT_IP, SEMATTRS_AWS_DYNAMODB_TABLE_NAMES, SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY, SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ, SEMATTRS_AWS_DYNAMODB_PROJECTION, SEMATTRS_AWS_DYNAMODB_LIMIT, SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET, SEMATTRS_AWS_DYNAMODB_INDEX_NAME, SEMATTRS_AWS_DYNAMODB_SELECT, SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, SEMATTRS_AWS_DYNAMODB_TABLE_COUNT, SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD, SEMATTRS_AWS_DYNAMODB_SEGMENT, SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS, SEMATTRS_AWS_DYNAMODB_COUNT, SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT, SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, SEMATTRS_MESSAGING_SYSTEM, SEMATTRS_MESSAGING_DESTINATION, SEMATTRS_MESSAGING_DESTINATION_KIND, SEMATTRS_MESSAGING_TEMP_DESTINATION, SEMATTRS_MESSAGING_PROTOCOL, SEMATTRS_MESSAGING_PROTOCOL_VERSION, SEMATTRS_MESSAGING_URL, SEMATTRS_MESSAGING_MESSAGE_ID, SEMATTRS_MESSAGING_CONVERSATION_ID, SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, SEMATTRS_MESSAGING_OPERATION, SEMATTRS_MESSAGING_CONSUMER_ID, SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY, SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY, SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP, SEMATTRS_MESSAGING_KAFKA_CLIENT_ID, SEMATTRS_MESSAGING_KAFKA_PARTITION, SEMATTRS_MESSAGING_KAFKA_TOMBSTONE, SEMATTRS_RPC_SYSTEM, SEMATTRS_RPC_SERVICE, SEMATTRS_RPC_METHOD, SEMATTRS_RPC_GRPC_STATUS_CODE, SEMATTRS_RPC_JSONRPC_VERSION, SEMATTRS_RPC_JSONRPC_REQUEST_ID, SEMATTRS_RPC_JSONRPC_ERROR_CODE, SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE, SEMATTRS_MESSAGE_TYPE, SEMATTRS_MESSAGE_ID, SEMATTRS_MESSAGE_COMPRESSED_SIZE, SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE, SemanticAttributes, TMP_DBSYSTEMVALUES_OTHER_SQL, TMP_DBSYSTEMVALUES_MSSQL, TMP_DBSYSTEMVALUES_MYSQL, TMP_DBSYSTEMVALUES_ORACLE, TMP_DBSYSTEMVALUES_DB2, TMP_DBSYSTEMVALUES_POSTGRESQL, TMP_DBSYSTEMVALUES_REDSHIFT, TMP_DBSYSTEMVALUES_HIVE, TMP_DBSYSTEMVALUES_CLOUDSCAPE, TMP_DBSYSTEMVALUES_HSQLDB, TMP_DBSYSTEMVALUES_PROGRESS, TMP_DBSYSTEMVALUES_MAXDB, TMP_DBSYSTEMVALUES_HANADB, TMP_DBSYSTEMVALUES_INGRES, TMP_DBSYSTEMVALUES_FIRSTSQL, TMP_DBSYSTEMVALUES_EDB, TMP_DBSYSTEMVALUES_CACHE, TMP_DBSYSTEMVALUES_ADABAS, TMP_DBSYSTEMVALUES_FIREBIRD, TMP_DBSYSTEMVALUES_DERBY, TMP_DBSYSTEMVALUES_FILEMAKER, TMP_DBSYSTEMVALUES_INFORMIX, TMP_DBSYSTEMVALUES_INSTANTDB, TMP_DBSYSTEMVALUES_INTERBASE, TMP_DBSYSTEMVALUES_MARIADB, TMP_DBSYSTEMVALUES_NETEZZA, TMP_DBSYSTEMVALUES_PERVASIVE, TMP_DBSYSTEMVALUES_POINTBASE, TMP_DBSYSTEMVALUES_SQLITE, TMP_DBSYSTEMVALUES_SYBASE, TMP_DBSYSTEMVALUES_TERADATA, TMP_DBSYSTEMVALUES_VERTICA, TMP_DBSYSTEMVALUES_H2, TMP_DBSYSTEMVALUES_COLDFUSION, TMP_DBSYSTEMVALUES_CASSANDRA, TMP_DBSYSTEMVALUES_HBASE, TMP_DBSYSTEMVALUES_MONGODB, TMP_DBSYSTEMVALUES_REDIS, TMP_DBSYSTEMVALUES_COUCHBASE, TMP_DBSYSTEMVALUES_COUCHDB, TMP_DBSYSTEMVALUES_COSMOSDB, TMP_DBSYSTEMVALUES_DYNAMODB, TMP_DBSYSTEMVALUES_NEO4J, TMP_DBSYSTEMVALUES_GEODE, TMP_DBSYSTEMVALUES_ELASTICSEARCH, TMP_DBSYSTEMVALUES_MEMCACHED, TMP_DBSYSTEMVALUES_COCKROACHDB, DBSYSTEMVALUES_OTHER_SQL, DBSYSTEMVALUES_MSSQL, DBSYSTEMVALUES_MYSQL, DBSYSTEMVALUES_ORACLE, DBSYSTEMVALUES_DB2, DBSYSTEMVALUES_POSTGRESQL, DBSYSTEMVALUES_REDSHIFT, DBSYSTEMVALUES_HIVE, DBSYSTEMVALUES_CLOUDSCAPE, DBSYSTEMVALUES_HSQLDB, DBSYSTEMVALUES_PROGRESS, DBSYSTEMVALUES_MAXDB, DBSYSTEMVALUES_HANADB, DBSYSTEMVALUES_INGRES, DBSYSTEMVALUES_FIRSTSQL, DBSYSTEMVALUES_EDB, DBSYSTEMVALUES_CACHE, DBSYSTEMVALUES_ADABAS, DBSYSTEMVALUES_FIREBIRD, DBSYSTEMVALUES_DERBY, DBSYSTEMVALUES_FILEMAKER, DBSYSTEMVALUES_INFORMIX, DBSYSTEMVALUES_INSTANTDB, DBSYSTEMVALUES_INTERBASE, DBSYSTEMVALUES_MARIADB, DBSYSTEMVALUES_NETEZZA, DBSYSTEMVALUES_PERVASIVE, DBSYSTEMVALUES_POINTBASE, DBSYSTEMVALUES_SQLITE, DBSYSTEMVALUES_SYBASE, DBSYSTEMVALUES_TERADATA, DBSYSTEMVALUES_VERTICA, DBSYSTEMVALUES_H2, DBSYSTEMVALUES_COLDFUSION, DBSYSTEMVALUES_CASSANDRA, DBSYSTEMVALUES_HBASE, DBSYSTEMVALUES_MONGODB, DBSYSTEMVALUES_REDIS, DBSYSTEMVALUES_COUCHBASE, DBSYSTEMVALUES_COUCHDB, DBSYSTEMVALUES_COSMOSDB, DBSYSTEMVALUES_DYNAMODB, DBSYSTEMVALUES_NEO4J, DBSYSTEMVALUES_GEODE, DBSYSTEMVALUES_ELASTICSEARCH, DBSYSTEMVALUES_MEMCACHED, DBSYSTEMVALUES_COCKROACHDB, DbSystemValues, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, DBCASSANDRACONSISTENCYLEVELVALUES_ALL, DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_ONE, DBCASSANDRACONSISTENCYLEVELVALUES_TWO, DBCASSANDRACONSISTENCYLEVELVALUES_THREE, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, DBCASSANDRACONSISTENCYLEVELVALUES_ANY, DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, DbCassandraConsistencyLevelValues, TMP_FAASTRIGGERVALUES_DATASOURCE, TMP_FAASTRIGGERVALUES_HTTP, TMP_FAASTRIGGERVALUES_PUBSUB, TMP_FAASTRIGGERVALUES_TIMER, TMP_FAASTRIGGERVALUES_OTHER, FAASTRIGGERVALUES_DATASOURCE, FAASTRIGGERVALUES_HTTP, FAASTRIGGERVALUES_PUBSUB, FAASTRIGGERVALUES_TIMER, FAASTRIGGERVALUES_OTHER, FaasTriggerValues, TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, TMP_FAASDOCUMENTOPERATIONVALUES_DELETE, FAASDOCUMENTOPERATIONVALUES_INSERT, FAASDOCUMENTOPERATIONVALUES_EDIT, FAASDOCUMENTOPERATIONVALUES_DELETE, FaasDocumentOperationValues, TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, TMP_FAASINVOKEDPROVIDERVALUES_AWS, TMP_FAASINVOKEDPROVIDERVALUES_AZURE, TMP_FAASINVOKEDPROVIDERVALUES_GCP, FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, FAASINVOKEDPROVIDERVALUES_AWS, FAASINVOKEDPROVIDERVALUES_AZURE, FAASINVOKEDPROVIDERVALUES_GCP, FaasInvokedProviderValues, TMP_NETTRANSPORTVALUES_IP_TCP, TMP_NETTRANSPORTVALUES_IP_UDP, TMP_NETTRANSPORTVALUES_IP, TMP_NETTRANSPORTVALUES_UNIX, TMP_NETTRANSPORTVALUES_PIPE, TMP_NETTRANSPORTVALUES_INPROC, TMP_NETTRANSPORTVALUES_OTHER, NETTRANSPORTVALUES_IP_TCP, NETTRANSPORTVALUES_IP_UDP, NETTRANSPORTVALUES_IP, NETTRANSPORTVALUES_UNIX, NETTRANSPORTVALUES_PIPE, NETTRANSPORTVALUES_INPROC, NETTRANSPORTVALUES_OTHER, NetTransportValues, TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, NETHOSTCONNECTIONTYPEVALUES_WIFI, NETHOSTCONNECTIONTYPEVALUES_WIRED, NETHOSTCONNECTIONTYPEVALUES_CELL, NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, NetHostConnectionTypeValues, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, NETHOSTCONNECTIONSUBTYPEVALUES_LTE, NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, NETHOSTCONNECTIONSUBTYPEVALUES_GSM, NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, NETHOSTCONNECTIONSUBTYPEVALUES_NR, NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, NetHostConnectionSubtypeValues, TMP_HTTPFLAVORVALUES_HTTP_1_0, TMP_HTTPFLAVORVALUES_HTTP_1_1, TMP_HTTPFLAVORVALUES_HTTP_2_0, TMP_HTTPFLAVORVALUES_SPDY, TMP_HTTPFLAVORVALUES_QUIC, HTTPFLAVORVALUES_HTTP_1_0, HTTPFLAVORVALUES_HTTP_1_1, HTTPFLAVORVALUES_HTTP_2_0, HTTPFLAVORVALUES_SPDY, HTTPFLAVORVALUES_QUIC, HttpFlavorValues, TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC, MESSAGINGDESTINATIONKINDVALUES_QUEUE, MESSAGINGDESTINATIONKINDVALUES_TOPIC, MessagingDestinationKindValues, TMP_MESSAGINGOPERATIONVALUES_RECEIVE, TMP_MESSAGINGOPERATIONVALUES_PROCESS, MESSAGINGOPERATIONVALUES_RECEIVE, MESSAGINGOPERATIONVALUES_PROCESS, MessagingOperationValues, TMP_RPCGRPCSTATUSCODEVALUES_OK, TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, RPCGRPCSTATUSCODEVALUES_OK, RPCGRPCSTATUSCODEVALUES_CANCELLED, RPCGRPCSTATUSCODEVALUES_UNKNOWN, RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, RPCGRPCSTATUSCODEVALUES_NOT_FOUND, RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, RPCGRPCSTATUSCODEVALUES_ABORTED, RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, RPCGRPCSTATUSCODEVALUES_INTERNAL, RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, RPCGRPCSTATUSCODEVALUES_DATA_LOSS, RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, RpcGrpcStatusCodeValues, TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED, MESSAGETYPEVALUES_SENT, MESSAGETYPEVALUES_RECEIVED, MessageTypeValues; -var init_SemanticAttributes = __esmMin((() => { - init_utils(); - TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; - TMP_DB_SYSTEM = "db.system"; - TMP_DB_CONNECTION_STRING = "db.connection_string"; - TMP_DB_USER = "db.user"; - TMP_DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname"; - TMP_DB_NAME = "db.name"; - TMP_DB_STATEMENT = "db.statement"; - TMP_DB_OPERATION = "db.operation"; - TMP_DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name"; - TMP_DB_CASSANDRA_KEYSPACE = "db.cassandra.keyspace"; - TMP_DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size"; - TMP_DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level"; - TMP_DB_CASSANDRA_TABLE = "db.cassandra.table"; - TMP_DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence"; - TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count"; - TMP_DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id"; - TMP_DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc"; - TMP_DB_HBASE_NAMESPACE = "db.hbase.namespace"; - TMP_DB_REDIS_DATABASE_INDEX = "db.redis.database_index"; - TMP_DB_MONGODB_COLLECTION = "db.mongodb.collection"; - TMP_DB_SQL_TABLE = "db.sql.table"; - TMP_EXCEPTION_TYPE = "exception.type"; - TMP_EXCEPTION_MESSAGE = "exception.message"; - TMP_EXCEPTION_STACKTRACE = "exception.stacktrace"; - TMP_EXCEPTION_ESCAPED = "exception.escaped"; - TMP_FAAS_TRIGGER = "faas.trigger"; - TMP_FAAS_EXECUTION = "faas.execution"; - TMP_FAAS_DOCUMENT_COLLECTION = "faas.document.collection"; - TMP_FAAS_DOCUMENT_OPERATION = "faas.document.operation"; - TMP_FAAS_DOCUMENT_TIME = "faas.document.time"; - TMP_FAAS_DOCUMENT_NAME = "faas.document.name"; - TMP_FAAS_TIME = "faas.time"; - TMP_FAAS_CRON = "faas.cron"; - TMP_FAAS_COLDSTART = "faas.coldstart"; - TMP_FAAS_INVOKED_NAME = "faas.invoked_name"; - TMP_FAAS_INVOKED_PROVIDER = "faas.invoked_provider"; - TMP_FAAS_INVOKED_REGION = "faas.invoked_region"; - TMP_NET_TRANSPORT = "net.transport"; - TMP_NET_PEER_IP = "net.peer.ip"; - TMP_NET_PEER_PORT = "net.peer.port"; - TMP_NET_PEER_NAME = "net.peer.name"; - TMP_NET_HOST_IP = "net.host.ip"; - TMP_NET_HOST_PORT = "net.host.port"; - TMP_NET_HOST_NAME = "net.host.name"; - TMP_NET_HOST_CONNECTION_TYPE = "net.host.connection.type"; - TMP_NET_HOST_CONNECTION_SUBTYPE = "net.host.connection.subtype"; - TMP_NET_HOST_CARRIER_NAME = "net.host.carrier.name"; - TMP_NET_HOST_CARRIER_MCC = "net.host.carrier.mcc"; - TMP_NET_HOST_CARRIER_MNC = "net.host.carrier.mnc"; - TMP_NET_HOST_CARRIER_ICC = "net.host.carrier.icc"; - TMP_PEER_SERVICE = "peer.service"; - TMP_ENDUSER_ID = "enduser.id"; - TMP_ENDUSER_ROLE = "enduser.role"; - TMP_ENDUSER_SCOPE = "enduser.scope"; - TMP_THREAD_ID = "thread.id"; - TMP_THREAD_NAME = "thread.name"; - TMP_CODE_FUNCTION = "code.function"; - TMP_CODE_NAMESPACE = "code.namespace"; - TMP_CODE_FILEPATH = "code.filepath"; - TMP_CODE_LINENO = "code.lineno"; - TMP_HTTP_METHOD = "http.method"; - TMP_HTTP_URL = "http.url"; - TMP_HTTP_TARGET = "http.target"; - TMP_HTTP_HOST = "http.host"; - TMP_HTTP_SCHEME = "http.scheme"; - TMP_HTTP_STATUS_CODE = "http.status_code"; - TMP_HTTP_FLAVOR = "http.flavor"; - TMP_HTTP_USER_AGENT = "http.user_agent"; - TMP_HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length"; - TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = "http.request_content_length_uncompressed"; - TMP_HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length"; - TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = "http.response_content_length_uncompressed"; - TMP_HTTP_SERVER_NAME = "http.server_name"; - TMP_HTTP_ROUTE = "http.route"; - TMP_HTTP_CLIENT_IP = "http.client_ip"; - TMP_AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names"; - TMP_AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity"; - TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics"; - TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity"; - TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity"; - TMP_AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read"; - TMP_AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection"; - TMP_AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit"; - TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get"; - TMP_AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name"; - TMP_AWS_DYNAMODB_SELECT = "aws.dynamodb.select"; - TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes"; - TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes"; - TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table"; - TMP_AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count"; - TMP_AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward"; - TMP_AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment"; - TMP_AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments"; - TMP_AWS_DYNAMODB_COUNT = "aws.dynamodb.count"; - TMP_AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count"; - TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions"; - TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates"; - TMP_MESSAGING_SYSTEM = "messaging.system"; - TMP_MESSAGING_DESTINATION = "messaging.destination"; - TMP_MESSAGING_DESTINATION_KIND = "messaging.destination_kind"; - TMP_MESSAGING_TEMP_DESTINATION = "messaging.temp_destination"; - TMP_MESSAGING_PROTOCOL = "messaging.protocol"; - TMP_MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version"; - TMP_MESSAGING_URL = "messaging.url"; - TMP_MESSAGING_MESSAGE_ID = "messaging.message_id"; - TMP_MESSAGING_CONVERSATION_ID = "messaging.conversation_id"; - TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message_payload_size_bytes"; - TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = "messaging.message_payload_compressed_size_bytes"; - TMP_MESSAGING_OPERATION = "messaging.operation"; - TMP_MESSAGING_CONSUMER_ID = "messaging.consumer_id"; - TMP_MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key"; - TMP_MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message_key"; - TMP_MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer_group"; - TMP_MESSAGING_KAFKA_CLIENT_ID = "messaging.kafka.client_id"; - TMP_MESSAGING_KAFKA_PARTITION = "messaging.kafka.partition"; - TMP_MESSAGING_KAFKA_TOMBSTONE = "messaging.kafka.tombstone"; - TMP_RPC_SYSTEM = "rpc.system"; - TMP_RPC_SERVICE = "rpc.service"; - TMP_RPC_METHOD = "rpc.method"; - TMP_RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code"; - TMP_RPC_JSONRPC_VERSION = "rpc.jsonrpc.version"; - TMP_RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id"; - TMP_RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code"; - TMP_RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message"; - TMP_MESSAGE_TYPE = "message.type"; - TMP_MESSAGE_ID = "message.id"; - TMP_MESSAGE_COMPRESSED_SIZE = "message.compressed_size"; - TMP_MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size"; - SEMATTRS_AWS_LAMBDA_INVOKED_ARN = TMP_AWS_LAMBDA_INVOKED_ARN; - SEMATTRS_DB_SYSTEM = TMP_DB_SYSTEM; - SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; - SEMATTRS_DB_USER = TMP_DB_USER; - SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = TMP_DB_JDBC_DRIVER_CLASSNAME; - SEMATTRS_DB_NAME = TMP_DB_NAME; - SEMATTRS_DB_STATEMENT = TMP_DB_STATEMENT; - SEMATTRS_DB_OPERATION = TMP_DB_OPERATION; - SEMATTRS_DB_MSSQL_INSTANCE_NAME = TMP_DB_MSSQL_INSTANCE_NAME; - SEMATTRS_DB_CASSANDRA_KEYSPACE = TMP_DB_CASSANDRA_KEYSPACE; - SEMATTRS_DB_CASSANDRA_PAGE_SIZE = TMP_DB_CASSANDRA_PAGE_SIZE; - SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = TMP_DB_CASSANDRA_CONSISTENCY_LEVEL; - SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; - SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = TMP_DB_CASSANDRA_IDEMPOTENCE; - SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT; - SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = TMP_DB_CASSANDRA_COORDINATOR_ID; - SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = TMP_DB_CASSANDRA_COORDINATOR_DC; - SEMATTRS_DB_HBASE_NAMESPACE = TMP_DB_HBASE_NAMESPACE; - SEMATTRS_DB_REDIS_DATABASE_INDEX = TMP_DB_REDIS_DATABASE_INDEX; - SEMATTRS_DB_MONGODB_COLLECTION = TMP_DB_MONGODB_COLLECTION; - SEMATTRS_DB_SQL_TABLE = TMP_DB_SQL_TABLE; - SEMATTRS_EXCEPTION_TYPE = TMP_EXCEPTION_TYPE; - SEMATTRS_EXCEPTION_MESSAGE = TMP_EXCEPTION_MESSAGE; - SEMATTRS_EXCEPTION_STACKTRACE = TMP_EXCEPTION_STACKTRACE; - SEMATTRS_EXCEPTION_ESCAPED = TMP_EXCEPTION_ESCAPED; - SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; - SEMATTRS_FAAS_EXECUTION = TMP_FAAS_EXECUTION; - SEMATTRS_FAAS_DOCUMENT_COLLECTION = TMP_FAAS_DOCUMENT_COLLECTION; - SEMATTRS_FAAS_DOCUMENT_OPERATION = TMP_FAAS_DOCUMENT_OPERATION; - SEMATTRS_FAAS_DOCUMENT_TIME = TMP_FAAS_DOCUMENT_TIME; - SEMATTRS_FAAS_DOCUMENT_NAME = TMP_FAAS_DOCUMENT_NAME; - SEMATTRS_FAAS_TIME = TMP_FAAS_TIME; - SEMATTRS_FAAS_CRON = TMP_FAAS_CRON; - SEMATTRS_FAAS_COLDSTART = TMP_FAAS_COLDSTART; - SEMATTRS_FAAS_INVOKED_NAME = TMP_FAAS_INVOKED_NAME; - SEMATTRS_FAAS_INVOKED_PROVIDER = TMP_FAAS_INVOKED_PROVIDER; - SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; - SEMATTRS_NET_TRANSPORT = TMP_NET_TRANSPORT; - SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; - SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; - SEMATTRS_NET_PEER_NAME = TMP_NET_PEER_NAME; - SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; - SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; - SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; - SEMATTRS_NET_HOST_CONNECTION_TYPE = TMP_NET_HOST_CONNECTION_TYPE; - SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; - SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; - SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; - SEMATTRS_NET_HOST_CARRIER_MNC = TMP_NET_HOST_CARRIER_MNC; - SEMATTRS_NET_HOST_CARRIER_ICC = TMP_NET_HOST_CARRIER_ICC; - SEMATTRS_PEER_SERVICE = TMP_PEER_SERVICE; - SEMATTRS_ENDUSER_ID = TMP_ENDUSER_ID; - SEMATTRS_ENDUSER_ROLE = TMP_ENDUSER_ROLE; - SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; - SEMATTRS_THREAD_ID = TMP_THREAD_ID; - SEMATTRS_THREAD_NAME = TMP_THREAD_NAME; - SEMATTRS_CODE_FUNCTION = TMP_CODE_FUNCTION; - SEMATTRS_CODE_NAMESPACE = TMP_CODE_NAMESPACE; - SEMATTRS_CODE_FILEPATH = TMP_CODE_FILEPATH; - SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; - SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD; - SEMATTRS_HTTP_URL = TMP_HTTP_URL; - SEMATTRS_HTTP_TARGET = TMP_HTTP_TARGET; - SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; - SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME; - SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE; - SEMATTRS_HTTP_FLAVOR = TMP_HTTP_FLAVOR; - SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT; - SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = TMP_HTTP_REQUEST_CONTENT_LENGTH; - SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED; - SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH; - SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED; - SEMATTRS_HTTP_SERVER_NAME = TMP_HTTP_SERVER_NAME; - SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE; - SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; - SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = TMP_AWS_DYNAMODB_TABLE_NAMES; - SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = TMP_AWS_DYNAMODB_CONSUMED_CAPACITY; - SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS; - SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY; - SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY; - SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; - SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; - SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; - SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET; - SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; - SEMATTRS_AWS_DYNAMODB_SELECT = TMP_AWS_DYNAMODB_SELECT; - SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES; - SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES; - SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE; - SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = TMP_AWS_DYNAMODB_TABLE_COUNT; - SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; - SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; - SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; - SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; - SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = TMP_AWS_DYNAMODB_SCANNED_COUNT; - SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS; - SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES; - SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM; - SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; - SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; - SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; - SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; - SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; - SEMATTRS_MESSAGING_URL = TMP_MESSAGING_URL; - SEMATTRS_MESSAGING_MESSAGE_ID = TMP_MESSAGING_MESSAGE_ID; - SEMATTRS_MESSAGING_CONVERSATION_ID = TMP_MESSAGING_CONVERSATION_ID; - SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; - SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES; - SEMATTRS_MESSAGING_OPERATION = TMP_MESSAGING_OPERATION; - SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; - SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = TMP_MESSAGING_RABBITMQ_ROUTING_KEY; - SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = TMP_MESSAGING_KAFKA_MESSAGE_KEY; - SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = TMP_MESSAGING_KAFKA_CONSUMER_GROUP; - SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; - SEMATTRS_MESSAGING_KAFKA_PARTITION = TMP_MESSAGING_KAFKA_PARTITION; - SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; - SEMATTRS_RPC_SYSTEM = TMP_RPC_SYSTEM; - SEMATTRS_RPC_SERVICE = TMP_RPC_SERVICE; - SEMATTRS_RPC_METHOD = TMP_RPC_METHOD; - SEMATTRS_RPC_GRPC_STATUS_CODE = TMP_RPC_GRPC_STATUS_CODE; - SEMATTRS_RPC_JSONRPC_VERSION = TMP_RPC_JSONRPC_VERSION; - SEMATTRS_RPC_JSONRPC_REQUEST_ID = TMP_RPC_JSONRPC_REQUEST_ID; - SEMATTRS_RPC_JSONRPC_ERROR_CODE = TMP_RPC_JSONRPC_ERROR_CODE; - SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; - SEMATTRS_MESSAGE_TYPE = TMP_MESSAGE_TYPE; - SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; - SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; - SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = TMP_MESSAGE_UNCOMPRESSED_SIZE; - SemanticAttributes = /* @__PURE__ */ createConstMap([ - TMP_AWS_LAMBDA_INVOKED_ARN, - TMP_DB_SYSTEM, - TMP_DB_CONNECTION_STRING, - TMP_DB_USER, - TMP_DB_JDBC_DRIVER_CLASSNAME, - TMP_DB_NAME, - TMP_DB_STATEMENT, - TMP_DB_OPERATION, - TMP_DB_MSSQL_INSTANCE_NAME, - TMP_DB_CASSANDRA_KEYSPACE, - TMP_DB_CASSANDRA_PAGE_SIZE, - TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, - TMP_DB_CASSANDRA_TABLE, - TMP_DB_CASSANDRA_IDEMPOTENCE, - TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, - TMP_DB_CASSANDRA_COORDINATOR_ID, - TMP_DB_CASSANDRA_COORDINATOR_DC, - TMP_DB_HBASE_NAMESPACE, - TMP_DB_REDIS_DATABASE_INDEX, - TMP_DB_MONGODB_COLLECTION, - TMP_DB_SQL_TABLE, - TMP_EXCEPTION_TYPE, - TMP_EXCEPTION_MESSAGE, - TMP_EXCEPTION_STACKTRACE, - TMP_EXCEPTION_ESCAPED, - TMP_FAAS_TRIGGER, - TMP_FAAS_EXECUTION, - TMP_FAAS_DOCUMENT_COLLECTION, - TMP_FAAS_DOCUMENT_OPERATION, - TMP_FAAS_DOCUMENT_TIME, - TMP_FAAS_DOCUMENT_NAME, - TMP_FAAS_TIME, - TMP_FAAS_CRON, - TMP_FAAS_COLDSTART, - TMP_FAAS_INVOKED_NAME, - TMP_FAAS_INVOKED_PROVIDER, - TMP_FAAS_INVOKED_REGION, - TMP_NET_TRANSPORT, - TMP_NET_PEER_IP, - TMP_NET_PEER_PORT, - TMP_NET_PEER_NAME, - TMP_NET_HOST_IP, - TMP_NET_HOST_PORT, - TMP_NET_HOST_NAME, - TMP_NET_HOST_CONNECTION_TYPE, - TMP_NET_HOST_CONNECTION_SUBTYPE, - TMP_NET_HOST_CARRIER_NAME, - TMP_NET_HOST_CARRIER_MCC, - TMP_NET_HOST_CARRIER_MNC, - TMP_NET_HOST_CARRIER_ICC, - TMP_PEER_SERVICE, - TMP_ENDUSER_ID, - TMP_ENDUSER_ROLE, - TMP_ENDUSER_SCOPE, - TMP_THREAD_ID, - TMP_THREAD_NAME, - TMP_CODE_FUNCTION, - TMP_CODE_NAMESPACE, - TMP_CODE_FILEPATH, - TMP_CODE_LINENO, - TMP_HTTP_METHOD, - TMP_HTTP_URL, - TMP_HTTP_TARGET, - TMP_HTTP_HOST, - TMP_HTTP_SCHEME, - TMP_HTTP_STATUS_CODE, - TMP_HTTP_FLAVOR, - TMP_HTTP_USER_AGENT, - TMP_HTTP_REQUEST_CONTENT_LENGTH, - TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, - TMP_HTTP_RESPONSE_CONTENT_LENGTH, - TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, - TMP_HTTP_SERVER_NAME, - TMP_HTTP_ROUTE, - TMP_HTTP_CLIENT_IP, - TMP_AWS_DYNAMODB_TABLE_NAMES, - TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, - TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, - TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, - TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, - TMP_AWS_DYNAMODB_CONSISTENT_READ, - TMP_AWS_DYNAMODB_PROJECTION, - TMP_AWS_DYNAMODB_LIMIT, - TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, - TMP_AWS_DYNAMODB_INDEX_NAME, - TMP_AWS_DYNAMODB_SELECT, - TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, - TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, - TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, - TMP_AWS_DYNAMODB_TABLE_COUNT, - TMP_AWS_DYNAMODB_SCAN_FORWARD, - TMP_AWS_DYNAMODB_SEGMENT, - TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, - TMP_AWS_DYNAMODB_COUNT, - TMP_AWS_DYNAMODB_SCANNED_COUNT, - TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, - TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, - TMP_MESSAGING_SYSTEM, - TMP_MESSAGING_DESTINATION, - TMP_MESSAGING_DESTINATION_KIND, - TMP_MESSAGING_TEMP_DESTINATION, - TMP_MESSAGING_PROTOCOL, - TMP_MESSAGING_PROTOCOL_VERSION, - TMP_MESSAGING_URL, - TMP_MESSAGING_MESSAGE_ID, - TMP_MESSAGING_CONVERSATION_ID, - TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, - TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, - TMP_MESSAGING_OPERATION, - TMP_MESSAGING_CONSUMER_ID, - TMP_MESSAGING_RABBITMQ_ROUTING_KEY, - TMP_MESSAGING_KAFKA_MESSAGE_KEY, - TMP_MESSAGING_KAFKA_CONSUMER_GROUP, - TMP_MESSAGING_KAFKA_CLIENT_ID, - TMP_MESSAGING_KAFKA_PARTITION, - TMP_MESSAGING_KAFKA_TOMBSTONE, - TMP_RPC_SYSTEM, - TMP_RPC_SERVICE, - TMP_RPC_METHOD, - TMP_RPC_GRPC_STATUS_CODE, - TMP_RPC_JSONRPC_VERSION, - TMP_RPC_JSONRPC_REQUEST_ID, - TMP_RPC_JSONRPC_ERROR_CODE, - TMP_RPC_JSONRPC_ERROR_MESSAGE, - TMP_MESSAGE_TYPE, - TMP_MESSAGE_ID, - TMP_MESSAGE_COMPRESSED_SIZE, - TMP_MESSAGE_UNCOMPRESSED_SIZE - ]); - TMP_DBSYSTEMVALUES_OTHER_SQL = "other_sql"; - TMP_DBSYSTEMVALUES_MSSQL = "mssql"; - TMP_DBSYSTEMVALUES_MYSQL = "mysql"; - TMP_DBSYSTEMVALUES_ORACLE = "oracle"; - TMP_DBSYSTEMVALUES_DB2 = "db2"; - TMP_DBSYSTEMVALUES_POSTGRESQL = "postgresql"; - TMP_DBSYSTEMVALUES_REDSHIFT = "redshift"; - TMP_DBSYSTEMVALUES_HIVE = "hive"; - TMP_DBSYSTEMVALUES_CLOUDSCAPE = "cloudscape"; - TMP_DBSYSTEMVALUES_HSQLDB = "hsqldb"; - TMP_DBSYSTEMVALUES_PROGRESS = "progress"; - TMP_DBSYSTEMVALUES_MAXDB = "maxdb"; - TMP_DBSYSTEMVALUES_HANADB = "hanadb"; - TMP_DBSYSTEMVALUES_INGRES = "ingres"; - TMP_DBSYSTEMVALUES_FIRSTSQL = "firstsql"; - TMP_DBSYSTEMVALUES_EDB = "edb"; - TMP_DBSYSTEMVALUES_CACHE = "cache"; - TMP_DBSYSTEMVALUES_ADABAS = "adabas"; - TMP_DBSYSTEMVALUES_FIREBIRD = "firebird"; - TMP_DBSYSTEMVALUES_DERBY = "derby"; - TMP_DBSYSTEMVALUES_FILEMAKER = "filemaker"; - TMP_DBSYSTEMVALUES_INFORMIX = "informix"; - TMP_DBSYSTEMVALUES_INSTANTDB = "instantdb"; - TMP_DBSYSTEMVALUES_INTERBASE = "interbase"; - TMP_DBSYSTEMVALUES_MARIADB = "mariadb"; - TMP_DBSYSTEMVALUES_NETEZZA = "netezza"; - TMP_DBSYSTEMVALUES_PERVASIVE = "pervasive"; - TMP_DBSYSTEMVALUES_POINTBASE = "pointbase"; - TMP_DBSYSTEMVALUES_SQLITE = "sqlite"; - TMP_DBSYSTEMVALUES_SYBASE = "sybase"; - TMP_DBSYSTEMVALUES_TERADATA = "teradata"; - TMP_DBSYSTEMVALUES_VERTICA = "vertica"; - TMP_DBSYSTEMVALUES_H2 = "h2"; - TMP_DBSYSTEMVALUES_COLDFUSION = "coldfusion"; - TMP_DBSYSTEMVALUES_CASSANDRA = "cassandra"; - TMP_DBSYSTEMVALUES_HBASE = "hbase"; - TMP_DBSYSTEMVALUES_MONGODB = "mongodb"; - TMP_DBSYSTEMVALUES_REDIS = "redis"; - TMP_DBSYSTEMVALUES_COUCHBASE = "couchbase"; - TMP_DBSYSTEMVALUES_COUCHDB = "couchdb"; - TMP_DBSYSTEMVALUES_COSMOSDB = "cosmosdb"; - TMP_DBSYSTEMVALUES_DYNAMODB = "dynamodb"; - TMP_DBSYSTEMVALUES_NEO4J = "neo4j"; - TMP_DBSYSTEMVALUES_GEODE = "geode"; - TMP_DBSYSTEMVALUES_ELASTICSEARCH = "elasticsearch"; - TMP_DBSYSTEMVALUES_MEMCACHED = "memcached"; - TMP_DBSYSTEMVALUES_COCKROACHDB = "cockroachdb"; - DBSYSTEMVALUES_OTHER_SQL = TMP_DBSYSTEMVALUES_OTHER_SQL; - DBSYSTEMVALUES_MSSQL = TMP_DBSYSTEMVALUES_MSSQL; - DBSYSTEMVALUES_MYSQL = TMP_DBSYSTEMVALUES_MYSQL; - DBSYSTEMVALUES_ORACLE = TMP_DBSYSTEMVALUES_ORACLE; - DBSYSTEMVALUES_DB2 = TMP_DBSYSTEMVALUES_DB2; - DBSYSTEMVALUES_POSTGRESQL = TMP_DBSYSTEMVALUES_POSTGRESQL; - DBSYSTEMVALUES_REDSHIFT = TMP_DBSYSTEMVALUES_REDSHIFT; - DBSYSTEMVALUES_HIVE = TMP_DBSYSTEMVALUES_HIVE; - DBSYSTEMVALUES_CLOUDSCAPE = TMP_DBSYSTEMVALUES_CLOUDSCAPE; - DBSYSTEMVALUES_HSQLDB = TMP_DBSYSTEMVALUES_HSQLDB; - DBSYSTEMVALUES_PROGRESS = TMP_DBSYSTEMVALUES_PROGRESS; - DBSYSTEMVALUES_MAXDB = TMP_DBSYSTEMVALUES_MAXDB; - DBSYSTEMVALUES_HANADB = TMP_DBSYSTEMVALUES_HANADB; - DBSYSTEMVALUES_INGRES = TMP_DBSYSTEMVALUES_INGRES; - DBSYSTEMVALUES_FIRSTSQL = TMP_DBSYSTEMVALUES_FIRSTSQL; - DBSYSTEMVALUES_EDB = TMP_DBSYSTEMVALUES_EDB; - DBSYSTEMVALUES_CACHE = TMP_DBSYSTEMVALUES_CACHE; - DBSYSTEMVALUES_ADABAS = TMP_DBSYSTEMVALUES_ADABAS; - DBSYSTEMVALUES_FIREBIRD = TMP_DBSYSTEMVALUES_FIREBIRD; - DBSYSTEMVALUES_DERBY = TMP_DBSYSTEMVALUES_DERBY; - DBSYSTEMVALUES_FILEMAKER = TMP_DBSYSTEMVALUES_FILEMAKER; - DBSYSTEMVALUES_INFORMIX = TMP_DBSYSTEMVALUES_INFORMIX; - DBSYSTEMVALUES_INSTANTDB = TMP_DBSYSTEMVALUES_INSTANTDB; - DBSYSTEMVALUES_INTERBASE = TMP_DBSYSTEMVALUES_INTERBASE; - DBSYSTEMVALUES_MARIADB = TMP_DBSYSTEMVALUES_MARIADB; - DBSYSTEMVALUES_NETEZZA = TMP_DBSYSTEMVALUES_NETEZZA; - DBSYSTEMVALUES_PERVASIVE = TMP_DBSYSTEMVALUES_PERVASIVE; - DBSYSTEMVALUES_POINTBASE = TMP_DBSYSTEMVALUES_POINTBASE; - DBSYSTEMVALUES_SQLITE = TMP_DBSYSTEMVALUES_SQLITE; - DBSYSTEMVALUES_SYBASE = TMP_DBSYSTEMVALUES_SYBASE; - DBSYSTEMVALUES_TERADATA = TMP_DBSYSTEMVALUES_TERADATA; - DBSYSTEMVALUES_VERTICA = TMP_DBSYSTEMVALUES_VERTICA; - DBSYSTEMVALUES_H2 = TMP_DBSYSTEMVALUES_H2; - DBSYSTEMVALUES_COLDFUSION = TMP_DBSYSTEMVALUES_COLDFUSION; - DBSYSTEMVALUES_CASSANDRA = TMP_DBSYSTEMVALUES_CASSANDRA; - DBSYSTEMVALUES_HBASE = TMP_DBSYSTEMVALUES_HBASE; - DBSYSTEMVALUES_MONGODB = TMP_DBSYSTEMVALUES_MONGODB; - DBSYSTEMVALUES_REDIS = TMP_DBSYSTEMVALUES_REDIS; - DBSYSTEMVALUES_COUCHBASE = TMP_DBSYSTEMVALUES_COUCHBASE; - DBSYSTEMVALUES_COUCHDB = TMP_DBSYSTEMVALUES_COUCHDB; - DBSYSTEMVALUES_COSMOSDB = TMP_DBSYSTEMVALUES_COSMOSDB; - DBSYSTEMVALUES_DYNAMODB = TMP_DBSYSTEMVALUES_DYNAMODB; - DBSYSTEMVALUES_NEO4J = TMP_DBSYSTEMVALUES_NEO4J; - DBSYSTEMVALUES_GEODE = TMP_DBSYSTEMVALUES_GEODE; - DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; - DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; - DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; - DbSystemValues = /* @__PURE__ */ createConstMap([ - TMP_DBSYSTEMVALUES_OTHER_SQL, - TMP_DBSYSTEMVALUES_MSSQL, - TMP_DBSYSTEMVALUES_MYSQL, - TMP_DBSYSTEMVALUES_ORACLE, - TMP_DBSYSTEMVALUES_DB2, - TMP_DBSYSTEMVALUES_POSTGRESQL, - TMP_DBSYSTEMVALUES_REDSHIFT, - TMP_DBSYSTEMVALUES_HIVE, - TMP_DBSYSTEMVALUES_CLOUDSCAPE, - TMP_DBSYSTEMVALUES_HSQLDB, - TMP_DBSYSTEMVALUES_PROGRESS, - TMP_DBSYSTEMVALUES_MAXDB, - TMP_DBSYSTEMVALUES_HANADB, - TMP_DBSYSTEMVALUES_INGRES, - TMP_DBSYSTEMVALUES_FIRSTSQL, - TMP_DBSYSTEMVALUES_EDB, - TMP_DBSYSTEMVALUES_CACHE, - TMP_DBSYSTEMVALUES_ADABAS, - TMP_DBSYSTEMVALUES_FIREBIRD, - TMP_DBSYSTEMVALUES_DERBY, - TMP_DBSYSTEMVALUES_FILEMAKER, - TMP_DBSYSTEMVALUES_INFORMIX, - TMP_DBSYSTEMVALUES_INSTANTDB, - TMP_DBSYSTEMVALUES_INTERBASE, - TMP_DBSYSTEMVALUES_MARIADB, - TMP_DBSYSTEMVALUES_NETEZZA, - TMP_DBSYSTEMVALUES_PERVASIVE, - TMP_DBSYSTEMVALUES_POINTBASE, - TMP_DBSYSTEMVALUES_SQLITE, - TMP_DBSYSTEMVALUES_SYBASE, - TMP_DBSYSTEMVALUES_TERADATA, - TMP_DBSYSTEMVALUES_VERTICA, - TMP_DBSYSTEMVALUES_H2, - TMP_DBSYSTEMVALUES_COLDFUSION, - TMP_DBSYSTEMVALUES_CASSANDRA, - TMP_DBSYSTEMVALUES_HBASE, - TMP_DBSYSTEMVALUES_MONGODB, - TMP_DBSYSTEMVALUES_REDIS, - TMP_DBSYSTEMVALUES_COUCHBASE, - TMP_DBSYSTEMVALUES_COUCHDB, - TMP_DBSYSTEMVALUES_COSMOSDB, - TMP_DBSYSTEMVALUES_DYNAMODB, - TMP_DBSYSTEMVALUES_NEO4J, - TMP_DBSYSTEMVALUES_GEODE, - TMP_DBSYSTEMVALUES_ELASTICSEARCH, - TMP_DBSYSTEMVALUES_MEMCACHED, - TMP_DBSYSTEMVALUES_COCKROACHDB - ]); - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL = "all"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = "each_quorum"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = "quorum"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = "local_quorum"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE = "one"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO = "two"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE = "three"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = "local_one"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY = "any"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = "serial"; - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = "local_serial"; - DBCASSANDRACONSISTENCYLEVELVALUES_ALL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL; - DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM; - DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM; - DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM; - DBCASSANDRACONSISTENCYLEVELVALUES_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE; - DBCASSANDRACONSISTENCYLEVELVALUES_TWO = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO; - DBCASSANDRACONSISTENCYLEVELVALUES_THREE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE; - DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE; - DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; - DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; - DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; - DbCassandraConsistencyLevelValues = /* @__PURE__ */ createConstMap([ - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, - TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL - ]); - TMP_FAASTRIGGERVALUES_DATASOURCE = "datasource"; - TMP_FAASTRIGGERVALUES_HTTP = "http"; - TMP_FAASTRIGGERVALUES_PUBSUB = "pubsub"; - TMP_FAASTRIGGERVALUES_TIMER = "timer"; - TMP_FAASTRIGGERVALUES_OTHER = "other"; - FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; - FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; - FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; - FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; - FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; - FaasTriggerValues = /* @__PURE__ */ createConstMap([ - TMP_FAASTRIGGERVALUES_DATASOURCE, - TMP_FAASTRIGGERVALUES_HTTP, - TMP_FAASTRIGGERVALUES_PUBSUB, - TMP_FAASTRIGGERVALUES_TIMER, - TMP_FAASTRIGGERVALUES_OTHER - ]); - TMP_FAASDOCUMENTOPERATIONVALUES_INSERT = "insert"; - TMP_FAASDOCUMENTOPERATIONVALUES_EDIT = "edit"; - TMP_FAASDOCUMENTOPERATIONVALUES_DELETE = "delete"; - FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; - FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; - FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; - FaasDocumentOperationValues = /* @__PURE__ */ createConstMap([ - TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, - TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, - TMP_FAASDOCUMENTOPERATIONVALUES_DELETE - ]); - TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; - TMP_FAASINVOKEDPROVIDERVALUES_AWS = "aws"; - TMP_FAASINVOKEDPROVIDERVALUES_AZURE = "azure"; - TMP_FAASINVOKEDPROVIDERVALUES_GCP = "gcp"; - FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD; - FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; - FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; - FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; - FaasInvokedProviderValues = /* @__PURE__ */ createConstMap([ - TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, - TMP_FAASINVOKEDPROVIDERVALUES_AWS, - TMP_FAASINVOKEDPROVIDERVALUES_AZURE, - TMP_FAASINVOKEDPROVIDERVALUES_GCP - ]); - TMP_NETTRANSPORTVALUES_IP_TCP = "ip_tcp"; - TMP_NETTRANSPORTVALUES_IP_UDP = "ip_udp"; - TMP_NETTRANSPORTVALUES_IP = "ip"; - TMP_NETTRANSPORTVALUES_UNIX = "unix"; - TMP_NETTRANSPORTVALUES_PIPE = "pipe"; - TMP_NETTRANSPORTVALUES_INPROC = "inproc"; - TMP_NETTRANSPORTVALUES_OTHER = "other"; - NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; - NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; - NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; - NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; - NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; - NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; - NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; - NetTransportValues = /* @__PURE__ */ createConstMap([ - TMP_NETTRANSPORTVALUES_IP_TCP, - TMP_NETTRANSPORTVALUES_IP_UDP, - TMP_NETTRANSPORTVALUES_IP, - TMP_NETTRANSPORTVALUES_UNIX, - TMP_NETTRANSPORTVALUES_PIPE, - TMP_NETTRANSPORTVALUES_INPROC, - TMP_NETTRANSPORTVALUES_OTHER - ]); - TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI = "wifi"; - TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED = "wired"; - TMP_NETHOSTCONNECTIONTYPEVALUES_CELL = "cell"; - TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = "unavailable"; - TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = "unknown"; - NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; - NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; - NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; - NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; - NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; - NetHostConnectionTypeValues = /* @__PURE__ */ createConstMap([ - TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, - TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, - TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, - TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, - TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN - ]); - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = "gprs"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = "edge"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = "umts"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = "cdma"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = "evdo_0"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = "evdo_a"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = "cdma2000_1xrtt"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = "hsdpa"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = "hsupa"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = "hspa"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = "iden"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = "evdo_b"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE = "lte"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = "ehrpd"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = "hspap"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM = "gsm"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = "td_scdma"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = "iwlan"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR = "nr"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = "nrnsa"; - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = "lte_ca"; - NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS; - NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE; - NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS; - NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA; - NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0; - NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A; - NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT; - NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA; - NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA; - NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA; - NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN; - NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B; - NETHOSTCONNECTIONSUBTYPEVALUES_LTE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE; - NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD; - NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP; - NETHOSTCONNECTIONSUBTYPEVALUES_GSM = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM; - NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA; - NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN; - NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; - NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; - NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; - NetHostConnectionSubtypeValues = /* @__PURE__ */ createConstMap([ - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, - TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA - ]); - TMP_HTTPFLAVORVALUES_HTTP_1_0 = "1.0"; - TMP_HTTPFLAVORVALUES_HTTP_1_1 = "1.1"; - TMP_HTTPFLAVORVALUES_HTTP_2_0 = "2.0"; - TMP_HTTPFLAVORVALUES_SPDY = "SPDY"; - TMP_HTTPFLAVORVALUES_QUIC = "QUIC"; - HTTPFLAVORVALUES_HTTP_1_0 = TMP_HTTPFLAVORVALUES_HTTP_1_0; - HTTPFLAVORVALUES_HTTP_1_1 = TMP_HTTPFLAVORVALUES_HTTP_1_1; - HTTPFLAVORVALUES_HTTP_2_0 = TMP_HTTPFLAVORVALUES_HTTP_2_0; - HTTPFLAVORVALUES_SPDY = TMP_HTTPFLAVORVALUES_SPDY; - HTTPFLAVORVALUES_QUIC = TMP_HTTPFLAVORVALUES_QUIC; - HttpFlavorValues = { - HTTP_1_0: TMP_HTTPFLAVORVALUES_HTTP_1_0, - HTTP_1_1: TMP_HTTPFLAVORVALUES_HTTP_1_1, - HTTP_2_0: TMP_HTTPFLAVORVALUES_HTTP_2_0, - SPDY: TMP_HTTPFLAVORVALUES_SPDY, - QUIC: TMP_HTTPFLAVORVALUES_QUIC - }; - TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE = "queue"; - TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = "topic"; - MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; - MESSAGINGDESTINATIONKINDVALUES_TOPIC = TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC; - MessagingDestinationKindValues = /* @__PURE__ */ createConstMap([TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC]); - TMP_MESSAGINGOPERATIONVALUES_RECEIVE = "receive"; - TMP_MESSAGINGOPERATIONVALUES_PROCESS = "process"; - MESSAGINGOPERATIONVALUES_RECEIVE = TMP_MESSAGINGOPERATIONVALUES_RECEIVE; - MESSAGINGOPERATIONVALUES_PROCESS = TMP_MESSAGINGOPERATIONVALUES_PROCESS; - MessagingOperationValues = /* @__PURE__ */ createConstMap([TMP_MESSAGINGOPERATIONVALUES_RECEIVE, TMP_MESSAGINGOPERATIONVALUES_PROCESS]); - TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; - TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; - TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; - TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = 3; - TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = 4; - TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND = 5; - TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = 6; - TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = 7; - TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = 8; - TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = 9; - TMP_RPCGRPCSTATUSCODEVALUES_ABORTED = 10; - TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = 11; - TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = 12; - TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL = 13; - TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = 14; - TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS = 15; - TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = 16; - RPCGRPCSTATUSCODEVALUES_OK = TMP_RPCGRPCSTATUSCODEVALUES_OK; - RPCGRPCSTATUSCODEVALUES_CANCELLED = TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED; - RPCGRPCSTATUSCODEVALUES_UNKNOWN = TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN; - RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT; - RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED; - RPCGRPCSTATUSCODEVALUES_NOT_FOUND = TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND; - RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS; - RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED; - RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED; - RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION; - RPCGRPCSTATUSCODEVALUES_ABORTED = TMP_RPCGRPCSTATUSCODEVALUES_ABORTED; - RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE; - RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED; - RPCGRPCSTATUSCODEVALUES_INTERNAL = TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL; - RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE; - RPCGRPCSTATUSCODEVALUES_DATA_LOSS = TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS; - RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED; - RpcGrpcStatusCodeValues = { - OK: TMP_RPCGRPCSTATUSCODEVALUES_OK, - CANCELLED: TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, - UNKNOWN: TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, - INVALID_ARGUMENT: TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, - DEADLINE_EXCEEDED: TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, - NOT_FOUND: TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, - ALREADY_EXISTS: TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, - PERMISSION_DENIED: TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, - RESOURCE_EXHAUSTED: TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, - FAILED_PRECONDITION: TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, - ABORTED: TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, - OUT_OF_RANGE: TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, - UNIMPLEMENTED: TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, - INTERNAL: TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, - UNAVAILABLE: TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, - DATA_LOSS: TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, - UNAUTHENTICATED: TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED - }; - TMP_MESSAGETYPEVALUES_SENT = "SENT"; - TMP_MESSAGETYPEVALUES_RECEIVED = "RECEIVED"; - MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; - MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; - MessageTypeValues = /* @__PURE__ */ createConstMap([TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED]); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js -var init_trace = __esmMin((() => { - init_SemanticAttributes(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js -var TMP_CLOUD_PROVIDER, TMP_CLOUD_ACCOUNT_ID, TMP_CLOUD_REGION, TMP_CLOUD_AVAILABILITY_ZONE, TMP_CLOUD_PLATFORM, TMP_AWS_ECS_CONTAINER_ARN, TMP_AWS_ECS_CLUSTER_ARN, TMP_AWS_ECS_LAUNCHTYPE, TMP_AWS_ECS_TASK_ARN, TMP_AWS_ECS_TASK_FAMILY, TMP_AWS_ECS_TASK_REVISION, TMP_AWS_EKS_CLUSTER_ARN, TMP_AWS_LOG_GROUP_NAMES, TMP_AWS_LOG_GROUP_ARNS, TMP_AWS_LOG_STREAM_NAMES, TMP_AWS_LOG_STREAM_ARNS, TMP_CONTAINER_NAME, TMP_CONTAINER_ID, TMP_CONTAINER_RUNTIME, TMP_CONTAINER_IMAGE_NAME, TMP_CONTAINER_IMAGE_TAG, TMP_DEPLOYMENT_ENVIRONMENT, TMP_DEVICE_ID, TMP_DEVICE_MODEL_IDENTIFIER, TMP_DEVICE_MODEL_NAME, TMP_FAAS_NAME, TMP_FAAS_ID, TMP_FAAS_VERSION, TMP_FAAS_INSTANCE, TMP_FAAS_MAX_MEMORY, TMP_HOST_ID, TMP_HOST_NAME, TMP_HOST_TYPE, TMP_HOST_ARCH, TMP_HOST_IMAGE_NAME, TMP_HOST_IMAGE_ID, TMP_HOST_IMAGE_VERSION, TMP_K8S_CLUSTER_NAME, TMP_K8S_NODE_NAME, TMP_K8S_NODE_UID, TMP_K8S_NAMESPACE_NAME, TMP_K8S_POD_UID, TMP_K8S_POD_NAME, TMP_K8S_CONTAINER_NAME, TMP_K8S_REPLICASET_UID, TMP_K8S_REPLICASET_NAME, TMP_K8S_DEPLOYMENT_UID, TMP_K8S_DEPLOYMENT_NAME, TMP_K8S_STATEFULSET_UID, TMP_K8S_STATEFULSET_NAME, TMP_K8S_DAEMONSET_UID, TMP_K8S_DAEMONSET_NAME, TMP_K8S_JOB_UID, TMP_K8S_JOB_NAME, TMP_K8S_CRONJOB_UID, TMP_K8S_CRONJOB_NAME, TMP_OS_TYPE, TMP_OS_DESCRIPTION, TMP_OS_NAME, TMP_OS_VERSION, TMP_PROCESS_PID, TMP_PROCESS_EXECUTABLE_NAME, TMP_PROCESS_EXECUTABLE_PATH, TMP_PROCESS_COMMAND, TMP_PROCESS_COMMAND_LINE, TMP_PROCESS_COMMAND_ARGS, TMP_PROCESS_OWNER, TMP_PROCESS_RUNTIME_NAME, TMP_PROCESS_RUNTIME_VERSION, TMP_PROCESS_RUNTIME_DESCRIPTION, TMP_SERVICE_NAME, TMP_SERVICE_NAMESPACE, TMP_SERVICE_INSTANCE_ID, TMP_SERVICE_VERSION, TMP_TELEMETRY_SDK_NAME, TMP_TELEMETRY_SDK_LANGUAGE, TMP_TELEMETRY_SDK_VERSION, TMP_TELEMETRY_AUTO_VERSION, TMP_WEBENGINE_NAME, TMP_WEBENGINE_VERSION, TMP_WEBENGINE_DESCRIPTION, SEMRESATTRS_CLOUD_PROVIDER, SEMRESATTRS_CLOUD_ACCOUNT_ID, SEMRESATTRS_CLOUD_REGION, SEMRESATTRS_CLOUD_AVAILABILITY_ZONE, SEMRESATTRS_CLOUD_PLATFORM, SEMRESATTRS_AWS_ECS_CONTAINER_ARN, SEMRESATTRS_AWS_ECS_CLUSTER_ARN, SEMRESATTRS_AWS_ECS_LAUNCHTYPE, SEMRESATTRS_AWS_ECS_TASK_ARN, SEMRESATTRS_AWS_ECS_TASK_FAMILY, SEMRESATTRS_AWS_ECS_TASK_REVISION, SEMRESATTRS_AWS_EKS_CLUSTER_ARN, SEMRESATTRS_AWS_LOG_GROUP_NAMES, SEMRESATTRS_AWS_LOG_GROUP_ARNS, SEMRESATTRS_AWS_LOG_STREAM_NAMES, SEMRESATTRS_AWS_LOG_STREAM_ARNS, SEMRESATTRS_CONTAINER_NAME, SEMRESATTRS_CONTAINER_ID, SEMRESATTRS_CONTAINER_RUNTIME, SEMRESATTRS_CONTAINER_IMAGE_NAME, SEMRESATTRS_CONTAINER_IMAGE_TAG, SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, SEMRESATTRS_DEVICE_ID, SEMRESATTRS_DEVICE_MODEL_IDENTIFIER, SEMRESATTRS_DEVICE_MODEL_NAME, SEMRESATTRS_FAAS_NAME, SEMRESATTRS_FAAS_ID, SEMRESATTRS_FAAS_VERSION, SEMRESATTRS_FAAS_INSTANCE, SEMRESATTRS_FAAS_MAX_MEMORY, SEMRESATTRS_HOST_ID, SEMRESATTRS_HOST_NAME, SEMRESATTRS_HOST_TYPE, SEMRESATTRS_HOST_ARCH, SEMRESATTRS_HOST_IMAGE_NAME, SEMRESATTRS_HOST_IMAGE_ID, SEMRESATTRS_HOST_IMAGE_VERSION, SEMRESATTRS_K8S_CLUSTER_NAME, SEMRESATTRS_K8S_NODE_NAME, SEMRESATTRS_K8S_NODE_UID, SEMRESATTRS_K8S_NAMESPACE_NAME, SEMRESATTRS_K8S_POD_UID, SEMRESATTRS_K8S_POD_NAME, SEMRESATTRS_K8S_CONTAINER_NAME, SEMRESATTRS_K8S_REPLICASET_UID, SEMRESATTRS_K8S_REPLICASET_NAME, SEMRESATTRS_K8S_DEPLOYMENT_UID, SEMRESATTRS_K8S_DEPLOYMENT_NAME, SEMRESATTRS_K8S_STATEFULSET_UID, SEMRESATTRS_K8S_STATEFULSET_NAME, SEMRESATTRS_K8S_DAEMONSET_UID, SEMRESATTRS_K8S_DAEMONSET_NAME, SEMRESATTRS_K8S_JOB_UID, SEMRESATTRS_K8S_JOB_NAME, SEMRESATTRS_K8S_CRONJOB_UID, SEMRESATTRS_K8S_CRONJOB_NAME, SEMRESATTRS_OS_TYPE, SEMRESATTRS_OS_DESCRIPTION, SEMRESATTRS_OS_NAME, SEMRESATTRS_OS_VERSION, SEMRESATTRS_PROCESS_PID, SEMRESATTRS_PROCESS_EXECUTABLE_NAME, SEMRESATTRS_PROCESS_EXECUTABLE_PATH, SEMRESATTRS_PROCESS_COMMAND, SEMRESATTRS_PROCESS_COMMAND_LINE, SEMRESATTRS_PROCESS_COMMAND_ARGS, SEMRESATTRS_PROCESS_OWNER, SEMRESATTRS_PROCESS_RUNTIME_NAME, SEMRESATTRS_PROCESS_RUNTIME_VERSION, SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_NAMESPACE, SEMRESATTRS_SERVICE_INSTANCE_ID, SEMRESATTRS_SERVICE_VERSION, SEMRESATTRS_TELEMETRY_SDK_NAME, SEMRESATTRS_TELEMETRY_SDK_LANGUAGE, SEMRESATTRS_TELEMETRY_SDK_VERSION, SEMRESATTRS_TELEMETRY_AUTO_VERSION, SEMRESATTRS_WEBENGINE_NAME, SEMRESATTRS_WEBENGINE_VERSION, SEMRESATTRS_WEBENGINE_DESCRIPTION, SemanticResourceAttributes, TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, TMP_CLOUDPROVIDERVALUES_AWS, TMP_CLOUDPROVIDERVALUES_AZURE, TMP_CLOUDPROVIDERVALUES_GCP, CLOUDPROVIDERVALUES_ALIBABA_CLOUD, CLOUDPROVIDERVALUES_AWS, CLOUDPROVIDERVALUES_AZURE, CLOUDPROVIDERVALUES_GCP, CloudProviderValues, TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, TMP_CLOUDPLATFORMVALUES_AWS_EC2, TMP_CLOUDPLATFORMVALUES_AWS_ECS, TMP_CLOUDPLATFORMVALUES_AWS_EKS, TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, TMP_CLOUDPLATFORMVALUES_AZURE_VM, TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, TMP_CLOUDPLATFORMVALUES_AZURE_AKS, TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE, CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, CLOUDPLATFORMVALUES_AWS_EC2, CLOUDPLATFORMVALUES_AWS_ECS, CLOUDPLATFORMVALUES_AWS_EKS, CLOUDPLATFORMVALUES_AWS_LAMBDA, CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, CLOUDPLATFORMVALUES_AZURE_VM, CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, CLOUDPLATFORMVALUES_AZURE_AKS, CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, CLOUDPLATFORMVALUES_GCP_APP_ENGINE, CloudPlatformValues, TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE, AWSECSLAUNCHTYPEVALUES_EC2, AWSECSLAUNCHTYPEVALUES_FARGATE, AwsEcsLaunchtypeValues, TMP_HOSTARCHVALUES_AMD64, TMP_HOSTARCHVALUES_ARM32, TMP_HOSTARCHVALUES_ARM64, TMP_HOSTARCHVALUES_IA64, TMP_HOSTARCHVALUES_PPC32, TMP_HOSTARCHVALUES_PPC64, TMP_HOSTARCHVALUES_X86, HOSTARCHVALUES_AMD64, HOSTARCHVALUES_ARM32, HOSTARCHVALUES_ARM64, HOSTARCHVALUES_IA64, HOSTARCHVALUES_PPC32, HOSTARCHVALUES_PPC64, HOSTARCHVALUES_X86, HostArchValues, TMP_OSTYPEVALUES_WINDOWS, TMP_OSTYPEVALUES_LINUX, TMP_OSTYPEVALUES_DARWIN, TMP_OSTYPEVALUES_FREEBSD, TMP_OSTYPEVALUES_NETBSD, TMP_OSTYPEVALUES_OPENBSD, TMP_OSTYPEVALUES_DRAGONFLYBSD, TMP_OSTYPEVALUES_HPUX, TMP_OSTYPEVALUES_AIX, TMP_OSTYPEVALUES_SOLARIS, TMP_OSTYPEVALUES_Z_OS, OSTYPEVALUES_WINDOWS, OSTYPEVALUES_LINUX, OSTYPEVALUES_DARWIN, OSTYPEVALUES_FREEBSD, OSTYPEVALUES_NETBSD, OSTYPEVALUES_OPENBSD, OSTYPEVALUES_DRAGONFLYBSD, OSTYPEVALUES_HPUX, OSTYPEVALUES_AIX, OSTYPEVALUES_SOLARIS, OSTYPEVALUES_Z_OS, OsTypeValues, TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, TMP_TELEMETRYSDKLANGUAGEVALUES_GO, TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS, TELEMETRYSDKLANGUAGEVALUES_CPP, TELEMETRYSDKLANGUAGEVALUES_DOTNET, TELEMETRYSDKLANGUAGEVALUES_ERLANG, TELEMETRYSDKLANGUAGEVALUES_GO, TELEMETRYSDKLANGUAGEVALUES_JAVA, TELEMETRYSDKLANGUAGEVALUES_NODEJS, TELEMETRYSDKLANGUAGEVALUES_PHP, TELEMETRYSDKLANGUAGEVALUES_PYTHON, TELEMETRYSDKLANGUAGEVALUES_RUBY, TELEMETRYSDKLANGUAGEVALUES_WEBJS, TelemetrySdkLanguageValues; -var init_SemanticResourceAttributes = __esmMin((() => { - init_utils(); - TMP_CLOUD_PROVIDER = "cloud.provider"; - TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; - TMP_CLOUD_REGION = "cloud.region"; - TMP_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; - TMP_CLOUD_PLATFORM = "cloud.platform"; - TMP_AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn"; - TMP_AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn"; - TMP_AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype"; - TMP_AWS_ECS_TASK_ARN = "aws.ecs.task.arn"; - TMP_AWS_ECS_TASK_FAMILY = "aws.ecs.task.family"; - TMP_AWS_ECS_TASK_REVISION = "aws.ecs.task.revision"; - TMP_AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn"; - TMP_AWS_LOG_GROUP_NAMES = "aws.log.group.names"; - TMP_AWS_LOG_GROUP_ARNS = "aws.log.group.arns"; - TMP_AWS_LOG_STREAM_NAMES = "aws.log.stream.names"; - TMP_AWS_LOG_STREAM_ARNS = "aws.log.stream.arns"; - TMP_CONTAINER_NAME = "container.name"; - TMP_CONTAINER_ID = "container.id"; - TMP_CONTAINER_RUNTIME = "container.runtime"; - TMP_CONTAINER_IMAGE_NAME = "container.image.name"; - TMP_CONTAINER_IMAGE_TAG = "container.image.tag"; - TMP_DEPLOYMENT_ENVIRONMENT = "deployment.environment"; - TMP_DEVICE_ID = "device.id"; - TMP_DEVICE_MODEL_IDENTIFIER = "device.model.identifier"; - TMP_DEVICE_MODEL_NAME = "device.model.name"; - TMP_FAAS_NAME = "faas.name"; - TMP_FAAS_ID = "faas.id"; - TMP_FAAS_VERSION = "faas.version"; - TMP_FAAS_INSTANCE = "faas.instance"; - TMP_FAAS_MAX_MEMORY = "faas.max_memory"; - TMP_HOST_ID = "host.id"; - TMP_HOST_NAME = "host.name"; - TMP_HOST_TYPE = "host.type"; - TMP_HOST_ARCH = "host.arch"; - TMP_HOST_IMAGE_NAME = "host.image.name"; - TMP_HOST_IMAGE_ID = "host.image.id"; - TMP_HOST_IMAGE_VERSION = "host.image.version"; - TMP_K8S_CLUSTER_NAME = "k8s.cluster.name"; - TMP_K8S_NODE_NAME = "k8s.node.name"; - TMP_K8S_NODE_UID = "k8s.node.uid"; - TMP_K8S_NAMESPACE_NAME = "k8s.namespace.name"; - TMP_K8S_POD_UID = "k8s.pod.uid"; - TMP_K8S_POD_NAME = "k8s.pod.name"; - TMP_K8S_CONTAINER_NAME = "k8s.container.name"; - TMP_K8S_REPLICASET_UID = "k8s.replicaset.uid"; - TMP_K8S_REPLICASET_NAME = "k8s.replicaset.name"; - TMP_K8S_DEPLOYMENT_UID = "k8s.deployment.uid"; - TMP_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; - TMP_K8S_STATEFULSET_UID = "k8s.statefulset.uid"; - TMP_K8S_STATEFULSET_NAME = "k8s.statefulset.name"; - TMP_K8S_DAEMONSET_UID = "k8s.daemonset.uid"; - TMP_K8S_DAEMONSET_NAME = "k8s.daemonset.name"; - TMP_K8S_JOB_UID = "k8s.job.uid"; - TMP_K8S_JOB_NAME = "k8s.job.name"; - TMP_K8S_CRONJOB_UID = "k8s.cronjob.uid"; - TMP_K8S_CRONJOB_NAME = "k8s.cronjob.name"; - TMP_OS_TYPE = "os.type"; - TMP_OS_DESCRIPTION = "os.description"; - TMP_OS_NAME = "os.name"; - TMP_OS_VERSION = "os.version"; - TMP_PROCESS_PID = "process.pid"; - TMP_PROCESS_EXECUTABLE_NAME = "process.executable.name"; - TMP_PROCESS_EXECUTABLE_PATH = "process.executable.path"; - TMP_PROCESS_COMMAND = "process.command"; - TMP_PROCESS_COMMAND_LINE = "process.command_line"; - TMP_PROCESS_COMMAND_ARGS = "process.command_args"; - TMP_PROCESS_OWNER = "process.owner"; - TMP_PROCESS_RUNTIME_NAME = "process.runtime.name"; - TMP_PROCESS_RUNTIME_VERSION = "process.runtime.version"; - TMP_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; - TMP_SERVICE_NAME = "service.name"; - TMP_SERVICE_NAMESPACE = "service.namespace"; - TMP_SERVICE_INSTANCE_ID = "service.instance.id"; - TMP_SERVICE_VERSION = "service.version"; - TMP_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; - TMP_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; - TMP_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; - TMP_TELEMETRY_AUTO_VERSION = "telemetry.auto.version"; - TMP_WEBENGINE_NAME = "webengine.name"; - TMP_WEBENGINE_VERSION = "webengine.version"; - TMP_WEBENGINE_DESCRIPTION = "webengine.description"; - SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; - SEMRESATTRS_CLOUD_ACCOUNT_ID = TMP_CLOUD_ACCOUNT_ID; - SEMRESATTRS_CLOUD_REGION = TMP_CLOUD_REGION; - SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = TMP_CLOUD_AVAILABILITY_ZONE; - SEMRESATTRS_CLOUD_PLATFORM = TMP_CLOUD_PLATFORM; - SEMRESATTRS_AWS_ECS_CONTAINER_ARN = TMP_AWS_ECS_CONTAINER_ARN; - SEMRESATTRS_AWS_ECS_CLUSTER_ARN = TMP_AWS_ECS_CLUSTER_ARN; - SEMRESATTRS_AWS_ECS_LAUNCHTYPE = TMP_AWS_ECS_LAUNCHTYPE; - SEMRESATTRS_AWS_ECS_TASK_ARN = TMP_AWS_ECS_TASK_ARN; - SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; - SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; - SEMRESATTRS_AWS_EKS_CLUSTER_ARN = TMP_AWS_EKS_CLUSTER_ARN; - SEMRESATTRS_AWS_LOG_GROUP_NAMES = TMP_AWS_LOG_GROUP_NAMES; - SEMRESATTRS_AWS_LOG_GROUP_ARNS = TMP_AWS_LOG_GROUP_ARNS; - SEMRESATTRS_AWS_LOG_STREAM_NAMES = TMP_AWS_LOG_STREAM_NAMES; - SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; - SEMRESATTRS_CONTAINER_NAME = TMP_CONTAINER_NAME; - SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; - SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; - SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; - SEMRESATTRS_CONTAINER_IMAGE_TAG = TMP_CONTAINER_IMAGE_TAG; - SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = TMP_DEPLOYMENT_ENVIRONMENT; - SEMRESATTRS_DEVICE_ID = TMP_DEVICE_ID; - SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = TMP_DEVICE_MODEL_IDENTIFIER; - SEMRESATTRS_DEVICE_MODEL_NAME = TMP_DEVICE_MODEL_NAME; - SEMRESATTRS_FAAS_NAME = TMP_FAAS_NAME; - SEMRESATTRS_FAAS_ID = TMP_FAAS_ID; - SEMRESATTRS_FAAS_VERSION = TMP_FAAS_VERSION; - SEMRESATTRS_FAAS_INSTANCE = TMP_FAAS_INSTANCE; - SEMRESATTRS_FAAS_MAX_MEMORY = TMP_FAAS_MAX_MEMORY; - SEMRESATTRS_HOST_ID = TMP_HOST_ID; - SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; - SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; - SEMRESATTRS_HOST_ARCH = TMP_HOST_ARCH; - SEMRESATTRS_HOST_IMAGE_NAME = TMP_HOST_IMAGE_NAME; - SEMRESATTRS_HOST_IMAGE_ID = TMP_HOST_IMAGE_ID; - SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; - SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; - SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; - SEMRESATTRS_K8S_NODE_UID = TMP_K8S_NODE_UID; - SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; - SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; - SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; - SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; - SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; - SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; - SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; - SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; - SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; - SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; - SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; - SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; - SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; - SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; - SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; - SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; - SEMRESATTRS_OS_TYPE = TMP_OS_TYPE; - SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; - SEMRESATTRS_OS_NAME = TMP_OS_NAME; - SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; - SEMRESATTRS_PROCESS_PID = TMP_PROCESS_PID; - SEMRESATTRS_PROCESS_EXECUTABLE_NAME = TMP_PROCESS_EXECUTABLE_NAME; - SEMRESATTRS_PROCESS_EXECUTABLE_PATH = TMP_PROCESS_EXECUTABLE_PATH; - SEMRESATTRS_PROCESS_COMMAND = TMP_PROCESS_COMMAND; - SEMRESATTRS_PROCESS_COMMAND_LINE = TMP_PROCESS_COMMAND_LINE; - SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; - SEMRESATTRS_PROCESS_OWNER = TMP_PROCESS_OWNER; - SEMRESATTRS_PROCESS_RUNTIME_NAME = TMP_PROCESS_RUNTIME_NAME; - SEMRESATTRS_PROCESS_RUNTIME_VERSION = TMP_PROCESS_RUNTIME_VERSION; - SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = TMP_PROCESS_RUNTIME_DESCRIPTION; - SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME; - SEMRESATTRS_SERVICE_NAMESPACE = TMP_SERVICE_NAMESPACE; - SEMRESATTRS_SERVICE_INSTANCE_ID = TMP_SERVICE_INSTANCE_ID; - SEMRESATTRS_SERVICE_VERSION = TMP_SERVICE_VERSION; - SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME; - SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE; - SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION; - SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; - SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; - SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; - SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; - SemanticResourceAttributes = /* @__PURE__ */ createConstMap([ - TMP_CLOUD_PROVIDER, - TMP_CLOUD_ACCOUNT_ID, - TMP_CLOUD_REGION, - TMP_CLOUD_AVAILABILITY_ZONE, - TMP_CLOUD_PLATFORM, - TMP_AWS_ECS_CONTAINER_ARN, - TMP_AWS_ECS_CLUSTER_ARN, - TMP_AWS_ECS_LAUNCHTYPE, - TMP_AWS_ECS_TASK_ARN, - TMP_AWS_ECS_TASK_FAMILY, - TMP_AWS_ECS_TASK_REVISION, - TMP_AWS_EKS_CLUSTER_ARN, - TMP_AWS_LOG_GROUP_NAMES, - TMP_AWS_LOG_GROUP_ARNS, - TMP_AWS_LOG_STREAM_NAMES, - TMP_AWS_LOG_STREAM_ARNS, - TMP_CONTAINER_NAME, - TMP_CONTAINER_ID, - TMP_CONTAINER_RUNTIME, - TMP_CONTAINER_IMAGE_NAME, - TMP_CONTAINER_IMAGE_TAG, - TMP_DEPLOYMENT_ENVIRONMENT, - TMP_DEVICE_ID, - TMP_DEVICE_MODEL_IDENTIFIER, - TMP_DEVICE_MODEL_NAME, - TMP_FAAS_NAME, - TMP_FAAS_ID, - TMP_FAAS_VERSION, - TMP_FAAS_INSTANCE, - TMP_FAAS_MAX_MEMORY, - TMP_HOST_ID, - TMP_HOST_NAME, - TMP_HOST_TYPE, - TMP_HOST_ARCH, - TMP_HOST_IMAGE_NAME, - TMP_HOST_IMAGE_ID, - TMP_HOST_IMAGE_VERSION, - TMP_K8S_CLUSTER_NAME, - TMP_K8S_NODE_NAME, - TMP_K8S_NODE_UID, - TMP_K8S_NAMESPACE_NAME, - TMP_K8S_POD_UID, - TMP_K8S_POD_NAME, - TMP_K8S_CONTAINER_NAME, - TMP_K8S_REPLICASET_UID, - TMP_K8S_REPLICASET_NAME, - TMP_K8S_DEPLOYMENT_UID, - TMP_K8S_DEPLOYMENT_NAME, - TMP_K8S_STATEFULSET_UID, - TMP_K8S_STATEFULSET_NAME, - TMP_K8S_DAEMONSET_UID, - TMP_K8S_DAEMONSET_NAME, - TMP_K8S_JOB_UID, - TMP_K8S_JOB_NAME, - TMP_K8S_CRONJOB_UID, - TMP_K8S_CRONJOB_NAME, - TMP_OS_TYPE, - TMP_OS_DESCRIPTION, - TMP_OS_NAME, - TMP_OS_VERSION, - TMP_PROCESS_PID, - TMP_PROCESS_EXECUTABLE_NAME, - TMP_PROCESS_EXECUTABLE_PATH, - TMP_PROCESS_COMMAND, - TMP_PROCESS_COMMAND_LINE, - TMP_PROCESS_COMMAND_ARGS, - TMP_PROCESS_OWNER, - TMP_PROCESS_RUNTIME_NAME, - TMP_PROCESS_RUNTIME_VERSION, - TMP_PROCESS_RUNTIME_DESCRIPTION, - TMP_SERVICE_NAME, - TMP_SERVICE_NAMESPACE, - TMP_SERVICE_INSTANCE_ID, - TMP_SERVICE_VERSION, - TMP_TELEMETRY_SDK_NAME, - TMP_TELEMETRY_SDK_LANGUAGE, - TMP_TELEMETRY_SDK_VERSION, - TMP_TELEMETRY_AUTO_VERSION, - TMP_WEBENGINE_NAME, - TMP_WEBENGINE_VERSION, - TMP_WEBENGINE_DESCRIPTION - ]); - TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; - TMP_CLOUDPROVIDERVALUES_AWS = "aws"; - TMP_CLOUDPROVIDERVALUES_AZURE = "azure"; - TMP_CLOUDPROVIDERVALUES_GCP = "gcp"; - CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; - CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; - CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; - CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; - CloudProviderValues = /* @__PURE__ */ createConstMap([ - TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, - TMP_CLOUDPROVIDERVALUES_AWS, - TMP_CLOUDPROVIDERVALUES_AZURE, - TMP_CLOUDPROVIDERVALUES_GCP - ]); - TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"; - TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = "alibaba_cloud_fc"; - TMP_CLOUDPLATFORMVALUES_AWS_EC2 = "aws_ec2"; - TMP_CLOUDPLATFORMVALUES_AWS_ECS = "aws_ecs"; - TMP_CLOUDPLATFORMVALUES_AWS_EKS = "aws_eks"; - TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA = "aws_lambda"; - TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"; - TMP_CLOUDPLATFORMVALUES_AZURE_VM = "azure_vm"; - TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = "azure_container_instances"; - TMP_CLOUDPLATFORMVALUES_AZURE_AKS = "azure_aks"; - TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = "azure_functions"; - TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = "azure_app_service"; - TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = "gcp_compute_engine"; - TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = "gcp_cloud_run"; - TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine"; - TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions"; - TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE = "gcp_app_engine"; - CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS; - CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC; - CLOUDPLATFORMVALUES_AWS_EC2 = TMP_CLOUDPLATFORMVALUES_AWS_EC2; - CLOUDPLATFORMVALUES_AWS_ECS = TMP_CLOUDPLATFORMVALUES_AWS_ECS; - CLOUDPLATFORMVALUES_AWS_EKS = TMP_CLOUDPLATFORMVALUES_AWS_EKS; - CLOUDPLATFORMVALUES_AWS_LAMBDA = TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA; - CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK; - CLOUDPLATFORMVALUES_AZURE_VM = TMP_CLOUDPLATFORMVALUES_AZURE_VM; - CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES; - CLOUDPLATFORMVALUES_AZURE_AKS = TMP_CLOUDPLATFORMVALUES_AZURE_AKS; - CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS; - CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE; - CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE; - CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN; - CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE; - CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS; - CLOUDPLATFORMVALUES_GCP_APP_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE; - CloudPlatformValues = /* @__PURE__ */ createConstMap([ - TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, - TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, - TMP_CLOUDPLATFORMVALUES_AWS_EC2, - TMP_CLOUDPLATFORMVALUES_AWS_ECS, - TMP_CLOUDPLATFORMVALUES_AWS_EKS, - TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, - TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, - TMP_CLOUDPLATFORMVALUES_AZURE_VM, - TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, - TMP_CLOUDPLATFORMVALUES_AZURE_AKS, - TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, - TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, - TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, - TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, - TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, - TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, - TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE - ]); - TMP_AWSECSLAUNCHTYPEVALUES_EC2 = "ec2"; - TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = "fargate"; - AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; - AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; - AwsEcsLaunchtypeValues = /* @__PURE__ */ createConstMap([TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE]); - TMP_HOSTARCHVALUES_AMD64 = "amd64"; - TMP_HOSTARCHVALUES_ARM32 = "arm32"; - TMP_HOSTARCHVALUES_ARM64 = "arm64"; - TMP_HOSTARCHVALUES_IA64 = "ia64"; - TMP_HOSTARCHVALUES_PPC32 = "ppc32"; - TMP_HOSTARCHVALUES_PPC64 = "ppc64"; - TMP_HOSTARCHVALUES_X86 = "x86"; - HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; - HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; - HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; - HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; - HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; - HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; - HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; - HostArchValues = /* @__PURE__ */ createConstMap([ - TMP_HOSTARCHVALUES_AMD64, - TMP_HOSTARCHVALUES_ARM32, - TMP_HOSTARCHVALUES_ARM64, - TMP_HOSTARCHVALUES_IA64, - TMP_HOSTARCHVALUES_PPC32, - TMP_HOSTARCHVALUES_PPC64, - TMP_HOSTARCHVALUES_X86 - ]); - TMP_OSTYPEVALUES_WINDOWS = "windows"; - TMP_OSTYPEVALUES_LINUX = "linux"; - TMP_OSTYPEVALUES_DARWIN = "darwin"; - TMP_OSTYPEVALUES_FREEBSD = "freebsd"; - TMP_OSTYPEVALUES_NETBSD = "netbsd"; - TMP_OSTYPEVALUES_OPENBSD = "openbsd"; - TMP_OSTYPEVALUES_DRAGONFLYBSD = "dragonflybsd"; - TMP_OSTYPEVALUES_HPUX = "hpux"; - TMP_OSTYPEVALUES_AIX = "aix"; - TMP_OSTYPEVALUES_SOLARIS = "solaris"; - TMP_OSTYPEVALUES_Z_OS = "z_os"; - OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; - OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; - OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; - OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; - OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; - OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; - OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; - OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; - OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; - OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; - OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; - OsTypeValues = /* @__PURE__ */ createConstMap([ - TMP_OSTYPEVALUES_WINDOWS, - TMP_OSTYPEVALUES_LINUX, - TMP_OSTYPEVALUES_DARWIN, - TMP_OSTYPEVALUES_FREEBSD, - TMP_OSTYPEVALUES_NETBSD, - TMP_OSTYPEVALUES_OPENBSD, - TMP_OSTYPEVALUES_DRAGONFLYBSD, - TMP_OSTYPEVALUES_HPUX, - TMP_OSTYPEVALUES_AIX, - TMP_OSTYPEVALUES_SOLARIS, - TMP_OSTYPEVALUES_Z_OS - ]); - TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = "cpp"; - TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = "dotnet"; - TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = "erlang"; - TMP_TELEMETRYSDKLANGUAGEVALUES_GO = "go"; - TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = "java"; - TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = "nodejs"; - TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = "php"; - TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = "python"; - TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = "ruby"; - TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = "webjs"; - TELEMETRYSDKLANGUAGEVALUES_CPP = TMP_TELEMETRYSDKLANGUAGEVALUES_CPP; - TELEMETRYSDKLANGUAGEVALUES_DOTNET = TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET; - TELEMETRYSDKLANGUAGEVALUES_ERLANG = TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG; - TELEMETRYSDKLANGUAGEVALUES_GO = TMP_TELEMETRYSDKLANGUAGEVALUES_GO; - TELEMETRYSDKLANGUAGEVALUES_JAVA = TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA; - TELEMETRYSDKLANGUAGEVALUES_NODEJS = TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS; - TELEMETRYSDKLANGUAGEVALUES_PHP = TMP_TELEMETRYSDKLANGUAGEVALUES_PHP; - TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; - TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; - TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; - TelemetrySdkLanguageValues = /* @__PURE__ */ createConstMap([ - TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, - TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, - TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, - TMP_TELEMETRYSDKLANGUAGEVALUES_GO, - TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, - TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, - TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, - TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, - TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, - TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS - ]); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js -var init_resource = __esmMin((() => { - init_SemanticResourceAttributes(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js -var ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED, ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE, ATTR_ASPNETCORE_RATE_LIMITING_POLICY, ATTR_ASPNETCORE_RATE_LIMITING_RESULT, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED, ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED, ATTR_ASPNETCORE_ROUTING_IS_FALLBACK, ATTR_ASPNETCORE_ROUTING_MATCH_STATUS, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS, ATTR_ASPNETCORE_USER_IS_AUTHENTICATED, ATTR_CLIENT_ADDRESS, ATTR_CLIENT_PORT, ATTR_CODE_COLUMN_NUMBER, ATTR_CODE_FILE_PATH, ATTR_CODE_FUNCTION_NAME, ATTR_CODE_LINE_NUMBER, ATTR_CODE_STACKTRACE, ATTR_DB_COLLECTION_NAME, ATTR_DB_NAMESPACE, ATTR_DB_OPERATION_BATCH_SIZE, ATTR_DB_OPERATION_NAME, ATTR_DB_QUERY_SUMMARY, ATTR_DB_QUERY_TEXT, ATTR_DB_RESPONSE_STATUS_CODE, ATTR_DB_STORED_PROCEDURE_NAME, ATTR_DB_SYSTEM_NAME, DB_SYSTEM_NAME_VALUE_MARIADB, DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER, DB_SYSTEM_NAME_VALUE_MYSQL, DB_SYSTEM_NAME_VALUE_POSTGRESQL, ATTR_DEPLOYMENT_ENVIRONMENT_NAME, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST, ATTR_DOTNET_GC_HEAP_GENERATION, DOTNET_GC_HEAP_GENERATION_VALUE_GEN0, DOTNET_GC_HEAP_GENERATION_VALUE_GEN1, DOTNET_GC_HEAP_GENERATION_VALUE_GEN2, DOTNET_GC_HEAP_GENERATION_VALUE_LOH, DOTNET_GC_HEAP_GENERATION_VALUE_POH, ATTR_ERROR_TYPE, ERROR_TYPE_VALUE_OTHER, ATTR_EXCEPTION_ESCAPED, ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, HTTP_REQUEST_METHOD_VALUE_OTHER, HTTP_REQUEST_METHOD_VALUE_CONNECT, HTTP_REQUEST_METHOD_VALUE_DELETE, HTTP_REQUEST_METHOD_VALUE_GET, HTTP_REQUEST_METHOD_VALUE_HEAD, HTTP_REQUEST_METHOD_VALUE_OPTIONS, HTTP_REQUEST_METHOD_VALUE_PATCH, HTTP_REQUEST_METHOD_VALUE_POST, HTTP_REQUEST_METHOD_VALUE_PUT, HTTP_REQUEST_METHOD_VALUE_TRACE, ATTR_HTTP_REQUEST_METHOD_ORIGINAL, ATTR_HTTP_REQUEST_RESEND_COUNT, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_JVM_GC_ACTION, ATTR_JVM_GC_NAME, ATTR_JVM_MEMORY_POOL_NAME, ATTR_JVM_MEMORY_TYPE, JVM_MEMORY_TYPE_VALUE_HEAP, JVM_MEMORY_TYPE_VALUE_NON_HEAP, ATTR_JVM_THREAD_DAEMON, ATTR_JVM_THREAD_STATE, JVM_THREAD_STATE_VALUE_BLOCKED, JVM_THREAD_STATE_VALUE_NEW, JVM_THREAD_STATE_VALUE_RUNNABLE, JVM_THREAD_STATE_VALUE_TERMINATED, JVM_THREAD_STATE_VALUE_TIMED_WAITING, JVM_THREAD_STATE_VALUE_WAITING, ATTR_NETWORK_LOCAL_ADDRESS, ATTR_NETWORK_LOCAL_PORT, ATTR_NETWORK_PEER_ADDRESS, ATTR_NETWORK_PEER_PORT, ATTR_NETWORK_PROTOCOL_NAME, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_NETWORK_TRANSPORT, NETWORK_TRANSPORT_VALUE_PIPE, NETWORK_TRANSPORT_VALUE_QUIC, NETWORK_TRANSPORT_VALUE_TCP, NETWORK_TRANSPORT_VALUE_UDP, NETWORK_TRANSPORT_VALUE_UNIX, ATTR_NETWORK_TYPE, NETWORK_TYPE_VALUE_IPV4, NETWORK_TYPE_VALUE_IPV6, ATTR_OTEL_EVENT_NAME, ATTR_OTEL_SCOPE_NAME, ATTR_OTEL_SCOPE_VERSION, ATTR_OTEL_STATUS_CODE, OTEL_STATUS_CODE_VALUE_ERROR, OTEL_STATUS_CODE_VALUE_OK, ATTR_OTEL_STATUS_DESCRIPTION, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_SERVICE_INSTANCE_ID, ATTR_SERVICE_NAME, ATTR_SERVICE_NAMESPACE, ATTR_SERVICE_VERSION, ATTR_SIGNALR_CONNECTION_STATUS, SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN, SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE, SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT, ATTR_SIGNALR_TRANSPORT, SIGNALR_TRANSPORT_VALUE_LONG_POLLING, SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS, SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, ATTR_TELEMETRY_DISTRO_NAME, ATTR_TELEMETRY_DISTRO_VERSION, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_CPP, TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET, TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG, TELEMETRY_SDK_LANGUAGE_VALUE_GO, TELEMETRY_SDK_LANGUAGE_VALUE_JAVA, TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, TELEMETRY_SDK_LANGUAGE_VALUE_PHP, TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON, TELEMETRY_SDK_LANGUAGE_VALUE_RUBY, TELEMETRY_SDK_LANGUAGE_VALUE_RUST, TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, ATTR_URL_FRAGMENT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_QUERY, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL; -var init_stable_attributes = __esmMin((() => { - ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result"; - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; - ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type"; - ATTR_ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy"; - ATTR_ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result"; - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; - ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled"; - ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback"; - ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status"; - ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; - ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; - ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = "aspnetcore.user.is_authenticated"; - ATTR_CLIENT_ADDRESS = "client.address"; - ATTR_CLIENT_PORT = "client.port"; - ATTR_CODE_COLUMN_NUMBER = "code.column.number"; - ATTR_CODE_FILE_PATH = "code.file.path"; - ATTR_CODE_FUNCTION_NAME = "code.function.name"; - ATTR_CODE_LINE_NUMBER = "code.line.number"; - ATTR_CODE_STACKTRACE = "code.stacktrace"; - ATTR_DB_COLLECTION_NAME = "db.collection.name"; - ATTR_DB_NAMESPACE = "db.namespace"; - ATTR_DB_OPERATION_BATCH_SIZE = "db.operation.batch.size"; - ATTR_DB_OPERATION_NAME = "db.operation.name"; - ATTR_DB_QUERY_SUMMARY = "db.query.summary"; - ATTR_DB_QUERY_TEXT = "db.query.text"; - ATTR_DB_RESPONSE_STATUS_CODE = "db.response.status_code"; - ATTR_DB_STORED_PROCEDURE_NAME = "db.stored_procedure.name"; - ATTR_DB_SYSTEM_NAME = "db.system.name"; - DB_SYSTEM_NAME_VALUE_MARIADB = "mariadb"; - DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = "microsoft.sql_server"; - DB_SYSTEM_NAME_VALUE_MYSQL = "mysql"; - DB_SYSTEM_NAME_VALUE_POSTGRESQL = "postgresql"; - ATTR_DEPLOYMENT_ENVIRONMENT_NAME = "deployment.environment.name"; - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = "development"; - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = "production"; - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = "staging"; - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = "test"; - ATTR_DOTNET_GC_HEAP_GENERATION = "dotnet.gc.heap.generation"; - DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = "gen0"; - DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = "gen1"; - DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = "gen2"; - DOTNET_GC_HEAP_GENERATION_VALUE_LOH = "loh"; - DOTNET_GC_HEAP_GENERATION_VALUE_POH = "poh"; - ATTR_ERROR_TYPE = "error.type"; - ERROR_TYPE_VALUE_OTHER = "_OTHER"; - ATTR_EXCEPTION_ESCAPED = "exception.escaped"; - ATTR_EXCEPTION_MESSAGE = "exception.message"; - ATTR_EXCEPTION_STACKTRACE = "exception.stacktrace"; - ATTR_EXCEPTION_TYPE = "exception.type"; - ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; - ATTR_HTTP_REQUEST_METHOD = "http.request.method"; - HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; - HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; - HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; - HTTP_REQUEST_METHOD_VALUE_GET = "GET"; - HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; - HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; - HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; - HTTP_REQUEST_METHOD_VALUE_POST = "POST"; - HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; - HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; - ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original"; - ATTR_HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count"; - ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; - ATTR_HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; - ATTR_HTTP_ROUTE = "http.route"; - ATTR_JVM_GC_ACTION = "jvm.gc.action"; - ATTR_JVM_GC_NAME = "jvm.gc.name"; - ATTR_JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name"; - ATTR_JVM_MEMORY_TYPE = "jvm.memory.type"; - JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; - JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; - ATTR_JVM_THREAD_DAEMON = "jvm.thread.daemon"; - ATTR_JVM_THREAD_STATE = "jvm.thread.state"; - JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; - JVM_THREAD_STATE_VALUE_NEW = "new"; - JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; - JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; - JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; - JVM_THREAD_STATE_VALUE_WAITING = "waiting"; - ATTR_NETWORK_LOCAL_ADDRESS = "network.local.address"; - ATTR_NETWORK_LOCAL_PORT = "network.local.port"; - ATTR_NETWORK_PEER_ADDRESS = "network.peer.address"; - ATTR_NETWORK_PEER_PORT = "network.peer.port"; - ATTR_NETWORK_PROTOCOL_NAME = "network.protocol.name"; - ATTR_NETWORK_PROTOCOL_VERSION = "network.protocol.version"; - ATTR_NETWORK_TRANSPORT = "network.transport"; - NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; - NETWORK_TRANSPORT_VALUE_QUIC = "quic"; - NETWORK_TRANSPORT_VALUE_TCP = "tcp"; - NETWORK_TRANSPORT_VALUE_UDP = "udp"; - NETWORK_TRANSPORT_VALUE_UNIX = "unix"; - ATTR_NETWORK_TYPE = "network.type"; - NETWORK_TYPE_VALUE_IPV4 = "ipv4"; - NETWORK_TYPE_VALUE_IPV6 = "ipv6"; - ATTR_OTEL_EVENT_NAME = "otel.event.name"; - ATTR_OTEL_SCOPE_NAME = "otel.scope.name"; - ATTR_OTEL_SCOPE_VERSION = "otel.scope.version"; - ATTR_OTEL_STATUS_CODE = "otel.status_code"; - OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; - OTEL_STATUS_CODE_VALUE_OK = "OK"; - ATTR_OTEL_STATUS_DESCRIPTION = "otel.status_description"; - ATTR_SERVER_ADDRESS = "server.address"; - ATTR_SERVER_PORT = "server.port"; - ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; - ATTR_SERVICE_NAME = "service.name"; - ATTR_SERVICE_NAMESPACE = "service.namespace"; - ATTR_SERVICE_VERSION = "service.version"; - ATTR_SIGNALR_CONNECTION_STATUS = "signalr.connection.status"; - SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; - SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; - SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; - ATTR_SIGNALR_TRANSPORT = "signalr.transport"; - SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; - SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; - SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; - ATTR_TELEMETRY_DISTRO_NAME = "telemetry.distro.name"; - ATTR_TELEMETRY_DISTRO_VERSION = "telemetry.distro.version"; - ATTR_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; - TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; - TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; - TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; - TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; - TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; - TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; - TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; - TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; - TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; - TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; - TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; - TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; - ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; - ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; - ATTR_URL_FRAGMENT = "url.fragment"; - ATTR_URL_FULL = "url.full"; - ATTR_URL_PATH = "url.path"; - ATTR_URL_QUERY = "url.query"; - ATTR_URL_SCHEME = "url.scheme"; - ATTR_USER_AGENT_ORIGINAL = "user_agent.original"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js -var METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS, METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES, METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS, METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE, METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION, METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS, METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS, METRIC_DB_CLIENT_OPERATION_DURATION, METRIC_DOTNET_ASSEMBLY_COUNT, METRIC_DOTNET_EXCEPTIONS, METRIC_DOTNET_GC_COLLECTIONS, METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED, METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE, METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE, METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE, METRIC_DOTNET_GC_PAUSE_TIME, METRIC_DOTNET_JIT_COMPILATION_TIME, METRIC_DOTNET_JIT_COMPILED_IL_SIZE, METRIC_DOTNET_JIT_COMPILED_METHODS, METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS, METRIC_DOTNET_PROCESS_CPU_COUNT, METRIC_DOTNET_PROCESS_CPU_TIME, METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET, METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH, METRIC_DOTNET_THREAD_POOL_THREAD_COUNT, METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT, METRIC_DOTNET_TIMER_COUNT, METRIC_HTTP_CLIENT_REQUEST_DURATION, METRIC_HTTP_SERVER_REQUEST_DURATION, METRIC_JVM_CLASS_COUNT, METRIC_JVM_CLASS_LOADED, METRIC_JVM_CLASS_UNLOADED, METRIC_JVM_CPU_COUNT, METRIC_JVM_CPU_RECENT_UTILIZATION, METRIC_JVM_CPU_TIME, METRIC_JVM_GC_DURATION, METRIC_JVM_MEMORY_COMMITTED, METRIC_JVM_MEMORY_LIMIT, METRIC_JVM_MEMORY_USED, METRIC_JVM_MEMORY_USED_AFTER_LAST_GC, METRIC_JVM_THREAD_COUNT, METRIC_KESTREL_ACTIVE_CONNECTIONS, METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES, METRIC_KESTREL_CONNECTION_DURATION, METRIC_KESTREL_QUEUED_CONNECTIONS, METRIC_KESTREL_QUEUED_REQUESTS, METRIC_KESTREL_REJECTED_CONNECTIONS, METRIC_KESTREL_TLS_HANDSHAKE_DURATION, METRIC_KESTREL_UPGRADED_CONNECTIONS, METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS, METRIC_SIGNALR_SERVER_CONNECTION_DURATION; -var init_stable_metrics = __esmMin((() => { - METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = "aspnetcore.diagnostics.exceptions"; - METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = "aspnetcore.rate_limiting.active_request_leases"; - METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = "aspnetcore.rate_limiting.queued_requests"; - METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = "aspnetcore.rate_limiting.request.time_in_queue"; - METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = "aspnetcore.rate_limiting.request_lease.duration"; - METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = "aspnetcore.rate_limiting.requests"; - METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = "aspnetcore.routing.match_attempts"; - METRIC_DB_CLIENT_OPERATION_DURATION = "db.client.operation.duration"; - METRIC_DOTNET_ASSEMBLY_COUNT = "dotnet.assembly.count"; - METRIC_DOTNET_EXCEPTIONS = "dotnet.exceptions"; - METRIC_DOTNET_GC_COLLECTIONS = "dotnet.gc.collections"; - METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = "dotnet.gc.heap.total_allocated"; - METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = "dotnet.gc.last_collection.heap.fragmentation.size"; - METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = "dotnet.gc.last_collection.heap.size"; - METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = "dotnet.gc.last_collection.memory.committed_size"; - METRIC_DOTNET_GC_PAUSE_TIME = "dotnet.gc.pause.time"; - METRIC_DOTNET_JIT_COMPILATION_TIME = "dotnet.jit.compilation.time"; - METRIC_DOTNET_JIT_COMPILED_IL_SIZE = "dotnet.jit.compiled_il.size"; - METRIC_DOTNET_JIT_COMPILED_METHODS = "dotnet.jit.compiled_methods"; - METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = "dotnet.monitor.lock_contentions"; - METRIC_DOTNET_PROCESS_CPU_COUNT = "dotnet.process.cpu.count"; - METRIC_DOTNET_PROCESS_CPU_TIME = "dotnet.process.cpu.time"; - METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = "dotnet.process.memory.working_set"; - METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = "dotnet.thread_pool.queue.length"; - METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = "dotnet.thread_pool.thread.count"; - METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = "dotnet.thread_pool.work_item.count"; - METRIC_DOTNET_TIMER_COUNT = "dotnet.timer.count"; - METRIC_HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration"; - METRIC_HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration"; - METRIC_JVM_CLASS_COUNT = "jvm.class.count"; - METRIC_JVM_CLASS_LOADED = "jvm.class.loaded"; - METRIC_JVM_CLASS_UNLOADED = "jvm.class.unloaded"; - METRIC_JVM_CPU_COUNT = "jvm.cpu.count"; - METRIC_JVM_CPU_RECENT_UTILIZATION = "jvm.cpu.recent_utilization"; - METRIC_JVM_CPU_TIME = "jvm.cpu.time"; - METRIC_JVM_GC_DURATION = "jvm.gc.duration"; - METRIC_JVM_MEMORY_COMMITTED = "jvm.memory.committed"; - METRIC_JVM_MEMORY_LIMIT = "jvm.memory.limit"; - METRIC_JVM_MEMORY_USED = "jvm.memory.used"; - METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = "jvm.memory.used_after_last_gc"; - METRIC_JVM_THREAD_COUNT = "jvm.thread.count"; - METRIC_KESTREL_ACTIVE_CONNECTIONS = "kestrel.active_connections"; - METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = "kestrel.active_tls_handshakes"; - METRIC_KESTREL_CONNECTION_DURATION = "kestrel.connection.duration"; - METRIC_KESTREL_QUEUED_CONNECTIONS = "kestrel.queued_connections"; - METRIC_KESTREL_QUEUED_REQUESTS = "kestrel.queued_requests"; - METRIC_KESTREL_REJECTED_CONNECTIONS = "kestrel.rejected_connections"; - METRIC_KESTREL_TLS_HANDSHAKE_DURATION = "kestrel.tls_handshake.duration"; - METRIC_KESTREL_UPGRADED_CONNECTIONS = "kestrel.upgraded_connections"; - METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = "signalr.server.active_connections"; - METRIC_SIGNALR_SERVER_CONNECTION_DURATION = "signalr.server.connection.duration"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js -var EVENT_EXCEPTION; -var init_stable_events = __esmMin((() => { - EVENT_EXCEPTION = "exception"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js -var esm_exports$1 = /* @__PURE__ */ __exportAll({ - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED, - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED, - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED, - ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED, - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED, - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER, - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER, - ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED, - ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE: () => ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE, - ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS: () => ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS, - ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT: () => ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT, - ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE: () => ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE, - ATTR_ASPNETCORE_RATE_LIMITING_POLICY: () => ATTR_ASPNETCORE_RATE_LIMITING_POLICY, - ATTR_ASPNETCORE_RATE_LIMITING_RESULT: () => ATTR_ASPNETCORE_RATE_LIMITING_RESULT, - ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED: () => ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED, - ATTR_ASPNETCORE_ROUTING_IS_FALLBACK: () => ATTR_ASPNETCORE_ROUTING_IS_FALLBACK, - ATTR_ASPNETCORE_ROUTING_MATCH_STATUS: () => ATTR_ASPNETCORE_ROUTING_MATCH_STATUS, - ATTR_ASPNETCORE_USER_IS_AUTHENTICATED: () => ATTR_ASPNETCORE_USER_IS_AUTHENTICATED, - ATTR_CLIENT_ADDRESS: () => ATTR_CLIENT_ADDRESS, - ATTR_CLIENT_PORT: () => ATTR_CLIENT_PORT, - ATTR_CODE_COLUMN_NUMBER: () => ATTR_CODE_COLUMN_NUMBER, - ATTR_CODE_FILE_PATH: () => ATTR_CODE_FILE_PATH, - ATTR_CODE_FUNCTION_NAME: () => ATTR_CODE_FUNCTION_NAME, - ATTR_CODE_LINE_NUMBER: () => ATTR_CODE_LINE_NUMBER, - ATTR_CODE_STACKTRACE: () => ATTR_CODE_STACKTRACE, - ATTR_DB_COLLECTION_NAME: () => ATTR_DB_COLLECTION_NAME, - ATTR_DB_NAMESPACE: () => ATTR_DB_NAMESPACE, - ATTR_DB_OPERATION_BATCH_SIZE: () => ATTR_DB_OPERATION_BATCH_SIZE, - ATTR_DB_OPERATION_NAME: () => ATTR_DB_OPERATION_NAME, - ATTR_DB_QUERY_SUMMARY: () => ATTR_DB_QUERY_SUMMARY, - ATTR_DB_QUERY_TEXT: () => ATTR_DB_QUERY_TEXT, - ATTR_DB_RESPONSE_STATUS_CODE: () => ATTR_DB_RESPONSE_STATUS_CODE, - ATTR_DB_STORED_PROCEDURE_NAME: () => ATTR_DB_STORED_PROCEDURE_NAME, - ATTR_DB_SYSTEM_NAME: () => ATTR_DB_SYSTEM_NAME, - ATTR_DEPLOYMENT_ENVIRONMENT_NAME: () => ATTR_DEPLOYMENT_ENVIRONMENT_NAME, - ATTR_DOTNET_GC_HEAP_GENERATION: () => ATTR_DOTNET_GC_HEAP_GENERATION, - ATTR_ERROR_TYPE: () => ATTR_ERROR_TYPE, - ATTR_EXCEPTION_ESCAPED: () => ATTR_EXCEPTION_ESCAPED, - ATTR_EXCEPTION_MESSAGE: () => ATTR_EXCEPTION_MESSAGE, - ATTR_EXCEPTION_STACKTRACE: () => ATTR_EXCEPTION_STACKTRACE, - ATTR_EXCEPTION_TYPE: () => ATTR_EXCEPTION_TYPE, - ATTR_HTTP_REQUEST_HEADER: () => ATTR_HTTP_REQUEST_HEADER, - ATTR_HTTP_REQUEST_METHOD: () => ATTR_HTTP_REQUEST_METHOD, - ATTR_HTTP_REQUEST_METHOD_ORIGINAL: () => ATTR_HTTP_REQUEST_METHOD_ORIGINAL, - ATTR_HTTP_REQUEST_RESEND_COUNT: () => ATTR_HTTP_REQUEST_RESEND_COUNT, - ATTR_HTTP_RESPONSE_HEADER: () => ATTR_HTTP_RESPONSE_HEADER, - ATTR_HTTP_RESPONSE_STATUS_CODE: () => ATTR_HTTP_RESPONSE_STATUS_CODE, - ATTR_HTTP_ROUTE: () => ATTR_HTTP_ROUTE, - ATTR_JVM_GC_ACTION: () => ATTR_JVM_GC_ACTION, - ATTR_JVM_GC_NAME: () => ATTR_JVM_GC_NAME, - ATTR_JVM_MEMORY_POOL_NAME: () => ATTR_JVM_MEMORY_POOL_NAME, - ATTR_JVM_MEMORY_TYPE: () => ATTR_JVM_MEMORY_TYPE, - ATTR_JVM_THREAD_DAEMON: () => ATTR_JVM_THREAD_DAEMON, - ATTR_JVM_THREAD_STATE: () => ATTR_JVM_THREAD_STATE, - ATTR_NETWORK_LOCAL_ADDRESS: () => ATTR_NETWORK_LOCAL_ADDRESS, - ATTR_NETWORK_LOCAL_PORT: () => ATTR_NETWORK_LOCAL_PORT, - ATTR_NETWORK_PEER_ADDRESS: () => ATTR_NETWORK_PEER_ADDRESS, - ATTR_NETWORK_PEER_PORT: () => ATTR_NETWORK_PEER_PORT, - ATTR_NETWORK_PROTOCOL_NAME: () => ATTR_NETWORK_PROTOCOL_NAME, - ATTR_NETWORK_PROTOCOL_VERSION: () => ATTR_NETWORK_PROTOCOL_VERSION, - ATTR_NETWORK_TRANSPORT: () => ATTR_NETWORK_TRANSPORT, - ATTR_NETWORK_TYPE: () => ATTR_NETWORK_TYPE, - ATTR_OTEL_EVENT_NAME: () => ATTR_OTEL_EVENT_NAME, - ATTR_OTEL_SCOPE_NAME: () => ATTR_OTEL_SCOPE_NAME, - ATTR_OTEL_SCOPE_VERSION: () => ATTR_OTEL_SCOPE_VERSION, - ATTR_OTEL_STATUS_CODE: () => ATTR_OTEL_STATUS_CODE, - ATTR_OTEL_STATUS_DESCRIPTION: () => ATTR_OTEL_STATUS_DESCRIPTION, - ATTR_SERVER_ADDRESS: () => ATTR_SERVER_ADDRESS, - ATTR_SERVER_PORT: () => ATTR_SERVER_PORT, - ATTR_SERVICE_INSTANCE_ID: () => ATTR_SERVICE_INSTANCE_ID, - ATTR_SERVICE_NAME: () => ATTR_SERVICE_NAME, - ATTR_SERVICE_NAMESPACE: () => ATTR_SERVICE_NAMESPACE, - ATTR_SERVICE_VERSION: () => ATTR_SERVICE_VERSION, - ATTR_SIGNALR_CONNECTION_STATUS: () => ATTR_SIGNALR_CONNECTION_STATUS, - ATTR_SIGNALR_TRANSPORT: () => ATTR_SIGNALR_TRANSPORT, - ATTR_TELEMETRY_DISTRO_NAME: () => ATTR_TELEMETRY_DISTRO_NAME, - ATTR_TELEMETRY_DISTRO_VERSION: () => ATTR_TELEMETRY_DISTRO_VERSION, - ATTR_TELEMETRY_SDK_LANGUAGE: () => ATTR_TELEMETRY_SDK_LANGUAGE, - ATTR_TELEMETRY_SDK_NAME: () => ATTR_TELEMETRY_SDK_NAME, - ATTR_TELEMETRY_SDK_VERSION: () => ATTR_TELEMETRY_SDK_VERSION, - ATTR_URL_FRAGMENT: () => ATTR_URL_FRAGMENT, - ATTR_URL_FULL: () => ATTR_URL_FULL, - ATTR_URL_PATH: () => ATTR_URL_PATH, - ATTR_URL_QUERY: () => ATTR_URL_QUERY, - ATTR_URL_SCHEME: () => ATTR_URL_SCHEME, - ATTR_USER_AGENT_ORIGINAL: () => ATTR_USER_AGENT_ORIGINAL, - AWSECSLAUNCHTYPEVALUES_EC2: () => AWSECSLAUNCHTYPEVALUES_EC2, - AWSECSLAUNCHTYPEVALUES_FARGATE: () => AWSECSLAUNCHTYPEVALUES_FARGATE, - AwsEcsLaunchtypeValues: () => AwsEcsLaunchtypeValues, - CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS: () => CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, - CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC: () => CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, - CLOUDPLATFORMVALUES_AWS_EC2: () => CLOUDPLATFORMVALUES_AWS_EC2, - CLOUDPLATFORMVALUES_AWS_ECS: () => CLOUDPLATFORMVALUES_AWS_ECS, - CLOUDPLATFORMVALUES_AWS_EKS: () => CLOUDPLATFORMVALUES_AWS_EKS, - CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK: () => CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, - CLOUDPLATFORMVALUES_AWS_LAMBDA: () => CLOUDPLATFORMVALUES_AWS_LAMBDA, - CLOUDPLATFORMVALUES_AZURE_AKS: () => CLOUDPLATFORMVALUES_AZURE_AKS, - CLOUDPLATFORMVALUES_AZURE_APP_SERVICE: () => CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, - CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES: () => CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, - CLOUDPLATFORMVALUES_AZURE_FUNCTIONS: () => CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, - CLOUDPLATFORMVALUES_AZURE_VM: () => CLOUDPLATFORMVALUES_AZURE_VM, - CLOUDPLATFORMVALUES_GCP_APP_ENGINE: () => CLOUDPLATFORMVALUES_GCP_APP_ENGINE, - CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS: () => CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, - CLOUDPLATFORMVALUES_GCP_CLOUD_RUN: () => CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, - CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE: () => CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, - CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE: () => CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, - CLOUDPROVIDERVALUES_ALIBABA_CLOUD: () => CLOUDPROVIDERVALUES_ALIBABA_CLOUD, - CLOUDPROVIDERVALUES_AWS: () => CLOUDPROVIDERVALUES_AWS, - CLOUDPROVIDERVALUES_AZURE: () => CLOUDPROVIDERVALUES_AZURE, - CLOUDPROVIDERVALUES_GCP: () => CLOUDPROVIDERVALUES_GCP, - CloudPlatformValues: () => CloudPlatformValues, - CloudProviderValues: () => CloudProviderValues, - DBCASSANDRACONSISTENCYLEVELVALUES_ALL: () => DBCASSANDRACONSISTENCYLEVELVALUES_ALL, - DBCASSANDRACONSISTENCYLEVELVALUES_ANY: () => DBCASSANDRACONSISTENCYLEVELVALUES_ANY, - DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, - DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, - DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, - DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, - DBCASSANDRACONSISTENCYLEVELVALUES_ONE: () => DBCASSANDRACONSISTENCYLEVELVALUES_ONE, - DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, - DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL: () => DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, - DBCASSANDRACONSISTENCYLEVELVALUES_THREE: () => DBCASSANDRACONSISTENCYLEVELVALUES_THREE, - DBCASSANDRACONSISTENCYLEVELVALUES_TWO: () => DBCASSANDRACONSISTENCYLEVELVALUES_TWO, - DBSYSTEMVALUES_ADABAS: () => DBSYSTEMVALUES_ADABAS, - DBSYSTEMVALUES_CACHE: () => DBSYSTEMVALUES_CACHE, - DBSYSTEMVALUES_CASSANDRA: () => DBSYSTEMVALUES_CASSANDRA, - DBSYSTEMVALUES_CLOUDSCAPE: () => DBSYSTEMVALUES_CLOUDSCAPE, - DBSYSTEMVALUES_COCKROACHDB: () => DBSYSTEMVALUES_COCKROACHDB, - DBSYSTEMVALUES_COLDFUSION: () => DBSYSTEMVALUES_COLDFUSION, - DBSYSTEMVALUES_COSMOSDB: () => DBSYSTEMVALUES_COSMOSDB, - DBSYSTEMVALUES_COUCHBASE: () => DBSYSTEMVALUES_COUCHBASE, - DBSYSTEMVALUES_COUCHDB: () => DBSYSTEMVALUES_COUCHDB, - DBSYSTEMVALUES_DB2: () => DBSYSTEMVALUES_DB2, - DBSYSTEMVALUES_DERBY: () => DBSYSTEMVALUES_DERBY, - DBSYSTEMVALUES_DYNAMODB: () => DBSYSTEMVALUES_DYNAMODB, - DBSYSTEMVALUES_EDB: () => DBSYSTEMVALUES_EDB, - DBSYSTEMVALUES_ELASTICSEARCH: () => DBSYSTEMVALUES_ELASTICSEARCH, - DBSYSTEMVALUES_FILEMAKER: () => DBSYSTEMVALUES_FILEMAKER, - DBSYSTEMVALUES_FIREBIRD: () => DBSYSTEMVALUES_FIREBIRD, - DBSYSTEMVALUES_FIRSTSQL: () => DBSYSTEMVALUES_FIRSTSQL, - DBSYSTEMVALUES_GEODE: () => DBSYSTEMVALUES_GEODE, - DBSYSTEMVALUES_H2: () => DBSYSTEMVALUES_H2, - DBSYSTEMVALUES_HANADB: () => DBSYSTEMVALUES_HANADB, - DBSYSTEMVALUES_HBASE: () => DBSYSTEMVALUES_HBASE, - DBSYSTEMVALUES_HIVE: () => DBSYSTEMVALUES_HIVE, - DBSYSTEMVALUES_HSQLDB: () => DBSYSTEMVALUES_HSQLDB, - DBSYSTEMVALUES_INFORMIX: () => DBSYSTEMVALUES_INFORMIX, - DBSYSTEMVALUES_INGRES: () => DBSYSTEMVALUES_INGRES, - DBSYSTEMVALUES_INSTANTDB: () => DBSYSTEMVALUES_INSTANTDB, - DBSYSTEMVALUES_INTERBASE: () => DBSYSTEMVALUES_INTERBASE, - DBSYSTEMVALUES_MARIADB: () => DBSYSTEMVALUES_MARIADB, - DBSYSTEMVALUES_MAXDB: () => DBSYSTEMVALUES_MAXDB, - DBSYSTEMVALUES_MEMCACHED: () => DBSYSTEMVALUES_MEMCACHED, - DBSYSTEMVALUES_MONGODB: () => DBSYSTEMVALUES_MONGODB, - DBSYSTEMVALUES_MSSQL: () => DBSYSTEMVALUES_MSSQL, - DBSYSTEMVALUES_MYSQL: () => DBSYSTEMVALUES_MYSQL, - DBSYSTEMVALUES_NEO4J: () => DBSYSTEMVALUES_NEO4J, - DBSYSTEMVALUES_NETEZZA: () => DBSYSTEMVALUES_NETEZZA, - DBSYSTEMVALUES_ORACLE: () => DBSYSTEMVALUES_ORACLE, - DBSYSTEMVALUES_OTHER_SQL: () => DBSYSTEMVALUES_OTHER_SQL, - DBSYSTEMVALUES_PERVASIVE: () => DBSYSTEMVALUES_PERVASIVE, - DBSYSTEMVALUES_POINTBASE: () => DBSYSTEMVALUES_POINTBASE, - DBSYSTEMVALUES_POSTGRESQL: () => DBSYSTEMVALUES_POSTGRESQL, - DBSYSTEMVALUES_PROGRESS: () => DBSYSTEMVALUES_PROGRESS, - DBSYSTEMVALUES_REDIS: () => DBSYSTEMVALUES_REDIS, - DBSYSTEMVALUES_REDSHIFT: () => DBSYSTEMVALUES_REDSHIFT, - DBSYSTEMVALUES_SQLITE: () => DBSYSTEMVALUES_SQLITE, - DBSYSTEMVALUES_SYBASE: () => DBSYSTEMVALUES_SYBASE, - DBSYSTEMVALUES_TERADATA: () => DBSYSTEMVALUES_TERADATA, - DBSYSTEMVALUES_VERTICA: () => DBSYSTEMVALUES_VERTICA, - DB_SYSTEM_NAME_VALUE_MARIADB: () => DB_SYSTEM_NAME_VALUE_MARIADB, - DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER: () => DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER, - DB_SYSTEM_NAME_VALUE_MYSQL: () => DB_SYSTEM_NAME_VALUE_MYSQL, - DB_SYSTEM_NAME_VALUE_POSTGRESQL: () => DB_SYSTEM_NAME_VALUE_POSTGRESQL, - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT, - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION, - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING, - DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST, - DOTNET_GC_HEAP_GENERATION_VALUE_GEN0: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN0, - DOTNET_GC_HEAP_GENERATION_VALUE_GEN1: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN1, - DOTNET_GC_HEAP_GENERATION_VALUE_GEN2: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN2, - DOTNET_GC_HEAP_GENERATION_VALUE_LOH: () => DOTNET_GC_HEAP_GENERATION_VALUE_LOH, - DOTNET_GC_HEAP_GENERATION_VALUE_POH: () => DOTNET_GC_HEAP_GENERATION_VALUE_POH, - DbCassandraConsistencyLevelValues: () => DbCassandraConsistencyLevelValues, - DbSystemValues: () => DbSystemValues, - ERROR_TYPE_VALUE_OTHER: () => ERROR_TYPE_VALUE_OTHER, - EVENT_EXCEPTION: () => EVENT_EXCEPTION, - FAASDOCUMENTOPERATIONVALUES_DELETE: () => FAASDOCUMENTOPERATIONVALUES_DELETE, - FAASDOCUMENTOPERATIONVALUES_EDIT: () => FAASDOCUMENTOPERATIONVALUES_EDIT, - FAASDOCUMENTOPERATIONVALUES_INSERT: () => FAASDOCUMENTOPERATIONVALUES_INSERT, - FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD: () => FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, - FAASINVOKEDPROVIDERVALUES_AWS: () => FAASINVOKEDPROVIDERVALUES_AWS, - FAASINVOKEDPROVIDERVALUES_AZURE: () => FAASINVOKEDPROVIDERVALUES_AZURE, - FAASINVOKEDPROVIDERVALUES_GCP: () => FAASINVOKEDPROVIDERVALUES_GCP, - FAASTRIGGERVALUES_DATASOURCE: () => FAASTRIGGERVALUES_DATASOURCE, - FAASTRIGGERVALUES_HTTP: () => FAASTRIGGERVALUES_HTTP, - FAASTRIGGERVALUES_OTHER: () => FAASTRIGGERVALUES_OTHER, - FAASTRIGGERVALUES_PUBSUB: () => FAASTRIGGERVALUES_PUBSUB, - FAASTRIGGERVALUES_TIMER: () => FAASTRIGGERVALUES_TIMER, - FaasDocumentOperationValues: () => FaasDocumentOperationValues, - FaasInvokedProviderValues: () => FaasInvokedProviderValues, - FaasTriggerValues: () => FaasTriggerValues, - HOSTARCHVALUES_AMD64: () => HOSTARCHVALUES_AMD64, - HOSTARCHVALUES_ARM32: () => HOSTARCHVALUES_ARM32, - HOSTARCHVALUES_ARM64: () => HOSTARCHVALUES_ARM64, - HOSTARCHVALUES_IA64: () => HOSTARCHVALUES_IA64, - HOSTARCHVALUES_PPC32: () => HOSTARCHVALUES_PPC32, - HOSTARCHVALUES_PPC64: () => HOSTARCHVALUES_PPC64, - HOSTARCHVALUES_X86: () => HOSTARCHVALUES_X86, - HTTPFLAVORVALUES_HTTP_1_0: () => HTTPFLAVORVALUES_HTTP_1_0, - HTTPFLAVORVALUES_HTTP_1_1: () => HTTPFLAVORVALUES_HTTP_1_1, - HTTPFLAVORVALUES_HTTP_2_0: () => HTTPFLAVORVALUES_HTTP_2_0, - HTTPFLAVORVALUES_QUIC: () => HTTPFLAVORVALUES_QUIC, - HTTPFLAVORVALUES_SPDY: () => HTTPFLAVORVALUES_SPDY, - HTTP_REQUEST_METHOD_VALUE_CONNECT: () => HTTP_REQUEST_METHOD_VALUE_CONNECT, - HTTP_REQUEST_METHOD_VALUE_DELETE: () => HTTP_REQUEST_METHOD_VALUE_DELETE, - HTTP_REQUEST_METHOD_VALUE_GET: () => HTTP_REQUEST_METHOD_VALUE_GET, - HTTP_REQUEST_METHOD_VALUE_HEAD: () => HTTP_REQUEST_METHOD_VALUE_HEAD, - HTTP_REQUEST_METHOD_VALUE_OPTIONS: () => HTTP_REQUEST_METHOD_VALUE_OPTIONS, - HTTP_REQUEST_METHOD_VALUE_OTHER: () => HTTP_REQUEST_METHOD_VALUE_OTHER, - HTTP_REQUEST_METHOD_VALUE_PATCH: () => HTTP_REQUEST_METHOD_VALUE_PATCH, - HTTP_REQUEST_METHOD_VALUE_POST: () => HTTP_REQUEST_METHOD_VALUE_POST, - HTTP_REQUEST_METHOD_VALUE_PUT: () => HTTP_REQUEST_METHOD_VALUE_PUT, - HTTP_REQUEST_METHOD_VALUE_TRACE: () => HTTP_REQUEST_METHOD_VALUE_TRACE, - HostArchValues: () => HostArchValues, - HttpFlavorValues: () => HttpFlavorValues, - JVM_MEMORY_TYPE_VALUE_HEAP: () => JVM_MEMORY_TYPE_VALUE_HEAP, - JVM_MEMORY_TYPE_VALUE_NON_HEAP: () => JVM_MEMORY_TYPE_VALUE_NON_HEAP, - JVM_THREAD_STATE_VALUE_BLOCKED: () => JVM_THREAD_STATE_VALUE_BLOCKED, - JVM_THREAD_STATE_VALUE_NEW: () => JVM_THREAD_STATE_VALUE_NEW, - JVM_THREAD_STATE_VALUE_RUNNABLE: () => JVM_THREAD_STATE_VALUE_RUNNABLE, - JVM_THREAD_STATE_VALUE_TERMINATED: () => JVM_THREAD_STATE_VALUE_TERMINATED, - JVM_THREAD_STATE_VALUE_TIMED_WAITING: () => JVM_THREAD_STATE_VALUE_TIMED_WAITING, - JVM_THREAD_STATE_VALUE_WAITING: () => JVM_THREAD_STATE_VALUE_WAITING, - MESSAGETYPEVALUES_RECEIVED: () => MESSAGETYPEVALUES_RECEIVED, - MESSAGETYPEVALUES_SENT: () => MESSAGETYPEVALUES_SENT, - MESSAGINGDESTINATIONKINDVALUES_QUEUE: () => MESSAGINGDESTINATIONKINDVALUES_QUEUE, - MESSAGINGDESTINATIONKINDVALUES_TOPIC: () => MESSAGINGDESTINATIONKINDVALUES_TOPIC, - MESSAGINGOPERATIONVALUES_PROCESS: () => MESSAGINGOPERATIONVALUES_PROCESS, - MESSAGINGOPERATIONVALUES_RECEIVE: () => MESSAGINGOPERATIONVALUES_RECEIVE, - METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS: () => METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS, - METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES: () => METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES, - METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS: () => METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS, - METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS, - METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION, - METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE, - METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS: () => METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS, - METRIC_DB_CLIENT_OPERATION_DURATION: () => METRIC_DB_CLIENT_OPERATION_DURATION, - METRIC_DOTNET_ASSEMBLY_COUNT: () => METRIC_DOTNET_ASSEMBLY_COUNT, - METRIC_DOTNET_EXCEPTIONS: () => METRIC_DOTNET_EXCEPTIONS, - METRIC_DOTNET_GC_COLLECTIONS: () => METRIC_DOTNET_GC_COLLECTIONS, - METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED: () => METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED, - METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE, - METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE, - METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE, - METRIC_DOTNET_GC_PAUSE_TIME: () => METRIC_DOTNET_GC_PAUSE_TIME, - METRIC_DOTNET_JIT_COMPILATION_TIME: () => METRIC_DOTNET_JIT_COMPILATION_TIME, - METRIC_DOTNET_JIT_COMPILED_IL_SIZE: () => METRIC_DOTNET_JIT_COMPILED_IL_SIZE, - METRIC_DOTNET_JIT_COMPILED_METHODS: () => METRIC_DOTNET_JIT_COMPILED_METHODS, - METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS: () => METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS, - METRIC_DOTNET_PROCESS_CPU_COUNT: () => METRIC_DOTNET_PROCESS_CPU_COUNT, - METRIC_DOTNET_PROCESS_CPU_TIME: () => METRIC_DOTNET_PROCESS_CPU_TIME, - METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET: () => METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET, - METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH: () => METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH, - METRIC_DOTNET_THREAD_POOL_THREAD_COUNT: () => METRIC_DOTNET_THREAD_POOL_THREAD_COUNT, - METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT: () => METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT, - METRIC_DOTNET_TIMER_COUNT: () => METRIC_DOTNET_TIMER_COUNT, - METRIC_HTTP_CLIENT_REQUEST_DURATION: () => METRIC_HTTP_CLIENT_REQUEST_DURATION, - METRIC_HTTP_SERVER_REQUEST_DURATION: () => METRIC_HTTP_SERVER_REQUEST_DURATION, - METRIC_JVM_CLASS_COUNT: () => METRIC_JVM_CLASS_COUNT, - METRIC_JVM_CLASS_LOADED: () => METRIC_JVM_CLASS_LOADED, - METRIC_JVM_CLASS_UNLOADED: () => METRIC_JVM_CLASS_UNLOADED, - METRIC_JVM_CPU_COUNT: () => METRIC_JVM_CPU_COUNT, - METRIC_JVM_CPU_RECENT_UTILIZATION: () => METRIC_JVM_CPU_RECENT_UTILIZATION, - METRIC_JVM_CPU_TIME: () => METRIC_JVM_CPU_TIME, - METRIC_JVM_GC_DURATION: () => METRIC_JVM_GC_DURATION, - METRIC_JVM_MEMORY_COMMITTED: () => METRIC_JVM_MEMORY_COMMITTED, - METRIC_JVM_MEMORY_LIMIT: () => METRIC_JVM_MEMORY_LIMIT, - METRIC_JVM_MEMORY_USED: () => METRIC_JVM_MEMORY_USED, - METRIC_JVM_MEMORY_USED_AFTER_LAST_GC: () => METRIC_JVM_MEMORY_USED_AFTER_LAST_GC, - METRIC_JVM_THREAD_COUNT: () => METRIC_JVM_THREAD_COUNT, - METRIC_KESTREL_ACTIVE_CONNECTIONS: () => METRIC_KESTREL_ACTIVE_CONNECTIONS, - METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES: () => METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES, - METRIC_KESTREL_CONNECTION_DURATION: () => METRIC_KESTREL_CONNECTION_DURATION, - METRIC_KESTREL_QUEUED_CONNECTIONS: () => METRIC_KESTREL_QUEUED_CONNECTIONS, - METRIC_KESTREL_QUEUED_REQUESTS: () => METRIC_KESTREL_QUEUED_REQUESTS, - METRIC_KESTREL_REJECTED_CONNECTIONS: () => METRIC_KESTREL_REJECTED_CONNECTIONS, - METRIC_KESTREL_TLS_HANDSHAKE_DURATION: () => METRIC_KESTREL_TLS_HANDSHAKE_DURATION, - METRIC_KESTREL_UPGRADED_CONNECTIONS: () => METRIC_KESTREL_UPGRADED_CONNECTIONS, - METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS: () => METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS, - METRIC_SIGNALR_SERVER_CONNECTION_DURATION: () => METRIC_SIGNALR_SERVER_CONNECTION_DURATION, - MessageTypeValues: () => MessageTypeValues, - MessagingDestinationKindValues: () => MessagingDestinationKindValues, - MessagingOperationValues: () => MessagingOperationValues, - NETHOSTCONNECTIONSUBTYPEVALUES_CDMA: () => NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, - NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT: () => NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, - NETHOSTCONNECTIONSUBTYPEVALUES_EDGE: () => NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, - NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD: () => NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, - NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, - NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, - NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, - NETHOSTCONNECTIONSUBTYPEVALUES_GPRS: () => NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, - NETHOSTCONNECTIONSUBTYPEVALUES_GSM: () => NETHOSTCONNECTIONSUBTYPEVALUES_GSM, - NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, - NETHOSTCONNECTIONSUBTYPEVALUES_HSPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, - NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, - NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, - NETHOSTCONNECTIONSUBTYPEVALUES_IDEN: () => NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, - NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN: () => NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, - NETHOSTCONNECTIONSUBTYPEVALUES_LTE: () => NETHOSTCONNECTIONSUBTYPEVALUES_LTE, - NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA: () => NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, - NETHOSTCONNECTIONSUBTYPEVALUES_NR: () => NETHOSTCONNECTIONSUBTYPEVALUES_NR, - NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA: () => NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, - NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA: () => NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, - NETHOSTCONNECTIONSUBTYPEVALUES_UMTS: () => NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, - NETHOSTCONNECTIONTYPEVALUES_CELL: () => NETHOSTCONNECTIONTYPEVALUES_CELL, - NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE: () => NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, - NETHOSTCONNECTIONTYPEVALUES_UNKNOWN: () => NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, - NETHOSTCONNECTIONTYPEVALUES_WIFI: () => NETHOSTCONNECTIONTYPEVALUES_WIFI, - NETHOSTCONNECTIONTYPEVALUES_WIRED: () => NETHOSTCONNECTIONTYPEVALUES_WIRED, - NETTRANSPORTVALUES_INPROC: () => NETTRANSPORTVALUES_INPROC, - NETTRANSPORTVALUES_IP: () => NETTRANSPORTVALUES_IP, - NETTRANSPORTVALUES_IP_TCP: () => NETTRANSPORTVALUES_IP_TCP, - NETTRANSPORTVALUES_IP_UDP: () => NETTRANSPORTVALUES_IP_UDP, - NETTRANSPORTVALUES_OTHER: () => NETTRANSPORTVALUES_OTHER, - NETTRANSPORTVALUES_PIPE: () => NETTRANSPORTVALUES_PIPE, - NETTRANSPORTVALUES_UNIX: () => NETTRANSPORTVALUES_UNIX, - NETWORK_TRANSPORT_VALUE_PIPE: () => NETWORK_TRANSPORT_VALUE_PIPE, - NETWORK_TRANSPORT_VALUE_QUIC: () => NETWORK_TRANSPORT_VALUE_QUIC, - NETWORK_TRANSPORT_VALUE_TCP: () => NETWORK_TRANSPORT_VALUE_TCP, - NETWORK_TRANSPORT_VALUE_UDP: () => NETWORK_TRANSPORT_VALUE_UDP, - NETWORK_TRANSPORT_VALUE_UNIX: () => NETWORK_TRANSPORT_VALUE_UNIX, - NETWORK_TYPE_VALUE_IPV4: () => NETWORK_TYPE_VALUE_IPV4, - NETWORK_TYPE_VALUE_IPV6: () => NETWORK_TYPE_VALUE_IPV6, - NetHostConnectionSubtypeValues: () => NetHostConnectionSubtypeValues, - NetHostConnectionTypeValues: () => NetHostConnectionTypeValues, - NetTransportValues: () => NetTransportValues, - OSTYPEVALUES_AIX: () => OSTYPEVALUES_AIX, - OSTYPEVALUES_DARWIN: () => OSTYPEVALUES_DARWIN, - OSTYPEVALUES_DRAGONFLYBSD: () => OSTYPEVALUES_DRAGONFLYBSD, - OSTYPEVALUES_FREEBSD: () => OSTYPEVALUES_FREEBSD, - OSTYPEVALUES_HPUX: () => OSTYPEVALUES_HPUX, - OSTYPEVALUES_LINUX: () => OSTYPEVALUES_LINUX, - OSTYPEVALUES_NETBSD: () => OSTYPEVALUES_NETBSD, - OSTYPEVALUES_OPENBSD: () => OSTYPEVALUES_OPENBSD, - OSTYPEVALUES_SOLARIS: () => OSTYPEVALUES_SOLARIS, - OSTYPEVALUES_WINDOWS: () => OSTYPEVALUES_WINDOWS, - OSTYPEVALUES_Z_OS: () => OSTYPEVALUES_Z_OS, - OTEL_STATUS_CODE_VALUE_ERROR: () => OTEL_STATUS_CODE_VALUE_ERROR, - OTEL_STATUS_CODE_VALUE_OK: () => OTEL_STATUS_CODE_VALUE_OK, - OsTypeValues: () => OsTypeValues, - RPCGRPCSTATUSCODEVALUES_ABORTED: () => RPCGRPCSTATUSCODEVALUES_ABORTED, - RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS: () => RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, - RPCGRPCSTATUSCODEVALUES_CANCELLED: () => RPCGRPCSTATUSCODEVALUES_CANCELLED, - RPCGRPCSTATUSCODEVALUES_DATA_LOSS: () => RPCGRPCSTATUSCODEVALUES_DATA_LOSS, - RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED: () => RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, - RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION: () => RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, - RPCGRPCSTATUSCODEVALUES_INTERNAL: () => RPCGRPCSTATUSCODEVALUES_INTERNAL, - RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT: () => RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, - RPCGRPCSTATUSCODEVALUES_NOT_FOUND: () => RPCGRPCSTATUSCODEVALUES_NOT_FOUND, - RPCGRPCSTATUSCODEVALUES_OK: () => RPCGRPCSTATUSCODEVALUES_OK, - RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE: () => RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, - RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED: () => RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, - RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED: () => RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, - RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED: () => RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, - RPCGRPCSTATUSCODEVALUES_UNAVAILABLE: () => RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, - RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED: () => RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, - RPCGRPCSTATUSCODEVALUES_UNKNOWN: () => RPCGRPCSTATUSCODEVALUES_UNKNOWN, - RpcGrpcStatusCodeValues: () => RpcGrpcStatusCodeValues, - SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET, - SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, - SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ: () => SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ, - SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY, - SEMATTRS_AWS_DYNAMODB_COUNT: () => SEMATTRS_AWS_DYNAMODB_COUNT, - SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE: () => SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, - SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: () => SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, - SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: () => SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, - SEMATTRS_AWS_DYNAMODB_INDEX_NAME: () => SEMATTRS_AWS_DYNAMODB_INDEX_NAME, - SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS: () => SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, - SEMATTRS_AWS_DYNAMODB_LIMIT: () => SEMATTRS_AWS_DYNAMODB_LIMIT, - SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: () => SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, - SEMATTRS_AWS_DYNAMODB_PROJECTION: () => SEMATTRS_AWS_DYNAMODB_PROJECTION, - SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, - SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, - SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT: () => SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT, - SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD: () => SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD, - SEMATTRS_AWS_DYNAMODB_SEGMENT: () => SEMATTRS_AWS_DYNAMODB_SEGMENT, - SEMATTRS_AWS_DYNAMODB_SELECT: () => SEMATTRS_AWS_DYNAMODB_SELECT, - SEMATTRS_AWS_DYNAMODB_TABLE_COUNT: () => SEMATTRS_AWS_DYNAMODB_TABLE_COUNT, - SEMATTRS_AWS_DYNAMODB_TABLE_NAMES: () => SEMATTRS_AWS_DYNAMODB_TABLE_NAMES, - SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS: () => SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS, - SEMATTRS_AWS_LAMBDA_INVOKED_ARN: () => SEMATTRS_AWS_LAMBDA_INVOKED_ARN, - SEMATTRS_CODE_FILEPATH: () => SEMATTRS_CODE_FILEPATH, - SEMATTRS_CODE_FUNCTION: () => SEMATTRS_CODE_FUNCTION, - SEMATTRS_CODE_LINENO: () => SEMATTRS_CODE_LINENO, - SEMATTRS_CODE_NAMESPACE: () => SEMATTRS_CODE_NAMESPACE, - SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL: () => SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL, - SEMATTRS_DB_CASSANDRA_COORDINATOR_DC: () => SEMATTRS_DB_CASSANDRA_COORDINATOR_DC, - SEMATTRS_DB_CASSANDRA_COORDINATOR_ID: () => SEMATTRS_DB_CASSANDRA_COORDINATOR_ID, - SEMATTRS_DB_CASSANDRA_IDEMPOTENCE: () => SEMATTRS_DB_CASSANDRA_IDEMPOTENCE, - SEMATTRS_DB_CASSANDRA_KEYSPACE: () => SEMATTRS_DB_CASSANDRA_KEYSPACE, - SEMATTRS_DB_CASSANDRA_PAGE_SIZE: () => SEMATTRS_DB_CASSANDRA_PAGE_SIZE, - SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: () => SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, - SEMATTRS_DB_CASSANDRA_TABLE: () => SEMATTRS_DB_CASSANDRA_TABLE, - SEMATTRS_DB_CONNECTION_STRING: () => SEMATTRS_DB_CONNECTION_STRING, - SEMATTRS_DB_HBASE_NAMESPACE: () => SEMATTRS_DB_HBASE_NAMESPACE, - SEMATTRS_DB_JDBC_DRIVER_CLASSNAME: () => SEMATTRS_DB_JDBC_DRIVER_CLASSNAME, - SEMATTRS_DB_MONGODB_COLLECTION: () => SEMATTRS_DB_MONGODB_COLLECTION, - SEMATTRS_DB_MSSQL_INSTANCE_NAME: () => SEMATTRS_DB_MSSQL_INSTANCE_NAME, - SEMATTRS_DB_NAME: () => SEMATTRS_DB_NAME, - SEMATTRS_DB_OPERATION: () => SEMATTRS_DB_OPERATION, - SEMATTRS_DB_REDIS_DATABASE_INDEX: () => SEMATTRS_DB_REDIS_DATABASE_INDEX, - SEMATTRS_DB_SQL_TABLE: () => SEMATTRS_DB_SQL_TABLE, - SEMATTRS_DB_STATEMENT: () => SEMATTRS_DB_STATEMENT, - SEMATTRS_DB_SYSTEM: () => SEMATTRS_DB_SYSTEM, - SEMATTRS_DB_USER: () => SEMATTRS_DB_USER, - SEMATTRS_ENDUSER_ID: () => SEMATTRS_ENDUSER_ID, - SEMATTRS_ENDUSER_ROLE: () => SEMATTRS_ENDUSER_ROLE, - SEMATTRS_ENDUSER_SCOPE: () => SEMATTRS_ENDUSER_SCOPE, - SEMATTRS_EXCEPTION_ESCAPED: () => SEMATTRS_EXCEPTION_ESCAPED, - SEMATTRS_EXCEPTION_MESSAGE: () => SEMATTRS_EXCEPTION_MESSAGE, - SEMATTRS_EXCEPTION_STACKTRACE: () => SEMATTRS_EXCEPTION_STACKTRACE, - SEMATTRS_EXCEPTION_TYPE: () => SEMATTRS_EXCEPTION_TYPE, - SEMATTRS_FAAS_COLDSTART: () => SEMATTRS_FAAS_COLDSTART, - SEMATTRS_FAAS_CRON: () => SEMATTRS_FAAS_CRON, - SEMATTRS_FAAS_DOCUMENT_COLLECTION: () => SEMATTRS_FAAS_DOCUMENT_COLLECTION, - SEMATTRS_FAAS_DOCUMENT_NAME: () => SEMATTRS_FAAS_DOCUMENT_NAME, - SEMATTRS_FAAS_DOCUMENT_OPERATION: () => SEMATTRS_FAAS_DOCUMENT_OPERATION, - SEMATTRS_FAAS_DOCUMENT_TIME: () => SEMATTRS_FAAS_DOCUMENT_TIME, - SEMATTRS_FAAS_EXECUTION: () => SEMATTRS_FAAS_EXECUTION, - SEMATTRS_FAAS_INVOKED_NAME: () => SEMATTRS_FAAS_INVOKED_NAME, - SEMATTRS_FAAS_INVOKED_PROVIDER: () => SEMATTRS_FAAS_INVOKED_PROVIDER, - SEMATTRS_FAAS_INVOKED_REGION: () => SEMATTRS_FAAS_INVOKED_REGION, - SEMATTRS_FAAS_TIME: () => SEMATTRS_FAAS_TIME, - SEMATTRS_FAAS_TRIGGER: () => SEMATTRS_FAAS_TRIGGER, - SEMATTRS_HTTP_CLIENT_IP: () => SEMATTRS_HTTP_CLIENT_IP, - SEMATTRS_HTTP_FLAVOR: () => SEMATTRS_HTTP_FLAVOR, - SEMATTRS_HTTP_HOST: () => SEMATTRS_HTTP_HOST, - SEMATTRS_HTTP_METHOD: () => SEMATTRS_HTTP_METHOD, - SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH: () => SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH, - SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: () => SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, - SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH: () => SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, - SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: () => SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, - SEMATTRS_HTTP_ROUTE: () => SEMATTRS_HTTP_ROUTE, - SEMATTRS_HTTP_SCHEME: () => SEMATTRS_HTTP_SCHEME, - SEMATTRS_HTTP_SERVER_NAME: () => SEMATTRS_HTTP_SERVER_NAME, - SEMATTRS_HTTP_STATUS_CODE: () => SEMATTRS_HTTP_STATUS_CODE, - SEMATTRS_HTTP_TARGET: () => SEMATTRS_HTTP_TARGET, - SEMATTRS_HTTP_URL: () => SEMATTRS_HTTP_URL, - SEMATTRS_HTTP_USER_AGENT: () => SEMATTRS_HTTP_USER_AGENT, - SEMATTRS_MESSAGE_COMPRESSED_SIZE: () => SEMATTRS_MESSAGE_COMPRESSED_SIZE, - SEMATTRS_MESSAGE_ID: () => SEMATTRS_MESSAGE_ID, - SEMATTRS_MESSAGE_TYPE: () => SEMATTRS_MESSAGE_TYPE, - SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE: () => SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE, - SEMATTRS_MESSAGING_CONSUMER_ID: () => SEMATTRS_MESSAGING_CONSUMER_ID, - SEMATTRS_MESSAGING_CONVERSATION_ID: () => SEMATTRS_MESSAGING_CONVERSATION_ID, - SEMATTRS_MESSAGING_DESTINATION: () => SEMATTRS_MESSAGING_DESTINATION, - SEMATTRS_MESSAGING_DESTINATION_KIND: () => SEMATTRS_MESSAGING_DESTINATION_KIND, - SEMATTRS_MESSAGING_KAFKA_CLIENT_ID: () => SEMATTRS_MESSAGING_KAFKA_CLIENT_ID, - SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP: () => SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP, - SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY: () => SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY, - SEMATTRS_MESSAGING_KAFKA_PARTITION: () => SEMATTRS_MESSAGING_KAFKA_PARTITION, - SEMATTRS_MESSAGING_KAFKA_TOMBSTONE: () => SEMATTRS_MESSAGING_KAFKA_TOMBSTONE, - SEMATTRS_MESSAGING_MESSAGE_ID: () => SEMATTRS_MESSAGING_MESSAGE_ID, - SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: () => SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, - SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: () => SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, - SEMATTRS_MESSAGING_OPERATION: () => SEMATTRS_MESSAGING_OPERATION, - SEMATTRS_MESSAGING_PROTOCOL: () => SEMATTRS_MESSAGING_PROTOCOL, - SEMATTRS_MESSAGING_PROTOCOL_VERSION: () => SEMATTRS_MESSAGING_PROTOCOL_VERSION, - SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY: () => SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY, - SEMATTRS_MESSAGING_SYSTEM: () => SEMATTRS_MESSAGING_SYSTEM, - SEMATTRS_MESSAGING_TEMP_DESTINATION: () => SEMATTRS_MESSAGING_TEMP_DESTINATION, - SEMATTRS_MESSAGING_URL: () => SEMATTRS_MESSAGING_URL, - SEMATTRS_NET_HOST_CARRIER_ICC: () => SEMATTRS_NET_HOST_CARRIER_ICC, - SEMATTRS_NET_HOST_CARRIER_MCC: () => SEMATTRS_NET_HOST_CARRIER_MCC, - SEMATTRS_NET_HOST_CARRIER_MNC: () => SEMATTRS_NET_HOST_CARRIER_MNC, - SEMATTRS_NET_HOST_CARRIER_NAME: () => SEMATTRS_NET_HOST_CARRIER_NAME, - SEMATTRS_NET_HOST_CONNECTION_SUBTYPE: () => SEMATTRS_NET_HOST_CONNECTION_SUBTYPE, - SEMATTRS_NET_HOST_CONNECTION_TYPE: () => SEMATTRS_NET_HOST_CONNECTION_TYPE, - SEMATTRS_NET_HOST_IP: () => SEMATTRS_NET_HOST_IP, - SEMATTRS_NET_HOST_NAME: () => SEMATTRS_NET_HOST_NAME, - SEMATTRS_NET_HOST_PORT: () => SEMATTRS_NET_HOST_PORT, - SEMATTRS_NET_PEER_IP: () => SEMATTRS_NET_PEER_IP, - SEMATTRS_NET_PEER_NAME: () => SEMATTRS_NET_PEER_NAME, - SEMATTRS_NET_PEER_PORT: () => SEMATTRS_NET_PEER_PORT, - SEMATTRS_NET_TRANSPORT: () => SEMATTRS_NET_TRANSPORT, - SEMATTRS_PEER_SERVICE: () => SEMATTRS_PEER_SERVICE, - SEMATTRS_RPC_GRPC_STATUS_CODE: () => SEMATTRS_RPC_GRPC_STATUS_CODE, - SEMATTRS_RPC_JSONRPC_ERROR_CODE: () => SEMATTRS_RPC_JSONRPC_ERROR_CODE, - SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE: () => SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE, - SEMATTRS_RPC_JSONRPC_REQUEST_ID: () => SEMATTRS_RPC_JSONRPC_REQUEST_ID, - SEMATTRS_RPC_JSONRPC_VERSION: () => SEMATTRS_RPC_JSONRPC_VERSION, - SEMATTRS_RPC_METHOD: () => SEMATTRS_RPC_METHOD, - SEMATTRS_RPC_SERVICE: () => SEMATTRS_RPC_SERVICE, - SEMATTRS_RPC_SYSTEM: () => SEMATTRS_RPC_SYSTEM, - SEMATTRS_THREAD_ID: () => SEMATTRS_THREAD_ID, - SEMATTRS_THREAD_NAME: () => SEMATTRS_THREAD_NAME, - SEMRESATTRS_AWS_ECS_CLUSTER_ARN: () => SEMRESATTRS_AWS_ECS_CLUSTER_ARN, - SEMRESATTRS_AWS_ECS_CONTAINER_ARN: () => SEMRESATTRS_AWS_ECS_CONTAINER_ARN, - SEMRESATTRS_AWS_ECS_LAUNCHTYPE: () => SEMRESATTRS_AWS_ECS_LAUNCHTYPE, - SEMRESATTRS_AWS_ECS_TASK_ARN: () => SEMRESATTRS_AWS_ECS_TASK_ARN, - SEMRESATTRS_AWS_ECS_TASK_FAMILY: () => SEMRESATTRS_AWS_ECS_TASK_FAMILY, - SEMRESATTRS_AWS_ECS_TASK_REVISION: () => SEMRESATTRS_AWS_ECS_TASK_REVISION, - SEMRESATTRS_AWS_EKS_CLUSTER_ARN: () => SEMRESATTRS_AWS_EKS_CLUSTER_ARN, - SEMRESATTRS_AWS_LOG_GROUP_ARNS: () => SEMRESATTRS_AWS_LOG_GROUP_ARNS, - SEMRESATTRS_AWS_LOG_GROUP_NAMES: () => SEMRESATTRS_AWS_LOG_GROUP_NAMES, - SEMRESATTRS_AWS_LOG_STREAM_ARNS: () => SEMRESATTRS_AWS_LOG_STREAM_ARNS, - SEMRESATTRS_AWS_LOG_STREAM_NAMES: () => SEMRESATTRS_AWS_LOG_STREAM_NAMES, - SEMRESATTRS_CLOUD_ACCOUNT_ID: () => SEMRESATTRS_CLOUD_ACCOUNT_ID, - SEMRESATTRS_CLOUD_AVAILABILITY_ZONE: () => SEMRESATTRS_CLOUD_AVAILABILITY_ZONE, - SEMRESATTRS_CLOUD_PLATFORM: () => SEMRESATTRS_CLOUD_PLATFORM, - SEMRESATTRS_CLOUD_PROVIDER: () => SEMRESATTRS_CLOUD_PROVIDER, - SEMRESATTRS_CLOUD_REGION: () => SEMRESATTRS_CLOUD_REGION, - SEMRESATTRS_CONTAINER_ID: () => SEMRESATTRS_CONTAINER_ID, - SEMRESATTRS_CONTAINER_IMAGE_NAME: () => SEMRESATTRS_CONTAINER_IMAGE_NAME, - SEMRESATTRS_CONTAINER_IMAGE_TAG: () => SEMRESATTRS_CONTAINER_IMAGE_TAG, - SEMRESATTRS_CONTAINER_NAME: () => SEMRESATTRS_CONTAINER_NAME, - SEMRESATTRS_CONTAINER_RUNTIME: () => SEMRESATTRS_CONTAINER_RUNTIME, - SEMRESATTRS_DEPLOYMENT_ENVIRONMENT: () => SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, - SEMRESATTRS_DEVICE_ID: () => SEMRESATTRS_DEVICE_ID, - SEMRESATTRS_DEVICE_MODEL_IDENTIFIER: () => SEMRESATTRS_DEVICE_MODEL_IDENTIFIER, - SEMRESATTRS_DEVICE_MODEL_NAME: () => SEMRESATTRS_DEVICE_MODEL_NAME, - SEMRESATTRS_FAAS_ID: () => SEMRESATTRS_FAAS_ID, - SEMRESATTRS_FAAS_INSTANCE: () => SEMRESATTRS_FAAS_INSTANCE, - SEMRESATTRS_FAAS_MAX_MEMORY: () => SEMRESATTRS_FAAS_MAX_MEMORY, - SEMRESATTRS_FAAS_NAME: () => SEMRESATTRS_FAAS_NAME, - SEMRESATTRS_FAAS_VERSION: () => SEMRESATTRS_FAAS_VERSION, - SEMRESATTRS_HOST_ARCH: () => SEMRESATTRS_HOST_ARCH, - SEMRESATTRS_HOST_ID: () => SEMRESATTRS_HOST_ID, - SEMRESATTRS_HOST_IMAGE_ID: () => SEMRESATTRS_HOST_IMAGE_ID, - SEMRESATTRS_HOST_IMAGE_NAME: () => SEMRESATTRS_HOST_IMAGE_NAME, - SEMRESATTRS_HOST_IMAGE_VERSION: () => SEMRESATTRS_HOST_IMAGE_VERSION, - SEMRESATTRS_HOST_NAME: () => SEMRESATTRS_HOST_NAME, - SEMRESATTRS_HOST_TYPE: () => SEMRESATTRS_HOST_TYPE, - SEMRESATTRS_K8S_CLUSTER_NAME: () => SEMRESATTRS_K8S_CLUSTER_NAME, - SEMRESATTRS_K8S_CONTAINER_NAME: () => SEMRESATTRS_K8S_CONTAINER_NAME, - SEMRESATTRS_K8S_CRONJOB_NAME: () => SEMRESATTRS_K8S_CRONJOB_NAME, - SEMRESATTRS_K8S_CRONJOB_UID: () => SEMRESATTRS_K8S_CRONJOB_UID, - SEMRESATTRS_K8S_DAEMONSET_NAME: () => SEMRESATTRS_K8S_DAEMONSET_NAME, - SEMRESATTRS_K8S_DAEMONSET_UID: () => SEMRESATTRS_K8S_DAEMONSET_UID, - SEMRESATTRS_K8S_DEPLOYMENT_NAME: () => SEMRESATTRS_K8S_DEPLOYMENT_NAME, - SEMRESATTRS_K8S_DEPLOYMENT_UID: () => SEMRESATTRS_K8S_DEPLOYMENT_UID, - SEMRESATTRS_K8S_JOB_NAME: () => SEMRESATTRS_K8S_JOB_NAME, - SEMRESATTRS_K8S_JOB_UID: () => SEMRESATTRS_K8S_JOB_UID, - SEMRESATTRS_K8S_NAMESPACE_NAME: () => SEMRESATTRS_K8S_NAMESPACE_NAME, - SEMRESATTRS_K8S_NODE_NAME: () => SEMRESATTRS_K8S_NODE_NAME, - SEMRESATTRS_K8S_NODE_UID: () => SEMRESATTRS_K8S_NODE_UID, - SEMRESATTRS_K8S_POD_NAME: () => SEMRESATTRS_K8S_POD_NAME, - SEMRESATTRS_K8S_POD_UID: () => SEMRESATTRS_K8S_POD_UID, - SEMRESATTRS_K8S_REPLICASET_NAME: () => SEMRESATTRS_K8S_REPLICASET_NAME, - SEMRESATTRS_K8S_REPLICASET_UID: () => SEMRESATTRS_K8S_REPLICASET_UID, - SEMRESATTRS_K8S_STATEFULSET_NAME: () => SEMRESATTRS_K8S_STATEFULSET_NAME, - SEMRESATTRS_K8S_STATEFULSET_UID: () => SEMRESATTRS_K8S_STATEFULSET_UID, - SEMRESATTRS_OS_DESCRIPTION: () => SEMRESATTRS_OS_DESCRIPTION, - SEMRESATTRS_OS_NAME: () => SEMRESATTRS_OS_NAME, - SEMRESATTRS_OS_TYPE: () => SEMRESATTRS_OS_TYPE, - SEMRESATTRS_OS_VERSION: () => SEMRESATTRS_OS_VERSION, - SEMRESATTRS_PROCESS_COMMAND: () => SEMRESATTRS_PROCESS_COMMAND, - SEMRESATTRS_PROCESS_COMMAND_ARGS: () => SEMRESATTRS_PROCESS_COMMAND_ARGS, - SEMRESATTRS_PROCESS_COMMAND_LINE: () => SEMRESATTRS_PROCESS_COMMAND_LINE, - SEMRESATTRS_PROCESS_EXECUTABLE_NAME: () => SEMRESATTRS_PROCESS_EXECUTABLE_NAME, - SEMRESATTRS_PROCESS_EXECUTABLE_PATH: () => SEMRESATTRS_PROCESS_EXECUTABLE_PATH, - SEMRESATTRS_PROCESS_OWNER: () => SEMRESATTRS_PROCESS_OWNER, - SEMRESATTRS_PROCESS_PID: () => SEMRESATTRS_PROCESS_PID, - SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION: () => SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, - SEMRESATTRS_PROCESS_RUNTIME_NAME: () => SEMRESATTRS_PROCESS_RUNTIME_NAME, - SEMRESATTRS_PROCESS_RUNTIME_VERSION: () => SEMRESATTRS_PROCESS_RUNTIME_VERSION, - SEMRESATTRS_SERVICE_INSTANCE_ID: () => SEMRESATTRS_SERVICE_INSTANCE_ID, - SEMRESATTRS_SERVICE_NAME: () => SEMRESATTRS_SERVICE_NAME, - SEMRESATTRS_SERVICE_NAMESPACE: () => SEMRESATTRS_SERVICE_NAMESPACE, - SEMRESATTRS_SERVICE_VERSION: () => SEMRESATTRS_SERVICE_VERSION, - SEMRESATTRS_TELEMETRY_AUTO_VERSION: () => SEMRESATTRS_TELEMETRY_AUTO_VERSION, - SEMRESATTRS_TELEMETRY_SDK_LANGUAGE: () => SEMRESATTRS_TELEMETRY_SDK_LANGUAGE, - SEMRESATTRS_TELEMETRY_SDK_NAME: () => SEMRESATTRS_TELEMETRY_SDK_NAME, - SEMRESATTRS_TELEMETRY_SDK_VERSION: () => SEMRESATTRS_TELEMETRY_SDK_VERSION, - SEMRESATTRS_WEBENGINE_DESCRIPTION: () => SEMRESATTRS_WEBENGINE_DESCRIPTION, - SEMRESATTRS_WEBENGINE_NAME: () => SEMRESATTRS_WEBENGINE_NAME, - SEMRESATTRS_WEBENGINE_VERSION: () => SEMRESATTRS_WEBENGINE_VERSION, - SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN: () => SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN, - SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE: () => SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE, - SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT: () => SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT, - SIGNALR_TRANSPORT_VALUE_LONG_POLLING: () => SIGNALR_TRANSPORT_VALUE_LONG_POLLING, - SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS: () => SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS, - SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS: () => SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, - SemanticAttributes: () => SemanticAttributes, - SemanticResourceAttributes: () => SemanticResourceAttributes, - TELEMETRYSDKLANGUAGEVALUES_CPP: () => TELEMETRYSDKLANGUAGEVALUES_CPP, - TELEMETRYSDKLANGUAGEVALUES_DOTNET: () => TELEMETRYSDKLANGUAGEVALUES_DOTNET, - TELEMETRYSDKLANGUAGEVALUES_ERLANG: () => TELEMETRYSDKLANGUAGEVALUES_ERLANG, - TELEMETRYSDKLANGUAGEVALUES_GO: () => TELEMETRYSDKLANGUAGEVALUES_GO, - TELEMETRYSDKLANGUAGEVALUES_JAVA: () => TELEMETRYSDKLANGUAGEVALUES_JAVA, - TELEMETRYSDKLANGUAGEVALUES_NODEJS: () => TELEMETRYSDKLANGUAGEVALUES_NODEJS, - TELEMETRYSDKLANGUAGEVALUES_PHP: () => TELEMETRYSDKLANGUAGEVALUES_PHP, - TELEMETRYSDKLANGUAGEVALUES_PYTHON: () => TELEMETRYSDKLANGUAGEVALUES_PYTHON, - TELEMETRYSDKLANGUAGEVALUES_RUBY: () => TELEMETRYSDKLANGUAGEVALUES_RUBY, - TELEMETRYSDKLANGUAGEVALUES_WEBJS: () => TELEMETRYSDKLANGUAGEVALUES_WEBJS, - TELEMETRY_SDK_LANGUAGE_VALUE_CPP: () => TELEMETRY_SDK_LANGUAGE_VALUE_CPP, - TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET: () => TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET, - TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG: () => TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG, - TELEMETRY_SDK_LANGUAGE_VALUE_GO: () => TELEMETRY_SDK_LANGUAGE_VALUE_GO, - TELEMETRY_SDK_LANGUAGE_VALUE_JAVA: () => TELEMETRY_SDK_LANGUAGE_VALUE_JAVA, - TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS: () => TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, - TELEMETRY_SDK_LANGUAGE_VALUE_PHP: () => TELEMETRY_SDK_LANGUAGE_VALUE_PHP, - TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON: () => TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON, - TELEMETRY_SDK_LANGUAGE_VALUE_RUBY: () => TELEMETRY_SDK_LANGUAGE_VALUE_RUBY, - TELEMETRY_SDK_LANGUAGE_VALUE_RUST: () => TELEMETRY_SDK_LANGUAGE_VALUE_RUST, - TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT: () => TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT, - TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS: () => TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, - TelemetrySdkLanguageValues: () => TelemetrySdkLanguageValues -}); -var init_esm$1 = __esmMin((() => { - init_trace(); - init_resource(); - init_stable_attributes(); - init_stable_metrics(); - init_stable_events(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js -var require_semconv$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ATTR_PROCESS_RUNTIME_NAME = void 0; - /** - * The name of the runtime of this process. - * - * @example OpenJDK Runtime Environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js -var require_sdk_info$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SDK_INFO = void 0; - const version_1 = require_version$3(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const semconv_1 = require_semconv$4(); - /** Constants describing the SDK in use */ - exports.SDK_INFO = { - [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", - [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", - [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, - [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js -var require_node$6 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = void 0; - var environment_1 = require_environment$1(); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return environment_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return environment_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return environment_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return environment_1.getStringListFromEnv; - } - }); - var globalThis_1 = require_globalThis$1(); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return globalThis_1._globalThis; - } - }); - var sdk_info_1 = require_sdk_info$1(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return sdk_info_1.SDK_INFO; - } - }); - /** - * @deprecated Use performance directly. - */ - exports.otperformance = performance; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js -var require_platform$6 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; - var node_1 = require_node$6(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return node_1.SDK_INFO; - } - }); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return node_1._globalThis; - } - }); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return node_1.otperformance; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return node_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return node_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return node_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return node_1.getStringListFromEnv; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/time.js -var require_time$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; - const platform_1 = require_platform$6(); - const NANOSECOND_DIGITS = 9; - const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); - const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); - /** - * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). - * @param epochMillis - */ - function millisToHrTime(epochMillis) { - const epochSeconds = epochMillis / 1e3; - return [Math.trunc(epochSeconds), Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS)]; - } - exports.millisToHrTime = millisToHrTime; - /** - * @deprecated Use `performance.timeOrigin` directly. - */ - function getTimeOrigin() { - return platform_1.otperformance.timeOrigin; - } - exports.getTimeOrigin = getTimeOrigin; - /** - * Returns an hrtime calculated via performance component. - * @param performanceNow - */ - function hrTime(performanceNow) { - return addHrTimes(millisToHrTime(platform_1.otperformance.timeOrigin), millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now())); - } - exports.hrTime = hrTime; - /** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ - function timeInputToHrTime(time$2) { - if (isTimeInputHrTime(time$2)) return time$2; - else if (typeof time$2 === "number") if (time$2 < platform_1.otperformance.timeOrigin) return hrTime(time$2); - else return millisToHrTime(time$2); - else if (time$2 instanceof Date) return millisToHrTime(time$2.getTime()); - else throw TypeError("Invalid input type"); - } - exports.timeInputToHrTime = timeInputToHrTime; - /** - * Returns a duration of two hrTime. - * @param startTime - * @param endTime - */ - function hrTimeDuration(startTime, endTime) { - let seconds = endTime[0] - startTime[0]; - let nanos = endTime[1] - startTime[1]; - if (nanos < 0) { - seconds -= 1; - nanos += SECOND_TO_NANOSECONDS; - } - return [seconds, nanos]; - } - exports.hrTimeDuration = hrTimeDuration; - /** - * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" - * @param time - */ - function hrTimeToTimeStamp(time$2) { - const precision = NANOSECOND_DIGITS; - const tmp = `${"0".repeat(precision)}${time$2[1]}Z`; - const nanoString = tmp.substring(tmp.length - precision - 1); - return (/* @__PURE__ */ new Date(time$2[0] * 1e3)).toISOString().replace("000Z", nanoString); - } - exports.hrTimeToTimeStamp = hrTimeToTimeStamp; - /** - * Convert hrTime to nanoseconds. - * @param time - */ - function hrTimeToNanoseconds(time$2) { - return time$2[0] * SECOND_TO_NANOSECONDS + time$2[1]; - } - exports.hrTimeToNanoseconds = hrTimeToNanoseconds; - /** - * Convert hrTime to milliseconds. - * @param time - */ - function hrTimeToMilliseconds(time$2) { - return time$2[0] * 1e3 + time$2[1] / 1e6; - } - exports.hrTimeToMilliseconds = hrTimeToMilliseconds; - /** - * Convert hrTime to microseconds. - * @param time - */ - function hrTimeToMicroseconds(time$2) { - return time$2[0] * 1e6 + time$2[1] / 1e3; - } - exports.hrTimeToMicroseconds = hrTimeToMicroseconds; - /** - * check if time is HrTime - * @param value - */ - function isTimeInputHrTime(value) { - return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; - } - exports.isTimeInputHrTime = isTimeInputHrTime; - /** - * check if input value is a correct types.TimeInput - * @param value - */ - function isTimeInput(value) { - return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; - } - exports.isTimeInput = isTimeInput; - /** - * Given 2 HrTime formatted times, return their sum as an HrTime. - */ - function addHrTimes(time1, time2) { - const out = [time1[0] + time2[0], time1[1] + time2[1]]; - if (out[1] >= SECOND_TO_NANOSECONDS) { - out[1] -= SECOND_TO_NANOSECONDS; - out[0] += 1; - } - return out; - } - exports.addHrTimes = addHrTimes; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/timer-util.js -var require_timer_util$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.unrefTimer = void 0; - /** - * @deprecated please copy this code to your implementation instead, this function will be removed in the next major version of this package. - * @param timer - */ - function unrefTimer(timer) { - if (typeof timer !== "number") timer.unref(); - } - exports.unrefTimer = unrefTimer; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/ExportResult.js -var require_ExportResult$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExportResultCode = void 0; - (function(ExportResultCode$1) { - ExportResultCode$1[ExportResultCode$1["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode$1[ExportResultCode$1["FAILED"] = 1] = "FAILED"; - })(exports.ExportResultCode || (exports.ExportResultCode = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/propagation/composite.js -var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.CompositePropagator = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - /** Combines multiple propagators into a single propagator. */ - var CompositePropagator = class { - _propagators; - _fields; - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config$1 = {}) { - this._propagators = config$1.propagators ?? []; - const fields = /* @__PURE__ */ new Set(); - for (const propagator of this._propagators) { - const propagatorFields = typeof propagator.fields === "function" ? propagator.fields() : []; - for (const field of propagatorFields) fields.add(field); - } - this._fields = Array.from(fields); - } - /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same carrier key, the propagator later in the list - * will "win". - * - * @param context Context to inject - * @param carrier Carrier into which context will be injected - */ - inject(context$1, carrier, setter) { - for (const propagator of this._propagators) try { - propagator.inject(context$1, carrier, setter); - } catch (err) { - api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); - } - } - /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same context key, the propagator later in the list - * will "win". - * - * @param context Context to add values to - * @param carrier Carrier from which to extract context - */ - extract(context$1, carrier, getter) { - return this._propagators.reduce((ctx, propagator) => { - try { - return propagator.extract(ctx, carrier, getter); - } catch (err) { - api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); - } - return ctx; - }, context$1); - } - fields() { - return this._fields.slice(); - } - }; - exports.CompositePropagator = CompositePropagator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/validators.js -var require_validators$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateValue = exports.validateKey = void 0; - const VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; - const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; - const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; - const VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); - const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; - const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; - /** - * Key is opaque string up to 256 characters printable. It MUST begin with a - * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, - * underscores _, dashes -, asterisks *, and forward slashes /. - * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the - * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. - * see https://www.w3.org/TR/trace-context/#key - */ - function validateKey(key) { - return VALID_KEY_REGEX.test(key); - } - exports.validateKey = validateKey; - /** - * Value is opaque string up to 256 characters printable ASCII RFC0020 - * characters (i.e., the range 0x20 to 0x7E) except comma , and =. - */ - function validateValue(value) { - return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); - } - exports.validateValue = validateValue; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/TraceState.js -var require_TraceState$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TraceState = void 0; - const validators_1 = require_validators$1(); - const MAX_TRACE_STATE_ITEMS = 32; - const MAX_TRACE_STATE_LEN = 512; - const LIST_MEMBERS_SEPARATOR = ","; - const LIST_MEMBER_KEY_VALUE_SPLITTER = "="; - /** - * TraceState must be a class and not a simple object type because of the spec - * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). - * - * Here is the list of allowed mutations: - * - New key-value pair should be added into the beginning of the list - * - The value of any key can be updated. Modified keys MUST be moved to the - * beginning of the list. - */ - var TraceState = class TraceState { - _length; - _rawTraceState; - _internalState; - constructor(rawTraceState) { - this._rawTraceState = typeof rawTraceState === "string" ? rawTraceState : ""; - this._length = this._rawTraceState.length; - } - set(key, value) { - if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) return this; - const currState = this._getState(); - const currValue = currState.get(key); - let newLength = this._length; - if (typeof currValue === "string") newLength += value.length - currValue.length; - else newLength += key.length + value.length + (currState.size > 0 ? 2 : 1); - if (newLength > MAX_TRACE_STATE_LEN) return this; - const newState = new Map(currState); - newState.delete(key); - newState.set(key, value); - return this._fromState(newState, newLength); - } - unset(key) { - const currState = this._getState(); - const currValue = currState.get(key); - if (typeof currValue !== "string") return this; - let newLength = this._length - (key.length + currValue.length + 1); - if (currState.size > 1) newLength = newLength - 1; - const newState = new Map(currState); - newState.delete(key); - return this._fromState(newState, newLength); - } - get(key) { - return this._getState().get(key); - } - serialize() { - let serialized = ""; - let index = 0; - for (const entry of this._getState()) { - if (index > 0) serialized = LIST_MEMBERS_SEPARATOR + serialized; - serialized = `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; - index++; - } - return serialized; - } - _getState() { - if (this._internalState) return this._internalState; - const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR); - const vendorEntries = /* @__PURE__ */ new Map(); - let currentLength = 0; - for (const member of vendorMembers) { - const m = member.trim(); - const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); - if (idx === -1) continue; - const key = m.slice(0, idx); - const value = m.slice(idx + 1); - if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) continue; - const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0); - if (futureLength > MAX_TRACE_STATE_LEN) continue; - vendorEntries.set(key, value); - currentLength = futureLength; - if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) break; - } - this._length = currentLength; - this._internalState = new Map(Array.from(vendorEntries.entries()).reverse()); - return this._internalState; - } - _fromState(state, length) { - const traceState = Object.create(TraceState.prototype); - traceState._internalState = state; - traceState._length = length; - return traceState; - } - }; - exports.TraceState = TraceState; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js -var require_W3CTraceContextPropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing$1(); - const TraceState_1 = require_TraceState$1(); - exports.TRACE_PARENT_HEADER = "traceparent"; - exports.TRACE_STATE_HEADER = "tracestate"; - const VERSION = "00"; - const TRACE_PARENT_REGEX = /* @__PURE__ */ new RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`); - /** - * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} - * @param traceParent - A meta property that comes from server. - * It should be dynamically generated server side to have the server's request trace Id, - * a parent span Id that was set on the server's request span, - * and the trace flags to indicate the server's sampling decision - * (01 = sampled, 00 = not sampled). - * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' - * For more information see {@link https://www.w3.org/TR/trace-context/} - */ - function parseTraceParent(traceParent) { - const match = TRACE_PARENT_REGEX.exec(traceParent); - if (!match) return null; - if (match[1] === "00" && match[5]) return null; - return { - traceId: match[2], - spanId: match[3], - traceFlags: parseInt(match[4], 16) - }; - } - exports.parseTraceParent = parseTraceParent; - /** - * Propagates {@link SpanContext} through Trace Context format propagation. - * - * Based on the Trace Context specification: - * https://www.w3.org/TR/trace-context/ - */ - var W3CTraceContextPropagator = class { - inject(context$1, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context$1); - if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context$1) || !(0, api_1.isSpanContextValid)(spanContext)) return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - extract(context$1, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) return context$1; - const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; - if (typeof traceParent !== "string") return context$1; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) return context$1; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : void 0); - } - return api_1.trace.setSpanContext(context$1, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; - } - }; - exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js -var require_rpc_metadata$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; - const RPC_METADATA_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); - (function(RPCType) { - RPCType["HTTP"] = "http"; - })(exports.RPCType || (exports.RPCType = {})); - function setRPCMetadata(context$1, meta$2) { - return context$1.setValue(RPC_METADATA_KEY, meta$2); - } - exports.setRPCMetadata = setRPCMetadata; - function deleteRPCMetadata(context$1) { - return context$1.deleteValue(RPC_METADATA_KEY); - } - exports.deleteRPCMetadata = deleteRPCMetadata; - function getRPCMetadata(context$1) { - return context$1.getValue(RPC_METADATA_KEY); - } - exports.getRPCMetadata = getRPCMetadata; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js -var require_lodash_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isPlainObject = void 0; - /** - * based on lodash in order to support esm builds without esModuleInterop. - * lodash is using MIT License. - **/ - const objectTag = "[object Object]"; - const nullTag = "[object Null]"; - const undefinedTag = "[object Undefined]"; - const funcToString = Function.prototype.toString; - const objectCtorString = funcToString.call(Object); - const getPrototypeOf = Object.getPrototypeOf; - const objectProto = Object.prototype; - const hasOwnProperty = objectProto.hasOwnProperty; - const symToStringTag = Symbol ? Symbol.toStringTag : void 0; - const nativeObjectToString = objectProto.toString; - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) !== objectTag) return false; - const proto = getPrototypeOf(value); - if (proto === null) return true; - const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; - } - exports.isPlainObject = isPlainObject; - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == "object"; - } - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) return value === void 0 ? undefinedTag : nullTag; - return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); - } - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; - let unmasked = false; - try { - value[symToStringTag] = void 0; - unmasked = true; - } catch {} - const result = nativeObjectToString.call(value); - if (unmasked) if (isOwn) value[symToStringTag] = tag; - else delete value[symToStringTag]; - return result; - } - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/merge.js -var require_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.merge = void 0; - const lodash_merge_1 = require_lodash_merge$1(); - const MAX_LEVEL = 20; - /** - * Merges objects together - * @param args - objects / values to be merged - */ - function merge(...args) { - let result = args.shift(); - const objects = /* @__PURE__ */ new WeakMap(); - while (args.length > 0) result = mergeTwoObjects(result, args.shift(), 0, objects); - return result; - } - exports.merge = merge; - function takeValue(value) { - if (isArray(value)) return value.slice(); - return value; - } - /** - * Merges two objects - * @param one - first object - * @param two - second object - * @param level - current deep level - * @param objects - objects holder that has been already referenced - to prevent - * cyclic dependency - */ - function mergeTwoObjects(one, two, level = 0, objects) { - let result; - if (level > MAX_LEVEL) return; - level++; - if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) result = takeValue(two); - else if (isArray(one)) { - result = one.slice(); - if (isArray(two)) for (let i = 0, j = two.length; i < j; i++) result.push(takeValue(two[i])); - else if (isObject(two)) { - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - if (key === "__proto__" || key === "constructor" || key === "prototype") continue; - result[key] = takeValue(two[key]); - } - } - } else if (isObject(one)) if (isObject(two)) { - if (!shouldMerge(one, two)) return two; - result = Object.assign({}, one); - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - if (key === "__proto__" || key === "constructor" || key === "prototype") continue; - const twoValue = two[key]; - if (isPrimitive(twoValue)) if (typeof twoValue === "undefined") delete result[key]; - else result[key] = twoValue; - else { - const obj1 = result[key]; - const obj2 = twoValue; - if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) delete result[key]; - else { - if (isObject(obj1) && isObject(obj2)) { - const arr1 = objects.get(obj1) || []; - const arr2 = objects.get(obj2) || []; - arr1.push({ - obj: one, - key - }); - arr2.push({ - obj: two, - key - }); - objects.set(obj1, arr1); - objects.set(obj2, arr2); - } - result[key] = mergeTwoObjects(result[key], twoValue, level, objects); - } - } - } - } else result = two; - return result; - } - /** - * Function to check if object has been already reference - * @param obj - * @param key - * @param objects - */ - function wasObjectReferenced(obj, key, objects) { - const arr = objects.get(obj[key]) || []; - for (let i = 0, j = arr.length; i < j; i++) { - const info = arr[i]; - if (info.key === key && info.obj === obj) return true; - } - return false; - } - function isArray(value) { - return Array.isArray(value); - } - function isFunction(value) { - return typeof value === "function"; - } - function isObject(value) { - return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; - } - function isPrimitive(value) { - return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; - } - function shouldMerge(one, two) { - if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) return false; - return true; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/timeout.js -var require_timeout$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.callWithTimeout = exports.TimeoutError = void 0; - /** - * Error that is thrown on timeouts. - */ - var TimeoutError = class TimeoutError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, TimeoutError.prototype); - } - }; - exports.TimeoutError = TimeoutError; - /** - * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise - * rejects, and resolves if the specified promise resolves. - * - *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. - * - * @param promise promise to use with timeout. - * @param timeout the timeout in milliseconds until the returned promise is rejected. - */ - function callWithTimeout(promise, timeout) { - let timeoutHandle; - const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { - timeoutHandle = setTimeout(function timeoutHandler() { - reject(new TimeoutError("Operation timed out.")); - }, timeout); - }); - return Promise.race([promise, timeoutPromise]).then((result) => { - clearTimeout(timeoutHandle); - return result; - }, (reason) => { - clearTimeout(timeoutHandle); - throw reason; - }); - } - exports.callWithTimeout = callWithTimeout; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/url.js -var require_url$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isUrlIgnored = exports.urlMatches = void 0; - function urlMatches(url, urlToMatch) { - if (typeof urlToMatch === "string") return url === urlToMatch; - else return !!url.match(urlToMatch); - } - exports.urlMatches = urlMatches; - /** - * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} - * @param url - * @param ignoredUrls - */ - function isUrlIgnored(url, ignoredUrls) { - if (!ignoredUrls) return false; - for (const ignoreUrl of ignoredUrls) if (urlMatches(url, ignoreUrl)) return true; - return false; - } - exports.isUrlIgnored = isUrlIgnored; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/promise.js -var require_promise$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Deferred = void 0; - var Deferred = class { - _promise; - _resolve; - _reject; - constructor() { - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - } - get promise() { - return this._promise; - } - resolve(val) { - this._resolve(val); - } - reject(err) { - this._reject(err); - } - }; - exports.Deferred = Deferred; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/callback.js -var require_callback$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BindOnceFuture = void 0; - const promise_1 = require_promise$1(); - /** - * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. - */ - var BindOnceFuture = class { - _isCalled = false; - _deferred = new promise_1.Deferred(); - _callback; - _that; - constructor(callback, that) { - this._callback = callback; - this._that = that; - } - get isCalled() { - return this._isCalled; - } - get promise() { - return this._deferred.promise; - } - call(...args) { - if (!this._isCalled) { - this._isCalled = true; - try { - Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); - } catch (err) { - this._deferred.reject(err); - } - } - return this._deferred.promise; - } - }; - exports.BindOnceFuture = BindOnceFuture; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/configuration.js -var require_configuration$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.diagLogLevelFromString = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const logLevelMap = { - ALL: api_1.DiagLogLevel.ALL, - VERBOSE: api_1.DiagLogLevel.VERBOSE, - DEBUG: api_1.DiagLogLevel.DEBUG, - INFO: api_1.DiagLogLevel.INFO, - WARN: api_1.DiagLogLevel.WARN, - ERROR: api_1.DiagLogLevel.ERROR, - NONE: api_1.DiagLogLevel.NONE - }; - /** - * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined. - * @param value - */ - function diagLogLevelFromString(value) { - if (value == null) return; - const resolvedLogLevel = logLevelMap[value.toUpperCase()]; - if (resolvedLogLevel == null) { - api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); - return api_1.DiagLogLevel.INFO; - } - return resolvedLogLevel; - } - exports.diagLogLevelFromString = diagLogLevelFromString; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/exporter.js -var require_exporter$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports._export = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing$1(); - /** - * @internal - * Shared functionality used by Exporters while exporting data, including suppression of Traces. - */ - function _export(exporter, arg) { - return new Promise((resolve) => { - api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, resolve); - }); - }); - } - exports._export = _export; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js -var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; - var W3CBaggagePropagator_1 = require_W3CBaggagePropagator$1(); - Object.defineProperty(exports, "W3CBaggagePropagator", { - enumerable: true, - get: function() { - return W3CBaggagePropagator_1.W3CBaggagePropagator; - } - }); - var anchored_clock_1 = require_anchored_clock$1(); - Object.defineProperty(exports, "AnchoredClock", { - enumerable: true, - get: function() { - return anchored_clock_1.AnchoredClock; - } - }); - var attributes_1 = require_attributes$1(); - Object.defineProperty(exports, "isAttributeValue", { - enumerable: true, - get: function() { - return attributes_1.isAttributeValue; - } - }); - Object.defineProperty(exports, "sanitizeAttributes", { - enumerable: true, - get: function() { - return attributes_1.sanitizeAttributes; - } - }); - var global_error_handler_1 = require_global_error_handler$1(); - Object.defineProperty(exports, "globalErrorHandler", { - enumerable: true, - get: function() { - return global_error_handler_1.globalErrorHandler; - } - }); - Object.defineProperty(exports, "setGlobalErrorHandler", { - enumerable: true, - get: function() { - return global_error_handler_1.setGlobalErrorHandler; - } - }); - var logging_error_handler_1 = require_logging_error_handler$1(); - Object.defineProperty(exports, "loggingErrorHandler", { - enumerable: true, - get: function() { - return logging_error_handler_1.loggingErrorHandler; - } - }); - var time_1 = require_time$1(); - Object.defineProperty(exports, "addHrTimes", { - enumerable: true, - get: function() { - return time_1.addHrTimes; - } - }); - Object.defineProperty(exports, "getTimeOrigin", { - enumerable: true, - get: function() { - return time_1.getTimeOrigin; - } - }); - Object.defineProperty(exports, "hrTime", { - enumerable: true, - get: function() { - return time_1.hrTime; - } - }); - Object.defineProperty(exports, "hrTimeDuration", { - enumerable: true, - get: function() { - return time_1.hrTimeDuration; - } - }); - Object.defineProperty(exports, "hrTimeToMicroseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToMicroseconds; - } - }); - Object.defineProperty(exports, "hrTimeToMilliseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToMilliseconds; - } - }); - Object.defineProperty(exports, "hrTimeToNanoseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToNanoseconds; - } - }); - Object.defineProperty(exports, "hrTimeToTimeStamp", { - enumerable: true, - get: function() { - return time_1.hrTimeToTimeStamp; - } - }); - Object.defineProperty(exports, "isTimeInput", { - enumerable: true, - get: function() { - return time_1.isTimeInput; - } - }); - Object.defineProperty(exports, "isTimeInputHrTime", { - enumerable: true, - get: function() { - return time_1.isTimeInputHrTime; - } - }); - Object.defineProperty(exports, "millisToHrTime", { - enumerable: true, - get: function() { - return time_1.millisToHrTime; - } - }); - Object.defineProperty(exports, "timeInputToHrTime", { - enumerable: true, - get: function() { - return time_1.timeInputToHrTime; - } - }); - var timer_util_1 = require_timer_util$1(); - Object.defineProperty(exports, "unrefTimer", { - enumerable: true, - get: function() { - return timer_util_1.unrefTimer; - } - }); - var ExportResult_1 = require_ExportResult$1(); - Object.defineProperty(exports, "ExportResultCode", { - enumerable: true, - get: function() { - return ExportResult_1.ExportResultCode; - } - }); - var utils_1 = require_utils$7(); - Object.defineProperty(exports, "parseKeyPairsIntoRecord", { - enumerable: true, - get: function() { - return utils_1.parseKeyPairsIntoRecord; - } - }); - var platform_1 = require_platform$6(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return platform_1.SDK_INFO; - } - }); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return platform_1._globalThis; - } - }); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return platform_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return platform_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return platform_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return platform_1.getStringListFromEnv; - } - }); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return platform_1.otperformance; - } - }); - var composite_1 = require_composite$1(); - Object.defineProperty(exports, "CompositePropagator", { - enumerable: true, - get: function() { - return composite_1.CompositePropagator; - } - }); - var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator$1(); - Object.defineProperty(exports, "TRACE_PARENT_HEADER", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; - } - }); - Object.defineProperty(exports, "TRACE_STATE_HEADER", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; - } - }); - Object.defineProperty(exports, "W3CTraceContextPropagator", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.W3CTraceContextPropagator; - } - }); - Object.defineProperty(exports, "parseTraceParent", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.parseTraceParent; - } - }); - var rpc_metadata_1 = require_rpc_metadata$1(); - Object.defineProperty(exports, "RPCType", { - enumerable: true, - get: function() { - return rpc_metadata_1.RPCType; - } - }); - Object.defineProperty(exports, "deleteRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.deleteRPCMetadata; - } - }); - Object.defineProperty(exports, "getRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.getRPCMetadata; - } - }); - Object.defineProperty(exports, "setRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.setRPCMetadata; - } - }); - var suppress_tracing_1 = require_suppress_tracing$1(); - Object.defineProperty(exports, "isTracingSuppressed", { - enumerable: true, - get: function() { - return suppress_tracing_1.isTracingSuppressed; - } - }); - Object.defineProperty(exports, "suppressTracing", { - enumerable: true, - get: function() { - return suppress_tracing_1.suppressTracing; - } - }); - Object.defineProperty(exports, "unsuppressTracing", { - enumerable: true, - get: function() { - return suppress_tracing_1.unsuppressTracing; - } - }); - var TraceState_1 = require_TraceState$1(); - Object.defineProperty(exports, "TraceState", { - enumerable: true, - get: function() { - return TraceState_1.TraceState; - } - }); - var merge_1 = require_merge$1(); - Object.defineProperty(exports, "merge", { - enumerable: true, - get: function() { - return merge_1.merge; - } - }); - var timeout_1 = require_timeout$1(); - Object.defineProperty(exports, "TimeoutError", { - enumerable: true, - get: function() { - return timeout_1.TimeoutError; - } - }); - Object.defineProperty(exports, "callWithTimeout", { - enumerable: true, - get: function() { - return timeout_1.callWithTimeout; - } - }); - var url_1 = require_url$1(); - Object.defineProperty(exports, "isUrlIgnored", { - enumerable: true, - get: function() { - return url_1.isUrlIgnored; - } - }); - Object.defineProperty(exports, "urlMatches", { - enumerable: true, - get: function() { - return url_1.urlMatches; - } - }); - var callback_1 = require_callback$1(); - Object.defineProperty(exports, "BindOnceFuture", { - enumerable: true, - get: function() { - return callback_1.BindOnceFuture; - } - }); - var configuration_1 = require_configuration$1(); - Object.defineProperty(exports, "diagLogLevelFromString", { - enumerable: true, - get: function() { - return configuration_1.diagLogLevelFromString; - } - }); - const exporter_1 = require_exporter$1(); - exports.internal = { _export: exporter_1._export }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js -var OTLPExporterBase; -var init_OTLPExporterBase = __esmMin((() => { - OTLPExporterBase = class { - _delegate; - constructor(_delegate) { - this._delegate = _delegate; - } - /** - * Export items. - * @param items - * @param resultCallback - */ - export(items, resultCallback) { - this._delegate.export(items, resultCallback); - } - forceFlush() { - return this._delegate.forceFlush(); - } - shutdown() { - return this._delegate.shutdown(); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js -var OTLPExporterError; -var init_types = __esmMin((() => { - OTLPExporterError = class extends Error { - code; - name = "OTLPExporterError"; - data; - constructor(message, code, data) { - super(message); - this.data = data; - this.code = code; - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js -function validateTimeoutMillis(timeoutMillis) { - if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) return timeoutMillis; - throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`); -} -function wrapStaticHeadersInFunction(headers) { - if (headers == null) return; - return () => headers; -} -/** -* @param userProvidedConfiguration Configuration options provided by the user in code. -* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. -* @param defaultConfiguration The defaults as defined by the exporter specification -*/ -function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { - return { - timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ?? fallbackConfiguration.timeoutMillis ?? defaultConfiguration.timeoutMillis), - concurrencyLimit: userProvidedConfiguration.concurrencyLimit ?? fallbackConfiguration.concurrencyLimit ?? defaultConfiguration.concurrencyLimit, - compression: userProvidedConfiguration.compression ?? fallbackConfiguration.compression ?? defaultConfiguration.compression - }; -} -function getSharedConfigurationDefaults() { - return { - timeoutMillis: 1e4, - concurrencyLimit: 30, - compression: "none" - }; -} -var init_shared_configuration = __esmMin((() => {})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/legacy-node-configuration.js -var CompressionAlgorithm; -var init_legacy_node_configuration = __esmMin((() => { - ; - (function(CompressionAlgorithm$1) { - CompressionAlgorithm$1["NONE"] = "none"; - CompressionAlgorithm$1["GZIP"] = "gzip"; - })(CompressionAlgorithm || (CompressionAlgorithm = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js -/** -* Promise queue for keeping track of export promises. Finished promises will be auto-dequeued. -* Allows for awaiting all promises in the queue. -*/ -function createBoundedQueueExportPromiseHandler(options) { - return new BoundedQueueExportPromiseHandler(options.concurrencyLimit); -} -var BoundedQueueExportPromiseHandler; -var init_bounded_queue_export_promise_handler = __esmMin((() => { - BoundedQueueExportPromiseHandler = class { - _concurrencyLimit; - _sendingPromises = []; - /** - * @param concurrencyLimit maximum promises allowed in a queue at the same time. - */ - constructor(concurrencyLimit) { - this._concurrencyLimit = concurrencyLimit; - } - pushPromise(promise) { - if (this.hasReachedLimit()) throw new Error("Concurrency Limit reached"); - this._sendingPromises.push(promise); - const popPromise = () => { - const index = this._sendingPromises.indexOf(promise); - this._sendingPromises.splice(index, 1); - }; - promise.then(popPromise, popPromise); - } - hasReachedLimit() { - return this._sendingPromises.length >= this._concurrencyLimit; - } - async awaitAll() { - await Promise.all(this._sendingPromises); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js -var require_suppress_tracing = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; - const SUPPRESS_TRACING_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); - function suppressTracing(context$1) { - return context$1.setValue(SUPPRESS_TRACING_KEY, true); - } - exports.suppressTracing = suppressTracing; - function unsuppressTracing(context$1) { - return context$1.deleteValue(SUPPRESS_TRACING_KEY); - } - exports.unsuppressTracing = unsuppressTracing; - function isTracingSuppressed(context$1) { - return context$1.getValue(SUPPRESS_TRACING_KEY) === true; - } - exports.isTracingSuppressed = isTracingSuppressed; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/constants.js -var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; - exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; - exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; - exports.BAGGAGE_ITEMS_SEPARATOR = ","; - exports.BAGGAGE_HEADER = "baggage"; - exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; - exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; - exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js -var require_utils$6 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const constants_1 = require_constants(); - function serializeKeyPairs(keyPairs) { - return keyPairs.reduce((hValue, current) => { - const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; - return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; - }, ""); - } - exports.serializeKeyPairs = serializeKeyPairs; - function getKeyPairs(baggage) { - return baggage.getAllEntries().map(([key, value]) => { - let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; - if (value.metadata !== void 0) entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); - return entry; - }); - } - exports.getKeyPairs = getKeyPairs; - function parsePairKeyValue(entry) { - const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); - if (valueProps.length <= 0) return; - const keyPairPart = valueProps.shift(); - if (!keyPairPart) return; - const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); - if (separatorIndex <= 0) return; - const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); - const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); - let metadata; - if (valueProps.length > 0) metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); - return { - key, - value, - metadata - }; - } - exports.parsePairKeyValue = parsePairKeyValue; - /** - * Parse a string serialized in the baggage HTTP Format (without metadata): - * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md - */ - function parseKeyPairsIntoRecord(value) { - const result = {}; - if (typeof value === "string" && value.length > 0) value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { - const keyPair = parsePairKeyValue(entry); - if (keyPair !== void 0 && keyPair.value.length > 0) result[keyPair.key] = keyPair.value; - }); - return result; - } - exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js -var require_W3CBaggagePropagator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.W3CBaggagePropagator = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing(); - const constants_1 = require_constants(); - const utils_1 = require_utils$6(); - /** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ - */ - var W3CBaggagePropagator = class { - inject(context$1, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context$1); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context$1)) return; - const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); - if (headerValue.length > 0) setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - extract(context$1, carrier, getter) { - const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); - const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; - if (!baggageString) return context$1; - const baggage = {}; - if (baggageString.length === 0) return context$1; - baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { - const keyPair = (0, utils_1.parsePairKeyValue)(entry); - if (keyPair) { - const baggageEntry = { value: keyPair.value }; - if (keyPair.metadata) baggageEntry.metadata = keyPair.metadata; - baggage[keyPair.key] = baggageEntry; - } - }); - if (Object.entries(baggage).length === 0) return context$1; - return api_1.propagation.setBaggage(context$1, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } - }; - exports.W3CBaggagePropagator = W3CBaggagePropagator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js -var require_anchored_clock = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AnchoredClock = void 0; - /** - * A utility for returning wall times anchored to a given point in time. Wall time measurements will - * not be taken from the system, but instead are computed by adding a monotonic clock time - * to the anchor point. - * - * This is needed because the system time can change and result in unexpected situations like - * spans ending before they are started. Creating an anchored clock for each local root span - * ensures that span timings and durations are accurate while preventing span times from drifting - * too far from the system clock. - * - * Only creating an anchored clock once per local trace ensures span times are correct relative - * to each other. For example, a child span will never have a start time before its parent even - * if the system clock is corrected during the local trace. - * - * Heavily inspired by the OTel Java anchored clock - * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java - */ - var AnchoredClock = class { - _monotonicClock; - _epochMillis; - _performanceMillis; - /** - * Create a new AnchoredClock anchored to the current time returned by systemClock. - * - * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date - * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance - */ - constructor(systemClock, monotonicClock) { - this._monotonicClock = monotonicClock; - this._epochMillis = systemClock.now(); - this._performanceMillis = monotonicClock.now(); - } - /** - * Returns the current time by adding the number of milliseconds since the - * AnchoredClock was created to the creation epoch time - */ - now() { - const delta = this._monotonicClock.now() - this._performanceMillis; - return this._epochMillis + delta; - } - }; - exports.AnchoredClock = AnchoredClock; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/attributes.js -var require_attributes = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - function sanitizeAttributes(attributes) { - const out = {}; - if (typeof attributes !== "object" || attributes == null) return out; - for (const [key, val] of Object.entries(attributes)) { - if (!isAttributeKey(key)) { - api_1.diag.warn(`Invalid attribute key: ${key}`); - continue; - } - if (!isAttributeValue(val)) { - api_1.diag.warn(`Invalid attribute value set for key: ${key}`); - continue; - } - if (Array.isArray(val)) out[key] = val.slice(); - else out[key] = val; - } - return out; - } - exports.sanitizeAttributes = sanitizeAttributes; - function isAttributeKey(key) { - return typeof key === "string" && key.length > 0; - } - exports.isAttributeKey = isAttributeKey; - function isAttributeValue(val) { - if (val == null) return true; - if (Array.isArray(val)) return isHomogeneousAttributeValueArray(val); - return isValidPrimitiveAttributeValue(val); - } - exports.isAttributeValue = isAttributeValue; - function isHomogeneousAttributeValueArray(arr) { - let type; - for (const element of arr) { - if (element == null) continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; - } - return false; - } - if (typeof element === type) continue; - return false; - } - return true; - } - function isValidPrimitiveAttributeValue(val) { - switch (typeof val) { - case "number": - case "boolean": - case "string": return true; - } - return false; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js -var require_logging_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.loggingErrorHandler = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - /** - * Returns a function that logs an error using the provided logger, or a - * console logger if one was not provided. - */ - function loggingErrorHandler() { - return (ex) => { - api_1.diag.error(stringifyException(ex)); - }; - } - exports.loggingErrorHandler = loggingErrorHandler; - /** - * Converts an exception into a string representation - * @param {Exception} ex - */ - function stringifyException(ex) { - if (typeof ex === "string") return ex; - else return JSON.stringify(flattenException(ex)); - } - /** - * Flattens an exception into key-value pairs by traversing the prototype chain - * and coercing values to strings. Duplicate properties will not be overwritten; - * the first insert wins. - */ - function flattenException(ex) { - const result = {}; - let current = ex; - while (current !== null) { - Object.getOwnPropertyNames(current).forEach((propertyName) => { - if (result[propertyName]) return; - const value = current[propertyName]; - if (value) result[propertyName] = String(value); - }); - current = Object.getPrototypeOf(current); - } - return result; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js -var require_global_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; - /** The global error handler delegate */ - let delegateHandler = (0, require_logging_error_handler().loggingErrorHandler)(); - /** - * Set the global error handler - * @param {ErrorHandler} handler - */ - function setGlobalErrorHandler(handler) { - delegateHandler = handler; - } - exports.setGlobalErrorHandler = setGlobalErrorHandler; - /** - * Return the global error handler - * @param {Exception} ex - */ - function globalErrorHandler(ex) { - try { - delegateHandler(ex); - } catch {} - } - exports.globalErrorHandler = globalErrorHandler; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/environment.js -var require_environment = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const util_1 = __require("util"); - /** - * Retrieves a number from an environment variable. - * - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number. - * - Returns a number in all other cases. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {number | undefined} - The number value or `undefined`. - */ - function getNumberFromEnv(key) { - const raw = process.env[key]; - if (raw == null || raw.trim() === "") return; - const value = Number(raw); - if (isNaN(value)) { - api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); - return; - } - return value; - } - exports.getNumberFromEnv = getNumberFromEnv; - /** - * Retrieves a string from an environment variable. - * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {string | undefined} - The string value or `undefined`. - */ - function getStringFromEnv(key) { - const raw = process.env[key]; - if (raw == null || raw.trim() === "") return; - return raw; - } - exports.getStringFromEnv = getStringFromEnv; - /** - * Retrieves a boolean value from an environment variable. - * - Trims leading and trailing whitespace and ignores casing. - * - Returns `false` if the environment variable is empty, unset, or contains only whitespace. - * - Returns `false` for strings that cannot be mapped to a boolean. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace. - */ - function getBooleanFromEnv(key) { - const raw = process.env[key]?.trim().toLowerCase(); - if (raw == null || raw === "") return false; - if (raw === "true") return true; - else if (raw === "false") return false; - else { - api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); - return false; - } - } - exports.getBooleanFromEnv = getBooleanFromEnv; - /** - * Retrieves a list of strings from an environment variable. - * - Uses ',' as the delimiter. - * - Trims leading and trailing whitespace from each entry. - * - Excludes empty entries. - * - Returns `undefined` if the environment variable is empty or contains only whitespace. - * - Returns an empty array if all entries are empty or whitespace. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {string[] | undefined} - The list of strings or `undefined`. - */ - function getStringListFromEnv(key) { - return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); - } - exports.getStringListFromEnv = getStringListFromEnv; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js -var require_globalThis = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports._globalThis = void 0; - /** only globals that common to node and browsers are allowed */ - exports._globalThis = typeof globalThis === "object" ? globalThis : global; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/performance.js -var require_performance = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.otperformance = void 0; - const perf_hooks_1 = __require("perf_hooks"); - exports.otperformance = perf_hooks_1.performance; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js -var require_version$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.VERSION = void 0; - exports.VERSION = "2.1.0"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js -var require_semconv$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ATTR_PROCESS_RUNTIME_NAME = void 0; - /** - * The name of the runtime of this process. - * - * @example OpenJDK Runtime Environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js -var require_sdk_info = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SDK_INFO = void 0; - const version_1 = require_version$2(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const semconv_1 = require_semconv$3(); - /** Constants describing the SDK in use */ - exports.SDK_INFO = { - [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", - [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", - [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, - [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js -var require_timer_util = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.unrefTimer = void 0; - function unrefTimer(timer) { - timer.unref(); - } - exports.unrefTimer = unrefTimer; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js -var require_node$5 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = void 0; - var environment_1 = require_environment(); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return environment_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return environment_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return environment_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return environment_1.getStringListFromEnv; - } - }); - var globalThis_1 = require_globalThis(); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return globalThis_1._globalThis; - } - }); - var performance_1 = require_performance(); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return performance_1.otperformance; - } - }); - var sdk_info_1 = require_sdk_info(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return sdk_info_1.SDK_INFO; - } - }); - var timer_util_1 = require_timer_util(); - Object.defineProperty(exports, "unrefTimer", { - enumerable: true, - get: function() { - return timer_util_1.unrefTimer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js -var require_platform$5 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; - var node_1 = require_node$5(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return node_1.SDK_INFO; - } - }); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return node_1._globalThis; - } - }); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return node_1.otperformance; - } - }); - Object.defineProperty(exports, "unrefTimer", { - enumerable: true, - get: function() { - return node_1.unrefTimer; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return node_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return node_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return node_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return node_1.getStringListFromEnv; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/time.js -var require_time = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; - const platform_1 = require_platform$5(); - const NANOSECOND_DIGITS = 9; - const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); - const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); - /** - * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). - * @param epochMillis - */ - function millisToHrTime(epochMillis) { - const epochSeconds = epochMillis / 1e3; - return [Math.trunc(epochSeconds), Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS)]; - } - exports.millisToHrTime = millisToHrTime; - function getTimeOrigin() { - let timeOrigin = platform_1.otperformance.timeOrigin; - if (typeof timeOrigin !== "number") { - const perf = platform_1.otperformance; - timeOrigin = perf.timing && perf.timing.fetchStart; - } - return timeOrigin; - } - exports.getTimeOrigin = getTimeOrigin; - /** - * Returns an hrtime calculated via performance component. - * @param performanceNow - */ - function hrTime(performanceNow) { - return addHrTimes(millisToHrTime(getTimeOrigin()), millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now())); - } - exports.hrTime = hrTime; - /** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ - function timeInputToHrTime(time$2) { - if (isTimeInputHrTime(time$2)) return time$2; - else if (typeof time$2 === "number") if (time$2 < getTimeOrigin()) return hrTime(time$2); - else return millisToHrTime(time$2); - else if (time$2 instanceof Date) return millisToHrTime(time$2.getTime()); - else throw TypeError("Invalid input type"); - } - exports.timeInputToHrTime = timeInputToHrTime; - /** - * Returns a duration of two hrTime. - * @param startTime - * @param endTime - */ - function hrTimeDuration(startTime, endTime) { - let seconds = endTime[0] - startTime[0]; - let nanos = endTime[1] - startTime[1]; - if (nanos < 0) { - seconds -= 1; - nanos += SECOND_TO_NANOSECONDS; - } - return [seconds, nanos]; - } - exports.hrTimeDuration = hrTimeDuration; - /** - * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" - * @param time - */ - function hrTimeToTimeStamp(time$2) { - const precision = NANOSECOND_DIGITS; - const tmp = `${"0".repeat(precision)}${time$2[1]}Z`; - const nanoString = tmp.substring(tmp.length - precision - 1); - return (/* @__PURE__ */ new Date(time$2[0] * 1e3)).toISOString().replace("000Z", nanoString); - } - exports.hrTimeToTimeStamp = hrTimeToTimeStamp; - /** - * Convert hrTime to nanoseconds. - * @param time - */ - function hrTimeToNanoseconds(time$2) { - return time$2[0] * SECOND_TO_NANOSECONDS + time$2[1]; - } - exports.hrTimeToNanoseconds = hrTimeToNanoseconds; - /** - * Convert hrTime to milliseconds. - * @param time - */ - function hrTimeToMilliseconds(time$2) { - return time$2[0] * 1e3 + time$2[1] / 1e6; - } - exports.hrTimeToMilliseconds = hrTimeToMilliseconds; - /** - * Convert hrTime to microseconds. - * @param time - */ - function hrTimeToMicroseconds(time$2) { - return time$2[0] * 1e6 + time$2[1] / 1e3; - } - exports.hrTimeToMicroseconds = hrTimeToMicroseconds; - /** - * check if time is HrTime - * @param value - */ - function isTimeInputHrTime(value) { - return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; - } - exports.isTimeInputHrTime = isTimeInputHrTime; - /** - * check if input value is a correct types.TimeInput - * @param value - */ - function isTimeInput(value) { - return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; - } - exports.isTimeInput = isTimeInput; - /** - * Given 2 HrTime formatted times, return their sum as an HrTime. - */ - function addHrTimes(time1, time2) { - const out = [time1[0] + time2[0], time1[1] + time2[1]]; - if (out[1] >= SECOND_TO_NANOSECONDS) { - out[1] -= SECOND_TO_NANOSECONDS; - out[0] += 1; - } - return out; - } - exports.addHrTimes = addHrTimes; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/ExportResult.js -var require_ExportResult = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExportResultCode = void 0; - (function(ExportResultCode$1) { - ExportResultCode$1[ExportResultCode$1["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode$1[ExportResultCode$1["FAILED"] = 1] = "FAILED"; - })(exports.ExportResultCode || (exports.ExportResultCode = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/propagation/composite.js -var require_composite = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.CompositePropagator = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - /** Combines multiple propagators into a single propagator. */ - var CompositePropagator = class { - _propagators; - _fields; - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config$1 = {}) { - this._propagators = config$1.propagators ?? []; - this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); - } - /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same carrier key, the propagator later in the list - * will "win". - * - * @param context Context to inject - * @param carrier Carrier into which context will be injected - */ - inject(context$1, carrier, setter) { - for (const propagator of this._propagators) try { - propagator.inject(context$1, carrier, setter); - } catch (err) { - api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); - } - } - /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same context key, the propagator later in the list - * will "win". - * - * @param context Context to add values to - * @param carrier Carrier from which to extract context - */ - extract(context$1, carrier, getter) { - return this._propagators.reduce((ctx, propagator) => { - try { - return propagator.extract(ctx, carrier, getter); - } catch (err) { - api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); - } - return ctx; - }, context$1); - } - fields() { - return this._fields.slice(); - } - }; - exports.CompositePropagator = CompositePropagator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/validators.js -var require_validators = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateValue = exports.validateKey = void 0; - const VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; - const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; - const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; - const VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); - const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; - const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; - /** - * Key is opaque string up to 256 characters printable. It MUST begin with a - * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, - * underscores _, dashes -, asterisks *, and forward slashes /. - * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the - * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. - * see https://www.w3.org/TR/trace-context/#key - */ - function validateKey(key) { - return VALID_KEY_REGEX.test(key); - } - exports.validateKey = validateKey; - /** - * Value is opaque string up to 256 characters printable ASCII RFC0020 - * characters (i.e., the range 0x20 to 0x7E) except comma , and =. - */ - function validateValue(value) { - return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); - } - exports.validateValue = validateValue; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/TraceState.js -var require_TraceState = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TraceState = void 0; - const validators_1 = require_validators(); - const MAX_TRACE_STATE_ITEMS = 32; - const MAX_TRACE_STATE_LEN = 512; - const LIST_MEMBERS_SEPARATOR = ","; - const LIST_MEMBER_KEY_VALUE_SPLITTER = "="; - /** - * TraceState must be a class and not a simple object type because of the spec - * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). - * - * Here is the list of allowed mutations: - * - New key-value pair should be added into the beginning of the list - * - The value of any key can be updated. Modified keys MUST be moved to the - * beginning of the list. - */ - var TraceState = class TraceState { - _internalState = /* @__PURE__ */ new Map(); - constructor(rawTraceState) { - if (rawTraceState) this._parse(rawTraceState); - } - set(key, value) { - const traceState = this._clone(); - if (traceState._internalState.has(key)) traceState._internalState.delete(key); - traceState._internalState.set(key, value); - return traceState; - } - unset(key) { - const traceState = this._clone(); - traceState._internalState.delete(key); - return traceState; - } - get(key) { - return this._internalState.get(key); - } - serialize() { - return this._keys().reduce((agg, key) => { - agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); - return agg; - }, []).join(LIST_MEMBERS_SEPARATOR); - } - _parse(rawTraceState) { - if (rawTraceState.length > MAX_TRACE_STATE_LEN) return; - this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => { - const listMember = part.trim(); - const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); - if (i !== -1) { - const key = listMember.slice(0, i); - const value = listMember.slice(i + 1, part.length); - if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) agg.set(key, value); - } - return agg; - }, /* @__PURE__ */ new Map()); - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); - } - _keys() { - return Array.from(this._internalState.keys()).reverse(); - } - _clone() { - const traceState = new TraceState(); - traceState._internalState = new Map(this._internalState); - return traceState; - } - }; - exports.TraceState = TraceState; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js -var require_W3CTraceContextPropagator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing(); - const TraceState_1 = require_TraceState(); - exports.TRACE_PARENT_HEADER = "traceparent"; - exports.TRACE_STATE_HEADER = "tracestate"; - const VERSION = "00"; - const TRACE_PARENT_REGEX = /* @__PURE__ */ new RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`); - /** - * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} - * @param traceParent - A meta property that comes from server. - * It should be dynamically generated server side to have the server's request trace Id, - * a parent span Id that was set on the server's request span, - * and the trace flags to indicate the server's sampling decision - * (01 = sampled, 00 = not sampled). - * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' - * For more information see {@link https://www.w3.org/TR/trace-context/} - */ - function parseTraceParent(traceParent) { - const match = TRACE_PARENT_REGEX.exec(traceParent); - if (!match) return null; - if (match[1] === "00" && match[5]) return null; - return { - traceId: match[2], - spanId: match[3], - traceFlags: parseInt(match[4], 16) - }; - } - exports.parseTraceParent = parseTraceParent; - /** - * Propagates {@link SpanContext} through Trace Context format propagation. - * - * Based on the Trace Context specification: - * https://www.w3.org/TR/trace-context/ - */ - var W3CTraceContextPropagator = class { - inject(context$1, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context$1); - if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context$1) || !(0, api_1.isSpanContextValid)(spanContext)) return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - extract(context$1, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) return context$1; - const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; - if (typeof traceParent !== "string") return context$1; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) return context$1; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : void 0); - } - return api_1.trace.setSpanContext(context$1, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; - } - }; - exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js -var require_rpc_metadata = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; - const RPC_METADATA_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); - (function(RPCType) { - RPCType["HTTP"] = "http"; - })(exports.RPCType || (exports.RPCType = {})); - function setRPCMetadata(context$1, meta$2) { - return context$1.setValue(RPC_METADATA_KEY, meta$2); - } - exports.setRPCMetadata = setRPCMetadata; - function deleteRPCMetadata(context$1) { - return context$1.deleteValue(RPC_METADATA_KEY); - } - exports.deleteRPCMetadata = deleteRPCMetadata; - function getRPCMetadata(context$1) { - return context$1.getValue(RPC_METADATA_KEY); - } - exports.getRPCMetadata = getRPCMetadata; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js -var require_lodash_merge = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isPlainObject = void 0; - /** - * based on lodash in order to support esm builds without esModuleInterop. - * lodash is using MIT License. - **/ - const objectTag = "[object Object]"; - const nullTag = "[object Null]"; - const undefinedTag = "[object Undefined]"; - const funcToString = Function.prototype.toString; - const objectCtorString = funcToString.call(Object); - const getPrototypeOf = Object.getPrototypeOf; - const objectProto = Object.prototype; - const hasOwnProperty = objectProto.hasOwnProperty; - const symToStringTag = Symbol ? Symbol.toStringTag : void 0; - const nativeObjectToString = objectProto.toString; - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) !== objectTag) return false; - const proto = getPrototypeOf(value); - if (proto === null) return true; - const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; - } - exports.isPlainObject = isPlainObject; - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == "object"; - } - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function baseGetTag(value) { - if (value == null) return value === void 0 ? undefinedTag : nullTag; - return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); - } - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; - let unmasked = false; - try { - value[symToStringTag] = void 0; - unmasked = true; - } catch {} - const result = nativeObjectToString.call(value); - if (unmasked) if (isOwn) value[symToStringTag] = tag; - else delete value[symToStringTag]; - return result; - } - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/merge.js -var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.merge = void 0; - const lodash_merge_1 = require_lodash_merge(); - const MAX_LEVEL = 20; - /** - * Merges objects together - * @param args - objects / values to be merged - */ - function merge(...args) { - let result = args.shift(); - const objects = /* @__PURE__ */ new WeakMap(); - while (args.length > 0) result = mergeTwoObjects(result, args.shift(), 0, objects); - return result; - } - exports.merge = merge; - function takeValue(value) { - if (isArray(value)) return value.slice(); - return value; - } - /** - * Merges two objects - * @param one - first object - * @param two - second object - * @param level - current deep level - * @param objects - objects holder that has been already referenced - to prevent - * cyclic dependency - */ - function mergeTwoObjects(one, two, level = 0, objects) { - let result; - if (level > MAX_LEVEL) return; - level++; - if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) result = takeValue(two); - else if (isArray(one)) { - result = one.slice(); - if (isArray(two)) for (let i = 0, j = two.length; i < j; i++) result.push(takeValue(two[i])); - else if (isObject(two)) { - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - result[key] = takeValue(two[key]); - } - } - } else if (isObject(one)) if (isObject(two)) { - if (!shouldMerge(one, two)) return two; - result = Object.assign({}, one); - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - const twoValue = two[key]; - if (isPrimitive(twoValue)) if (typeof twoValue === "undefined") delete result[key]; - else result[key] = twoValue; - else { - const obj1 = result[key]; - const obj2 = twoValue; - if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) delete result[key]; - else { - if (isObject(obj1) && isObject(obj2)) { - const arr1 = objects.get(obj1) || []; - const arr2 = objects.get(obj2) || []; - arr1.push({ - obj: one, - key - }); - arr2.push({ - obj: two, - key - }); - objects.set(obj1, arr1); - objects.set(obj2, arr2); - } - result[key] = mergeTwoObjects(result[key], twoValue, level, objects); - } - } - } - } else result = two; - return result; - } - /** - * Function to check if object has been already reference - * @param obj - * @param key - * @param objects - */ - function wasObjectReferenced(obj, key, objects) { - const arr = objects.get(obj[key]) || []; - for (let i = 0, j = arr.length; i < j; i++) { - const info = arr[i]; - if (info.key === key && info.obj === obj) return true; - } - return false; - } - function isArray(value) { - return Array.isArray(value); - } - function isFunction(value) { - return typeof value === "function"; - } - function isObject(value) { - return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; - } - function isPrimitive(value) { - return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; - } - function shouldMerge(one, two) { - if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) return false; - return true; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/timeout.js -var require_timeout = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.callWithTimeout = exports.TimeoutError = void 0; - /** - * Error that is thrown on timeouts. - */ - var TimeoutError = class TimeoutError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, TimeoutError.prototype); - } - }; - exports.TimeoutError = TimeoutError; - /** - * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise - * rejects, and resolves if the specified promise resolves. - * - *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. - * - * @param promise promise to use with timeout. - * @param timeout the timeout in milliseconds until the returned promise is rejected. - */ - function callWithTimeout(promise, timeout) { - let timeoutHandle; - const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { - timeoutHandle = setTimeout(function timeoutHandler() { - reject(new TimeoutError("Operation timed out.")); - }, timeout); - }); - return Promise.race([promise, timeoutPromise]).then((result) => { - clearTimeout(timeoutHandle); - return result; - }, (reason) => { - clearTimeout(timeoutHandle); - throw reason; - }); - } - exports.callWithTimeout = callWithTimeout; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/url.js -var require_url = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isUrlIgnored = exports.urlMatches = void 0; - function urlMatches(url, urlToMatch) { - if (typeof urlToMatch === "string") return url === urlToMatch; - else return !!url.match(urlToMatch); - } - exports.urlMatches = urlMatches; - /** - * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} - * @param url - * @param ignoredUrls - */ - function isUrlIgnored(url, ignoredUrls) { - if (!ignoredUrls) return false; - for (const ignoreUrl of ignoredUrls) if (urlMatches(url, ignoreUrl)) return true; - return false; - } - exports.isUrlIgnored = isUrlIgnored; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/promise.js -var require_promise = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Deferred = void 0; - var Deferred = class { - _promise; - _resolve; - _reject; - constructor() { - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - } - get promise() { - return this._promise; - } - resolve(val) { - this._resolve(val); - } - reject(err) { - this._reject(err); - } - }; - exports.Deferred = Deferred; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/callback.js -var require_callback = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BindOnceFuture = void 0; - const promise_1 = require_promise(); - /** - * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. - */ - var BindOnceFuture = class { - _callback; - _that; - _isCalled = false; - _deferred = new promise_1.Deferred(); - constructor(_callback, _that) { - this._callback = _callback; - this._that = _that; - } - get isCalled() { - return this._isCalled; - } - get promise() { - return this._deferred.promise; - } - call(...args) { - if (!this._isCalled) { - this._isCalled = true; - try { - Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); - } catch (err) { - this._deferred.reject(err); - } - } - return this._deferred.promise; - } - }; - exports.BindOnceFuture = BindOnceFuture; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/configuration.js -var require_configuration = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.diagLogLevelFromString = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const logLevelMap = { - ALL: api_1.DiagLogLevel.ALL, - VERBOSE: api_1.DiagLogLevel.VERBOSE, - DEBUG: api_1.DiagLogLevel.DEBUG, - INFO: api_1.DiagLogLevel.INFO, - WARN: api_1.DiagLogLevel.WARN, - ERROR: api_1.DiagLogLevel.ERROR, - NONE: api_1.DiagLogLevel.NONE - }; - /** - * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined. - * @param value - */ - function diagLogLevelFromString(value) { - if (value == null) return; - const resolvedLogLevel = logLevelMap[value.toUpperCase()]; - if (resolvedLogLevel == null) { - api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); - return api_1.DiagLogLevel.INFO; - } - return resolvedLogLevel; - } - exports.diagLogLevelFromString = diagLogLevelFromString; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/exporter.js -var require_exporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports._export = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing(); - /** - * @internal - * Shared functionality used by Exporters while exporting data, including suppression of Traces. - */ - function _export(exporter, arg) { - return new Promise((resolve) => { - api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, (result) => { - resolve(result); - }); - }); - }); - } - exports._export = _export; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js -var require_src$8 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; - var W3CBaggagePropagator_1 = require_W3CBaggagePropagator(); - Object.defineProperty(exports, "W3CBaggagePropagator", { - enumerable: true, - get: function() { - return W3CBaggagePropagator_1.W3CBaggagePropagator; - } - }); - var anchored_clock_1 = require_anchored_clock(); - Object.defineProperty(exports, "AnchoredClock", { - enumerable: true, - get: function() { - return anchored_clock_1.AnchoredClock; - } - }); - var attributes_1 = require_attributes(); - Object.defineProperty(exports, "isAttributeValue", { - enumerable: true, - get: function() { - return attributes_1.isAttributeValue; - } - }); - Object.defineProperty(exports, "sanitizeAttributes", { - enumerable: true, - get: function() { - return attributes_1.sanitizeAttributes; - } - }); - var global_error_handler_1 = require_global_error_handler(); - Object.defineProperty(exports, "globalErrorHandler", { - enumerable: true, - get: function() { - return global_error_handler_1.globalErrorHandler; - } - }); - Object.defineProperty(exports, "setGlobalErrorHandler", { - enumerable: true, - get: function() { - return global_error_handler_1.setGlobalErrorHandler; - } - }); - var logging_error_handler_1 = require_logging_error_handler(); - Object.defineProperty(exports, "loggingErrorHandler", { - enumerable: true, - get: function() { - return logging_error_handler_1.loggingErrorHandler; - } - }); - var time_1 = require_time(); - Object.defineProperty(exports, "addHrTimes", { - enumerable: true, - get: function() { - return time_1.addHrTimes; - } - }); - Object.defineProperty(exports, "getTimeOrigin", { - enumerable: true, - get: function() { - return time_1.getTimeOrigin; - } - }); - Object.defineProperty(exports, "hrTime", { - enumerable: true, - get: function() { - return time_1.hrTime; - } - }); - Object.defineProperty(exports, "hrTimeDuration", { - enumerable: true, - get: function() { - return time_1.hrTimeDuration; - } - }); - Object.defineProperty(exports, "hrTimeToMicroseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToMicroseconds; - } - }); - Object.defineProperty(exports, "hrTimeToMilliseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToMilliseconds; - } - }); - Object.defineProperty(exports, "hrTimeToNanoseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToNanoseconds; - } - }); - Object.defineProperty(exports, "hrTimeToTimeStamp", { - enumerable: true, - get: function() { - return time_1.hrTimeToTimeStamp; - } - }); - Object.defineProperty(exports, "isTimeInput", { - enumerable: true, - get: function() { - return time_1.isTimeInput; - } - }); - Object.defineProperty(exports, "isTimeInputHrTime", { - enumerable: true, - get: function() { - return time_1.isTimeInputHrTime; - } - }); - Object.defineProperty(exports, "millisToHrTime", { - enumerable: true, - get: function() { - return time_1.millisToHrTime; - } - }); - Object.defineProperty(exports, "timeInputToHrTime", { - enumerable: true, - get: function() { - return time_1.timeInputToHrTime; - } - }); - var ExportResult_1 = require_ExportResult(); - Object.defineProperty(exports, "ExportResultCode", { - enumerable: true, - get: function() { - return ExportResult_1.ExportResultCode; - } - }); - var utils_1 = require_utils$6(); - Object.defineProperty(exports, "parseKeyPairsIntoRecord", { - enumerable: true, - get: function() { - return utils_1.parseKeyPairsIntoRecord; - } - }); - var platform_1 = require_platform$5(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return platform_1.SDK_INFO; - } - }); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return platform_1._globalThis; - } - }); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return platform_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return platform_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return platform_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return platform_1.getStringListFromEnv; - } - }); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return platform_1.otperformance; - } - }); - Object.defineProperty(exports, "unrefTimer", { - enumerable: true, - get: function() { - return platform_1.unrefTimer; - } - }); - var composite_1 = require_composite(); - Object.defineProperty(exports, "CompositePropagator", { - enumerable: true, - get: function() { - return composite_1.CompositePropagator; - } - }); - var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator(); - Object.defineProperty(exports, "TRACE_PARENT_HEADER", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; - } - }); - Object.defineProperty(exports, "TRACE_STATE_HEADER", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; - } - }); - Object.defineProperty(exports, "W3CTraceContextPropagator", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.W3CTraceContextPropagator; - } - }); - Object.defineProperty(exports, "parseTraceParent", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.parseTraceParent; - } - }); - var rpc_metadata_1 = require_rpc_metadata(); - Object.defineProperty(exports, "RPCType", { - enumerable: true, - get: function() { - return rpc_metadata_1.RPCType; - } - }); - Object.defineProperty(exports, "deleteRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.deleteRPCMetadata; - } - }); - Object.defineProperty(exports, "getRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.getRPCMetadata; - } - }); - Object.defineProperty(exports, "setRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.setRPCMetadata; - } - }); - var suppress_tracing_1 = require_suppress_tracing(); - Object.defineProperty(exports, "isTracingSuppressed", { - enumerable: true, - get: function() { - return suppress_tracing_1.isTracingSuppressed; - } - }); - Object.defineProperty(exports, "suppressTracing", { - enumerable: true, - get: function() { - return suppress_tracing_1.suppressTracing; - } - }); - Object.defineProperty(exports, "unsuppressTracing", { - enumerable: true, - get: function() { - return suppress_tracing_1.unsuppressTracing; - } - }); - var TraceState_1 = require_TraceState(); - Object.defineProperty(exports, "TraceState", { - enumerable: true, - get: function() { - return TraceState_1.TraceState; - } - }); - var merge_1 = require_merge(); - Object.defineProperty(exports, "merge", { - enumerable: true, - get: function() { - return merge_1.merge; - } - }); - var timeout_1 = require_timeout(); - Object.defineProperty(exports, "TimeoutError", { - enumerable: true, - get: function() { - return timeout_1.TimeoutError; - } - }); - Object.defineProperty(exports, "callWithTimeout", { - enumerable: true, - get: function() { - return timeout_1.callWithTimeout; - } - }); - var url_1 = require_url(); - Object.defineProperty(exports, "isUrlIgnored", { - enumerable: true, - get: function() { - return url_1.isUrlIgnored; - } - }); - Object.defineProperty(exports, "urlMatches", { - enumerable: true, - get: function() { - return url_1.urlMatches; - } - }); - var callback_1 = require_callback(); - Object.defineProperty(exports, "BindOnceFuture", { - enumerable: true, - get: function() { - return callback_1.BindOnceFuture; - } - }); - var configuration_1 = require_configuration(); - Object.defineProperty(exports, "diagLogLevelFromString", { - enumerable: true, - get: function() { - return configuration_1.diagLogLevelFromString; - } - }); - const exporter_1 = require_exporter(); - exports.internal = { _export: exporter_1._export }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js -function isPartialSuccessResponse(response) { - return Object.prototype.hasOwnProperty.call(response, "partialSuccess"); -} -/** -* Default response handler that logs a partial success to the console. -*/ -function createLoggingPartialSuccessResponseHandler() { - return { handleResponse(response) { - if (response == null || !isPartialSuccessResponse(response) || response.partialSuccess == null || Object.keys(response.partialSuccess).length === 0) return; - diag.warn("Received Partial Success response:", JSON.stringify(response.partialSuccess)); - } }; -} -var init_logging_response_handler = __esmMin((() => { - init_esm$2(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js -/** -* Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all -* signals. -*/ -function createOtlpExportDelegate(components, settings) { - return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout); -} -var import_src$5, OTLPExportDelegate; -var init_otlp_export_delegate = __esmMin((() => { - import_src$5 = require_src$8(); - init_types(); - init_logging_response_handler(); - init_esm$2(); - OTLPExportDelegate = class { - _transport; - _serializer; - _responseHandler; - _promiseQueue; - _timeout; - _diagLogger; - constructor(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) { - this._transport = _transport; - this._serializer = _serializer; - this._responseHandler = _responseHandler; - this._promiseQueue = _promiseQueue; - this._timeout = _timeout; - this._diagLogger = diag.createComponentLogger({ namespace: "OTLPExportDelegate" }); - } - export(internalRepresentation, resultCallback) { - this._diagLogger.debug("items to be sent", internalRepresentation); - if (this._promiseQueue.hasReachedLimit()) { - resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: /* @__PURE__ */ new Error("Concurrent export limit reached") - }); - return; - } - const serializedRequest = this._serializer.serializeRequest(internalRepresentation); - if (serializedRequest == null) { - resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: /* @__PURE__ */ new Error("Nothing to send") - }); - return; - } - this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => { - if (response.status === "success") { - if (response.data != null) try { - this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data)); - } catch (e) { - this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e, response.data); - } - resultCallback({ code: import_src$5.ExportResultCode.SUCCESS }); - return; - } else if (response.status === "failure" && response.error) { - resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: response.error - }); - return; - } else if (response.status === "retryable") resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: new OTLPExporterError("Export failed with retryable status") - }); - else resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: new OTLPExporterError("Export failed with unknown error") - }); - }, (reason) => resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: reason - }))); - } - forceFlush() { - return this._promiseQueue.awaitAll(); - } - async shutdown() { - this._diagLogger.debug("shutdown started"); - await this.forceFlush(); - this._transport.shutdown(); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js -function createOtlpNetworkExportDelegate(options, serializer, transport) { - return createOtlpExportDelegate({ - transport, - serializer, - promiseHandler: createBoundedQueueExportPromiseHandler(options) - }, { timeout: options.timeoutMillis }); -} -var init_otlp_network_export_delegate = __esmMin((() => { - init_bounded_queue_export_promise_handler(); - init_otlp_export_delegate(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index.js -var esm_exports = /* @__PURE__ */ __exportAll({ - CompressionAlgorithm: () => CompressionAlgorithm, - OTLPExporterBase: () => OTLPExporterBase, - OTLPExporterError: () => OTLPExporterError, - createOtlpNetworkExportDelegate: () => createOtlpNetworkExportDelegate, - getSharedConfigurationDefaults: () => getSharedConfigurationDefaults, - mergeOtlpSharedConfigurationWithDefaults: () => mergeOtlpSharedConfigurationWithDefaults -}); -var init_esm = __esmMin((() => { - init_OTLPExporterBase(); - init_types(); - init_shared_configuration(); - init_legacy_node_configuration(); - init_otlp_network_export_delegate(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/version.js -var require_version$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.VERSION = void 0; - exports.VERSION = "0.205.0"; -})); - -//#endregion -//#region node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js -var require_aspromise = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = asPromise; - /** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ - /** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function - */ - function asPromise(fn, ctx) { - var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; - while (index < arguments.length) params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err) { - if (pending) { - pending = false; - if (err) reject(err); - else { - var params$1 = new Array(arguments.length - 1), offset$1 = 0; - while (offset$1 < params$1.length) params$1[offset$1++] = arguments[offset$1]; - resolve.apply(null, params$1); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); - } -})); - -//#endregion -//#region node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js -var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace - */ - var base64 = exports; - /** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length - */ - base64.length = function length(string$2) { - var p = string$2.length; - if (!p) return 0; - var n = 0; - while (--p % 4 > 1 && string$2.charAt(p) === "=") ++n; - return Math.ceil(string$2.length * 3) / 4 - n; - }; - var b64 = new Array(64); - var s64 = new Array(123); - for (var i = 0; i < 64;) s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - /** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ - base64.encode = function encode$2(buffer, start, end) { - var parts = null, chunk = []; - var i = 0, j = 0, t; - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) chunk[i++] = 61; - } - if (parts) { - if (i) parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); - }; - var invalidEncoding = "invalid encoding"; - /** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ - base64.decode = function decode$2(string$2, buffer, offset) { - var start = offset; - var j = 0, t; - for (var i = 0; i < string$2.length;) { - var c = string$2.charCodeAt(i++); - if (c === 61 && j > 1) break; - if ((c = s64[c]) === void 0) throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) throw Error(invalidEncoding); - return offset - start; - }; - /** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false - */ - base64.test = function test(string$2) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string$2); - }; -})); - -//#endregion -//#region node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.js -var require_eventemitter = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = EventEmitter; - /** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor - */ - function EventEmitter() { - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = Object.create(null); - } - /** - * Event listener as used by {@link util.EventEmitter}. - * @typedef EventEmitterListener - * @type {function} - * @param {...*} args Arguments - * @returns {undefined} - */ - /** - * Registers an event listener. - * @param {string} evt Event name - * @param {EventEmitterListener} fn Listener - * @param {*} [ctx] Listener context - * @returns {this} `this` - */ - EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn, - ctx: ctx || this - }); - return this; - }; - /** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {this} `this` - */ - EventEmitter.prototype.off = function off(evt, fn) { - if (evt === void 0) this._listeners = Object.create(null); - else if (fn === void 0) this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - if (!listeners) return this; - for (var i = 0; i < listeners.length;) if (listeners[i].fn === fn) listeners.splice(i, 1); - else ++i; - } - return this; - }; - /** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {this} `this` - */ - EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], i = 1; - for (; i < arguments.length;) args.push(arguments[i++]); - for (i = 0; i < listeners.length;) listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; - }; -})); - -//#endregion -//#region node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js -var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = factory(factory); - /** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - /** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - /** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - /** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - /** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - function factory(exports$1) { - if (typeof Float32Array !== "undefined") (function() { - var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128; - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - /* istanbul ignore next */ - exports$1.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports$1.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - /* istanbul ignore next */ - exports$1.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports$1.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - })(); - else (function() { - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) val = -val; - if (val === 0) writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos); - else if (isNaN(val)) writeUint(2143289344, buf, pos); - else if (val > 34028234663852886e22) writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 11754943508222875e-54) writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - exports$1.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports$1.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; - return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - exports$1.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports$1.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - })(); - if (typeof Float64Array !== "undefined") (function() { - var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128; - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - /* istanbul ignore next */ - exports$1.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports$1.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - /* istanbul ignore next */ - exports$1.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports$1.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - })(); - else (function() { - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 17976931348623157e292) { - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 22250738585072014e-324) { - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - exports$1.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports$1.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - exports$1.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports$1.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - })(); - return exports$1; - } - function writeUintLE(val, buf, pos) { - buf[pos] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; - } - function writeUintBE(val, buf, pos) { - buf[pos] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; - } - function readUintLE(buf, pos) { - return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; - } - function readUintBE(buf, pos) { - return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; - } -})); - -//#endregion -//#region node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.js -var require_inquire = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = inquire; - /** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - * @deprecated Legacy optional require helper. Will be removed in a future release. - */ - function inquire(moduleName) { - try { - if (typeof __require !== "function") return null; - var mod = __require(moduleName); - if (mod && (mod.length || Object.keys(mod).length)) return mod; - return null; - } catch (err) { - return null; - } - } -})); - -//#endregion -//#region node_modules/.pnpm/@protobufjs+utf8@1.1.1/node_modules/@protobufjs/utf8/index.js -var require_utf8 = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace - */ - var utf8 = exports, replacementChar = "�"; - /** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ - utf8.length = function utf8_length(string$2) { - var len = 0, c = 0; - for (var i = 0; i < string$2.length; ++i) { - c = string$2.charCodeAt(i); - if (c < 128) len += 1; - else if (c < 2048) len += 2; - else if ((c & 64512) === 55296 && (string$2.charCodeAt(i + 1) & 64512) === 56320) { - ++i; - len += 4; - } else len += 3; - } - return len; - }; - /** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ - utf8.read = function utf8_read(buffer, start, end) { - if (end - start < 1) return ""; - var str = ""; - for (var i = start; i < end;) { - var t = buffer[i++]; - if (t <= 127) str += String.fromCharCode(t); - else if (t >= 192 && t < 224) { - var c2 = (t & 31) << 6 | buffer[i++] & 63; - str += c2 >= 128 ? String.fromCharCode(c2) : replacementChar; - } else if (t >= 224 && t < 240) { - var c3 = (t & 15) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; - str += c3 >= 2048 ? String.fromCharCode(c3) : replacementChar; - } else if (t >= 240) { - var t2 = (t & 7) << 18 | (buffer[i++] & 63) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; - if (t2 < 65536 || t2 > 1114111) str += replacementChar; - else { - t2 -= 65536; - str += String.fromCharCode(55296 + (t2 >> 10)); - str += String.fromCharCode(56320 + (t2 & 1023)); - } - } - } - return str; - }; - /** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ - utf8.write = function utf8_write(string$2, buffer, offset) { - var start = offset, c1, c2; - for (var i = 0; i < string$2.length; ++i) { - c1 = string$2.charCodeAt(i); - if (c1 < 128) buffer[offset++] = c1; - else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 64512) === 55296 && ((c2 = string$2.charCodeAt(i + 1)) & 64512) === 56320) { - c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } - } - return offset - start; - }; -})); - -//#endregion -//#region node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js -var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = pool; - /** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - /** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - /** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ - function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size$1) { - if (size$1 < 1 || size$1 > MAX) return alloc(size$1); - if (offset + size$1 > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size$1); - if (offset & 7) offset = (offset | 7) + 1; - return buf; - }; - } -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/util/longbits.js -var require_longbits = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = LongBits; - var util = require_minimal$1(); - /** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned - */ - function LongBits(lo, hi) { - /** - * Low bits. - * @type {number} - */ - this.lo = lo >>> 0; - /** - * High bits. - * @type {number} - */ - this.hi = hi >>> 0; - } - /** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ - var zero = LongBits.zero = new LongBits(0, 0); - zero.toNumber = function() { - return 0; - }; - zero.zzEncode = zero.zzDecode = function() { - return this; - }; - zero.length = function() { - return 1; - }; - /** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ - var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - /** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ - LongBits.fromNumber = function fromNumber(value) { - if (value === 0) return zero; - var sign = value < 0; - if (sign) value = -value; - var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) hi = 0; - } - } - return new LongBits(lo, hi); - }; - /** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ - LongBits.from = function from(value) { - if (typeof value === "number") return LongBits.fromNumber(value); - if (util.isString(value)) - /* istanbul ignore else */ - if (util.Long) value = util.Long.fromString(value); - else return LongBits.fromNumber(parseInt(value, 10)); - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; - }; - /** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ - LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; - if (!lo) hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); - } - return this.lo + this.hi * 4294967296; - }; - /** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ - LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { - low: this.lo | 0, - high: this.hi | 0, - unsigned: Boolean(unsigned) - }; - }; - var charCodeAt = String.prototype.charCodeAt; - /** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ - LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) return zero; - return new LongBits((charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0, (charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0); - }; - /** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ - LongBits.prototype.toHash = function toHash() { - return String.fromCharCode(this.lo & 255, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, this.hi & 255, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24); - }; - /** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ - LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = (this.lo << 1 ^ mask) >>> 0; - return this; - }; - /** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ - LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = (this.hi >>> 1 ^ mask) >>> 0; - return this; - }; - /** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length - */ - LongBits.prototype.length = function length() { - var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; - return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; - }; -})); - -//#endregion -//#region node_modules/.pnpm/long@5.3.2/node_modules/long/umd/index.js -var require_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => { - (function(global$1, factory) { - function preferDefault(exports$1) { - return exports$1.default || exports$1; - } - if (typeof define === "function" && define.amd) define([], function() { - var exports$1 = {}; - factory(exports$1); - return preferDefault(exports$1); - }); - else if (typeof exports === "object") { - factory(exports); - if (typeof module === "object") module.exports = preferDefault(exports); - } else (function() { - var exports$1 = {}; - factory(exports$1); - global$1.Long = preferDefault(exports$1); - })(); - })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : exports, function(_exports) { - "use strict"; - Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; - /** - * @license - * Copyright 2009 The Closure Library Authors - * Copyright 2020 Daniel Wirtz / The long.js Authors. - * - * Licensed 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. - * - * SPDX-License-Identifier: Apache-2.0 - */ - var wasm = null; - try { - wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ - 0, - 97, - 115, - 109, - 1, - 0, - 0, - 0, - 1, - 13, - 2, - 96, - 0, - 1, - 127, - 96, - 4, - 127, - 127, - 127, - 127, - 1, - 127, - 3, - 7, - 6, - 0, - 1, - 1, - 1, - 1, - 1, - 6, - 6, - 1, - 127, - 1, - 65, - 0, - 11, - 7, - 50, - 6, - 3, - 109, - 117, - 108, - 0, - 1, - 5, - 100, - 105, - 118, - 95, - 115, - 0, - 2, - 5, - 100, - 105, - 118, - 95, - 117, - 0, - 3, - 5, - 114, - 101, - 109, - 95, - 115, - 0, - 4, - 5, - 114, - 101, - 109, - 95, - 117, - 0, - 5, - 8, - 103, - 101, - 116, - 95, - 104, - 105, - 103, - 104, - 0, - 0, - 10, - 191, - 1, - 6, - 4, - 0, - 35, - 0, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 126, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 127, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 128, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 129, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 130, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11 - ])), {}).exports; - } catch {} - /** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. - * See the from* functions below for more convenient ways of constructing Longs. - * @exports Long - * @class A Long class for representing a 64 bit two's-complement integer value. - * @param {number} low The low (signed) 32 bits of the long - * @param {number} high The high (signed) 32 bits of the long - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @constructor - */ - function Long(low, high, unsigned) { - /** - * The low 32 bits as a signed value. - * @type {number} - */ - this.low = low | 0; - /** - * The high 32 bits as a signed value. - * @type {number} - */ - this.high = high | 0; - /** - * Whether unsigned or not. - * @type {boolean} - */ - this.unsigned = !!unsigned; - } - /** - * An indicator used to reliably determine if an object is a Long or not. - * @type {boolean} - * @const - * @private - */ - Long.prototype.__isLong__; - Object.defineProperty(Long.prototype, "__isLong__", { value: true }); - /** - * @function - * @param {*} obj Object - * @returns {boolean} - * @inner - */ - function isLong(obj) { - return (obj && obj["__isLong__"]) === true; - } - /** - * @function - * @param {*} value number - * @returns {number} - * @inner - */ - function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; - } - /** - * Tests if the specified object is a Long. - * @function - * @param {*} obj Object - * @returns {boolean} - */ - Long.isLong = isLong; - /** - * A cache of the Long representations of small integer values. - * @type {!Object} - * @inner - */ - var INT_CACHE = {}; - /** - * A cache of the Long representations of small unsigned integer values. - * @type {!Object} - * @inner - */ - var UINT_CACHE = {}; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - function fromInt(value, unsigned) { - var obj, cachedObj, cache; - if (unsigned) { - value >>>= 0; - if (cache = 0 <= value && value < 256) { - cachedObj = UINT_CACHE[value]; - if (cachedObj) return cachedObj; - } - obj = fromBits(value, 0, true); - if (cache) UINT_CACHE[value] = obj; - return obj; - } else { - value |= 0; - if (cache = -128 <= value && value < 128) { - cachedObj = INT_CACHE[value]; - if (cachedObj) return cachedObj; - } - obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache) INT_CACHE[value] = obj; - return obj; - } - } - /** - * Returns a Long representing the given 32 bit integer value. - * @function - * @param {number} value The 32 bit integer in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromInt = fromInt; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - function fromNumber(value, unsigned) { - if (isNaN(value)) return unsigned ? UZERO : ZERO; - if (unsigned) { - if (value < 0) return UZERO; - if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; - } else { - if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; - if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; - } - if (value < 0) return fromNumber(-value, unsigned).neg(); - return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); - } - /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - * @function - * @param {number} value The number in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromNumber = fromNumber; - /** - * @param {number} lowBits - * @param {number} highBits - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); - } - /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is - * assumed to use 32 bits. - * @function - * @param {number} lowBits The low 32 bits - * @param {number} highBits The high 32 bits - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromBits = fromBits; - /** - * @function - * @param {number} base - * @param {number} exponent - * @returns {number} - * @inner - */ - var pow_dbl = Math.pow; - /** - * @param {string} str - * @param {(boolean|number)=} unsigned - * @param {number=} radix - * @returns {!Long} - * @inner - */ - function fromString(str, unsigned, radix) { - if (str.length === 0) throw Error("empty string"); - if (typeof unsigned === "number") { - radix = unsigned; - unsigned = false; - } else unsigned = !!unsigned; - if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - var p; - if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen"); - else if (p === 0) return fromString(str.substring(1), unsigned, radix).neg(); - var radixToPower = fromNumber(pow_dbl(radix, 8)); - var result = ZERO; - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); - if (size < 8) { - var power = fromNumber(pow_dbl(radix, size)); - result = result.mul(power).add(fromNumber(value)); - } else { - result = result.mul(radixToPower); - result = result.add(fromNumber(value)); - } - } - result.unsigned = unsigned; - return result; - } - /** - * Returns a Long representation of the given string, written using the specified radix. - * @function - * @param {string} str The textual representation of the Long - * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed - * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 - * @returns {!Long} The corresponding Long value - */ - Long.fromString = fromString; - /** - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val - * @param {boolean=} unsigned - * @returns {!Long} - * @inner - */ - function fromValue(val, unsigned) { - if (typeof val === "number") return fromNumber(val, unsigned); - if (typeof val === "string") return fromString(val, unsigned); - return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); - } - /** - * Converts the specified value to a Long using the appropriate from* function for its type. - * @function - * @param {!Long|number|bigint|string|!{low: number, high: number, unsigned: boolean}} val Value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} - */ - Long.fromValue = fromValue; - /** - * @type {number} - * @const - * @inner - */ - var TWO_PWR_16_DBL = 65536; - /** - * @type {number} - * @const - * @inner - */ - var TWO_PWR_24_DBL = 1 << 24; - /** - * @type {number} - * @const - * @inner - */ - var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; - /** - * @type {number} - * @const - * @inner - */ - var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; - /** - * @type {number} - * @const - * @inner - */ - var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; - /** - * @type {!Long} - * @const - * @inner - */ - var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); - /** - * @type {!Long} - * @inner - */ - var ZERO = fromInt(0); - /** - * Signed zero. - * @type {!Long} - */ - Long.ZERO = ZERO; - /** - * @type {!Long} - * @inner - */ - var UZERO = fromInt(0, true); - /** - * Unsigned zero. - * @type {!Long} - */ - Long.UZERO = UZERO; - /** - * @type {!Long} - * @inner - */ - var ONE = fromInt(1); - /** - * Signed one. - * @type {!Long} - */ - Long.ONE = ONE; - /** - * @type {!Long} - * @inner - */ - var UONE = fromInt(1, true); - /** - * Unsigned one. - * @type {!Long} - */ - Long.UONE = UONE; - /** - * @type {!Long} - * @inner - */ - var NEG_ONE = fromInt(-1); - /** - * Signed negative one. - * @type {!Long} - */ - Long.NEG_ONE = NEG_ONE; - /** - * @type {!Long} - * @inner - */ - var MAX_VALUE = fromBits(-1, 2147483647, false); - /** - * Maximum signed value. - * @type {!Long} - */ - Long.MAX_VALUE = MAX_VALUE; - /** - * @type {!Long} - * @inner - */ - var MAX_UNSIGNED_VALUE = fromBits(-1, -1, true); - /** - * Maximum unsigned value. - * @type {!Long} - */ - Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; - /** - * @type {!Long} - * @inner - */ - var MIN_VALUE = fromBits(0, -2147483648, false); - /** - * Minimum signed value. - * @type {!Long} - */ - Long.MIN_VALUE = MIN_VALUE; - /** - * @alias Long.prototype - * @inner - */ - var LongPrototype = Long.prototype; - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - * @this {!Long} - * @returns {number} - */ - LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; - }; - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - * @this {!Long} - * @returns {number} - */ - LongPrototype.toNumber = function toNumber() { - if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); - return this.high * TWO_PWR_32_DBL + (this.low >>> 0); - }; - /** - * Converts the Long to a string written in the specified radix. - * @this {!Long} - * @param {number=} radix Radix (2-36), defaults to 10 - * @returns {string} - * @override - * @throws {RangeError} If `radix` is out of range - */ - LongPrototype.toString = function toString(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - if (this.isZero()) return "0"; - if (this.isNegative()) if (this.eq(MIN_VALUE)) { - var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); - return div.toString(radix) + rem1.toInt().toString(radix); - } else return "-" + this.neg().toString(radix); - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; - var result = ""; - while (true) { - var remDiv = rem.div(radixToPower), digits = (rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0).toString(radix); - rem = remDiv; - if (rem.isZero()) return digits + result; - else { - while (digits.length < 6) digits = "0" + digits; - result = "" + digits + result; - } - } - }; - /** - * Gets the high 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed high bits - */ - LongPrototype.getHighBits = function getHighBits() { - return this.high; - }; - /** - * Gets the high 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned high bits - */ - LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; - }; - /** - * Gets the low 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed low bits - */ - LongPrototype.getLowBits = function getLowBits() { - return this.low; - }; - /** - * Gets the low 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned low bits - */ - LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; - }; - /** - * Gets the number of bits needed to represent the absolute value of this Long. - * @this {!Long} - * @returns {number} - */ - LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; - return this.high != 0 ? bit + 33 : bit + 1; - }; - /** - * Tests if this Long can be safely represented as a JavaScript number. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isSafeInteger = function isSafeInteger() { - var top11Bits = this.high >> 21; - if (!top11Bits) return true; - if (this.unsigned) return false; - return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); - }; - /** - * Tests if this Long's value equals zero. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; - }; - /** - * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. - * @returns {boolean} - */ - LongPrototype.eqz = LongPrototype.isZero; - /** - * Tests if this Long's value is negative. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; - }; - /** - * Tests if this Long's value is positive or zero. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; - }; - /** - * Tests if this Long's value is odd. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; - }; - /** - * Tests if this Long's value is even. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; - }; - /** - * Tests if this Long's value equals the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.equals = function equals(other) { - if (!isLong(other)) other = fromValue(other); - if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false; - return this.high === other.high && this.low === other.low; - }; - /** - * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.eq = LongPrototype.equals; - /** - * Tests if this Long's value differs from the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.notEquals = function notEquals(other) { - return !this.eq(other); - }; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.neq = LongPrototype.notEquals; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.ne = LongPrototype.notEquals; - /** - * Tests if this Long's value is less than the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lessThan = function lessThan(other) { - return this.comp(other) < 0; - }; - /** - * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lt = LongPrototype.lessThan; - /** - * Tests if this Long's value is less than or equal the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp(other) <= 0; - }; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lte = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.le = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is greater than the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.greaterThan = function greaterThan(other) { - return this.comp(other) > 0; - }; - /** - * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.gt = LongPrototype.greaterThan; - /** - * Tests if this Long's value is greater than or equal the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp(other) >= 0; - }; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.gte = LongPrototype.greaterThanOrEqual; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.ge = LongPrototype.greaterThanOrEqual; - /** - * Compares this Long's value with the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - LongPrototype.compare = function compare(other) { - if (!isLong(other)) other = fromValue(other); - if (this.eq(other)) return 0; - var thisNeg = this.isNegative(), otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) return -1; - if (!thisNeg && otherNeg) return 1; - if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; - return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; - }; - /** - * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - LongPrototype.comp = LongPrototype.compare; - /** - * Negates this Long's value. - * @this {!Long} - * @returns {!Long} Negated Long - */ - LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; - return this.not().add(ONE); - }; - /** - * Negates this Long's value. This is an alias of {@link Long#negate}. - * @function - * @returns {!Long} Negated Long - */ - LongPrototype.neg = LongPrototype.negate; - /** - * Returns the sum of this and the specified Long. - * @this {!Long} - * @param {!Long|number|bigint|string} addend Addend - * @returns {!Long} Sum - */ - LongPrototype.add = function add(addend) { - if (!isLong(addend)) addend = fromValue(addend); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = addend.high >>> 16; - var b32 = addend.high & 65535; - var b16 = addend.low >>> 16; - var b00 = addend.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 + b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; - /** - * Returns the difference of this and the specified Long. - * @this {!Long} - * @param {!Long|number|bigint|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ - LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); - }; - /** - * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. - * @function - * @param {!Long|number|bigint|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ - LongPrototype.sub = LongPrototype.subtract; - /** - * Returns the product of this and the specified Long. - * @this {!Long} - * @param {!Long|number|bigint|string} multiplier Multiplier - * @returns {!Long} Product - */ - LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) return this; - if (!isLong(multiplier)) multiplier = fromValue(multiplier); - if (wasm) return fromBits(wasm["mul"](this.low, this.high, multiplier.low, multiplier.high), wasm["get_high"](), this.unsigned); - if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; - if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; - if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; - if (this.isNegative()) if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); - else return this.neg().mul(multiplier).neg(); - else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); - if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 65535; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 65535; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; - /** - * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. - * @function - * @param {!Long|number|bigint|string} multiplier Multiplier - * @returns {!Long} Product - */ - LongPrototype.mul = LongPrototype.multiply; - /** - * Returns this Long divided by the specified. The result is signed if this Long is signed or - * unsigned if this Long is unsigned. - * @this {!Long} - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Quotient - */ - LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (divisor.isZero()) throw Error("division by zero"); - if (wasm) { - if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) return this; - return fromBits((this.unsigned ? wasm["div_u"] : wasm["div_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned); - } - if (this.isZero()) return this.unsigned ? UZERO : ZERO; - var approx, rem, res; - if (!this.unsigned) { - if (this.eq(MIN_VALUE)) if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; - else if (divisor.eq(MIN_VALUE)) return ONE; - else { - approx = this.shr(1).div(divisor).shl(1); - if (approx.eq(ZERO)) return divisor.isNegative() ? ONE : NEG_ONE; - else { - rem = this.sub(divisor.mul(approx)); - res = approx.add(rem.div(divisor)); - return res; - } - } - else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; - if (this.isNegative()) { - if (divisor.isNegative()) return this.neg().div(divisor.neg()); - return this.neg().div(divisor).neg(); - } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); - res = ZERO; - } else { - if (!divisor.unsigned) divisor = divisor.toUnsigned(); - if (divisor.gt(this)) return UZERO; - if (divisor.gt(this.shru(1))) return UONE; - res = UZERO; - } - rem = this; - while (rem.gte(divisor)) { - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); - var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } - if (approxRes.isZero()) approxRes = ONE; - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - return res; - }; - /** - * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. - * @function - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Quotient - */ - LongPrototype.div = LongPrototype.divide; - /** - * Returns this Long modulo the specified. - * @this {!Long} - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Remainder - */ - LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (wasm) return fromBits((this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned); - return this.sub(this.div(divisor).mul(divisor)); - }; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Remainder - */ - LongPrototype.mod = LongPrototype.modulo; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Remainder - */ - LongPrototype.rem = LongPrototype.modulo; - /** - * Returns the bitwise NOT of this Long. - * @this {!Long} - * @returns {!Long} - */ - LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); - }; - /** - * Returns count leading zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; - }; - /** - * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - LongPrototype.clz = LongPrototype.countLeadingZeros; - /** - * Returns count trailing zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; - }; - /** - * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - LongPrototype.ctz = LongPrototype.countTrailingZeros; - /** - * Returns the bitwise AND of this Long and the specified. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other Long - * @returns {!Long} - */ - LongPrototype.and = function and(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); - }; - /** - * Returns the bitwise OR of this Long and the specified. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other Long - * @returns {!Long} - */ - LongPrototype.or = function or(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); - }; - /** - * Returns the bitwise XOR of this Long and the given one. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other Long - * @returns {!Long} - */ - LongPrototype.xor = function xor(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shiftLeft = function shiftLeft(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - else if (numBits < 32) return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned); - else return fromBits(0, this.low << numBits - 32, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shl = LongPrototype.shiftLeft; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shiftRight = function shiftRight(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - else if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned); - else return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); - }; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shr = LongPrototype.shiftRight; - /** - * Returns this Long with bits logically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> numBits - 32, 0, this.unsigned); - }; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shru = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits rotated to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned); - } - numBits -= 32; - b = 32 - numBits; - return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotl = LongPrototype.rotateLeft; - /** - * Returns this Long with bits rotated to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned); - } - numBits -= 32; - b = 32 - numBits; - return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotr = LongPrototype.rotateRight; - /** - * Converts this Long to signed. - * @this {!Long} - * @returns {!Long} Signed long - */ - LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) return this; - return fromBits(this.low, this.high, false); - }; - /** - * Converts this Long to unsigned. - * @this {!Long} - * @returns {!Long} Unsigned long - */ - LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) return this; - return fromBits(this.low, this.high, true); - }; - /** - * Converts this Long to its byte representation. - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @this {!Long} - * @returns {!Array.} Byte representation - */ - LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); - }; - /** - * Converts this Long to its little endian byte representation. - * @this {!Long} - * @returns {!Array.} Little endian byte representation - */ - LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, lo = this.low; - return [ - lo & 255, - lo >>> 8 & 255, - lo >>> 16 & 255, - lo >>> 24, - hi & 255, - hi >>> 8 & 255, - hi >>> 16 & 255, - hi >>> 24 - ]; - }; - /** - * Converts this Long to its big endian byte representation. - * @this {!Long} - * @returns {!Array.} Big endian byte representation - */ - LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, lo = this.low; - return [ - hi >>> 24, - hi >>> 16 & 255, - hi >>> 8 & 255, - hi & 255, - lo >>> 24, - lo >>> 16 & 255, - lo >>> 8 & 255, - lo & 255 - ]; - }; - /** - * Creates a Long from its byte representation. - * @param {!Array.} bytes Byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @returns {Long} The corresponding Long value - */ - Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); - }; - /** - * Creates a Long from its little endian byte representation. - * @param {!Array.} bytes Little endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); - }; - /** - * Creates a Long from its big endian byte representation. - * @param {!Array.} bytes Big endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); - }; - if (typeof BigInt === "function") { - /** - * Returns a Long representing the given big integer. - * @function - * @param {number} value The big integer value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromBigInt = function fromBigInt(value, unsigned) { - return fromBits(Number(BigInt.asIntN(32, value)), Number(BigInt.asIntN(32, value >> BigInt(32))), unsigned); - }; - Long.fromValue = function fromValueWithBigInt(value, unsigned) { - if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); - return fromValue(value, unsigned); - }; - /** - * Converts the Long to its big integer representation. - * @this {!Long} - * @returns {bigint} - */ - LongPrototype.toBigInt = function toBigInt() { - var lowBigInt = BigInt(this.low >>> 0); - return BigInt(this.unsigned ? this.high >>> 0 : this.high) << BigInt(32) | lowBigInt; - }; - } - _exports.default = Long; - }); -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/util/minimal.js -var require_minimal$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var util = exports; - util.asPromise = require_aspromise(); - util.base64 = require_base64(); - util.EventEmitter = require_eventemitter(); - util.float = require_float(); - util.inquire = require_inquire(); - util.utf8 = require_utf8(); - util.pool = require_pool(); - util.LongBits = require_longbits(); - /** - * Tests if the specified key can affect object prototypes. - * @memberof util - * @param {string} key Key to test - * @returns {boolean} `true` if the key is unsafe - */ - function isUnsafeProperty(key) { - return key === "__proto__" || key === "prototype" || key === "constructor"; - } - util.isUnsafeProperty = isUnsafeProperty; - /** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ - util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node); - /** - * Global object reference. - * @memberof util - * @type {Object} - */ - util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports; - /** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ - util.emptyArray = Object.freeze ? Object.freeze([]) : []; - /** - * An immutable empty object. - * @type {Object} - * @const - */ - util.emptyObject = Object.freeze ? Object.freeze({}) : ( /* istanbul ignore next */ {}); - /** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ - util.isInteger = Number.isInteger || function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; - }; - /** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ - util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; - }; - /** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object - */ - util.isObject = function isObject$1(value) { - return value && typeof value === "object"; - }; - /** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` - */ - util.isset = util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; - }; - /** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - /** - * Node's Buffer class if available. - * @type {Constructor} - */ - util.Buffer = (function() { - try { - var Buffer$1 = util.global.Buffer; - return Buffer$1.prototype.utf8Write ? Buffer$1 : null; - } catch (e) { - /* istanbul ignore next */ - return null; - } - })(); - util._Buffer_from = null; - util._Buffer_allocUnsafe = null; - /** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ - util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); - }; - /** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ - util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; - /** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not - */ - /** - * Long.js's Long class if available. - * @type {Constructor} - */ - util.Long = util.global.dcodeIO && util.global.dcodeIO.Long || util.global.Long || (function() { - try { - var Long = require_umd(); - return Long && Long.isLong ? Long : null; - } catch (e) { - /* istanbul ignore next */ - return null; - } - })(); - /** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ - util.key2Re = /^true|false|0|1$/; - /** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ - util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - /** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ - util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - /** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ - util.longToHash = function longToHash(value) { - return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash; - }; - /** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value - */ - util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); - }; - /** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {...(Object.|boolean)} src Source objects, optionally followed by an `ifNotSet` flag - * @returns {Object.} Destination object - */ - function merge(dst) { - var ifNotSet = typeof arguments[arguments.length - 1] === "boolean", limit = ifNotSet ? arguments.length - 1 : arguments.length; - ifNotSet = ifNotSet && arguments[arguments.length - 1]; - for (var a = 1; a < limit; ++a) { - var src = arguments[a]; - if (!src) continue; - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) if (!isUnsafeProperty(keys[i]) && (dst[keys[i]] === void 0 || !ifNotSet)) dst[keys[i]] = src[keys[i]]; - } - return dst; - } - util.merge = merge; - /** - * Schema declaration nesting limit. - * @memberof util - * @type {number} - */ - util.nestingLimit = 32; - /** - * Recursion limit. - * @memberof util - * @type {number} - */ - util.recursionLimit = 100; - /** - * Makes a property safe for assignment as an own property. - * @memberof util - * @param {Object.} obj Object - * @param {string} key Property key - * @returns {undefined} - */ - util.makeProp = function makeProp(obj, key) { - Object.defineProperty(obj, key, { - enumerable: true, - configurable: true, - writable: true - }); - }; - /** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string - */ - util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); - }; - /** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ - function newError(name) { - function CustomError(message, properties) { - if (!(this instanceof CustomError)) return new CustomError(message, properties); - Object.defineProperty(this, "message", { get: function() { - return message; - } }); - /* istanbul ignore next */ - if (Error.captureStackTrace) Error.captureStackTrace(this, CustomError); - else Object.defineProperty(this, "stack", { value: (/* @__PURE__ */ new Error()).stack || "" }); - if (properties) merge(this, properties); - } - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true - }, - name: { - get: function get() { - return name; - }, - set: void 0, - enumerable: false, - configurable: true - }, - toString: { - value: function value() { - return this.name + ": " + this.message; - }, - writable: true, - enumerable: false, - configurable: true - } - }); - return CustomError; - } - util.newError = newError; - /** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ - util.ProtocolError = newError("ProtocolError"); - /** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ - /** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any - */ - /** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter - */ - util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) fieldMap[fieldNames[i]] = 1; - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { - for (var keys = Object.keys(this), i$1 = keys.length - 1; i$1 > -1; --i$1) if (fieldMap[keys[i$1]] === 1 && this[keys[i$1]] !== void 0 && this[keys[i$1]] !== null) return keys[i$1]; - }; - }; - /** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} - */ - /** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter - */ - util.oneOfSetter = function setOneOf(fieldNames) { - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) if (fieldNames[i] !== name) delete this[fieldNames[i]]; - }; - }; - /** - * Default conversion options used for {@link Message#toJSON} implementations. - * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: - * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings - * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json - */ - util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true - }; - util._configure = function() { - var Buffer$1 = util.Buffer; - /* istanbul ignore if */ - if (!Buffer$1) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; - } - util._Buffer_from = Buffer$1.from !== Uint8Array.from && Buffer$1.from || function Buffer_from(value, encoding) { - return new Buffer$1(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer$1.allocUnsafe || function Buffer_allocUnsafe(size) { - return new Buffer$1(size); - }; - }; -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/writer.js -var require_writer = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Writer; - var util = require_minimal$1(); - var BufferWriter; - var LongBits = util.LongBits, base64 = util.base64, utf8 = util.utf8; - /** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore - */ - function Op(fn, len, val) { - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - /** - * Value byte length. - * @type {number} - */ - this.len = len; - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = void 0; - /** - * Value to write. - * @type {*} - */ - this.val = val; - } - /* istanbul ignore next */ - function noop() {} - /** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ - function State(writer) { - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; - } - /** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ - function Writer() { - /** - * Current length. - * @type {number} - */ - this.len = 0; - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - } - var create = function create() { - return util.Buffer ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } : function create_array() { - return new Writer(); - }; - }; - /** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ - Writer.create = create(); - /** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - Writer.alloc = function alloc(size) { - return new util.Array(size); - }; - /* istanbul ignore else */ - if (util.Array !== Array) Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - /** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ - Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; - }; - function writeByte(val, buf, pos) { - buf[pos] = val & 255; - } - function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; - } - /** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ - function VarintOp(len, val) { - this.len = len; - this.next = void 0; - this.val = val; - } - VarintOp.prototype = Object.create(Op.prototype); - VarintOp.prototype.fn = writeVarint32; - /** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.uint32 = function write_uint32(value) { - this.len += (this.tail = this.tail.next = new VarintOp((value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, value)).len; - return this; - }; - /** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.int32 = function write_int32(value) { - return (value |= 0) < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value); - }; - /** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); - }; - function writeVarint64(val, buf, pos) { - var lo = val.lo, hi = val.hi; - while (hi) { - buf[pos++] = lo & 127 | 128; - lo = (lo >>> 7 | hi << 25) >>> 0; - hi >>>= 7; - } - while (lo > 127) { - buf[pos++] = lo & 127 | 128; - lo = lo >>> 7; - } - buf[pos++] = lo; - } - /** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); - }; - /** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.int64 = Writer.prototype.uint64; - /** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); - }; - /** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); - }; - function writeFixed32(val, buf, pos) { - buf[pos] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; - } - /** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); - }; - /** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.sfixed32 = Writer.prototype.fixed32; - /** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); - }; - /** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.sfixed64 = Writer.prototype.fixed64; - /** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); - }; - /** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); - }; - var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); - } : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) buf[pos + i] = val[i]; - }; - /** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ - Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; - } - return this.uint32(len)._push(writeBytes, len, value); - }; - /** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0); - }; - /** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ - Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; - }; - /** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ - Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - } - return this; - }; - /** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` - */ - Writer.prototype.ldelim = function ldelim() { - var head = this.head, tail = this.tail, len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; - this.tail = tail; - this.len += len; - } - return this; - }; - /** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ - Writer.prototype.finish = function finish() { - var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; - } - return buf; - }; - Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); - }; -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/writer_buffer.js -var require_writer_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = BufferWriter; - var Writer = require_writer(); - (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - var util = require_minimal$1(); - /** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor - */ - function BufferWriter() { - Writer.call(this); - } - BufferWriter._configure = function() { - /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer - */ - BufferWriter.alloc = util._Buffer_allocUnsafe; - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); - } : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) buf[pos++] = val[i++]; - }; - }; - /** - * @override - */ - BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) this._push(BufferWriter.writeBytesBuffer, len, value); - return this; - }; - function writeStringBuffer(val, buf, pos) { - if (val.length < 40) util.utf8.write(val, buf, pos); - else if (buf.utf8Write) buf.utf8Write(val, pos); - else buf.write(val, pos); - } - /** - * @override - */ - BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) this._push(writeStringBuffer, len, value); - return this; - }; - /** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - BufferWriter._configure(); -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/reader.js -var require_reader = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Reader; - var util = require_minimal$1(); - var BufferReader; - var LongBits = util.LongBits, utf8 = util.utf8; - /* istanbul ignore next */ - function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); - } - /** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from - */ - function Reader(buffer) { - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; - /** - * Read buffer position. - * @type {number} - */ - this.pos = 0; - /** - * Read buffer length. - * @type {number} - */ - this.len = buffer.length; - } - var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) return new Reader(buffer); - throw Error("illegal buffer"); - } : function create_array(buffer) { - if (Array.isArray(buffer)) return new Reader(buffer); - throw Error("illegal buffer"); - }; - var create = function create() { - return util.Buffer ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer$1) { - return util.Buffer.isBuffer(buffer$1) ? new BufferReader(buffer$1) : create_array(buffer$1); - })(buffer); - } : create_array; - }; - /** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ - Reader.create = create(); - Reader.prototype._slice = util.Array.prototype.subarray || util.Array.prototype.slice; - /** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ - Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; - return function read_uint32() { - value = (this.buf[this.pos] & 127) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; - if (this.buf[this.pos++] < 128) return value; - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; - })(); - /** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ - Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; - }; - /** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ - Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; - }; - function readLongVarint() { - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { - for (; i < 4; ++i) { - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - } - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) throw indexOutOfRange(this); - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - } - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; - } - if (this.len - this.pos > 4) for (; i < 5; ++i) { - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - } - else for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) throw indexOutOfRange(this); - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); - } - /** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ - Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; - }; - function readFixed32_end(buf, end) { - return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; - } - /** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ - Reader.prototype.fixed32 = function read_fixed32() { - /* istanbul ignore if */ - if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); - return readFixed32_end(this.buf, this.pos += 4); - }; - /** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ - Reader.prototype.sfixed32 = function read_sfixed32() { - /* istanbul ignore if */ - if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); - return readFixed32_end(this.buf, this.pos += 4) | 0; - }; - function readFixed64() { - /* istanbul ignore if */ - if (this.pos + 8 > this.len) throw indexOutOfRange(this, 8); - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); - } - /** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - /** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ - Reader.prototype.float = function read_float() { - /* istanbul ignore if */ - if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; - }; - /** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ - Reader.prototype.double = function read_double() { - /* istanbul ignore if */ - if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4); - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; - }; - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ - Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), start = this.pos, end = this.pos + length; - /* istanbul ignore if */ - if (end > this.len) throw indexOutOfRange(this, length); - this.pos += length; - if (Array.isArray(this.buf)) return this.buf.slice(start, end); - if (start === end) { - var nativeBuffer = util.Buffer; - return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); - } - return this._slice.call(this.buf, start, end); - }; - /** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ - Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); - }; - /** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ - Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) throw indexOutOfRange(this, length); - this.pos += length; - } else do - /* istanbul ignore if */ - if (this.pos >= this.len) throw indexOutOfRange(this); - while (this.buf[this.pos++] & 128); - return this; - }; - /** - * Recursion limit. - * @type {number} - */ - Reader.recursionLimit = util.recursionLimit; - /** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted - * @returns {Reader} `this` - */ - Reader.prototype.skipType = function(wireType, depth) { - if (depth === void 0) depth = 0; - if (depth > Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) this.skipType(wireType, depth + 1); - break; - case 5: - this.skip(4); - break; - default: throw Error("invalid wire type " + wireType + " at offset " + this.pos); - } - return this; - }; - Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); - var fn = util.Long ? "toLong" : "toNumber"; - util.merge(Reader.prototype, { - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - }); - }; -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/reader_buffer.js -var require_reader_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = BufferReader; - var Reader = require_reader(); - (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - var util = require_minimal$1(); - /** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ - function BufferReader(buffer) { - Reader.call(this, buffer); - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ - } - BufferReader._configure = function() { - /* istanbul ignore else */ - if (util.Buffer) BufferReader.prototype._slice = util.Buffer.prototype.slice; - }; - /** - * @override - */ - BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); - return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); - }; - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - BufferReader._configure(); -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/rpc/service.js -var require_service = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Service; - var util = require_minimal$1(); - (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; - /** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. - * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - /** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - /** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Service(rpcImpl, requestDelimited, responseDelimited) { - if (typeof rpcImpl !== "function") throw TypeError("rpcImpl must be a function"); - util.EventEmitter.call(this); - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); - } - /** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ - Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - if (!request) throw TypeError("request must be specified"); - var self$1 = this; - if (!callback) return util.asPromise(rpcCall, self$1, method, requestCtor, responseCtor, request); - if (!self$1.rpcImpl) { - setTimeout(function() { - callback(Error("already ended")); - }, 0); - return; - } - try { - return self$1.rpcImpl(method, requestCtor[self$1.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err, response) { - if (err) { - self$1.emit("error", err, method); - return callback(err); - } - if (response === null) { - self$1.end(true); - return; - } - if (!(response instanceof responseCtor)) try { - response = responseCtor[self$1.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err$1) { - self$1.emit("error", err$1, method); - return callback(err$1); - } - self$1.emit("data", response, method); - return callback(null, response); - }); - } catch (err) { - self$1.emit("error", err, method); - setTimeout(function() { - callback(err); - }, 0); - return; - } - }; - /** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ - Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); - } - return this; - }; -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/rpc.js -var require_rpc = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * Streaming RPC helpers. - * @namespace - */ - var rpc = exports; - /** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - /** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - rpc.Service = require_service(); -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/roots.js -var require_roots = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Object.create(null); -})); -/** -* Named roots. -* This is where pbjs stores generated structures (the option `-r, --root` specifies a name). -* Can also be used manually to make roots available across modules. -* @name roots -* @type {Object.} -* @example -* // pbjs -r myroot -o compiled.js ... -* -* // in another module: -* require("./compiled.js"); -* -* // in any subsequent module: -* var root = protobuf.roots["myroot"]; -*/ - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/index-minimal.js -var require_index_minimal = /* @__PURE__ */ __commonJSMin(((exports) => { - var protobuf = exports; - /** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ - protobuf.build = "minimal"; - protobuf.Writer = require_writer(); - protobuf.BufferWriter = require_writer_buffer(); - protobuf.Reader = require_reader(); - protobuf.BufferReader = require_reader_buffer(); - protobuf.util = require_minimal$1(); - protobuf.rpc = require_rpc(); - protobuf.roots = require_roots(); - protobuf.configure = configure; - /* istanbul ignore next */ - /** - * Reconfigures the library according to the environment. - * @returns {undefined} - */ - function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); - } - configure(); -})); - -//#endregion -//#region node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/minimal.js -var require_minimal = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = require_index_minimal(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js -var require_root = /* @__PURE__ */ __commonJSMin(((exports, module) => { - Object.defineProperty(exports, "__esModule", { value: true }); - var $protobuf = require_minimal(); - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); - $root.opentelemetry = (function() { - /** - * Namespace opentelemetry. - * @exports opentelemetry - * @namespace - */ - var opentelemetry = {}; - opentelemetry.proto = (function() { - /** - * Namespace proto. - * @memberof opentelemetry - * @namespace - */ - var proto = {}; - proto.common = (function() { - /** - * Namespace common. - * @memberof opentelemetry.proto - * @namespace - */ - var common = {}; - common.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.common - * @namespace - */ - var v1 = {}; - v1.AnyValue = (function() { - /** - * Properties of an AnyValue. - * @memberof opentelemetry.proto.common.v1 - * @interface IAnyValue - * @property {string|null} [stringValue] AnyValue stringValue - * @property {boolean|null} [boolValue] AnyValue boolValue - * @property {number|Long|null} [intValue] AnyValue intValue - * @property {number|null} [doubleValue] AnyValue doubleValue - * @property {opentelemetry.proto.common.v1.IArrayValue|null} [arrayValue] AnyValue arrayValue - * @property {opentelemetry.proto.common.v1.IKeyValueList|null} [kvlistValue] AnyValue kvlistValue - * @property {Uint8Array|null} [bytesValue] AnyValue bytesValue - */ - /** - * Constructs a new AnyValue. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an AnyValue. - * @implements IAnyValue - * @constructor - * @param {opentelemetry.proto.common.v1.IAnyValue=} [properties] Properties to set - */ - function AnyValue(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * AnyValue stringValue. - * @member {string|null|undefined} stringValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.stringValue = null; - /** - * AnyValue boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.boolValue = null; - /** - * AnyValue intValue. - * @member {number|Long|null|undefined} intValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.intValue = null; - /** - * AnyValue doubleValue. - * @member {number|null|undefined} doubleValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.doubleValue = null; - /** - * AnyValue arrayValue. - * @member {opentelemetry.proto.common.v1.IArrayValue|null|undefined} arrayValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.arrayValue = null; - /** - * AnyValue kvlistValue. - * @member {opentelemetry.proto.common.v1.IKeyValueList|null|undefined} kvlistValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.kvlistValue = null; - /** - * AnyValue bytesValue. - * @member {Uint8Array|null|undefined} bytesValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.bytesValue = null; - var $oneOfFields; - /** - * AnyValue value. - * @member {"stringValue"|"boolValue"|"intValue"|"doubleValue"|"arrayValue"|"kvlistValue"|"bytesValue"|undefined} value - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - Object.defineProperty(AnyValue.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = [ - "stringValue", - "boolValue", - "intValue", - "doubleValue", - "arrayValue", - "kvlistValue", - "bytesValue" - ]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new AnyValue instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.IAnyValue=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue instance - */ - AnyValue.create = function create(properties) { - return new AnyValue(properties); - }; - /** - * Encodes the specified AnyValue message. Does not implicitly {@link opentelemetry.proto.common.v1.AnyValue.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.IAnyValue} message AnyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnyValue.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(10).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) writer.uint32(16).bool(message.boolValue); - if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) writer.uint32(24).int64(message.intValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(33).double(message.doubleValue); - if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) $root.opentelemetry.proto.common.v1.ArrayValue.encode(message.arrayValue, writer.uint32(42).fork()).ldelim(); - if (message.kvlistValue != null && Object.hasOwnProperty.call(message, "kvlistValue")) $root.opentelemetry.proto.common.v1.KeyValueList.encode(message.kvlistValue, writer.uint32(50).fork()).ldelim(); - if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) writer.uint32(58).bytes(message.bytesValue); - return writer; - }; - /** - * Encodes the specified AnyValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.AnyValue.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.IAnyValue} message AnyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnyValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an AnyValue message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AnyValue.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.AnyValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.stringValue = reader.string(); - break; - case 2: - message.boolValue = reader.bool(); - break; - case 3: - message.intValue = reader.int64(); - break; - case 4: - message.doubleValue = reader.double(); - break; - case 5: - message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.decode(reader, reader.uint32()); - break; - case 6: - message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.decode(reader, reader.uint32()); - break; - case 7: - message.bytesValue = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an AnyValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AnyValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an AnyValue message. - * @function verify - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AnyValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - properties.value = 1; - if (!$util.isString(message.stringValue)) return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (typeof message.boolValue !== "boolean") return "boolValue: boolean expected"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) return "intValue: integer|Long expected"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - var error = $root.opentelemetry.proto.common.v1.ArrayValue.verify(message.arrayValue); - if (error) return "arrayValue." + error; - } - if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - var error = $root.opentelemetry.proto.common.v1.KeyValueList.verify(message.kvlistValue); - if (error) return "kvlistValue." + error; - } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) return "bytesValue: buffer expected"; - } - return null; - }; - /** - * Creates an AnyValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue - */ - AnyValue.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.AnyValue) return object$1; - var message = new $root.opentelemetry.proto.common.v1.AnyValue(); - if (object$1.stringValue != null) message.stringValue = String(object$1.stringValue); - if (object$1.boolValue != null) message.boolValue = Boolean(object$1.boolValue); - if (object$1.intValue != null) { - if ($util.Long) (message.intValue = $util.Long.fromValue(object$1.intValue)).unsigned = false; - else if (typeof object$1.intValue === "string") message.intValue = parseInt(object$1.intValue, 10); - else if (typeof object$1.intValue === "number") message.intValue = object$1.intValue; - else if (typeof object$1.intValue === "object") message.intValue = new $util.LongBits(object$1.intValue.low >>> 0, object$1.intValue.high >>> 0).toNumber(); - } - if (object$1.doubleValue != null) message.doubleValue = Number(object$1.doubleValue); - if (object$1.arrayValue != null) { - if (typeof object$1.arrayValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected"); - message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.fromObject(object$1.arrayValue); - } - if (object$1.kvlistValue != null) { - if (typeof object$1.kvlistValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected"); - message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.fromObject(object$1.kvlistValue); - } - if (object$1.bytesValue != null) { - if (typeof object$1.bytesValue === "string") $util.base64.decode(object$1.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object$1.bytesValue)), 0); - else if (object$1.bytesValue.length >= 0) message.bytesValue = object$1.bytesValue; - } - return message; - }; - /** - * Creates a plain object from an AnyValue message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.AnyValue} message AnyValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AnyValue.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object$1.stringValue = message.stringValue; - if (options.oneofs) object$1.value = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object$1.boolValue = message.boolValue; - if (options.oneofs) object$1.value = "boolValue"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (typeof message.intValue === "number") object$1.intValue = options.longs === String ? String(message.intValue) : message.intValue; - else object$1.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; - if (options.oneofs) object$1.value = "intValue"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - object$1.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (options.oneofs) object$1.value = "doubleValue"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - object$1.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.toObject(message.arrayValue, options); - if (options.oneofs) object$1.value = "arrayValue"; - } - if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { - object$1.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.toObject(message.kvlistValue, options); - if (options.oneofs) object$1.value = "kvlistValue"; - } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { - object$1.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; - if (options.oneofs) object$1.value = "bytesValue"; - } - return object$1; - }; - /** - * Converts this AnyValue to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - * @returns {Object.} JSON object - */ - AnyValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for AnyValue - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AnyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.AnyValue"; - }; - return AnyValue; - })(); - v1.ArrayValue = (function() { - /** - * Properties of an ArrayValue. - * @memberof opentelemetry.proto.common.v1 - * @interface IArrayValue - * @property {Array.|null} [values] ArrayValue values - */ - /** - * Constructs a new ArrayValue. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an ArrayValue. - * @implements IArrayValue - * @constructor - * @param {opentelemetry.proto.common.v1.IArrayValue=} [properties] Properties to set - */ - function ArrayValue(properties) { - this.values = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ArrayValue values. - * @member {Array.} values - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @instance - */ - ArrayValue.prototype.values = $util.emptyArray; - /** - * Creates a new ArrayValue instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.IArrayValue=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue instance - */ - ArrayValue.create = function create(properties) { - return new ArrayValue(properties); - }; - /** - * Encodes the specified ArrayValue message. Does not implicitly {@link opentelemetry.proto.common.v1.ArrayValue.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.IArrayValue} message ArrayValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ArrayValue.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.ArrayValue.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.IArrayValue} message ArrayValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ArrayValue message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ArrayValue.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.ArrayValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) message.values = []; - message.values.push($root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ArrayValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ArrayValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ArrayValue message. - * @function verify - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ArrayValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.values[i]); - if (error) return "values." + error; - } - } - return null; - }; - /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue - */ - ArrayValue.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.ArrayValue) return object$1; - var message = new $root.opentelemetry.proto.common.v1.ArrayValue(); - if (object$1.values) { - if (!Array.isArray(object$1.values)) throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected"); - message.values = []; - for (var i = 0; i < object$1.values.length; ++i) { - if (typeof object$1.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected"); - message.values[i] = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.values[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.ArrayValue} message ArrayValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ArrayValue.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.values = []; - if (message.values && message.values.length) { - object$1.values = []; - for (var j = 0; j < message.values.length; ++j) object$1.values[j] = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.values[j], options); - } - return object$1; - }; - /** - * Converts this ArrayValue to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @instance - * @returns {Object.} JSON object - */ - ArrayValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ArrayValue - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.ArrayValue"; - }; - return ArrayValue; - })(); - v1.KeyValueList = (function() { - /** - * Properties of a KeyValueList. - * @memberof opentelemetry.proto.common.v1 - * @interface IKeyValueList - * @property {Array.|null} [values] KeyValueList values - */ - /** - * Constructs a new KeyValueList. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents a KeyValueList. - * @implements IKeyValueList - * @constructor - * @param {opentelemetry.proto.common.v1.IKeyValueList=} [properties] Properties to set - */ - function KeyValueList(properties) { - this.values = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * KeyValueList values. - * @member {Array.} values - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @instance - */ - KeyValueList.prototype.values = $util.emptyArray; - /** - * Creates a new KeyValueList instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.IKeyValueList=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList instance - */ - KeyValueList.create = function create(properties) { - return new KeyValueList(properties); - }; - /** - * Encodes the specified KeyValueList message. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValueList.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.IKeyValueList} message KeyValueList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValueList.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified KeyValueList message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValueList.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.IKeyValueList} message KeyValueList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValueList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a KeyValueList message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValueList.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValueList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) message.values = []; - message.values.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a KeyValueList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValueList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a KeyValueList message. - * @function verify - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyValueList.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.values[i]); - if (error) return "values." + error; - } - } - return null; - }; - /** - * Creates a KeyValueList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList - */ - KeyValueList.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.KeyValueList) return object$1; - var message = new $root.opentelemetry.proto.common.v1.KeyValueList(); - if (object$1.values) { - if (!Array.isArray(object$1.values)) throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected"); - message.values = []; - for (var i = 0; i < object$1.values.length; ++i) { - if (typeof object$1.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected"); - message.values[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.values[i]); - } - } - return message; - }; - /** - * Creates a plain object from a KeyValueList message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.KeyValueList} message KeyValueList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyValueList.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.values = []; - if (message.values && message.values.length) { - object$1.values = []; - for (var j = 0; j < message.values.length; ++j) object$1.values[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.values[j], options); - } - return object$1; - }; - /** - * Converts this KeyValueList to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @instance - * @returns {Object.} JSON object - */ - KeyValueList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for KeyValueList - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyValueList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValueList"; - }; - return KeyValueList; - })(); - v1.KeyValue = (function() { - /** - * Properties of a KeyValue. - * @memberof opentelemetry.proto.common.v1 - * @interface IKeyValue - * @property {string|null} [key] KeyValue key - * @property {opentelemetry.proto.common.v1.IAnyValue|null} [value] KeyValue value - */ - /** - * Constructs a new KeyValue. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents a KeyValue. - * @implements IKeyValue - * @constructor - * @param {opentelemetry.proto.common.v1.IKeyValue=} [properties] Properties to set - */ - function KeyValue(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * KeyValue key. - * @member {string|null|undefined} key - * @memberof opentelemetry.proto.common.v1.KeyValue - * @instance - */ - KeyValue.prototype.key = null; - /** - * KeyValue value. - * @member {opentelemetry.proto.common.v1.IAnyValue|null|undefined} value - * @memberof opentelemetry.proto.common.v1.KeyValue - * @instance - */ - KeyValue.prototype.value = null; - /** - * Creates a new KeyValue instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.IKeyValue=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue instance - */ - KeyValue.create = function create(properties) { - return new KeyValue(properties); - }; - /** - * Encodes the specified KeyValue message. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValue.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.IKeyValue} message KeyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValue.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) writer.uint32(10).string(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.value, writer.uint32(18).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValue.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.IKeyValue} message KeyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a KeyValue message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValue.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a KeyValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a KeyValue message. - * @function verify - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - if (!$util.isString(message.key)) return "key: string expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.value); - if (error) return "value." + error; - } - return null; - }; - /** - * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue - */ - KeyValue.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.KeyValue) return object$1; - var message = new $root.opentelemetry.proto.common.v1.KeyValue(); - if (object$1.key != null) message.key = String(object$1.key); - if (object$1.value != null) { - if (typeof object$1.value !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected"); - message.value = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.value); - } - return message; - }; - /** - * Creates a plain object from a KeyValue message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.KeyValue} message KeyValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyValue.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - object$1.key = ""; - object$1.value = null; - } - if (message.key != null && message.hasOwnProperty("key")) object$1.key = message.key; - if (message.value != null && message.hasOwnProperty("value")) object$1.value = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.value, options); - return object$1; - }; - /** - * Converts this KeyValue to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.KeyValue - * @instance - * @returns {Object.} JSON object - */ - KeyValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for KeyValue - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValue"; - }; - return KeyValue; - })(); - v1.InstrumentationScope = (function() { - /** - * Properties of an InstrumentationScope. - * @memberof opentelemetry.proto.common.v1 - * @interface IInstrumentationScope - * @property {string|null} [name] InstrumentationScope name - * @property {string|null} [version] InstrumentationScope version - * @property {Array.|null} [attributes] InstrumentationScope attributes - * @property {number|null} [droppedAttributesCount] InstrumentationScope droppedAttributesCount - */ - /** - * Constructs a new InstrumentationScope. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an InstrumentationScope. - * @implements IInstrumentationScope - * @constructor - * @param {opentelemetry.proto.common.v1.IInstrumentationScope=} [properties] Properties to set - */ - function InstrumentationScope(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * InstrumentationScope name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.name = null; - /** - * InstrumentationScope version. - * @member {string|null|undefined} version - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.version = null; - /** - * InstrumentationScope attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.attributes = $util.emptyArray; - /** - * InstrumentationScope droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.droppedAttributesCount = null; - /** - * Creates a new InstrumentationScope instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.IInstrumentationScope=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope instance - */ - InstrumentationScope.create = function create(properties) { - return new InstrumentationScope(properties); - }; - /** - * Encodes the specified InstrumentationScope message. Does not implicitly {@link opentelemetry.proto.common.v1.InstrumentationScope.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.IInstrumentationScope} message InstrumentationScope message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstrumentationScope.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(18).string(message.version); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); - return writer; - }; - /** - * Encodes the specified InstrumentationScope message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.InstrumentationScope.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.IInstrumentationScope} message InstrumentationScope message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstrumentationScope.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an InstrumentationScope message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstrumentationScope.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.InstrumentationScope(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - case 3: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 4: - message.droppedAttributesCount = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an InstrumentationScope message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstrumentationScope.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an InstrumentationScope message. - * @function verify - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstrumentationScope.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.version != null && message.hasOwnProperty("version")) { - if (!$util.isString(message.version)) return "version: string expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - return null; - }; - /** - * Creates an InstrumentationScope message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope - */ - InstrumentationScope.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.InstrumentationScope) return object$1; - var message = new $root.opentelemetry.proto.common.v1.InstrumentationScope(); - if (object$1.name != null) message.name = String(object$1.name); - if (object$1.version != null) message.version = String(object$1.version); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - return message; - }; - /** - * Creates a plain object from an InstrumentationScope message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.InstrumentationScope} message InstrumentationScope - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstrumentationScope.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - object$1.name = ""; - object$1.version = ""; - object$1.droppedAttributesCount = 0; - } - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) object$1.version = message.version; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - return object$1; - }; - /** - * Converts this InstrumentationScope to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - * @returns {Object.} JSON object - */ - InstrumentationScope.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for InstrumentationScope - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstrumentationScope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.InstrumentationScope"; - }; - return InstrumentationScope; - })(); - v1.EntityRef = (function() { - /** - * Properties of an EntityRef. - * @memberof opentelemetry.proto.common.v1 - * @interface IEntityRef - * @property {string|null} [schemaUrl] EntityRef schemaUrl - * @property {string|null} [type] EntityRef type - * @property {Array.|null} [idKeys] EntityRef idKeys - * @property {Array.|null} [descriptionKeys] EntityRef descriptionKeys - */ - /** - * Constructs a new EntityRef. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an EntityRef. - * @implements IEntityRef - * @constructor - * @param {opentelemetry.proto.common.v1.IEntityRef=} [properties] Properties to set - */ - function EntityRef(properties) { - this.idKeys = []; - this.descriptionKeys = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * EntityRef schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.schemaUrl = null; - /** - * EntityRef type. - * @member {string|null|undefined} type - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.type = null; - /** - * EntityRef idKeys. - * @member {Array.} idKeys - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.idKeys = $util.emptyArray; - /** - * EntityRef descriptionKeys. - * @member {Array.} descriptionKeys - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.descriptionKeys = $util.emptyArray; - /** - * Creates a new EntityRef instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.IEntityRef=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef instance - */ - EntityRef.create = function create(properties) { - return new EntityRef(properties); - }; - /** - * Encodes the specified EntityRef message. Does not implicitly {@link opentelemetry.proto.common.v1.EntityRef.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.IEntityRef} message EntityRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityRef.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(10).string(message.schemaUrl); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(18).string(message.type); - if (message.idKeys != null && message.idKeys.length) for (var i = 0; i < message.idKeys.length; ++i) writer.uint32(26).string(message.idKeys[i]); - if (message.descriptionKeys != null && message.descriptionKeys.length) for (var i = 0; i < message.descriptionKeys.length; ++i) writer.uint32(34).string(message.descriptionKeys[i]); - return writer; - }; - /** - * Encodes the specified EntityRef message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.EntityRef.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.IEntityRef} message EntityRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityRef.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an EntityRef message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityRef.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.EntityRef(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.schemaUrl = reader.string(); - break; - case 2: - message.type = reader.string(); - break; - case 3: - if (!(message.idKeys && message.idKeys.length)) message.idKeys = []; - message.idKeys.push(reader.string()); - break; - case 4: - if (!(message.descriptionKeys && message.descriptionKeys.length)) message.descriptionKeys = []; - message.descriptionKeys.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an EntityRef message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityRef.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an EntityRef message. - * @function verify - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityRef.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - if (message.type != null && message.hasOwnProperty("type")) { - if (!$util.isString(message.type)) return "type: string expected"; - } - if (message.idKeys != null && message.hasOwnProperty("idKeys")) { - if (!Array.isArray(message.idKeys)) return "idKeys: array expected"; - for (var i = 0; i < message.idKeys.length; ++i) if (!$util.isString(message.idKeys[i])) return "idKeys: string[] expected"; - } - if (message.descriptionKeys != null && message.hasOwnProperty("descriptionKeys")) { - if (!Array.isArray(message.descriptionKeys)) return "descriptionKeys: array expected"; - for (var i = 0; i < message.descriptionKeys.length; ++i) if (!$util.isString(message.descriptionKeys[i])) return "descriptionKeys: string[] expected"; - } - return null; - }; - /** - * Creates an EntityRef message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef - */ - EntityRef.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.EntityRef) return object$1; - var message = new $root.opentelemetry.proto.common.v1.EntityRef(); - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - if (object$1.type != null) message.type = String(object$1.type); - if (object$1.idKeys) { - if (!Array.isArray(object$1.idKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected"); - message.idKeys = []; - for (var i = 0; i < object$1.idKeys.length; ++i) message.idKeys[i] = String(object$1.idKeys[i]); - } - if (object$1.descriptionKeys) { - if (!Array.isArray(object$1.descriptionKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected"); - message.descriptionKeys = []; - for (var i = 0; i < object$1.descriptionKeys.length; ++i) message.descriptionKeys[i] = String(object$1.descriptionKeys[i]); - } - return message; - }; - /** - * Creates a plain object from an EntityRef message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.EntityRef} message EntityRef - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityRef.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.idKeys = []; - object$1.descriptionKeys = []; - } - if (options.defaults) { - object$1.schemaUrl = ""; - object$1.type = ""; - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - if (message.type != null && message.hasOwnProperty("type")) object$1.type = message.type; - if (message.idKeys && message.idKeys.length) { - object$1.idKeys = []; - for (var j = 0; j < message.idKeys.length; ++j) object$1.idKeys[j] = message.idKeys[j]; - } - if (message.descriptionKeys && message.descriptionKeys.length) { - object$1.descriptionKeys = []; - for (var j = 0; j < message.descriptionKeys.length; ++j) object$1.descriptionKeys[j] = message.descriptionKeys[j]; - } - return object$1; - }; - /** - * Converts this EntityRef to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - * @returns {Object.} JSON object - */ - EntityRef.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for EntityRef - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.EntityRef"; - }; - return EntityRef; - })(); - return v1; - })(); - return common; - })(); - proto.resource = (function() { - /** - * Namespace resource. - * @memberof opentelemetry.proto - * @namespace - */ - var resource = {}; - resource.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.resource - * @namespace - */ - var v1 = {}; - v1.Resource = (function() { - /** - * Properties of a Resource. - * @memberof opentelemetry.proto.resource.v1 - * @interface IResource - * @property {Array.|null} [attributes] Resource attributes - * @property {number|null} [droppedAttributesCount] Resource droppedAttributesCount - * @property {Array.|null} [entityRefs] Resource entityRefs - */ - /** - * Constructs a new Resource. - * @memberof opentelemetry.proto.resource.v1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {opentelemetry.proto.resource.v1.IResource=} [properties] Properties to set - */ - function Resource(properties) { - this.attributes = []; - this.entityRefs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Resource attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - */ - Resource.prototype.attributes = $util.emptyArray; - /** - * Resource droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - */ - Resource.prototype.droppedAttributesCount = null; - /** - * Resource entityRefs. - * @member {Array.} entityRefs - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - */ - Resource.prototype.entityRefs = $util.emptyArray; - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.IResource=} [properties] Properties to set - * @returns {opentelemetry.proto.resource.v1.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; - /** - * Encodes the specified Resource message. Does not implicitly {@link opentelemetry.proto.resource.v1.Resource.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(16).uint32(message.droppedAttributesCount); - if (message.entityRefs != null && message.entityRefs.length) for (var i = 0; i < message.entityRefs.length; ++i) $root.opentelemetry.proto.common.v1.EntityRef.encode(message.entityRefs[i], writer.uint32(26).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link opentelemetry.proto.resource.v1.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Resource message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.resource.v1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.resource.v1.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.droppedAttributesCount = reader.uint32(); - break; - case 3: - if (!(message.entityRefs && message.entityRefs.length)) message.entityRefs = []; - message.entityRefs.push($root.opentelemetry.proto.common.v1.EntityRef.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.resource.v1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Resource message. - * @function verify - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Resource.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.entityRefs != null && message.hasOwnProperty("entityRefs")) { - if (!Array.isArray(message.entityRefs)) return "entityRefs: array expected"; - for (var i = 0; i < message.entityRefs.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.EntityRef.verify(message.entityRefs[i]); - if (error) return "entityRefs." + error; - } - } - return null; - }; - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.resource.v1.Resource} Resource - */ - Resource.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.resource.v1.Resource) return object$1; - var message = new $root.opentelemetry.proto.resource.v1.Resource(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.entityRefs) { - if (!Array.isArray(object$1.entityRefs)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected"); - message.entityRefs = []; - for (var i = 0; i < object$1.entityRefs.length; ++i) { - if (typeof object$1.entityRefs[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected"); - message.entityRefs[i] = $root.opentelemetry.proto.common.v1.EntityRef.fromObject(object$1.entityRefs[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.Resource} message Resource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Resource.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.attributes = []; - object$1.entityRefs = []; - } - if (options.defaults) object$1.droppedAttributesCount = 0; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.entityRefs && message.entityRefs.length) { - object$1.entityRefs = []; - for (var j = 0; j < message.entityRefs.length; ++j) object$1.entityRefs[j] = $root.opentelemetry.proto.common.v1.EntityRef.toObject(message.entityRefs[j], options); - } - return object$1; - }; - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Resource - * @function getTypeUrl - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.resource.v1.Resource"; - }; - return Resource; - })(); - return v1; - })(); - return resource; - })(); - proto.trace = (function() { - /** - * Namespace trace. - * @memberof opentelemetry.proto - * @namespace - */ - var trace$1 = {}; - trace$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.trace - * @namespace - */ - var v1 = {}; - v1.TracesData = (function() { - /** - * Properties of a TracesData. - * @memberof opentelemetry.proto.trace.v1 - * @interface ITracesData - * @property {Array.|null} [resourceSpans] TracesData resourceSpans - */ - /** - * Constructs a new TracesData. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a TracesData. - * @implements ITracesData - * @constructor - * @param {opentelemetry.proto.trace.v1.ITracesData=} [properties] Properties to set - */ - function TracesData(properties) { - this.resourceSpans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * TracesData resourceSpans. - * @member {Array.} resourceSpans - * @memberof opentelemetry.proto.trace.v1.TracesData - * @instance - */ - TracesData.prototype.resourceSpans = $util.emptyArray; - /** - * Creates a new TracesData instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.ITracesData=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData instance - */ - TracesData.create = function create(properties) { - return new TracesData(properties); - }; - /** - * Encodes the specified TracesData message. Does not implicitly {@link opentelemetry.proto.trace.v1.TracesData.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.ITracesData} message TracesData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TracesData.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceSpans != null && message.resourceSpans.length) for (var i = 0; i < message.resourceSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified TracesData message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.TracesData.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.ITracesData} message TracesData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TracesData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a TracesData message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TracesData.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.TracesData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceSpans && message.resourceSpans.length)) message.resourceSpans = []; - message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a TracesData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TracesData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a TracesData message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TracesData.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { - if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; - for (var i = 0; i < message.resourceSpans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); - if (error) return "resourceSpans." + error; - } - } - return null; - }; - /** - * Creates a TracesData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData - */ - TracesData.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.TracesData) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.TracesData(); - if (object$1.resourceSpans) { - if (!Array.isArray(object$1.resourceSpans)) throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected"); - message.resourceSpans = []; - for (var i = 0; i < object$1.resourceSpans.length; ++i) { - if (typeof object$1.resourceSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected"); - message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object$1.resourceSpans[i]); - } - } - return message; - }; - /** - * Creates a plain object from a TracesData message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.TracesData} message TracesData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TracesData.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceSpans = []; - if (message.resourceSpans && message.resourceSpans.length) { - object$1.resourceSpans = []; - for (var j = 0; j < message.resourceSpans.length; ++j) object$1.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); - } - return object$1; - }; - /** - * Converts this TracesData to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.TracesData - * @instance - * @returns {Object.} JSON object - */ - TracesData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for TracesData - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TracesData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.TracesData"; - }; - return TracesData; - })(); - v1.ResourceSpans = (function() { - /** - * Properties of a ResourceSpans. - * @memberof opentelemetry.proto.trace.v1 - * @interface IResourceSpans - * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceSpans resource - * @property {Array.|null} [scopeSpans] ResourceSpans scopeSpans - * @property {string|null} [schemaUrl] ResourceSpans schemaUrl - */ - /** - * Constructs a new ResourceSpans. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a ResourceSpans. - * @implements IResourceSpans - * @constructor - * @param {opentelemetry.proto.trace.v1.IResourceSpans=} [properties] Properties to set - */ - function ResourceSpans(properties) { - this.scopeSpans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ResourceSpans resource. - * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - */ - ResourceSpans.prototype.resource = null; - /** - * ResourceSpans scopeSpans. - * @member {Array.} scopeSpans - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - */ - ResourceSpans.prototype.scopeSpans = $util.emptyArray; - /** - * ResourceSpans schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - */ - ResourceSpans.prototype.schemaUrl = null; - /** - * Creates a new ResourceSpans instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.IResourceSpans=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans instance - */ - ResourceSpans.create = function create(properties) { - return new ResourceSpans(properties); - }; - /** - * Encodes the specified ResourceSpans message. Does not implicitly {@link opentelemetry.proto.trace.v1.ResourceSpans.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.IResourceSpans} message ResourceSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSpans.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - if (message.scopeSpans != null && message.scopeSpans.length) for (var i = 0; i < message.scopeSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ScopeSpans.encode(message.scopeSpans[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ResourceSpans message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.ResourceSpans.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.IResourceSpans} message ResourceSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSpans.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ResourceSpans message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSpans.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ResourceSpans(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.scopeSpans && message.scopeSpans.length)) message.scopeSpans = []; - message.scopeSpans.push($root.opentelemetry.proto.trace.v1.ScopeSpans.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ResourceSpans message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSpans.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ResourceSpans message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceSpans.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error) return "resource." + error; - } - if (message.scopeSpans != null && message.hasOwnProperty("scopeSpans")) { - if (!Array.isArray(message.scopeSpans)) return "scopeSpans: array expected"; - for (var i = 0; i < message.scopeSpans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.ScopeSpans.verify(message.scopeSpans[i]); - if (error) return "scopeSpans." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ResourceSpans message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans - */ - ResourceSpans.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.ResourceSpans) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.ResourceSpans(); - if (object$1.resource != null) { - if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected"); - message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); - } - if (object$1.scopeSpans) { - if (!Array.isArray(object$1.scopeSpans)) throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected"); - message.scopeSpans = []; - for (var i = 0; i < object$1.scopeSpans.length; ++i) { - if (typeof object$1.scopeSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected"); - message.scopeSpans[i] = $root.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(object$1.scopeSpans[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ResourceSpans message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.ResourceSpans} message ResourceSpans - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceSpans.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.scopeSpans = []; - if (options.defaults) { - object$1.resource = null; - object$1.schemaUrl = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); - if (message.scopeSpans && message.scopeSpans.length) { - object$1.scopeSpans = []; - for (var j = 0; j < message.scopeSpans.length; ++j) object$1.scopeSpans[j] = $root.opentelemetry.proto.trace.v1.ScopeSpans.toObject(message.scopeSpans[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ResourceSpans to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - * @returns {Object.} JSON object - */ - ResourceSpans.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ResourceSpans - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ResourceSpans"; - }; - return ResourceSpans; - })(); - v1.ScopeSpans = (function() { - /** - * Properties of a ScopeSpans. - * @memberof opentelemetry.proto.trace.v1 - * @interface IScopeSpans - * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeSpans scope - * @property {Array.|null} [spans] ScopeSpans spans - * @property {string|null} [schemaUrl] ScopeSpans schemaUrl - */ - /** - * Constructs a new ScopeSpans. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a ScopeSpans. - * @implements IScopeSpans - * @constructor - * @param {opentelemetry.proto.trace.v1.IScopeSpans=} [properties] Properties to set - */ - function ScopeSpans(properties) { - this.spans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ScopeSpans scope. - * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - */ - ScopeSpans.prototype.scope = null; - /** - * ScopeSpans spans. - * @member {Array.} spans - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - */ - ScopeSpans.prototype.spans = $util.emptyArray; - /** - * ScopeSpans schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - */ - ScopeSpans.prototype.schemaUrl = null; - /** - * Creates a new ScopeSpans instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.IScopeSpans=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans instance - */ - ScopeSpans.create = function create(properties) { - return new ScopeSpans(properties); - }; - /** - * Encodes the specified ScopeSpans message. Does not implicitly {@link opentelemetry.proto.trace.v1.ScopeSpans.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.IScopeSpans} message ScopeSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeSpans.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); - if (message.spans != null && message.spans.length) for (var i = 0; i < message.spans.length; ++i) $root.opentelemetry.proto.trace.v1.Span.encode(message.spans[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ScopeSpans message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.ScopeSpans.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.IScopeSpans} message ScopeSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeSpans.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ScopeSpans message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeSpans.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ScopeSpans(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.spans && message.spans.length)) message.spans = []; - message.spans.push($root.opentelemetry.proto.trace.v1.Span.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ScopeSpans message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeSpans.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ScopeSpans message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScopeSpans.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) { - var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error) return "scope." + error; - } - if (message.spans != null && message.hasOwnProperty("spans")) { - if (!Array.isArray(message.spans)) return "spans: array expected"; - for (var i = 0; i < message.spans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.Span.verify(message.spans[i]); - if (error) return "spans." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ScopeSpans message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans - */ - ScopeSpans.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.ScopeSpans) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.ScopeSpans(); - if (object$1.scope != null) { - if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected"); - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); - } - if (object$1.spans) { - if (!Array.isArray(object$1.spans)) throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected"); - message.spans = []; - for (var i = 0; i < object$1.spans.length; ++i) { - if (typeof object$1.spans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected"); - message.spans[i] = $root.opentelemetry.proto.trace.v1.Span.fromObject(object$1.spans[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ScopeSpans message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.ScopeSpans} message ScopeSpans - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScopeSpans.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.spans = []; - if (options.defaults) { - object$1.scope = null; - object$1.schemaUrl = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); - if (message.spans && message.spans.length) { - object$1.spans = []; - for (var j = 0; j < message.spans.length; ++j) object$1.spans[j] = $root.opentelemetry.proto.trace.v1.Span.toObject(message.spans[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ScopeSpans to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - * @returns {Object.} JSON object - */ - ScopeSpans.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ScopeSpans - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScopeSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ScopeSpans"; - }; - return ScopeSpans; - })(); - v1.Span = (function() { - /** - * Properties of a Span. - * @memberof opentelemetry.proto.trace.v1 - * @interface ISpan - * @property {Uint8Array|null} [traceId] Span traceId - * @property {Uint8Array|null} [spanId] Span spanId - * @property {string|null} [traceState] Span traceState - * @property {Uint8Array|null} [parentSpanId] Span parentSpanId - * @property {number|null} [flags] Span flags - * @property {string|null} [name] Span name - * @property {opentelemetry.proto.trace.v1.Span.SpanKind|null} [kind] Span kind - * @property {number|Long|null} [startTimeUnixNano] Span startTimeUnixNano - * @property {number|Long|null} [endTimeUnixNano] Span endTimeUnixNano - * @property {Array.|null} [attributes] Span attributes - * @property {number|null} [droppedAttributesCount] Span droppedAttributesCount - * @property {Array.|null} [events] Span events - * @property {number|null} [droppedEventsCount] Span droppedEventsCount - * @property {Array.|null} [links] Span links - * @property {number|null} [droppedLinksCount] Span droppedLinksCount - * @property {opentelemetry.proto.trace.v1.IStatus|null} [status] Span status - */ - /** - * Constructs a new Span. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a Span. - * @implements ISpan - * @constructor - * @param {opentelemetry.proto.trace.v1.ISpan=} [properties] Properties to set - */ - function Span(properties) { - this.attributes = []; - this.events = []; - this.links = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Span traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.traceId = null; - /** - * Span spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.spanId = null; - /** - * Span traceState. - * @member {string|null|undefined} traceState - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.traceState = null; - /** - * Span parentSpanId. - * @member {Uint8Array|null|undefined} parentSpanId - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.parentSpanId = null; - /** - * Span flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.flags = null; - /** - * Span name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.name = null; - /** - * Span kind. - * @member {opentelemetry.proto.trace.v1.Span.SpanKind|null|undefined} kind - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.kind = null; - /** - * Span startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.startTimeUnixNano = null; - /** - * Span endTimeUnixNano. - * @member {number|Long|null|undefined} endTimeUnixNano - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.endTimeUnixNano = null; - /** - * Span attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.attributes = $util.emptyArray; - /** - * Span droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.droppedAttributesCount = null; - /** - * Span events. - * @member {Array.} events - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.events = $util.emptyArray; - /** - * Span droppedEventsCount. - * @member {number|null|undefined} droppedEventsCount - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.droppedEventsCount = null; - /** - * Span links. - * @member {Array.} links - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.links = $util.emptyArray; - /** - * Span droppedLinksCount. - * @member {number|null|undefined} droppedLinksCount - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.droppedLinksCount = null; - /** - * Span status. - * @member {opentelemetry.proto.trace.v1.IStatus|null|undefined} status - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.status = null; - /** - * Creates a new Span instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.ISpan=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Span} Span instance - */ - Span.create = function create(properties) { - return new Span(properties); - }; - /** - * Encodes the specified Span message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(10).bytes(message.traceId); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(18).bytes(message.spanId); - if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) writer.uint32(26).string(message.traceState); - if (message.parentSpanId != null && Object.hasOwnProperty.call(message, "parentSpanId")) writer.uint32(34).bytes(message.parentSpanId); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(42).string(message.name); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(48).int32(message.kind); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(57).fixed64(message.startTimeUnixNano); - if (message.endTimeUnixNano != null && Object.hasOwnProperty.call(message, "endTimeUnixNano")) writer.uint32(65).fixed64(message.endTimeUnixNano); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(80).uint32(message.droppedAttributesCount); - if (message.events != null && message.events.length) for (var i = 0; i < message.events.length; ++i) $root.opentelemetry.proto.trace.v1.Span.Event.encode(message.events[i], writer.uint32(90).fork()).ldelim(); - if (message.droppedEventsCount != null && Object.hasOwnProperty.call(message, "droppedEventsCount")) writer.uint32(96).uint32(message.droppedEventsCount); - if (message.links != null && message.links.length) for (var i = 0; i < message.links.length; ++i) $root.opentelemetry.proto.trace.v1.Span.Link.encode(message.links[i], writer.uint32(106).fork()).ldelim(); - if (message.droppedLinksCount != null && Object.hasOwnProperty.call(message, "droppedLinksCount")) writer.uint32(112).uint32(message.droppedLinksCount); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) $root.opentelemetry.proto.trace.v1.Status.encode(message.status, writer.uint32(122).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(133).fixed32(message.flags); - return writer; - }; - /** - * Encodes the specified Span message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Span message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.traceId = reader.bytes(); - break; - case 2: - message.spanId = reader.bytes(); - break; - case 3: - message.traceState = reader.string(); - break; - case 4: - message.parentSpanId = reader.bytes(); - break; - case 16: - message.flags = reader.fixed32(); - break; - case 5: - message.name = reader.string(); - break; - case 6: - message.kind = reader.int32(); - break; - case 7: - message.startTimeUnixNano = reader.fixed64(); - break; - case 8: - message.endTimeUnixNano = reader.fixed64(); - break; - case 9: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 10: - message.droppedAttributesCount = reader.uint32(); - break; - case 11: - if (!(message.events && message.events.length)) message.events = []; - message.events.push($root.opentelemetry.proto.trace.v1.Span.Event.decode(reader, reader.uint32())); - break; - case 12: - message.droppedEventsCount = reader.uint32(); - break; - case 13: - if (!(message.links && message.links.length)) message.links = []; - message.links.push($root.opentelemetry.proto.trace.v1.Span.Link.decode(reader, reader.uint32())); - break; - case 14: - message.droppedLinksCount = reader.uint32(); - break; - case 15: - message.status = $root.opentelemetry.proto.trace.v1.Status.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Span message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Span message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Span.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.traceState != null && message.hasOwnProperty("traceState")) { - if (!$util.isString(message.traceState)) return "traceState: string expected"; - } - if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) { - if (!(message.parentSpanId && typeof message.parentSpanId.length === "number" || $util.isString(message.parentSpanId))) return "parentSpanId: buffer expected"; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.kind != null && message.hasOwnProperty("kind")) switch (message.kind) { - default: return "kind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: break; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) { - if (!$util.isInteger(message.endTimeUnixNano) && !(message.endTimeUnixNano && $util.isInteger(message.endTimeUnixNano.low) && $util.isInteger(message.endTimeUnixNano.high))) return "endTimeUnixNano: integer|Long expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.Span.Event.verify(message.events[i]); - if (error) return "events." + error; - } - } - if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) { - if (!$util.isInteger(message.droppedEventsCount)) return "droppedEventsCount: integer expected"; - } - if (message.links != null && message.hasOwnProperty("links")) { - if (!Array.isArray(message.links)) return "links: array expected"; - for (var i = 0; i < message.links.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.Span.Link.verify(message.links[i]); - if (error) return "links." + error; - } - } - if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) { - if (!$util.isInteger(message.droppedLinksCount)) return "droppedLinksCount: integer expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.opentelemetry.proto.trace.v1.Status.verify(message.status); - if (error) return "status." + error; - } - return null; - }; - /** - * Creates a Span message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Span} Span - */ - Span.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Span(); - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.traceState != null) message.traceState = String(object$1.traceState); - if (object$1.parentSpanId != null) { - if (typeof object$1.parentSpanId === "string") $util.base64.decode(object$1.parentSpanId, message.parentSpanId = $util.newBuffer($util.base64.length(object$1.parentSpanId)), 0); - else if (object$1.parentSpanId.length >= 0) message.parentSpanId = object$1.parentSpanId; - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.name != null) message.name = String(object$1.name); - switch (object$1.kind) { - default: - if (typeof object$1.kind === "number") { - message.kind = object$1.kind; - break; - } - break; - case "SPAN_KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "SPAN_KIND_INTERNAL": - case 1: - message.kind = 1; - break; - case "SPAN_KIND_SERVER": - case 2: - message.kind = 2; - break; - case "SPAN_KIND_CLIENT": - case 3: - message.kind = 3; - break; - case "SPAN_KIND_PRODUCER": - case 4: - message.kind = 4; - break; - case "SPAN_KIND_CONSUMER": - case 5: - message.kind = 5; - break; - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.endTimeUnixNano != null) { - if ($util.Long) (message.endTimeUnixNano = $util.Long.fromValue(object$1.endTimeUnixNano)).unsigned = false; - else if (typeof object$1.endTimeUnixNano === "string") message.endTimeUnixNano = parseInt(object$1.endTimeUnixNano, 10); - else if (typeof object$1.endTimeUnixNano === "number") message.endTimeUnixNano = object$1.endTimeUnixNano; - else if (typeof object$1.endTimeUnixNano === "object") message.endTimeUnixNano = new $util.LongBits(object$1.endTimeUnixNano.low >>> 0, object$1.endTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.events) { - if (!Array.isArray(object$1.events)) throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected"); - message.events = []; - for (var i = 0; i < object$1.events.length; ++i) { - if (typeof object$1.events[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected"); - message.events[i] = $root.opentelemetry.proto.trace.v1.Span.Event.fromObject(object$1.events[i]); - } - } - if (object$1.droppedEventsCount != null) message.droppedEventsCount = object$1.droppedEventsCount >>> 0; - if (object$1.links) { - if (!Array.isArray(object$1.links)) throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected"); - message.links = []; - for (var i = 0; i < object$1.links.length; ++i) { - if (typeof object$1.links[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected"); - message.links[i] = $root.opentelemetry.proto.trace.v1.Span.Link.fromObject(object$1.links[i]); - } - } - if (object$1.droppedLinksCount != null) message.droppedLinksCount = object$1.droppedLinksCount >>> 0; - if (object$1.status != null) { - if (typeof object$1.status !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected"); - message.status = $root.opentelemetry.proto.trace.v1.Status.fromObject(object$1.status); - } - return message; - }; - /** - * Creates a plain object from a Span message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.Span} message Span - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Span.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.attributes = []; - object$1.events = []; - object$1.links = []; - } - if (options.defaults) { - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - object$1.traceState = ""; - if (options.bytes === String) object$1.parentSpanId = ""; - else { - object$1.parentSpanId = []; - if (options.bytes !== Array) object$1.parentSpanId = $util.newBuffer(object$1.parentSpanId); - } - object$1.name = ""; - object$1.kind = options.enums === String ? "SPAN_KIND_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.endTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.endTimeUnixNano = options.longs === String ? "0" : 0; - object$1.droppedAttributesCount = 0; - object$1.droppedEventsCount = 0; - object$1.droppedLinksCount = 0; - object$1.status = null; - object$1.flags = 0; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.traceState != null && message.hasOwnProperty("traceState")) object$1.traceState = message.traceState; - if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) object$1.parentSpanId = options.bytes === String ? $util.base64.encode(message.parentSpanId, 0, message.parentSpanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.parentSpanId) : message.parentSpanId; - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.kind != null && message.hasOwnProperty("kind")) object$1.kind = options.enums === String ? $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] === void 0 ? message.kind : $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] : message.kind; - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) if (typeof message.endTimeUnixNano === "number") object$1.endTimeUnixNano = options.longs === String ? String(message.endTimeUnixNano) : message.endTimeUnixNano; - else object$1.endTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.endTimeUnixNano.low >>> 0, message.endTimeUnixNano.high >>> 0).toNumber() : message.endTimeUnixNano; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.events && message.events.length) { - object$1.events = []; - for (var j = 0; j < message.events.length; ++j) object$1.events[j] = $root.opentelemetry.proto.trace.v1.Span.Event.toObject(message.events[j], options); - } - if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) object$1.droppedEventsCount = message.droppedEventsCount; - if (message.links && message.links.length) { - object$1.links = []; - for (var j = 0; j < message.links.length; ++j) object$1.links[j] = $root.opentelemetry.proto.trace.v1.Span.Link.toObject(message.links[j], options); - } - if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) object$1.droppedLinksCount = message.droppedLinksCount; - if (message.status != null && message.hasOwnProperty("status")) object$1.status = $root.opentelemetry.proto.trace.v1.Status.toObject(message.status, options); - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this Span to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - * @returns {Object.} JSON object - */ - Span.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Span - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span"; - }; - /** - * SpanKind enum. - * @name opentelemetry.proto.trace.v1.Span.SpanKind - * @enum {number} - * @property {number} SPAN_KIND_UNSPECIFIED=0 SPAN_KIND_UNSPECIFIED value - * @property {number} SPAN_KIND_INTERNAL=1 SPAN_KIND_INTERNAL value - * @property {number} SPAN_KIND_SERVER=2 SPAN_KIND_SERVER value - * @property {number} SPAN_KIND_CLIENT=3 SPAN_KIND_CLIENT value - * @property {number} SPAN_KIND_PRODUCER=4 SPAN_KIND_PRODUCER value - * @property {number} SPAN_KIND_CONSUMER=5 SPAN_KIND_CONSUMER value - */ - Span.SpanKind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SPAN_KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "SPAN_KIND_INTERNAL"] = 1; - values[valuesById[2] = "SPAN_KIND_SERVER"] = 2; - values[valuesById[3] = "SPAN_KIND_CLIENT"] = 3; - values[valuesById[4] = "SPAN_KIND_PRODUCER"] = 4; - values[valuesById[5] = "SPAN_KIND_CONSUMER"] = 5; - return values; - })(); - Span.Event = (function() { - /** - * Properties of an Event. - * @memberof opentelemetry.proto.trace.v1.Span - * @interface IEvent - * @property {number|Long|null} [timeUnixNano] Event timeUnixNano - * @property {string|null} [name] Event name - * @property {Array.|null} [attributes] Event attributes - * @property {number|null} [droppedAttributesCount] Event droppedAttributesCount - */ - /** - * Constructs a new Event. - * @memberof opentelemetry.proto.trace.v1.Span - * @classdesc Represents an Event. - * @implements IEvent - * @constructor - * @param {opentelemetry.proto.trace.v1.Span.IEvent=} [properties] Properties to set - */ - function Event(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Event timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.timeUnixNano = null; - /** - * Event name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.name = null; - /** - * Event attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.attributes = $util.emptyArray; - /** - * Event droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.droppedAttributesCount = null; - /** - * Creates a new Event instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.IEvent=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event instance - */ - Event.create = function create(properties) { - return new Event(properties); - }; - /** - * Encodes the specified Event message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Event.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(9).fixed64(message.timeUnixNano); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(18).string(message.name); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); - return writer; - }; - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Event.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an Event message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Event(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.timeUnixNano = reader.fixed64(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 4: - message.droppedAttributesCount = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an Event message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Event.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - return null; - }; - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event - */ - Event.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span.Event) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Span.Event(); - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.name != null) message.name = String(object$1.name); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - return message; - }; - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.Event} message Event - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Event.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - object$1.name = ""; - object$1.droppedAttributesCount = 0; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - return object$1; - }; - /** - * Converts this Event to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - * @returns {Object.} JSON object - */ - Event.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Event - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Event"; - }; - return Event; - })(); - Span.Link = (function() { - /** - * Properties of a Link. - * @memberof opentelemetry.proto.trace.v1.Span - * @interface ILink - * @property {Uint8Array|null} [traceId] Link traceId - * @property {Uint8Array|null} [spanId] Link spanId - * @property {string|null} [traceState] Link traceState - * @property {Array.|null} [attributes] Link attributes - * @property {number|null} [droppedAttributesCount] Link droppedAttributesCount - * @property {number|null} [flags] Link flags - */ - /** - * Constructs a new Link. - * @memberof opentelemetry.proto.trace.v1.Span - * @classdesc Represents a Link. - * @implements ILink - * @constructor - * @param {opentelemetry.proto.trace.v1.Span.ILink=} [properties] Properties to set - */ - function Link(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Link traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.traceId = null; - /** - * Link spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.spanId = null; - /** - * Link traceState. - * @member {string|null|undefined} traceState - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.traceState = null; - /** - * Link attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.attributes = $util.emptyArray; - /** - * Link droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.droppedAttributesCount = null; - /** - * Link flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.flags = null; - /** - * Creates a new Link instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.ILink=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link instance - */ - Link.create = function create(properties) { - return new Link(properties); - }; - /** - * Encodes the specified Link message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Link.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.ILink} message Link message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Link.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(10).bytes(message.traceId); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(18).bytes(message.spanId); - if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) writer.uint32(26).string(message.traceState); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(34).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(40).uint32(message.droppedAttributesCount); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(53).fixed32(message.flags); - return writer; - }; - /** - * Encodes the specified Link message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Link.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.ILink} message Link message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Link.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Link message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Link.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Link(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.traceId = reader.bytes(); - break; - case 2: - message.spanId = reader.bytes(); - break; - case 3: - message.traceState = reader.string(); - break; - case 4: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 5: - message.droppedAttributesCount = reader.uint32(); - break; - case 6: - message.flags = reader.fixed32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Link message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Link.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Link message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Link.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.traceState != null && message.hasOwnProperty("traceState")) { - if (!$util.isString(message.traceState)) return "traceState: string expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - return null; - }; - /** - * Creates a Link message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link - */ - Link.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span.Link) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Span.Link(); - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.traceState != null) message.traceState = String(object$1.traceState); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - return message; - }; - /** - * Creates a plain object from a Link message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.Link} message Link - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Link.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - object$1.traceState = ""; - object$1.droppedAttributesCount = 0; - object$1.flags = 0; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.traceState != null && message.hasOwnProperty("traceState")) object$1.traceState = message.traceState; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this Link to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - * @returns {Object.} JSON object - */ - Link.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Link - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Link.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Link"; - }; - return Link; - })(); - return Span; - })(); - v1.Status = (function() { - /** - * Properties of a Status. - * @memberof opentelemetry.proto.trace.v1 - * @interface IStatus - * @property {string|null} [message] Status message - * @property {opentelemetry.proto.trace.v1.Status.StatusCode|null} [code] Status code - */ - /** - * Constructs a new Status. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {opentelemetry.proto.trace.v1.IStatus=} [properties] Properties to set - */ - function Status(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Status message. - * @member {string|null|undefined} message - * @memberof opentelemetry.proto.trace.v1.Status - * @instance - */ - Status.prototype.message = null; - /** - * Status code. - * @member {opentelemetry.proto.trace.v1.Status.StatusCode|null|undefined} code - * @memberof opentelemetry.proto.trace.v1.Status - * @instance - */ - Status.prototype.code = null; - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.IStatus=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - /** - * Encodes the specified Status message. Does not implicitly {@link opentelemetry.proto.trace.v1.Status.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(18).string(message.message); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(24).int32(message.code); - return writer; - }; - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 2: - message.message = reader.string(); - break; - case 3: - message.code = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Status message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - if (!$util.isString(message.message)) return "message: string expected"; - } - if (message.code != null && message.hasOwnProperty("code")) switch (message.code) { - default: return "code: enum value expected"; - case 0: - case 1: - case 2: break; - } - return null; - }; - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Status} Status - */ - Status.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Status) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Status(); - if (object$1.message != null) message.message = String(object$1.message); - switch (object$1.code) { - default: - if (typeof object$1.code === "number") { - message.code = object$1.code; - break; - } - break; - case "STATUS_CODE_UNSET": - case 0: - message.code = 0; - break; - case "STATUS_CODE_OK": - case 1: - message.code = 1; - break; - case "STATUS_CODE_ERROR": - case 2: - message.code = 2; - break; - } - return message; - }; - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - object$1.message = ""; - object$1.code = options.enums === String ? "STATUS_CODE_UNSET" : 0; - } - if (message.message != null && message.hasOwnProperty("message")) object$1.message = message.message; - if (message.code != null && message.hasOwnProperty("code")) object$1.code = options.enums === String ? $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] === void 0 ? message.code : $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] : message.code; - return object$1; - }; - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Status"; - }; - /** - * StatusCode enum. - * @name opentelemetry.proto.trace.v1.Status.StatusCode - * @enum {number} - * @property {number} STATUS_CODE_UNSET=0 STATUS_CODE_UNSET value - * @property {number} STATUS_CODE_OK=1 STATUS_CODE_OK value - * @property {number} STATUS_CODE_ERROR=2 STATUS_CODE_ERROR value - */ - Status.StatusCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_CODE_UNSET"] = 0; - values[valuesById[1] = "STATUS_CODE_OK"] = 1; - values[valuesById[2] = "STATUS_CODE_ERROR"] = 2; - return values; - })(); - return Status; - })(); - /** - * SpanFlags enum. - * @name opentelemetry.proto.trace.v1.SpanFlags - * @enum {number} - * @property {number} SPAN_FLAGS_DO_NOT_USE=0 SPAN_FLAGS_DO_NOT_USE value - * @property {number} SPAN_FLAGS_TRACE_FLAGS_MASK=255 SPAN_FLAGS_TRACE_FLAGS_MASK value - * @property {number} SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK=256 SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK value - * @property {number} SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK=512 SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK value - */ - v1.SpanFlags = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SPAN_FLAGS_DO_NOT_USE"] = 0; - values[valuesById[255] = "SPAN_FLAGS_TRACE_FLAGS_MASK"] = 255; - values[valuesById[256] = "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"] = 256; - values[valuesById[512] = "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"] = 512; - return values; - })(); - return v1; - })(); - return trace$1; - })(); - proto.collector = (function() { - /** - * Namespace collector. - * @memberof opentelemetry.proto - * @namespace - */ - var collector = {}; - collector.trace = (function() { - /** - * Namespace trace. - * @memberof opentelemetry.proto.collector - * @namespace - */ - var trace$1 = {}; - trace$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.collector.trace - * @namespace - */ - var v1 = {}; - v1.TraceService = (function() { - /** - * Constructs a new TraceService service. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents a TraceService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function TraceService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (TraceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TraceService; - /** - * Creates new TraceService service using the specified rpc implementation. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {TraceService} RPC service. Useful where requests and/or responses are streamed. - */ - TraceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - /** - * Callback as used by {@link opentelemetry.proto.collector.trace.v1.TraceService#export_}. - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @typedef ExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} [response] ExportTraceServiceResponse - */ - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @instance - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} request ExportTraceServiceRequest message or plain object - * @param {opentelemetry.proto.collector.trace.v1.TraceService.ExportCallback} callback Node-style callback called with the error, if any, and ExportTraceServiceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TraceService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse, request, callback); - }, "name", { value: "Export" }); - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @instance - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} request ExportTraceServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return TraceService; - })(); - v1.ExportTraceServiceRequest = (function() { - /** - * Properties of an ExportTraceServiceRequest. - * @memberof opentelemetry.proto.collector.trace.v1 - * @interface IExportTraceServiceRequest - * @property {Array.|null} [resourceSpans] ExportTraceServiceRequest resourceSpans - */ - /** - * Constructs a new ExportTraceServiceRequest. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents an ExportTraceServiceRequest. - * @implements IExportTraceServiceRequest - * @constructor - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest=} [properties] Properties to set - */ - function ExportTraceServiceRequest(properties) { - this.resourceSpans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportTraceServiceRequest resourceSpans. - * @member {Array.} resourceSpans - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @instance - */ - ExportTraceServiceRequest.prototype.resourceSpans = $util.emptyArray; - /** - * Creates a new ExportTraceServiceRequest instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest instance - */ - ExportTraceServiceRequest.create = function create(properties) { - return new ExportTraceServiceRequest(properties); - }; - /** - * Encodes the specified ExportTraceServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} message ExportTraceServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceRequest.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceSpans != null && message.resourceSpans.length) for (var i = 0; i < message.resourceSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportTraceServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} message ExportTraceServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportTraceServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceRequest.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceSpans && message.resourceSpans.length)) message.resourceSpans = []; - message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportTraceServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportTraceServiceRequest message. - * @function verify - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportTraceServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { - if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; - for (var i = 0; i < message.resourceSpans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); - if (error) return "resourceSpans." + error; - } - } - return null; - }; - /** - * Creates an ExportTraceServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest - */ - ExportTraceServiceRequest.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) return object$1; - var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest(); - if (object$1.resourceSpans) { - if (!Array.isArray(object$1.resourceSpans)) throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected"); - message.resourceSpans = []; - for (var i = 0; i < object$1.resourceSpans.length; ++i) { - if (typeof object$1.resourceSpans[i] !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected"); - message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object$1.resourceSpans[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ExportTraceServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} message ExportTraceServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportTraceServiceRequest.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceSpans = []; - if (message.resourceSpans && message.resourceSpans.length) { - object$1.resourceSpans = []; - for (var j = 0; j < message.resourceSpans.length; ++j) object$1.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); - } - return object$1; - }; - /** - * Converts this ExportTraceServiceRequest to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @instance - * @returns {Object.} JSON object - */ - ExportTraceServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportTraceServiceRequest - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportTraceServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"; - }; - return ExportTraceServiceRequest; - })(); - v1.ExportTraceServiceResponse = (function() { - /** - * Properties of an ExportTraceServiceResponse. - * @memberof opentelemetry.proto.collector.trace.v1 - * @interface IExportTraceServiceResponse - * @property {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess|null} [partialSuccess] ExportTraceServiceResponse partialSuccess - */ - /** - * Constructs a new ExportTraceServiceResponse. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents an ExportTraceServiceResponse. - * @implements IExportTraceServiceResponse - * @constructor - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse=} [properties] Properties to set - */ - function ExportTraceServiceResponse(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportTraceServiceResponse partialSuccess. - * @member {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess|null|undefined} partialSuccess - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @instance - */ - ExportTraceServiceResponse.prototype.partialSuccess = null; - /** - * Creates a new ExportTraceServiceResponse instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse instance - */ - ExportTraceServiceResponse.create = function create(properties) { - return new ExportTraceServiceResponse(properties); - }; - /** - * Encodes the specified ExportTraceServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse} message ExportTraceServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceResponse.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportTraceServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse} message ExportTraceServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportTraceServiceResponse message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceResponse.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportTraceServiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportTraceServiceResponse message. - * @function verify - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportTraceServiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(message.partialSuccess); - if (error) return "partialSuccess." + error; - } - return null; - }; - /** - * Creates an ExportTraceServiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse - */ - ExportTraceServiceResponse.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse) return object$1; - var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse(); - if (object$1.partialSuccess != null) { - if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected"); - message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(object$1.partialSuccess); - } - return message; - }; - /** - * Creates a plain object from an ExportTraceServiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} message ExportTraceServiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportTraceServiceResponse.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) object$1.partialSuccess = null; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(message.partialSuccess, options); - return object$1; - }; - /** - * Converts this ExportTraceServiceResponse to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @instance - * @returns {Object.} JSON object - */ - ExportTraceServiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportTraceServiceResponse - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportTraceServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"; - }; - return ExportTraceServiceResponse; - })(); - v1.ExportTracePartialSuccess = (function() { - /** - * Properties of an ExportTracePartialSuccess. - * @memberof opentelemetry.proto.collector.trace.v1 - * @interface IExportTracePartialSuccess - * @property {number|Long|null} [rejectedSpans] ExportTracePartialSuccess rejectedSpans - * @property {string|null} [errorMessage] ExportTracePartialSuccess errorMessage - */ - /** - * Constructs a new ExportTracePartialSuccess. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents an ExportTracePartialSuccess. - * @implements IExportTracePartialSuccess - * @constructor - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess=} [properties] Properties to set - */ - function ExportTracePartialSuccess(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportTracePartialSuccess rejectedSpans. - * @member {number|Long|null|undefined} rejectedSpans - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @instance - */ - ExportTracePartialSuccess.prototype.rejectedSpans = null; - /** - * ExportTracePartialSuccess errorMessage. - * @member {string|null|undefined} errorMessage - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @instance - */ - ExportTracePartialSuccess.prototype.errorMessage = null; - /** - * Creates a new ExportTracePartialSuccess instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess instance - */ - ExportTracePartialSuccess.create = function create(properties) { - return new ExportTracePartialSuccess(properties); - }; - /** - * Encodes the specified ExportTracePartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess} message ExportTracePartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTracePartialSuccess.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.rejectedSpans != null && Object.hasOwnProperty.call(message, "rejectedSpans")) writer.uint32(8).int64(message.rejectedSpans); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); - return writer; - }; - /** - * Encodes the specified ExportTracePartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess} message ExportTracePartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTracePartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportTracePartialSuccess message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTracePartialSuccess.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.rejectedSpans = reader.int64(); - break; - case 2: - message.errorMessage = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportTracePartialSuccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTracePartialSuccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportTracePartialSuccess message. - * @function verify - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportTracePartialSuccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) { - if (!$util.isInteger(message.rejectedSpans) && !(message.rejectedSpans && $util.isInteger(message.rejectedSpans.low) && $util.isInteger(message.rejectedSpans.high))) return "rejectedSpans: integer|Long expected"; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { - if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; - } - return null; - }; - /** - * Creates an ExportTracePartialSuccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess - */ - ExportTracePartialSuccess.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess) return object$1; - var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess(); - if (object$1.rejectedSpans != null) { - if ($util.Long) (message.rejectedSpans = $util.Long.fromValue(object$1.rejectedSpans)).unsigned = false; - else if (typeof object$1.rejectedSpans === "string") message.rejectedSpans = parseInt(object$1.rejectedSpans, 10); - else if (typeof object$1.rejectedSpans === "number") message.rejectedSpans = object$1.rejectedSpans; - else if (typeof object$1.rejectedSpans === "object") message.rejectedSpans = new $util.LongBits(object$1.rejectedSpans.low >>> 0, object$1.rejectedSpans.high >>> 0).toNumber(); - } - if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); - return message; - }; - /** - * Creates a plain object from an ExportTracePartialSuccess message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} message ExportTracePartialSuccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportTracePartialSuccess.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.rejectedSpans = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.rejectedSpans = options.longs === String ? "0" : 0; - object$1.errorMessage = ""; - } - if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) if (typeof message.rejectedSpans === "number") object$1.rejectedSpans = options.longs === String ? String(message.rejectedSpans) : message.rejectedSpans; - else object$1.rejectedSpans = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedSpans) : options.longs === Number ? new $util.LongBits(message.rejectedSpans.low >>> 0, message.rejectedSpans.high >>> 0).toNumber() : message.rejectedSpans; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; - return object$1; - }; - /** - * Converts this ExportTracePartialSuccess to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @instance - * @returns {Object.} JSON object - */ - ExportTracePartialSuccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportTracePartialSuccess - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportTracePartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"; - }; - return ExportTracePartialSuccess; - })(); - return v1; - })(); - return trace$1; - })(); - collector.metrics = (function() { - /** - * Namespace metrics. - * @memberof opentelemetry.proto.collector - * @namespace - */ - var metrics$1 = {}; - metrics$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.collector.metrics - * @namespace - */ - var v1 = {}; - v1.MetricsService = (function() { - /** - * Constructs a new MetricsService service. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents a MetricsService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function MetricsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (MetricsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsService; - /** - * Creates new MetricsService service using the specified rpc implementation. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {MetricsService} RPC service. Useful where requests and/or responses are streamed. - */ - MetricsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - /** - * Callback as used by {@link opentelemetry.proto.collector.metrics.v1.MetricsService#export_}. - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @typedef ExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} [response] ExportMetricsServiceResponse - */ - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @instance - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} request ExportMetricsServiceRequest message or plain object - * @param {opentelemetry.proto.collector.metrics.v1.MetricsService.ExportCallback} callback Node-style callback called with the error, if any, and ExportMetricsServiceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricsService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse, request, callback); - }, "name", { value: "Export" }); - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @instance - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} request ExportMetricsServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return MetricsService; - })(); - v1.ExportMetricsServiceRequest = (function() { - /** - * Properties of an ExportMetricsServiceRequest. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @interface IExportMetricsServiceRequest - * @property {Array.|null} [resourceMetrics] ExportMetricsServiceRequest resourceMetrics - */ - /** - * Constructs a new ExportMetricsServiceRequest. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents an ExportMetricsServiceRequest. - * @implements IExportMetricsServiceRequest - * @constructor - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest=} [properties] Properties to set - */ - function ExportMetricsServiceRequest(properties) { - this.resourceMetrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportMetricsServiceRequest resourceMetrics. - * @member {Array.} resourceMetrics - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @instance - */ - ExportMetricsServiceRequest.prototype.resourceMetrics = $util.emptyArray; - /** - * Creates a new ExportMetricsServiceRequest instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest instance - */ - ExportMetricsServiceRequest.create = function create(properties) { - return new ExportMetricsServiceRequest(properties); - }; - /** - * Encodes the specified ExportMetricsServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} message ExportMetricsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceRequest.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceMetrics != null && message.resourceMetrics.length) for (var i = 0; i < message.resourceMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportMetricsServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} message ExportMetricsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportMetricsServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceRequest.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceMetrics && message.resourceMetrics.length)) message.resourceMetrics = []; - message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportMetricsServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportMetricsServiceRequest message. - * @function verify - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportMetricsServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { - if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; - for (var i = 0; i < message.resourceMetrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); - if (error) return "resourceMetrics." + error; - } - } - return null; - }; - /** - * Creates an ExportMetricsServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest - */ - ExportMetricsServiceRequest.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) return object$1; - var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest(); - if (object$1.resourceMetrics) { - if (!Array.isArray(object$1.resourceMetrics)) throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected"); - message.resourceMetrics = []; - for (var i = 0; i < object$1.resourceMetrics.length; ++i) { - if (typeof object$1.resourceMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected"); - message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object$1.resourceMetrics[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ExportMetricsServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} message ExportMetricsServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportMetricsServiceRequest.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceMetrics = []; - if (message.resourceMetrics && message.resourceMetrics.length) { - object$1.resourceMetrics = []; - for (var j = 0; j < message.resourceMetrics.length; ++j) object$1.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); - } - return object$1; - }; - /** - * Converts this ExportMetricsServiceRequest to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @instance - * @returns {Object.} JSON object - */ - ExportMetricsServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportMetricsServiceRequest - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportMetricsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"; - }; - return ExportMetricsServiceRequest; - })(); - v1.ExportMetricsServiceResponse = (function() { - /** - * Properties of an ExportMetricsServiceResponse. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @interface IExportMetricsServiceResponse - * @property {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess|null} [partialSuccess] ExportMetricsServiceResponse partialSuccess - */ - /** - * Constructs a new ExportMetricsServiceResponse. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents an ExportMetricsServiceResponse. - * @implements IExportMetricsServiceResponse - * @constructor - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse=} [properties] Properties to set - */ - function ExportMetricsServiceResponse(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportMetricsServiceResponse partialSuccess. - * @member {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess|null|undefined} partialSuccess - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @instance - */ - ExportMetricsServiceResponse.prototype.partialSuccess = null; - /** - * Creates a new ExportMetricsServiceResponse instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse instance - */ - ExportMetricsServiceResponse.create = function create(properties) { - return new ExportMetricsServiceResponse(properties); - }; - /** - * Encodes the specified ExportMetricsServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse} message ExportMetricsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceResponse.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportMetricsServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse} message ExportMetricsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportMetricsServiceResponse message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceResponse.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportMetricsServiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportMetricsServiceResponse message. - * @function verify - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportMetricsServiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(message.partialSuccess); - if (error) return "partialSuccess." + error; - } - return null; - }; - /** - * Creates an ExportMetricsServiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse - */ - ExportMetricsServiceResponse.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse) return object$1; - var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse(); - if (object$1.partialSuccess != null) { - if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected"); - message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(object$1.partialSuccess); - } - return message; - }; - /** - * Creates a plain object from an ExportMetricsServiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} message ExportMetricsServiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportMetricsServiceResponse.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) object$1.partialSuccess = null; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(message.partialSuccess, options); - return object$1; - }; - /** - * Converts this ExportMetricsServiceResponse to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @instance - * @returns {Object.} JSON object - */ - ExportMetricsServiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportMetricsServiceResponse - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportMetricsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"; - }; - return ExportMetricsServiceResponse; - })(); - v1.ExportMetricsPartialSuccess = (function() { - /** - * Properties of an ExportMetricsPartialSuccess. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @interface IExportMetricsPartialSuccess - * @property {number|Long|null} [rejectedDataPoints] ExportMetricsPartialSuccess rejectedDataPoints - * @property {string|null} [errorMessage] ExportMetricsPartialSuccess errorMessage - */ - /** - * Constructs a new ExportMetricsPartialSuccess. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents an ExportMetricsPartialSuccess. - * @implements IExportMetricsPartialSuccess - * @constructor - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess=} [properties] Properties to set - */ - function ExportMetricsPartialSuccess(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportMetricsPartialSuccess rejectedDataPoints. - * @member {number|Long|null|undefined} rejectedDataPoints - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @instance - */ - ExportMetricsPartialSuccess.prototype.rejectedDataPoints = null; - /** - * ExportMetricsPartialSuccess errorMessage. - * @member {string|null|undefined} errorMessage - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @instance - */ - ExportMetricsPartialSuccess.prototype.errorMessage = null; - /** - * Creates a new ExportMetricsPartialSuccess instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess instance - */ - ExportMetricsPartialSuccess.create = function create(properties) { - return new ExportMetricsPartialSuccess(properties); - }; - /** - * Encodes the specified ExportMetricsPartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess} message ExportMetricsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsPartialSuccess.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.rejectedDataPoints != null && Object.hasOwnProperty.call(message, "rejectedDataPoints")) writer.uint32(8).int64(message.rejectedDataPoints); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); - return writer; - }; - /** - * Encodes the specified ExportMetricsPartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess} message ExportMetricsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportMetricsPartialSuccess message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsPartialSuccess.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.rejectedDataPoints = reader.int64(); - break; - case 2: - message.errorMessage = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportMetricsPartialSuccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportMetricsPartialSuccess message. - * @function verify - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportMetricsPartialSuccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) { - if (!$util.isInteger(message.rejectedDataPoints) && !(message.rejectedDataPoints && $util.isInteger(message.rejectedDataPoints.low) && $util.isInteger(message.rejectedDataPoints.high))) return "rejectedDataPoints: integer|Long expected"; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { - if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; - } - return null; - }; - /** - * Creates an ExportMetricsPartialSuccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess - */ - ExportMetricsPartialSuccess.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess) return object$1; - var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess(); - if (object$1.rejectedDataPoints != null) { - if ($util.Long) (message.rejectedDataPoints = $util.Long.fromValue(object$1.rejectedDataPoints)).unsigned = false; - else if (typeof object$1.rejectedDataPoints === "string") message.rejectedDataPoints = parseInt(object$1.rejectedDataPoints, 10); - else if (typeof object$1.rejectedDataPoints === "number") message.rejectedDataPoints = object$1.rejectedDataPoints; - else if (typeof object$1.rejectedDataPoints === "object") message.rejectedDataPoints = new $util.LongBits(object$1.rejectedDataPoints.low >>> 0, object$1.rejectedDataPoints.high >>> 0).toNumber(); - } - if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); - return message; - }; - /** - * Creates a plain object from an ExportMetricsPartialSuccess message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} message ExportMetricsPartialSuccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportMetricsPartialSuccess.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.rejectedDataPoints = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.rejectedDataPoints = options.longs === String ? "0" : 0; - object$1.errorMessage = ""; - } - if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) if (typeof message.rejectedDataPoints === "number") object$1.rejectedDataPoints = options.longs === String ? String(message.rejectedDataPoints) : message.rejectedDataPoints; - else object$1.rejectedDataPoints = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedDataPoints) : options.longs === Number ? new $util.LongBits(message.rejectedDataPoints.low >>> 0, message.rejectedDataPoints.high >>> 0).toNumber() : message.rejectedDataPoints; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; - return object$1; - }; - /** - * Converts this ExportMetricsPartialSuccess to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @instance - * @returns {Object.} JSON object - */ - ExportMetricsPartialSuccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportMetricsPartialSuccess - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportMetricsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"; - }; - return ExportMetricsPartialSuccess; - })(); - return v1; - })(); - return metrics$1; - })(); - collector.logs = (function() { - /** - * Namespace logs. - * @memberof opentelemetry.proto.collector - * @namespace - */ - var logs = {}; - logs.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.collector.logs - * @namespace - */ - var v1 = {}; - v1.LogsService = (function() { - /** - * Constructs a new LogsService service. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents a LogsService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function LogsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (LogsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LogsService; - /** - * Creates new LogsService service using the specified rpc implementation. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {LogsService} RPC service. Useful where requests and/or responses are streamed. - */ - LogsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - /** - * Callback as used by {@link opentelemetry.proto.collector.logs.v1.LogsService#export_}. - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @typedef ExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} [response] ExportLogsServiceResponse - */ - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @instance - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} request ExportLogsServiceRequest message or plain object - * @param {opentelemetry.proto.collector.logs.v1.LogsService.ExportCallback} callback Node-style callback called with the error, if any, and ExportLogsServiceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LogsService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse, request, callback); - }, "name", { value: "Export" }); - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @instance - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} request ExportLogsServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return LogsService; - })(); - v1.ExportLogsServiceRequest = (function() { - /** - * Properties of an ExportLogsServiceRequest. - * @memberof opentelemetry.proto.collector.logs.v1 - * @interface IExportLogsServiceRequest - * @property {Array.|null} [resourceLogs] ExportLogsServiceRequest resourceLogs - */ - /** - * Constructs a new ExportLogsServiceRequest. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents an ExportLogsServiceRequest. - * @implements IExportLogsServiceRequest - * @constructor - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest=} [properties] Properties to set - */ - function ExportLogsServiceRequest(properties) { - this.resourceLogs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportLogsServiceRequest resourceLogs. - * @member {Array.} resourceLogs - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @instance - */ - ExportLogsServiceRequest.prototype.resourceLogs = $util.emptyArray; - /** - * Creates a new ExportLogsServiceRequest instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest instance - */ - ExportLogsServiceRequest.create = function create(properties) { - return new ExportLogsServiceRequest(properties); - }; - /** - * Encodes the specified ExportLogsServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} message ExportLogsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceRequest.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceLogs != null && message.resourceLogs.length) for (var i = 0; i < message.resourceLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportLogsServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} message ExportLogsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportLogsServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceRequest.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceLogs && message.resourceLogs.length)) message.resourceLogs = []; - message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportLogsServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportLogsServiceRequest message. - * @function verify - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportLogsServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { - if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; - for (var i = 0; i < message.resourceLogs.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); - if (error) return "resourceLogs." + error; - } - } - return null; - }; - /** - * Creates an ExportLogsServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest - */ - ExportLogsServiceRequest.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) return object$1; - var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest(); - if (object$1.resourceLogs) { - if (!Array.isArray(object$1.resourceLogs)) throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected"); - message.resourceLogs = []; - for (var i = 0; i < object$1.resourceLogs.length; ++i) { - if (typeof object$1.resourceLogs[i] !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected"); - message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object$1.resourceLogs[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ExportLogsServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} message ExportLogsServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportLogsServiceRequest.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceLogs = []; - if (message.resourceLogs && message.resourceLogs.length) { - object$1.resourceLogs = []; - for (var j = 0; j < message.resourceLogs.length; ++j) object$1.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); - } - return object$1; - }; - /** - * Converts this ExportLogsServiceRequest to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @instance - * @returns {Object.} JSON object - */ - ExportLogsServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportLogsServiceRequest - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportLogsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"; - }; - return ExportLogsServiceRequest; - })(); - v1.ExportLogsServiceResponse = (function() { - /** - * Properties of an ExportLogsServiceResponse. - * @memberof opentelemetry.proto.collector.logs.v1 - * @interface IExportLogsServiceResponse - * @property {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess|null} [partialSuccess] ExportLogsServiceResponse partialSuccess - */ - /** - * Constructs a new ExportLogsServiceResponse. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents an ExportLogsServiceResponse. - * @implements IExportLogsServiceResponse - * @constructor - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse=} [properties] Properties to set - */ - function ExportLogsServiceResponse(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportLogsServiceResponse partialSuccess. - * @member {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess|null|undefined} partialSuccess - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @instance - */ - ExportLogsServiceResponse.prototype.partialSuccess = null; - /** - * Creates a new ExportLogsServiceResponse instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse instance - */ - ExportLogsServiceResponse.create = function create(properties) { - return new ExportLogsServiceResponse(properties); - }; - /** - * Encodes the specified ExportLogsServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse} message ExportLogsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceResponse.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportLogsServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse} message ExportLogsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportLogsServiceResponse message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceResponse.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportLogsServiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportLogsServiceResponse message. - * @function verify - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportLogsServiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(message.partialSuccess); - if (error) return "partialSuccess." + error; - } - return null; - }; - /** - * Creates an ExportLogsServiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse - */ - ExportLogsServiceResponse.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse) return object$1; - var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse(); - if (object$1.partialSuccess != null) { - if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected"); - message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(object$1.partialSuccess); - } - return message; - }; - /** - * Creates a plain object from an ExportLogsServiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} message ExportLogsServiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportLogsServiceResponse.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) object$1.partialSuccess = null; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(message.partialSuccess, options); - return object$1; - }; - /** - * Converts this ExportLogsServiceResponse to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @instance - * @returns {Object.} JSON object - */ - ExportLogsServiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportLogsServiceResponse - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportLogsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"; - }; - return ExportLogsServiceResponse; - })(); - v1.ExportLogsPartialSuccess = (function() { - /** - * Properties of an ExportLogsPartialSuccess. - * @memberof opentelemetry.proto.collector.logs.v1 - * @interface IExportLogsPartialSuccess - * @property {number|Long|null} [rejectedLogRecords] ExportLogsPartialSuccess rejectedLogRecords - * @property {string|null} [errorMessage] ExportLogsPartialSuccess errorMessage - */ - /** - * Constructs a new ExportLogsPartialSuccess. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents an ExportLogsPartialSuccess. - * @implements IExportLogsPartialSuccess - * @constructor - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess=} [properties] Properties to set - */ - function ExportLogsPartialSuccess(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportLogsPartialSuccess rejectedLogRecords. - * @member {number|Long|null|undefined} rejectedLogRecords - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @instance - */ - ExportLogsPartialSuccess.prototype.rejectedLogRecords = null; - /** - * ExportLogsPartialSuccess errorMessage. - * @member {string|null|undefined} errorMessage - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @instance - */ - ExportLogsPartialSuccess.prototype.errorMessage = null; - /** - * Creates a new ExportLogsPartialSuccess instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess instance - */ - ExportLogsPartialSuccess.create = function create(properties) { - return new ExportLogsPartialSuccess(properties); - }; - /** - * Encodes the specified ExportLogsPartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess} message ExportLogsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsPartialSuccess.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.rejectedLogRecords != null && Object.hasOwnProperty.call(message, "rejectedLogRecords")) writer.uint32(8).int64(message.rejectedLogRecords); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); - return writer; - }; - /** - * Encodes the specified ExportLogsPartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess} message ExportLogsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportLogsPartialSuccess message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsPartialSuccess.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.rejectedLogRecords = reader.int64(); - break; - case 2: - message.errorMessage = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportLogsPartialSuccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportLogsPartialSuccess message. - * @function verify - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportLogsPartialSuccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) { - if (!$util.isInteger(message.rejectedLogRecords) && !(message.rejectedLogRecords && $util.isInteger(message.rejectedLogRecords.low) && $util.isInteger(message.rejectedLogRecords.high))) return "rejectedLogRecords: integer|Long expected"; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { - if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; - } - return null; - }; - /** - * Creates an ExportLogsPartialSuccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess - */ - ExportLogsPartialSuccess.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess) return object$1; - var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess(); - if (object$1.rejectedLogRecords != null) { - if ($util.Long) (message.rejectedLogRecords = $util.Long.fromValue(object$1.rejectedLogRecords)).unsigned = false; - else if (typeof object$1.rejectedLogRecords === "string") message.rejectedLogRecords = parseInt(object$1.rejectedLogRecords, 10); - else if (typeof object$1.rejectedLogRecords === "number") message.rejectedLogRecords = object$1.rejectedLogRecords; - else if (typeof object$1.rejectedLogRecords === "object") message.rejectedLogRecords = new $util.LongBits(object$1.rejectedLogRecords.low >>> 0, object$1.rejectedLogRecords.high >>> 0).toNumber(); - } - if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); - return message; - }; - /** - * Creates a plain object from an ExportLogsPartialSuccess message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} message ExportLogsPartialSuccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportLogsPartialSuccess.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.rejectedLogRecords = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.rejectedLogRecords = options.longs === String ? "0" : 0; - object$1.errorMessage = ""; - } - if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) if (typeof message.rejectedLogRecords === "number") object$1.rejectedLogRecords = options.longs === String ? String(message.rejectedLogRecords) : message.rejectedLogRecords; - else object$1.rejectedLogRecords = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedLogRecords) : options.longs === Number ? new $util.LongBits(message.rejectedLogRecords.low >>> 0, message.rejectedLogRecords.high >>> 0).toNumber() : message.rejectedLogRecords; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; - return object$1; - }; - /** - * Converts this ExportLogsPartialSuccess to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @instance - * @returns {Object.} JSON object - */ - ExportLogsPartialSuccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportLogsPartialSuccess - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportLogsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"; - }; - return ExportLogsPartialSuccess; - })(); - return v1; - })(); - return logs; - })(); - return collector; - })(); - proto.metrics = (function() { - /** - * Namespace metrics. - * @memberof opentelemetry.proto - * @namespace - */ - var metrics$1 = {}; - metrics$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.metrics - * @namespace - */ - var v1 = {}; - v1.MetricsData = (function() { - /** - * Properties of a MetricsData. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IMetricsData - * @property {Array.|null} [resourceMetrics] MetricsData resourceMetrics - */ - /** - * Constructs a new MetricsData. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a MetricsData. - * @implements IMetricsData - * @constructor - * @param {opentelemetry.proto.metrics.v1.IMetricsData=} [properties] Properties to set - */ - function MetricsData(properties) { - this.resourceMetrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * MetricsData resourceMetrics. - * @member {Array.} resourceMetrics - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @instance - */ - MetricsData.prototype.resourceMetrics = $util.emptyArray; - /** - * Creates a new MetricsData instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.IMetricsData=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData instance - */ - MetricsData.create = function create(properties) { - return new MetricsData(properties); - }; - /** - * Encodes the specified MetricsData message. Does not implicitly {@link opentelemetry.proto.metrics.v1.MetricsData.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.IMetricsData} message MetricsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsData.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceMetrics != null && message.resourceMetrics.length) for (var i = 0; i < message.resourceMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified MetricsData message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.MetricsData.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.IMetricsData} message MetricsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a MetricsData message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsData.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.MetricsData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceMetrics && message.resourceMetrics.length)) message.resourceMetrics = []; - message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a MetricsData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a MetricsData message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricsData.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { - if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; - for (var i = 0; i < message.resourceMetrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); - if (error) return "resourceMetrics." + error; - } - } - return null; - }; - /** - * Creates a MetricsData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData - */ - MetricsData.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.MetricsData) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.MetricsData(); - if (object$1.resourceMetrics) { - if (!Array.isArray(object$1.resourceMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected"); - message.resourceMetrics = []; - for (var i = 0; i < object$1.resourceMetrics.length; ++i) { - if (typeof object$1.resourceMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected"); - message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object$1.resourceMetrics[i]); - } - } - return message; - }; - /** - * Creates a plain object from a MetricsData message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.MetricsData} message MetricsData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricsData.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceMetrics = []; - if (message.resourceMetrics && message.resourceMetrics.length) { - object$1.resourceMetrics = []; - for (var j = 0; j < message.resourceMetrics.length; ++j) object$1.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); - } - return object$1; - }; - /** - * Converts this MetricsData to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @instance - * @returns {Object.} JSON object - */ - MetricsData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for MetricsData - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetricsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.MetricsData"; - }; - return MetricsData; - })(); - v1.ResourceMetrics = (function() { - /** - * Properties of a ResourceMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IResourceMetrics - * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceMetrics resource - * @property {Array.|null} [scopeMetrics] ResourceMetrics scopeMetrics - * @property {string|null} [schemaUrl] ResourceMetrics schemaUrl - */ - /** - * Constructs a new ResourceMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a ResourceMetrics. - * @implements IResourceMetrics - * @constructor - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics=} [properties] Properties to set - */ - function ResourceMetrics(properties) { - this.scopeMetrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ResourceMetrics resource. - * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - */ - ResourceMetrics.prototype.resource = null; - /** - * ResourceMetrics scopeMetrics. - * @member {Array.} scopeMetrics - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - */ - ResourceMetrics.prototype.scopeMetrics = $util.emptyArray; - /** - * ResourceMetrics schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - */ - ResourceMetrics.prototype.schemaUrl = null; - /** - * Creates a new ResourceMetrics instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics instance - */ - ResourceMetrics.create = function create(properties) { - return new ResourceMetrics(properties); - }; - /** - * Encodes the specified ResourceMetrics message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ResourceMetrics.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics} message ResourceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceMetrics.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - if (message.scopeMetrics != null && message.scopeMetrics.length) for (var i = 0; i < message.scopeMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(message.scopeMetrics[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ResourceMetrics message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ResourceMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics} message ResourceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ResourceMetrics message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceMetrics.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.scopeMetrics && message.scopeMetrics.length)) message.scopeMetrics = []; - message.scopeMetrics.push($root.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ResourceMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ResourceMetrics message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error) return "resource." + error; - } - if (message.scopeMetrics != null && message.hasOwnProperty("scopeMetrics")) { - if (!Array.isArray(message.scopeMetrics)) return "scopeMetrics: array expected"; - for (var i = 0; i < message.scopeMetrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(message.scopeMetrics[i]); - if (error) return "scopeMetrics." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ResourceMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics - */ - ResourceMetrics.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ResourceMetrics) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics(); - if (object$1.resource != null) { - if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected"); - message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); - } - if (object$1.scopeMetrics) { - if (!Array.isArray(object$1.scopeMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected"); - message.scopeMetrics = []; - for (var i = 0; i < object$1.scopeMetrics.length; ++i) { - if (typeof object$1.scopeMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected"); - message.scopeMetrics[i] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(object$1.scopeMetrics[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ResourceMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.ResourceMetrics} message ResourceMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceMetrics.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.scopeMetrics = []; - if (options.defaults) { - object$1.resource = null; - object$1.schemaUrl = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); - if (message.scopeMetrics && message.scopeMetrics.length) { - object$1.scopeMetrics = []; - for (var j = 0; j < message.scopeMetrics.length; ++j) object$1.scopeMetrics[j] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(message.scopeMetrics[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ResourceMetrics to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - * @returns {Object.} JSON object - */ - ResourceMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ResourceMetrics - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ResourceMetrics"; - }; - return ResourceMetrics; - })(); - v1.ScopeMetrics = (function() { - /** - * Properties of a ScopeMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IScopeMetrics - * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeMetrics scope - * @property {Array.|null} [metrics] ScopeMetrics metrics - * @property {string|null} [schemaUrl] ScopeMetrics schemaUrl - */ - /** - * Constructs a new ScopeMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a ScopeMetrics. - * @implements IScopeMetrics - * @constructor - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics=} [properties] Properties to set - */ - function ScopeMetrics(properties) { - this.metrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ScopeMetrics scope. - * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - */ - ScopeMetrics.prototype.scope = null; - /** - * ScopeMetrics metrics. - * @member {Array.} metrics - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - */ - ScopeMetrics.prototype.metrics = $util.emptyArray; - /** - * ScopeMetrics schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - */ - ScopeMetrics.prototype.schemaUrl = null; - /** - * Creates a new ScopeMetrics instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics instance - */ - ScopeMetrics.create = function create(properties) { - return new ScopeMetrics(properties); - }; - /** - * Encodes the specified ScopeMetrics message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ScopeMetrics.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics} message ScopeMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeMetrics.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); - if (message.metrics != null && message.metrics.length) for (var i = 0; i < message.metrics.length; ++i) $root.opentelemetry.proto.metrics.v1.Metric.encode(message.metrics[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ScopeMetrics message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ScopeMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics} message ScopeMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ScopeMetrics message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeMetrics.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.metrics && message.metrics.length)) message.metrics = []; - message.metrics.push($root.opentelemetry.proto.metrics.v1.Metric.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ScopeMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ScopeMetrics message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScopeMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) { - var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error) return "scope." + error; - } - if (message.metrics != null && message.hasOwnProperty("metrics")) { - if (!Array.isArray(message.metrics)) return "metrics: array expected"; - for (var i = 0; i < message.metrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Metric.verify(message.metrics[i]); - if (error) return "metrics." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ScopeMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics - */ - ScopeMetrics.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ScopeMetrics) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics(); - if (object$1.scope != null) { - if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected"); - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); - } - if (object$1.metrics) { - if (!Array.isArray(object$1.metrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected"); - message.metrics = []; - for (var i = 0; i < object$1.metrics.length; ++i) { - if (typeof object$1.metrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected"); - message.metrics[i] = $root.opentelemetry.proto.metrics.v1.Metric.fromObject(object$1.metrics[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ScopeMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.ScopeMetrics} message ScopeMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScopeMetrics.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.metrics = []; - if (options.defaults) { - object$1.scope = null; - object$1.schemaUrl = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); - if (message.metrics && message.metrics.length) { - object$1.metrics = []; - for (var j = 0; j < message.metrics.length; ++j) object$1.metrics[j] = $root.opentelemetry.proto.metrics.v1.Metric.toObject(message.metrics[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ScopeMetrics to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - * @returns {Object.} JSON object - */ - ScopeMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ScopeMetrics - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScopeMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ScopeMetrics"; - }; - return ScopeMetrics; - })(); - v1.Metric = (function() { - /** - * Properties of a Metric. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IMetric - * @property {string|null} [name] Metric name - * @property {string|null} [description] Metric description - * @property {string|null} [unit] Metric unit - * @property {opentelemetry.proto.metrics.v1.IGauge|null} [gauge] Metric gauge - * @property {opentelemetry.proto.metrics.v1.ISum|null} [sum] Metric sum - * @property {opentelemetry.proto.metrics.v1.IHistogram|null} [histogram] Metric histogram - * @property {opentelemetry.proto.metrics.v1.IExponentialHistogram|null} [exponentialHistogram] Metric exponentialHistogram - * @property {opentelemetry.proto.metrics.v1.ISummary|null} [summary] Metric summary - * @property {Array.|null} [metadata] Metric metadata - */ - /** - * Constructs a new Metric. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Metric. - * @implements IMetric - * @constructor - * @param {opentelemetry.proto.metrics.v1.IMetric=} [properties] Properties to set - */ - function Metric(properties) { - this.metadata = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Metric name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.name = null; - /** - * Metric description. - * @member {string|null|undefined} description - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.description = null; - /** - * Metric unit. - * @member {string|null|undefined} unit - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.unit = null; - /** - * Metric gauge. - * @member {opentelemetry.proto.metrics.v1.IGauge|null|undefined} gauge - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.gauge = null; - /** - * Metric sum. - * @member {opentelemetry.proto.metrics.v1.ISum|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.sum = null; - /** - * Metric histogram. - * @member {opentelemetry.proto.metrics.v1.IHistogram|null|undefined} histogram - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.histogram = null; - /** - * Metric exponentialHistogram. - * @member {opentelemetry.proto.metrics.v1.IExponentialHistogram|null|undefined} exponentialHistogram - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.exponentialHistogram = null; - /** - * Metric summary. - * @member {opentelemetry.proto.metrics.v1.ISummary|null|undefined} summary - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.summary = null; - /** - * Metric metadata. - * @member {Array.} metadata - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.metadata = $util.emptyArray; - var $oneOfFields; - /** - * Metric data. - * @member {"gauge"|"sum"|"histogram"|"exponentialHistogram"|"summary"|undefined} data - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Object.defineProperty(Metric.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = [ - "gauge", - "sum", - "histogram", - "exponentialHistogram", - "summary" - ]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new Metric instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.IMetric=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric instance - */ - Metric.create = function create(properties) { - return new Metric(properties); - }; - /** - * Encodes the specified Metric message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Metric.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.IMetric} message Metric message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metric.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(18).string(message.description); - if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) writer.uint32(26).string(message.unit); - if (message.gauge != null && Object.hasOwnProperty.call(message, "gauge")) $root.opentelemetry.proto.metrics.v1.Gauge.encode(message.gauge, writer.uint32(42).fork()).ldelim(); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) $root.opentelemetry.proto.metrics.v1.Sum.encode(message.sum, writer.uint32(58).fork()).ldelim(); - if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) $root.opentelemetry.proto.metrics.v1.Histogram.encode(message.histogram, writer.uint32(74).fork()).ldelim(); - if (message.exponentialHistogram != null && Object.hasOwnProperty.call(message, "exponentialHistogram")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(message.exponentialHistogram, writer.uint32(82).fork()).ldelim(); - if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) $root.opentelemetry.proto.metrics.v1.Summary.encode(message.summary, writer.uint32(90).fork()).ldelim(); - if (message.metadata != null && message.metadata.length) for (var i = 0; i < message.metadata.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.metadata[i], writer.uint32(98).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Metric message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Metric.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.IMetric} message Metric message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metric.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Metric message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metric.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Metric(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.unit = reader.string(); - break; - case 5: - message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.decode(reader, reader.uint32()); - break; - case 7: - message.sum = $root.opentelemetry.proto.metrics.v1.Sum.decode(reader, reader.uint32()); - break; - case 9: - message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.decode(reader, reader.uint32()); - break; - case 10: - message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(reader, reader.uint32()); - break; - case 11: - message.summary = $root.opentelemetry.proto.metrics.v1.Summary.decode(reader, reader.uint32()); - break; - case 12: - if (!(message.metadata && message.metadata.length)) message.metadata = []; - message.metadata.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Metric message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metric.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Metric message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metric.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.description != null && message.hasOwnProperty("description")) { - if (!$util.isString(message.description)) return "description: string expected"; - } - if (message.unit != null && message.hasOwnProperty("unit")) { - if (!$util.isString(message.unit)) return "unit: string expected"; - } - if (message.gauge != null && message.hasOwnProperty("gauge")) { - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Gauge.verify(message.gauge); - if (error) return "gauge." + error; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Sum.verify(message.sum); - if (error) return "sum." + error; - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Histogram.verify(message.histogram); - if (error) return "histogram." + error; - } - if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(message.exponentialHistogram); - if (error) return "exponentialHistogram." + error; - } - if (message.summary != null && message.hasOwnProperty("summary")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Summary.verify(message.summary); - if (error) return "summary." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!Array.isArray(message.metadata)) return "metadata: array expected"; - for (var i = 0; i < message.metadata.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.metadata[i]); - if (error) return "metadata." + error; - } - } - return null; - }; - /** - * Creates a Metric message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric - */ - Metric.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Metric) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Metric(); - if (object$1.name != null) message.name = String(object$1.name); - if (object$1.description != null) message.description = String(object$1.description); - if (object$1.unit != null) message.unit = String(object$1.unit); - if (object$1.gauge != null) { - if (typeof object$1.gauge !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected"); - message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.fromObject(object$1.gauge); - } - if (object$1.sum != null) { - if (typeof object$1.sum !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected"); - message.sum = $root.opentelemetry.proto.metrics.v1.Sum.fromObject(object$1.sum); - } - if (object$1.histogram != null) { - if (typeof object$1.histogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected"); - message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.fromObject(object$1.histogram); - } - if (object$1.exponentialHistogram != null) { - if (typeof object$1.exponentialHistogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected"); - message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(object$1.exponentialHistogram); - } - if (object$1.summary != null) { - if (typeof object$1.summary !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected"); - message.summary = $root.opentelemetry.proto.metrics.v1.Summary.fromObject(object$1.summary); - } - if (object$1.metadata) { - if (!Array.isArray(object$1.metadata)) throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected"); - message.metadata = []; - for (var i = 0; i < object$1.metadata.length; ++i) { - if (typeof object$1.metadata[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected"); - message.metadata[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.metadata[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Metric message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.Metric} message Metric - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metric.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.metadata = []; - if (options.defaults) { - object$1.name = ""; - object$1.description = ""; - object$1.unit = ""; - } - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) object$1.description = message.description; - if (message.unit != null && message.hasOwnProperty("unit")) object$1.unit = message.unit; - if (message.gauge != null && message.hasOwnProperty("gauge")) { - object$1.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.toObject(message.gauge, options); - if (options.oneofs) object$1.data = "gauge"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - object$1.sum = $root.opentelemetry.proto.metrics.v1.Sum.toObject(message.sum, options); - if (options.oneofs) object$1.data = "sum"; - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - object$1.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.toObject(message.histogram, options); - if (options.oneofs) object$1.data = "histogram"; - } - if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { - object$1.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(message.exponentialHistogram, options); - if (options.oneofs) object$1.data = "exponentialHistogram"; - } - if (message.summary != null && message.hasOwnProperty("summary")) { - object$1.summary = $root.opentelemetry.proto.metrics.v1.Summary.toObject(message.summary, options); - if (options.oneofs) object$1.data = "summary"; - } - if (message.metadata && message.metadata.length) { - object$1.metadata = []; - for (var j = 0; j < message.metadata.length; ++j) object$1.metadata[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.metadata[j], options); - } - return object$1; - }; - /** - * Converts this Metric to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - * @returns {Object.} JSON object - */ - Metric.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Metric - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Metric"; - }; - return Metric; - })(); - v1.Gauge = (function() { - /** - * Properties of a Gauge. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IGauge - * @property {Array.|null} [dataPoints] Gauge dataPoints - */ - /** - * Constructs a new Gauge. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Gauge. - * @implements IGauge - * @constructor - * @param {opentelemetry.proto.metrics.v1.IGauge=} [properties] Properties to set - */ - function Gauge(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Gauge dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @instance - */ - Gauge.prototype.dataPoints = $util.emptyArray; - /** - * Creates a new Gauge instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.IGauge=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge instance - */ - Gauge.create = function create(properties) { - return new Gauge(properties); - }; - /** - * Encodes the specified Gauge message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Gauge.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.IGauge} message Gauge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Gauge.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Gauge message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Gauge.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.IGauge} message Gauge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Gauge.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Gauge message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Gauge.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Gauge(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Gauge message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Gauge.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Gauge message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Gauge.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - return null; - }; - /** - * Creates a Gauge message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge - */ - Gauge.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Gauge) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Gauge(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object$1.dataPoints[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Gauge message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.Gauge} message Gauge - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Gauge.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); - } - return object$1; - }; - /** - * Converts this Gauge to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @instance - * @returns {Object.} JSON object - */ - Gauge.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Gauge - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Gauge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Gauge"; - }; - return Gauge; - })(); - v1.Sum = (function() { - /** - * Properties of a Sum. - * @memberof opentelemetry.proto.metrics.v1 - * @interface ISum - * @property {Array.|null} [dataPoints] Sum dataPoints - * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] Sum aggregationTemporality - * @property {boolean|null} [isMonotonic] Sum isMonotonic - */ - /** - * Constructs a new Sum. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Sum. - * @implements ISum - * @constructor - * @param {opentelemetry.proto.metrics.v1.ISum=} [properties] Properties to set - */ - function Sum(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Sum dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - */ - Sum.prototype.dataPoints = $util.emptyArray; - /** - * Sum aggregationTemporality. - * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - */ - Sum.prototype.aggregationTemporality = null; - /** - * Sum isMonotonic. - * @member {boolean|null|undefined} isMonotonic - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - */ - Sum.prototype.isMonotonic = null; - /** - * Creates a new Sum instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.ISum=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum instance - */ - Sum.create = function create(properties) { - return new Sum(properties); - }; - /** - * Encodes the specified Sum message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Sum.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); - if (message.isMonotonic != null && Object.hasOwnProperty.call(message, "isMonotonic")) writer.uint32(24).bool(message.isMonotonic); - return writer; - }; - /** - * Encodes the specified Sum message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Sum.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Sum message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Sum(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); - break; - case 2: - message.aggregationTemporality = reader.int32(); - break; - case 3: - message.isMonotonic = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Sum message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Sum message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Sum.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { - default: return "aggregationTemporality: enum value expected"; - case 0: - case 1: - case 2: break; - } - if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) { - if (typeof message.isMonotonic !== "boolean") return "isMonotonic: boolean expected"; - } - return null; - }; - /** - * Creates a Sum message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum - */ - Sum.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Sum) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Sum(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object$1.dataPoints[i]); - } - } - switch (object$1.aggregationTemporality) { - default: - if (typeof object$1.aggregationTemporality === "number") { - message.aggregationTemporality = object$1.aggregationTemporality; - break; - } - break; - case "AGGREGATION_TEMPORALITY_UNSPECIFIED": - case 0: - message.aggregationTemporality = 0; - break; - case "AGGREGATION_TEMPORALITY_DELTA": - case 1: - message.aggregationTemporality = 1; - break; - case "AGGREGATION_TEMPORALITY_CUMULATIVE": - case 2: - message.aggregationTemporality = 2; - break; - } - if (object$1.isMonotonic != null) message.isMonotonic = Boolean(object$1.isMonotonic); - return message; - }; - /** - * Creates a plain object from a Sum message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.Sum} message Sum - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Sum.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (options.defaults) { - object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; - object$1.isMonotonic = false; - } - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; - if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) object$1.isMonotonic = message.isMonotonic; - return object$1; - }; - /** - * Converts this Sum to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - * @returns {Object.} JSON object - */ - Sum.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Sum - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Sum"; - }; - return Sum; - })(); - v1.Histogram = (function() { - /** - * Properties of a Histogram. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IHistogram - * @property {Array.|null} [dataPoints] Histogram dataPoints - * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] Histogram aggregationTemporality - */ - /** - * Constructs a new Histogram. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Histogram. - * @implements IHistogram - * @constructor - * @param {opentelemetry.proto.metrics.v1.IHistogram=} [properties] Properties to set - */ - function Histogram(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Histogram dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @instance - */ - Histogram.prototype.dataPoints = $util.emptyArray; - /** - * Histogram aggregationTemporality. - * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @instance - */ - Histogram.prototype.aggregationTemporality = null; - /** - * Creates a new Histogram instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogram=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram instance - */ - Histogram.create = function create(properties) { - return new Histogram(properties); - }; - /** - * Encodes the specified Histogram message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Histogram.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); - return writer; - }; - /** - * Encodes the specified Histogram message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Histogram.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Histogram message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Histogram(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(reader, reader.uint32())); - break; - case 2: - message.aggregationTemporality = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Histogram message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Histogram message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Histogram.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { - default: return "aggregationTemporality: enum value expected"; - case 0: - case 1: - case 2: break; - } - return null; - }; - /** - * Creates a Histogram message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram - */ - Histogram.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Histogram) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Histogram(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(object$1.dataPoints[i]); - } - } - switch (object$1.aggregationTemporality) { - default: - if (typeof object$1.aggregationTemporality === "number") { - message.aggregationTemporality = object$1.aggregationTemporality; - break; - } - break; - case "AGGREGATION_TEMPORALITY_UNSPECIFIED": - case 0: - message.aggregationTemporality = 0; - break; - case "AGGREGATION_TEMPORALITY_DELTA": - case 1: - message.aggregationTemporality = 1; - break; - case "AGGREGATION_TEMPORALITY_CUMULATIVE": - case 2: - message.aggregationTemporality = 2; - break; - } - return message; - }; - /** - * Creates a plain object from a Histogram message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.Histogram} message Histogram - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Histogram.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (options.defaults) object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(message.dataPoints[j], options); - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; - return object$1; - }; - /** - * Converts this Histogram to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @instance - * @returns {Object.} JSON object - */ - Histogram.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Histogram - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Histogram"; - }; - return Histogram; - })(); - v1.ExponentialHistogram = (function() { - /** - * Properties of an ExponentialHistogram. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IExponentialHistogram - * @property {Array.|null} [dataPoints] ExponentialHistogram dataPoints - * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] ExponentialHistogram aggregationTemporality - */ - /** - * Constructs a new ExponentialHistogram. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents an ExponentialHistogram. - * @implements IExponentialHistogram - * @constructor - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram=} [properties] Properties to set - */ - function ExponentialHistogram(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExponentialHistogram dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @instance - */ - ExponentialHistogram.prototype.dataPoints = $util.emptyArray; - /** - * ExponentialHistogram aggregationTemporality. - * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @instance - */ - ExponentialHistogram.prototype.aggregationTemporality = null; - /** - * Creates a new ExponentialHistogram instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram instance - */ - ExponentialHistogram.create = function create(properties) { - return new ExponentialHistogram(properties); - }; - /** - * Encodes the specified ExponentialHistogram message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogram.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram} message ExponentialHistogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogram.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); - return writer; - }; - /** - * Encodes the specified ExponentialHistogram message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogram.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram} message ExponentialHistogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogram.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExponentialHistogram message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogram.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(reader, reader.uint32())); - break; - case 2: - message.aggregationTemporality = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExponentialHistogram message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogram.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExponentialHistogram message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExponentialHistogram.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { - default: return "aggregationTemporality: enum value expected"; - case 0: - case 1: - case 2: break; - } - return null; - }; - /** - * Creates an ExponentialHistogram message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram - */ - ExponentialHistogram.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogram) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(object$1.dataPoints[i]); - } - } - switch (object$1.aggregationTemporality) { - default: - if (typeof object$1.aggregationTemporality === "number") { - message.aggregationTemporality = object$1.aggregationTemporality; - break; - } - break; - case "AGGREGATION_TEMPORALITY_UNSPECIFIED": - case 0: - message.aggregationTemporality = 0; - break; - case "AGGREGATION_TEMPORALITY_DELTA": - case 1: - message.aggregationTemporality = 1; - break; - case "AGGREGATION_TEMPORALITY_CUMULATIVE": - case 2: - message.aggregationTemporality = 2; - break; - } - return message; - }; - /** - * Creates a plain object from an ExponentialHistogram message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogram} message ExponentialHistogram - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExponentialHistogram.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (options.defaults) object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(message.dataPoints[j], options); - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; - return object$1; - }; - /** - * Converts this ExponentialHistogram to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @instance - * @returns {Object.} JSON object - */ - ExponentialHistogram.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExponentialHistogram - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExponentialHistogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogram"; - }; - return ExponentialHistogram; - })(); - v1.Summary = (function() { - /** - * Properties of a Summary. - * @memberof opentelemetry.proto.metrics.v1 - * @interface ISummary - * @property {Array.|null} [dataPoints] Summary dataPoints - */ - /** - * Constructs a new Summary. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Summary. - * @implements ISummary - * @constructor - * @param {opentelemetry.proto.metrics.v1.ISummary=} [properties] Properties to set - */ - function Summary(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Summary dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Summary - * @instance - */ - Summary.prototype.dataPoints = $util.emptyArray; - /** - * Creates a new Summary instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.ISummary=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary instance - */ - Summary.create = function create(properties) { - return new Summary(properties); - }; - /** - * Encodes the specified Summary message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Summary.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.ISummary} message Summary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Summary.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Summary message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Summary.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.ISummary} message Summary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Summary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Summary message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Summary.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Summary(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Summary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Summary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Summary message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Summary.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - return null; - }; - /** - * Creates a Summary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary - */ - Summary.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Summary) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Summary(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(object$1.dataPoints[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Summary message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.Summary} message Summary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Summary.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(message.dataPoints[j], options); - } - return object$1; - }; - /** - * Converts this Summary to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Summary - * @instance - * @returns {Object.} JSON object - */ - Summary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Summary - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Summary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Summary"; - }; - return Summary; - })(); - /** - * AggregationTemporality enum. - * @name opentelemetry.proto.metrics.v1.AggregationTemporality - * @enum {number} - * @property {number} AGGREGATION_TEMPORALITY_UNSPECIFIED=0 AGGREGATION_TEMPORALITY_UNSPECIFIED value - * @property {number} AGGREGATION_TEMPORALITY_DELTA=1 AGGREGATION_TEMPORALITY_DELTA value - * @property {number} AGGREGATION_TEMPORALITY_CUMULATIVE=2 AGGREGATION_TEMPORALITY_CUMULATIVE value - */ - v1.AggregationTemporality = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AGGREGATION_TEMPORALITY_DELTA"] = 1; - values[valuesById[2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2; - return values; - })(); - /** - * DataPointFlags enum. - * @name opentelemetry.proto.metrics.v1.DataPointFlags - * @enum {number} - * @property {number} DATA_POINT_FLAGS_DO_NOT_USE=0 DATA_POINT_FLAGS_DO_NOT_USE value - * @property {number} DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK=1 DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK value - */ - v1.DataPointFlags = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_POINT_FLAGS_DO_NOT_USE"] = 0; - values[valuesById[1] = "DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"] = 1; - return values; - })(); - v1.NumberDataPoint = (function() { - /** - * Properties of a NumberDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface INumberDataPoint - * @property {Array.|null} [attributes] NumberDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] NumberDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] NumberDataPoint timeUnixNano - * @property {number|null} [asDouble] NumberDataPoint asDouble - * @property {number|Long|null} [asInt] NumberDataPoint asInt - * @property {Array.|null} [exemplars] NumberDataPoint exemplars - * @property {number|null} [flags] NumberDataPoint flags - */ - /** - * Constructs a new NumberDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a NumberDataPoint. - * @implements INumberDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint=} [properties] Properties to set - */ - function NumberDataPoint(properties) { - this.attributes = []; - this.exemplars = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * NumberDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.attributes = $util.emptyArray; - /** - * NumberDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.startTimeUnixNano = null; - /** - * NumberDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.timeUnixNano = null; - /** - * NumberDataPoint asDouble. - * @member {number|null|undefined} asDouble - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.asDouble = null; - /** - * NumberDataPoint asInt. - * @member {number|Long|null|undefined} asInt - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.asInt = null; - /** - * NumberDataPoint exemplars. - * @member {Array.} exemplars - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.exemplars = $util.emptyArray; - /** - * NumberDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.flags = null; - var $oneOfFields; - /** - * NumberDataPoint value. - * @member {"asDouble"|"asInt"|undefined} value - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - Object.defineProperty(NumberDataPoint.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new NumberDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint instance - */ - NumberDataPoint.create = function create(properties) { - return new NumberDataPoint(properties); - }; - /** - * Encodes the specified NumberDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.NumberDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint} message NumberDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumberDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) writer.uint32(33).double(message.asDouble); - if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(42).fork()).ldelim(); - if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); - return writer; - }; - /** - * Encodes the specified NumberDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.NumberDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint} message NumberDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumberDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a NumberDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumberDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 7: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.asDouble = reader.double(); - break; - case 6: - message.asInt = reader.sfixed64(); - break; - case 5: - if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; - message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); - break; - case 8: - message.flags = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a NumberDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumberDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a NumberDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NumberDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - properties.value = 1; - if (typeof message.asDouble !== "number") return "asDouble: number expected"; - } - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) return "asInt: integer|Long expected"; - } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); - if (error) return "exemplars." + error; - } - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - return null; - }; - /** - * Creates a NumberDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint - */ - NumberDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.NumberDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.asDouble != null) message.asDouble = Number(object$1.asDouble); - if (object$1.asInt != null) { - if ($util.Long) (message.asInt = $util.Long.fromValue(object$1.asInt)).unsigned = false; - else if (typeof object$1.asInt === "string") message.asInt = parseInt(object$1.asInt, 10); - else if (typeof object$1.asInt === "number") message.asInt = object$1.asInt; - else if (typeof object$1.asInt === "object") message.asInt = new $util.LongBits(object$1.asInt.low >>> 0, object$1.asInt.high >>> 0).toNumber(); - } - if (object$1.exemplars) { - if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object$1.exemplars.length; ++i) { - if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected"); - message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); - } - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - return message; - }; - /** - * Creates a plain object from a NumberDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.NumberDataPoint} message NumberDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NumberDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.exemplars = []; - object$1.attributes = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - object$1.flags = 0; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - object$1.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; - if (options.oneofs) object$1.value = "asDouble"; - } - if (message.exemplars && message.exemplars.length) { - object$1.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); - } - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (typeof message.asInt === "number") object$1.asInt = options.longs === String ? String(message.asInt) : message.asInt; - else object$1.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; - if (options.oneofs) object$1.value = "asInt"; - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this NumberDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - * @returns {Object.} JSON object - */ - NumberDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for NumberDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NumberDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.NumberDataPoint"; - }; - return NumberDataPoint; - })(); - v1.HistogramDataPoint = (function() { - /** - * Properties of a HistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IHistogramDataPoint - * @property {Array.|null} [attributes] HistogramDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] HistogramDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] HistogramDataPoint timeUnixNano - * @property {number|Long|null} [count] HistogramDataPoint count - * @property {number|null} [sum] HistogramDataPoint sum - * @property {Array.|null} [bucketCounts] HistogramDataPoint bucketCounts - * @property {Array.|null} [explicitBounds] HistogramDataPoint explicitBounds - * @property {Array.|null} [exemplars] HistogramDataPoint exemplars - * @property {number|null} [flags] HistogramDataPoint flags - * @property {number|null} [min] HistogramDataPoint min - * @property {number|null} [max] HistogramDataPoint max - */ - /** - * Constructs a new HistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a HistogramDataPoint. - * @implements IHistogramDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint=} [properties] Properties to set - */ - function HistogramDataPoint(properties) { - this.attributes = []; - this.bucketCounts = []; - this.explicitBounds = []; - this.exemplars = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * HistogramDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.attributes = $util.emptyArray; - /** - * HistogramDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.startTimeUnixNano = null; - /** - * HistogramDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.timeUnixNano = null; - /** - * HistogramDataPoint count. - * @member {number|Long|null|undefined} count - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.count = null; - /** - * HistogramDataPoint sum. - * @member {number|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.sum = null; - /** - * HistogramDataPoint bucketCounts. - * @member {Array.} bucketCounts - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.bucketCounts = $util.emptyArray; - /** - * HistogramDataPoint explicitBounds. - * @member {Array.} explicitBounds - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.explicitBounds = $util.emptyArray; - /** - * HistogramDataPoint exemplars. - * @member {Array.} exemplars - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.exemplars = $util.emptyArray; - /** - * HistogramDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.flags = null; - /** - * HistogramDataPoint min. - * @member {number|null|undefined} min - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.min = null; - /** - * HistogramDataPoint max. - * @member {number|null|undefined} max - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.max = null; - var $oneOfFields; - /** - * HistogramDataPoint _sum. - * @member {"sum"|undefined} _sum - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - Object.defineProperty(HistogramDataPoint.prototype, "_sum", { - get: $util.oneOfGetter($oneOfFields = ["sum"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * HistogramDataPoint _min. - * @member {"min"|undefined} _min - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - Object.defineProperty(HistogramDataPoint.prototype, "_min", { - get: $util.oneOfGetter($oneOfFields = ["min"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * HistogramDataPoint _max. - * @member {"max"|undefined} _max - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - Object.defineProperty(HistogramDataPoint.prototype, "_max", { - get: $util.oneOfGetter($oneOfFields = ["max"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new HistogramDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint instance - */ - HistogramDataPoint.create = function create(properties) { - return new HistogramDataPoint(properties); - }; - /** - * Encodes the specified HistogramDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.HistogramDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint} message HistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); - if (message.bucketCounts != null && message.bucketCounts.length) { - writer.uint32(50).fork(); - for (var i = 0; i < message.bucketCounts.length; ++i) writer.fixed64(message.bucketCounts[i]); - writer.ldelim(); - } - if (message.explicitBounds != null && message.explicitBounds.length) { - writer.uint32(58).fork(); - for (var i = 0; i < message.explicitBounds.length; ++i) writer.double(message.explicitBounds[i]); - writer.ldelim(); - } - if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(66).fork()).ldelim(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); - if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(89).double(message.min); - if (message.max != null && Object.hasOwnProperty.call(message, "max")) writer.uint32(97).double(message.max); - return writer; - }; - /** - * Encodes the specified HistogramDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.HistogramDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint} message HistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a HistogramDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 9: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.count = reader.fixed64(); - break; - case 5: - message.sum = reader.double(); - break; - case 6: - if (!(message.bucketCounts && message.bucketCounts.length)) message.bucketCounts = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) message.bucketCounts.push(reader.fixed64()); - } else message.bucketCounts.push(reader.fixed64()); - break; - case 7: - if (!(message.explicitBounds && message.explicitBounds.length)) message.explicitBounds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) message.explicitBounds.push(reader.double()); - } else message.explicitBounds.push(reader.double()); - break; - case 8: - if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; - message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); - break; - case 10: - message.flags = reader.uint32(); - break; - case 11: - message.min = reader.double(); - break; - case 12: - message.max = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a HistogramDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a HistogramDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HistogramDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.count != null && message.hasOwnProperty("count")) { - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - properties._sum = 1; - if (typeof message.sum !== "number") return "sum: number expected"; - } - if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { - if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; - for (var i = 0; i < message.bucketCounts.length; ++i) if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) return "bucketCounts: integer|Long[] expected"; - } - if (message.explicitBounds != null && message.hasOwnProperty("explicitBounds")) { - if (!Array.isArray(message.explicitBounds)) return "explicitBounds: array expected"; - for (var i = 0; i < message.explicitBounds.length; ++i) if (typeof message.explicitBounds[i] !== "number") return "explicitBounds: number[] expected"; - } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); - if (error) return "exemplars." + error; - } - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.min != null && message.hasOwnProperty("min")) { - properties._min = 1; - if (typeof message.min !== "number") return "min: number expected"; - } - if (message.max != null && message.hasOwnProperty("max")) { - properties._max = 1; - if (typeof message.max !== "number") return "max: number expected"; - } - return null; - }; - /** - * Creates a HistogramDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint - */ - HistogramDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.HistogramDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.count != null) { - if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; - else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); - else if (typeof object$1.count === "number") message.count = object$1.count; - else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); - } - if (object$1.sum != null) message.sum = Number(object$1.sum); - if (object$1.bucketCounts) { - if (!Array.isArray(object$1.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected"); - message.bucketCounts = []; - for (var i = 0; i < object$1.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object$1.bucketCounts[i])).unsigned = false; - else if (typeof object$1.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object$1.bucketCounts[i], 10); - else if (typeof object$1.bucketCounts[i] === "number") message.bucketCounts[i] = object$1.bucketCounts[i]; - else if (typeof object$1.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object$1.bucketCounts[i].low >>> 0, object$1.bucketCounts[i].high >>> 0).toNumber(); - } - if (object$1.explicitBounds) { - if (!Array.isArray(object$1.explicitBounds)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected"); - message.explicitBounds = []; - for (var i = 0; i < object$1.explicitBounds.length; ++i) message.explicitBounds[i] = Number(object$1.explicitBounds[i]); - } - if (object$1.exemplars) { - if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object$1.exemplars.length; ++i) { - if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected"); - message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); - } - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.min != null) message.min = Number(object$1.min); - if (object$1.max != null) message.max = Number(object$1.max); - return message; - }; - /** - * Creates a plain object from a HistogramDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.HistogramDataPoint} message HistogramDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HistogramDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.bucketCounts = []; - object$1.explicitBounds = []; - object$1.exemplars = []; - object$1.attributes = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.count = options.longs === String ? "0" : 0; - object$1.flags = 0; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; - else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.sum != null && message.hasOwnProperty("sum")) { - object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; - if (options.oneofs) object$1._sum = "sum"; - } - if (message.bucketCounts && message.bucketCounts.length) { - object$1.bucketCounts = []; - for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object$1.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; - else object$1.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; - } - if (message.explicitBounds && message.explicitBounds.length) { - object$1.explicitBounds = []; - for (var j = 0; j < message.explicitBounds.length; ++j) object$1.explicitBounds[j] = options.json && !isFinite(message.explicitBounds[j]) ? String(message.explicitBounds[j]) : message.explicitBounds[j]; - } - if (message.exemplars && message.exemplars.length) { - object$1.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - if (message.min != null && message.hasOwnProperty("min")) { - object$1.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; - if (options.oneofs) object$1._min = "min"; - } - if (message.max != null && message.hasOwnProperty("max")) { - object$1.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; - if (options.oneofs) object$1._max = "max"; - } - return object$1; - }; - /** - * Converts this HistogramDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - * @returns {Object.} JSON object - */ - HistogramDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for HistogramDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.HistogramDataPoint"; - }; - return HistogramDataPoint; - })(); - v1.ExponentialHistogramDataPoint = (function() { - /** - * Properties of an ExponentialHistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IExponentialHistogramDataPoint - * @property {Array.|null} [attributes] ExponentialHistogramDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] ExponentialHistogramDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] ExponentialHistogramDataPoint timeUnixNano - * @property {number|Long|null} [count] ExponentialHistogramDataPoint count - * @property {number|null} [sum] ExponentialHistogramDataPoint sum - * @property {number|null} [scale] ExponentialHistogramDataPoint scale - * @property {number|Long|null} [zeroCount] ExponentialHistogramDataPoint zeroCount - * @property {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null} [positive] ExponentialHistogramDataPoint positive - * @property {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null} [negative] ExponentialHistogramDataPoint negative - * @property {number|null} [flags] ExponentialHistogramDataPoint flags - * @property {Array.|null} [exemplars] ExponentialHistogramDataPoint exemplars - * @property {number|null} [min] ExponentialHistogramDataPoint min - * @property {number|null} [max] ExponentialHistogramDataPoint max - * @property {number|null} [zeroThreshold] ExponentialHistogramDataPoint zeroThreshold - */ - /** - * Constructs a new ExponentialHistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents an ExponentialHistogramDataPoint. - * @implements IExponentialHistogramDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint=} [properties] Properties to set - */ - function ExponentialHistogramDataPoint(properties) { - this.attributes = []; - this.exemplars = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExponentialHistogramDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.attributes = $util.emptyArray; - /** - * ExponentialHistogramDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.startTimeUnixNano = null; - /** - * ExponentialHistogramDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.timeUnixNano = null; - /** - * ExponentialHistogramDataPoint count. - * @member {number|Long|null|undefined} count - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.count = null; - /** - * ExponentialHistogramDataPoint sum. - * @member {number|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.sum = null; - /** - * ExponentialHistogramDataPoint scale. - * @member {number|null|undefined} scale - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.scale = null; - /** - * ExponentialHistogramDataPoint zeroCount. - * @member {number|Long|null|undefined} zeroCount - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.zeroCount = null; - /** - * ExponentialHistogramDataPoint positive. - * @member {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null|undefined} positive - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.positive = null; - /** - * ExponentialHistogramDataPoint negative. - * @member {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null|undefined} negative - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.negative = null; - /** - * ExponentialHistogramDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.flags = null; - /** - * ExponentialHistogramDataPoint exemplars. - * @member {Array.} exemplars - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.exemplars = $util.emptyArray; - /** - * ExponentialHistogramDataPoint min. - * @member {number|null|undefined} min - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.min = null; - /** - * ExponentialHistogramDataPoint max. - * @member {number|null|undefined} max - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.max = null; - /** - * ExponentialHistogramDataPoint zeroThreshold. - * @member {number|null|undefined} zeroThreshold - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.zeroThreshold = null; - var $oneOfFields; - /** - * ExponentialHistogramDataPoint _sum. - * @member {"sum"|undefined} _sum - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_sum", { - get: $util.oneOfGetter($oneOfFields = ["sum"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * ExponentialHistogramDataPoint _min. - * @member {"min"|undefined} _min - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_min", { - get: $util.oneOfGetter($oneOfFields = ["min"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * ExponentialHistogramDataPoint _max. - * @member {"max"|undefined} _max - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_max", { - get: $util.oneOfGetter($oneOfFields = ["max"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new ExponentialHistogramDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint instance - */ - ExponentialHistogramDataPoint.create = function create(properties) { - return new ExponentialHistogramDataPoint(properties); - }; - /** - * Encodes the specified ExponentialHistogramDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint} message ExponentialHistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogramDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); - if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) writer.uint32(48).sint32(message.scale); - if (message.zeroCount != null && Object.hasOwnProperty.call(message, "zeroCount")) writer.uint32(57).fixed64(message.zeroCount); - if (message.positive != null && Object.hasOwnProperty.call(message, "positive")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.positive, writer.uint32(66).fork()).ldelim(); - if (message.negative != null && Object.hasOwnProperty.call(message, "negative")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.negative, writer.uint32(74).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); - if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(90).fork()).ldelim(); - if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(97).double(message.min); - if (message.max != null && Object.hasOwnProperty.call(message, "max")) writer.uint32(105).double(message.max); - if (message.zeroThreshold != null && Object.hasOwnProperty.call(message, "zeroThreshold")) writer.uint32(113).double(message.zeroThreshold); - return writer; - }; - /** - * Encodes the specified ExponentialHistogramDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint} message ExponentialHistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExponentialHistogramDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogramDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.count = reader.fixed64(); - break; - case 5: - message.sum = reader.double(); - break; - case 6: - message.scale = reader.sint32(); - break; - case 7: - message.zeroCount = reader.fixed64(); - break; - case 8: - message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); - break; - case 9: - message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); - break; - case 10: - message.flags = reader.uint32(); - break; - case 11: - if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; - message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); - break; - case 12: - message.min = reader.double(); - break; - case 13: - message.max = reader.double(); - break; - case 14: - message.zeroThreshold = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExponentialHistogramDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExponentialHistogramDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExponentialHistogramDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.count != null && message.hasOwnProperty("count")) { - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - properties._sum = 1; - if (typeof message.sum !== "number") return "sum: number expected"; - } - if (message.scale != null && message.hasOwnProperty("scale")) { - if (!$util.isInteger(message.scale)) return "scale: integer expected"; - } - if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) { - if (!$util.isInteger(message.zeroCount) && !(message.zeroCount && $util.isInteger(message.zeroCount.low) && $util.isInteger(message.zeroCount.high))) return "zeroCount: integer|Long expected"; - } - if (message.positive != null && message.hasOwnProperty("positive")) { - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.positive); - if (error) return "positive." + error; - } - if (message.negative != null && message.hasOwnProperty("negative")) { - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.negative); - if (error) return "negative." + error; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); - if (error) return "exemplars." + error; - } - } - if (message.min != null && message.hasOwnProperty("min")) { - properties._min = 1; - if (typeof message.min !== "number") return "min: number expected"; - } - if (message.max != null && message.hasOwnProperty("max")) { - properties._max = 1; - if (typeof message.max !== "number") return "max: number expected"; - } - if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) { - if (typeof message.zeroThreshold !== "number") return "zeroThreshold: number expected"; - } - return null; - }; - /** - * Creates an ExponentialHistogramDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint - */ - ExponentialHistogramDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.count != null) { - if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; - else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); - else if (typeof object$1.count === "number") message.count = object$1.count; - else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); - } - if (object$1.sum != null) message.sum = Number(object$1.sum); - if (object$1.scale != null) message.scale = object$1.scale | 0; - if (object$1.zeroCount != null) { - if ($util.Long) (message.zeroCount = $util.Long.fromValue(object$1.zeroCount)).unsigned = false; - else if (typeof object$1.zeroCount === "string") message.zeroCount = parseInt(object$1.zeroCount, 10); - else if (typeof object$1.zeroCount === "number") message.zeroCount = object$1.zeroCount; - else if (typeof object$1.zeroCount === "object") message.zeroCount = new $util.LongBits(object$1.zeroCount.low >>> 0, object$1.zeroCount.high >>> 0).toNumber(); - } - if (object$1.positive != null) { - if (typeof object$1.positive !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected"); - message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object$1.positive); - } - if (object$1.negative != null) { - if (typeof object$1.negative !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected"); - message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object$1.negative); - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.exemplars) { - if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object$1.exemplars.length; ++i) { - if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected"); - message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); - } - } - if (object$1.min != null) message.min = Number(object$1.min); - if (object$1.max != null) message.max = Number(object$1.max); - if (object$1.zeroThreshold != null) message.zeroThreshold = Number(object$1.zeroThreshold); - return message; - }; - /** - * Creates a plain object from an ExponentialHistogramDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} message ExponentialHistogramDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExponentialHistogramDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.attributes = []; - object$1.exemplars = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.count = options.longs === String ? "0" : 0; - object$1.scale = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.zeroCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.zeroCount = options.longs === String ? "0" : 0; - object$1.positive = null; - object$1.negative = null; - object$1.flags = 0; - object$1.zeroThreshold = 0; - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; - else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.sum != null && message.hasOwnProperty("sum")) { - object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; - if (options.oneofs) object$1._sum = "sum"; - } - if (message.scale != null && message.hasOwnProperty("scale")) object$1.scale = message.scale; - if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) if (typeof message.zeroCount === "number") object$1.zeroCount = options.longs === String ? String(message.zeroCount) : message.zeroCount; - else object$1.zeroCount = options.longs === String ? $util.Long.prototype.toString.call(message.zeroCount) : options.longs === Number ? new $util.LongBits(message.zeroCount.low >>> 0, message.zeroCount.high >>> 0).toNumber() : message.zeroCount; - if (message.positive != null && message.hasOwnProperty("positive")) object$1.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.positive, options); - if (message.negative != null && message.hasOwnProperty("negative")) object$1.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.negative, options); - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - if (message.exemplars && message.exemplars.length) { - object$1.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); - } - if (message.min != null && message.hasOwnProperty("min")) { - object$1.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; - if (options.oneofs) object$1._min = "min"; - } - if (message.max != null && message.hasOwnProperty("max")) { - object$1.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; - if (options.oneofs) object$1._max = "max"; - } - if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) object$1.zeroThreshold = options.json && !isFinite(message.zeroThreshold) ? String(message.zeroThreshold) : message.zeroThreshold; - return object$1; - }; - /** - * Converts this ExponentialHistogramDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - * @returns {Object.} JSON object - */ - ExponentialHistogramDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExponentialHistogramDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExponentialHistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"; - }; - ExponentialHistogramDataPoint.Buckets = (function() { - /** - * Properties of a Buckets. - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @interface IBuckets - * @property {number|null} [offset] Buckets offset - * @property {Array.|null} [bucketCounts] Buckets bucketCounts - */ - /** - * Constructs a new Buckets. - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @classdesc Represents a Buckets. - * @implements IBuckets - * @constructor - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets=} [properties] Properties to set - */ - function Buckets(properties) { - this.bucketCounts = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Buckets offset. - * @member {number|null|undefined} offset - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @instance - */ - Buckets.prototype.offset = null; - /** - * Buckets bucketCounts. - * @member {Array.} bucketCounts - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @instance - */ - Buckets.prototype.bucketCounts = $util.emptyArray; - /** - * Creates a new Buckets instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets instance - */ - Buckets.create = function create(properties) { - return new Buckets(properties); - }; - /** - * Encodes the specified Buckets message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets} message Buckets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Buckets.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) writer.uint32(8).sint32(message.offset); - if (message.bucketCounts != null && message.bucketCounts.length) { - writer.uint32(18).fork(); - for (var i = 0; i < message.bucketCounts.length; ++i) writer.uint64(message.bucketCounts[i]); - writer.ldelim(); - } - return writer; - }; - /** - * Encodes the specified Buckets message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets} message Buckets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Buckets.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Buckets message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Buckets.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.offset = reader.sint32(); - break; - case 2: - if (!(message.bucketCounts && message.bucketCounts.length)) message.bucketCounts = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) message.bucketCounts.push(reader.uint64()); - } else message.bucketCounts.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Buckets message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Buckets.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Buckets message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Buckets.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.offset != null && message.hasOwnProperty("offset")) { - if (!$util.isInteger(message.offset)) return "offset: integer expected"; - } - if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { - if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; - for (var i = 0; i < message.bucketCounts.length; ++i) if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) return "bucketCounts: integer|Long[] expected"; - } - return null; - }; - /** - * Creates a Buckets message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets - */ - Buckets.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets(); - if (object$1.offset != null) message.offset = object$1.offset | 0; - if (object$1.bucketCounts) { - if (!Array.isArray(object$1.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected"); - message.bucketCounts = []; - for (var i = 0; i < object$1.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object$1.bucketCounts[i])).unsigned = true; - else if (typeof object$1.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object$1.bucketCounts[i], 10); - else if (typeof object$1.bucketCounts[i] === "number") message.bucketCounts[i] = object$1.bucketCounts[i]; - else if (typeof object$1.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object$1.bucketCounts[i].low >>> 0, object$1.bucketCounts[i].high >>> 0).toNumber(true); - } - return message; - }; - /** - * Creates a plain object from a Buckets message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} message Buckets - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Buckets.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.bucketCounts = []; - if (options.defaults) object$1.offset = 0; - if (message.offset != null && message.hasOwnProperty("offset")) object$1.offset = message.offset; - if (message.bucketCounts && message.bucketCounts.length) { - object$1.bucketCounts = []; - for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object$1.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; - else object$1.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber(true) : message.bucketCounts[j]; - } - return object$1; - }; - /** - * Converts this Buckets to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @instance - * @returns {Object.} JSON object - */ - Buckets.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Buckets - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Buckets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"; - }; - return Buckets; - })(); - return ExponentialHistogramDataPoint; - })(); - v1.SummaryDataPoint = (function() { - /** - * Properties of a SummaryDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface ISummaryDataPoint - * @property {Array.|null} [attributes] SummaryDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] SummaryDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] SummaryDataPoint timeUnixNano - * @property {number|Long|null} [count] SummaryDataPoint count - * @property {number|null} [sum] SummaryDataPoint sum - * @property {Array.|null} [quantileValues] SummaryDataPoint quantileValues - * @property {number|null} [flags] SummaryDataPoint flags - */ - /** - * Constructs a new SummaryDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a SummaryDataPoint. - * @implements ISummaryDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint=} [properties] Properties to set - */ - function SummaryDataPoint(properties) { - this.attributes = []; - this.quantileValues = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * SummaryDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.attributes = $util.emptyArray; - /** - * SummaryDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.startTimeUnixNano = null; - /** - * SummaryDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.timeUnixNano = null; - /** - * SummaryDataPoint count. - * @member {number|Long|null|undefined} count - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.count = null; - /** - * SummaryDataPoint sum. - * @member {number|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.sum = null; - /** - * SummaryDataPoint quantileValues. - * @member {Array.} quantileValues - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.quantileValues = $util.emptyArray; - /** - * SummaryDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.flags = null; - /** - * Creates a new SummaryDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint instance - */ - SummaryDataPoint.create = function create(properties) { - return new SummaryDataPoint(properties); - }; - /** - * Encodes the specified SummaryDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint} message SummaryDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); - if (message.quantileValues != null && message.quantileValues.length) for (var i = 0; i < message.quantileValues.length; ++i) $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(message.quantileValues[i], writer.uint32(50).fork()).ldelim(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); - return writer; - }; - /** - * Encodes the specified SummaryDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint} message SummaryDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a SummaryDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 7: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.count = reader.fixed64(); - break; - case 5: - message.sum = reader.double(); - break; - case 6: - if (!(message.quantileValues && message.quantileValues.length)) message.quantileValues = []; - message.quantileValues.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(reader, reader.uint32())); - break; - case 8: - message.flags = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a SummaryDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a SummaryDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SummaryDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.count != null && message.hasOwnProperty("count")) { - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - if (typeof message.sum !== "number") return "sum: number expected"; - } - if (message.quantileValues != null && message.hasOwnProperty("quantileValues")) { - if (!Array.isArray(message.quantileValues)) return "quantileValues: array expected"; - for (var i = 0; i < message.quantileValues.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(message.quantileValues[i]); - if (error) return "quantileValues." + error; - } - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - return null; - }; - /** - * Creates a SummaryDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint - */ - SummaryDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.count != null) { - if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; - else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); - else if (typeof object$1.count === "number") message.count = object$1.count; - else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); - } - if (object$1.sum != null) message.sum = Number(object$1.sum); - if (object$1.quantileValues) { - if (!Array.isArray(object$1.quantileValues)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected"); - message.quantileValues = []; - for (var i = 0; i < object$1.quantileValues.length; ++i) { - if (typeof object$1.quantileValues[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected"); - message.quantileValues[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(object$1.quantileValues[i]); - } - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - return message; - }; - /** - * Creates a plain object from a SummaryDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint} message SummaryDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SummaryDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.quantileValues = []; - object$1.attributes = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.count = options.longs === String ? "0" : 0; - object$1.sum = 0; - object$1.flags = 0; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; - else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.sum != null && message.hasOwnProperty("sum")) object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; - if (message.quantileValues && message.quantileValues.length) { - object$1.quantileValues = []; - for (var j = 0; j < message.quantileValues.length; ++j) object$1.quantileValues[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(message.quantileValues[j], options); - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this SummaryDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - * @returns {Object.} JSON object - */ - SummaryDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for SummaryDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SummaryDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint"; - }; - SummaryDataPoint.ValueAtQuantile = (function() { - /** - * Properties of a ValueAtQuantile. - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @interface IValueAtQuantile - * @property {number|null} [quantile] ValueAtQuantile quantile - * @property {number|null} [value] ValueAtQuantile value - */ - /** - * Constructs a new ValueAtQuantile. - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @classdesc Represents a ValueAtQuantile. - * @implements IValueAtQuantile - * @constructor - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile=} [properties] Properties to set - */ - function ValueAtQuantile(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ValueAtQuantile quantile. - * @member {number|null|undefined} quantile - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @instance - */ - ValueAtQuantile.prototype.quantile = null; - /** - * ValueAtQuantile value. - * @member {number|null|undefined} value - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @instance - */ - ValueAtQuantile.prototype.value = null; - /** - * Creates a new ValueAtQuantile instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile instance - */ - ValueAtQuantile.create = function create(properties) { - return new ValueAtQuantile(properties); - }; - /** - * Encodes the specified ValueAtQuantile message. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile} message ValueAtQuantile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueAtQuantile.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.quantile != null && Object.hasOwnProperty.call(message, "quantile")) writer.uint32(9).double(message.quantile); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(17).double(message.value); - return writer; - }; - /** - * Encodes the specified ValueAtQuantile message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile} message ValueAtQuantile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueAtQuantile.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ValueAtQuantile message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueAtQuantile.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.quantile = reader.double(); - break; - case 2: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ValueAtQuantile message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueAtQuantile.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ValueAtQuantile message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValueAtQuantile.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.quantile != null && message.hasOwnProperty("quantile")) { - if (typeof message.quantile !== "number") return "quantile: number expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - if (typeof message.value !== "number") return "value: number expected"; - } - return null; - }; - /** - * Creates a ValueAtQuantile message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile - */ - ValueAtQuantile.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile(); - if (object$1.quantile != null) message.quantile = Number(object$1.quantile); - if (object$1.value != null) message.value = Number(object$1.value); - return message; - }; - /** - * Creates a plain object from a ValueAtQuantile message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} message ValueAtQuantile - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValueAtQuantile.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - object$1.quantile = 0; - object$1.value = 0; - } - if (message.quantile != null && message.hasOwnProperty("quantile")) object$1.quantile = options.json && !isFinite(message.quantile) ? String(message.quantile) : message.quantile; - if (message.value != null && message.hasOwnProperty("value")) object$1.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object$1; - }; - /** - * Converts this ValueAtQuantile to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @instance - * @returns {Object.} JSON object - */ - ValueAtQuantile.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ValueAtQuantile - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValueAtQuantile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"; - }; - return ValueAtQuantile; - })(); - return SummaryDataPoint; - })(); - v1.Exemplar = (function() { - /** - * Properties of an Exemplar. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IExemplar - * @property {Array.|null} [filteredAttributes] Exemplar filteredAttributes - * @property {number|Long|null} [timeUnixNano] Exemplar timeUnixNano - * @property {number|null} [asDouble] Exemplar asDouble - * @property {number|Long|null} [asInt] Exemplar asInt - * @property {Uint8Array|null} [spanId] Exemplar spanId - * @property {Uint8Array|null} [traceId] Exemplar traceId - */ - /** - * Constructs a new Exemplar. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents an Exemplar. - * @implements IExemplar - * @constructor - * @param {opentelemetry.proto.metrics.v1.IExemplar=} [properties] Properties to set - */ - function Exemplar(properties) { - this.filteredAttributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Exemplar filteredAttributes. - * @member {Array.} filteredAttributes - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.filteredAttributes = $util.emptyArray; - /** - * Exemplar timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.timeUnixNano = null; - /** - * Exemplar asDouble. - * @member {number|null|undefined} asDouble - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.asDouble = null; - /** - * Exemplar asInt. - * @member {number|Long|null|undefined} asInt - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.asInt = null; - /** - * Exemplar spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.spanId = null; - /** - * Exemplar traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.traceId = null; - var $oneOfFields; - /** - * Exemplar value. - * @member {"asDouble"|"asInt"|undefined} value - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Object.defineProperty(Exemplar.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new Exemplar instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.IExemplar=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar instance - */ - Exemplar.create = function create(properties) { - return new Exemplar(properties); - }; - /** - * Encodes the specified Exemplar message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Exemplar.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.IExemplar} message Exemplar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exemplar.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(17).fixed64(message.timeUnixNano); - if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) writer.uint32(25).double(message.asDouble); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(34).bytes(message.spanId); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(42).bytes(message.traceId); - if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); - if (message.filteredAttributes != null && message.filteredAttributes.length) for (var i = 0; i < message.filteredAttributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.filteredAttributes[i], writer.uint32(58).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Exemplar.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.IExemplar} message Exemplar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exemplar.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an Exemplar message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exemplar.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Exemplar(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 7: - if (!(message.filteredAttributes && message.filteredAttributes.length)) message.filteredAttributes = []; - message.filteredAttributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.timeUnixNano = reader.fixed64(); - break; - case 3: - message.asDouble = reader.double(); - break; - case 6: - message.asInt = reader.sfixed64(); - break; - case 4: - message.spanId = reader.bytes(); - break; - case 5: - message.traceId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an Exemplar message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exemplar.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an Exemplar message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Exemplar.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.filteredAttributes != null && message.hasOwnProperty("filteredAttributes")) { - if (!Array.isArray(message.filteredAttributes)) return "filteredAttributes: array expected"; - for (var i = 0; i < message.filteredAttributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.filteredAttributes[i]); - if (error) return "filteredAttributes." + error; - } - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - properties.value = 1; - if (typeof message.asDouble !== "number") return "asDouble: number expected"; - } - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) return "asInt: integer|Long expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - return null; - }; - /** - * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar - */ - Exemplar.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Exemplar) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Exemplar(); - if (object$1.filteredAttributes) { - if (!Array.isArray(object$1.filteredAttributes)) throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected"); - message.filteredAttributes = []; - for (var i = 0; i < object$1.filteredAttributes.length; ++i) { - if (typeof object$1.filteredAttributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected"); - message.filteredAttributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.filteredAttributes[i]); - } - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.asDouble != null) message.asDouble = Number(object$1.asDouble); - if (object$1.asInt != null) { - if ($util.Long) (message.asInt = $util.Long.fromValue(object$1.asInt)).unsigned = false; - else if (typeof object$1.asInt === "string") message.asInt = parseInt(object$1.asInt, 10); - else if (typeof object$1.asInt === "number") message.asInt = object$1.asInt; - else if (typeof object$1.asInt === "object") message.asInt = new $util.LongBits(object$1.asInt.low >>> 0, object$1.asInt.high >>> 0).toNumber(); - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - return message; - }; - /** - * Creates a plain object from an Exemplar message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.Exemplar} message Exemplar - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exemplar.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.filteredAttributes = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - object$1.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; - if (options.oneofs) object$1.value = "asDouble"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (typeof message.asInt === "number") object$1.asInt = options.longs === String ? String(message.asInt) : message.asInt; - else object$1.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; - if (options.oneofs) object$1.value = "asInt"; - } - if (message.filteredAttributes && message.filteredAttributes.length) { - object$1.filteredAttributes = []; - for (var j = 0; j < message.filteredAttributes.length; ++j) object$1.filteredAttributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.filteredAttributes[j], options); - } - return object$1; - }; - /** - * Converts this Exemplar to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - * @returns {Object.} JSON object - */ - Exemplar.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Exemplar - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Exemplar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Exemplar"; - }; - return Exemplar; - })(); - return v1; - })(); - return metrics$1; - })(); - proto.logs = (function() { - /** - * Namespace logs. - * @memberof opentelemetry.proto - * @namespace - */ - var logs = {}; - logs.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.logs - * @namespace - */ - var v1 = {}; - v1.LogsData = (function() { - /** - * Properties of a LogsData. - * @memberof opentelemetry.proto.logs.v1 - * @interface ILogsData - * @property {Array.|null} [resourceLogs] LogsData resourceLogs - */ - /** - * Constructs a new LogsData. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a LogsData. - * @implements ILogsData - * @constructor - * @param {opentelemetry.proto.logs.v1.ILogsData=} [properties] Properties to set - */ - function LogsData(properties) { - this.resourceLogs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * LogsData resourceLogs. - * @member {Array.} resourceLogs - * @memberof opentelemetry.proto.logs.v1.LogsData - * @instance - */ - LogsData.prototype.resourceLogs = $util.emptyArray; - /** - * Creates a new LogsData instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.ILogsData=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData instance - */ - LogsData.create = function create(properties) { - return new LogsData(properties); - }; - /** - * Encodes the specified LogsData message. Does not implicitly {@link opentelemetry.proto.logs.v1.LogsData.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.ILogsData} message LogsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsData.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceLogs != null && message.resourceLogs.length) for (var i = 0; i < message.resourceLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified LogsData message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.LogsData.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.ILogsData} message LogsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a LogsData message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsData.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogsData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceLogs && message.resourceLogs.length)) message.resourceLogs = []; - message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a LogsData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a LogsData message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogsData.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { - if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; - for (var i = 0; i < message.resourceLogs.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); - if (error) return "resourceLogs." + error; - } - } - return null; - }; - /** - * Creates a LogsData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData - */ - LogsData.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.LogsData) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.LogsData(); - if (object$1.resourceLogs) { - if (!Array.isArray(object$1.resourceLogs)) throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected"); - message.resourceLogs = []; - for (var i = 0; i < object$1.resourceLogs.length; ++i) { - if (typeof object$1.resourceLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected"); - message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object$1.resourceLogs[i]); - } - } - return message; - }; - /** - * Creates a plain object from a LogsData message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.LogsData} message LogsData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogsData.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceLogs = []; - if (message.resourceLogs && message.resourceLogs.length) { - object$1.resourceLogs = []; - for (var j = 0; j < message.resourceLogs.length; ++j) object$1.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); - } - return object$1; - }; - /** - * Converts this LogsData to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.LogsData - * @instance - * @returns {Object.} JSON object - */ - LogsData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for LogsData - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogsData"; - }; - return LogsData; - })(); - v1.ResourceLogs = (function() { - /** - * Properties of a ResourceLogs. - * @memberof opentelemetry.proto.logs.v1 - * @interface IResourceLogs - * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceLogs resource - * @property {Array.|null} [scopeLogs] ResourceLogs scopeLogs - * @property {string|null} [schemaUrl] ResourceLogs schemaUrl - */ - /** - * Constructs a new ResourceLogs. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a ResourceLogs. - * @implements IResourceLogs - * @constructor - * @param {opentelemetry.proto.logs.v1.IResourceLogs=} [properties] Properties to set - */ - function ResourceLogs(properties) { - this.scopeLogs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ResourceLogs resource. - * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - */ - ResourceLogs.prototype.resource = null; - /** - * ResourceLogs scopeLogs. - * @member {Array.} scopeLogs - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - */ - ResourceLogs.prototype.scopeLogs = $util.emptyArray; - /** - * ResourceLogs schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - */ - ResourceLogs.prototype.schemaUrl = null; - /** - * Creates a new ResourceLogs instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.IResourceLogs=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs instance - */ - ResourceLogs.create = function create(properties) { - return new ResourceLogs(properties); - }; - /** - * Encodes the specified ResourceLogs message. Does not implicitly {@link opentelemetry.proto.logs.v1.ResourceLogs.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.IResourceLogs} message ResourceLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceLogs.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - if (message.scopeLogs != null && message.scopeLogs.length) for (var i = 0; i < message.scopeLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ScopeLogs.encode(message.scopeLogs[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ResourceLogs message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.ResourceLogs.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.IResourceLogs} message ResourceLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceLogs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ResourceLogs message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceLogs.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ResourceLogs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.scopeLogs && message.scopeLogs.length)) message.scopeLogs = []; - message.scopeLogs.push($root.opentelemetry.proto.logs.v1.ScopeLogs.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ResourceLogs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceLogs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ResourceLogs message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceLogs.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error) return "resource." + error; - } - if (message.scopeLogs != null && message.hasOwnProperty("scopeLogs")) { - if (!Array.isArray(message.scopeLogs)) return "scopeLogs: array expected"; - for (var i = 0; i < message.scopeLogs.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.ScopeLogs.verify(message.scopeLogs[i]); - if (error) return "scopeLogs." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ResourceLogs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs - */ - ResourceLogs.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.ResourceLogs) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.ResourceLogs(); - if (object$1.resource != null) { - if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected"); - message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); - } - if (object$1.scopeLogs) { - if (!Array.isArray(object$1.scopeLogs)) throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected"); - message.scopeLogs = []; - for (var i = 0; i < object$1.scopeLogs.length; ++i) { - if (typeof object$1.scopeLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected"); - message.scopeLogs[i] = $root.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(object$1.scopeLogs[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ResourceLogs message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.ResourceLogs} message ResourceLogs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceLogs.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.scopeLogs = []; - if (options.defaults) { - object$1.resource = null; - object$1.schemaUrl = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); - if (message.scopeLogs && message.scopeLogs.length) { - object$1.scopeLogs = []; - for (var j = 0; j < message.scopeLogs.length; ++j) object$1.scopeLogs[j] = $root.opentelemetry.proto.logs.v1.ScopeLogs.toObject(message.scopeLogs[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ResourceLogs to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - * @returns {Object.} JSON object - */ - ResourceLogs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ResourceLogs - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ResourceLogs"; - }; - return ResourceLogs; - })(); - v1.ScopeLogs = (function() { - /** - * Properties of a ScopeLogs. - * @memberof opentelemetry.proto.logs.v1 - * @interface IScopeLogs - * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeLogs scope - * @property {Array.|null} [logRecords] ScopeLogs logRecords - * @property {string|null} [schemaUrl] ScopeLogs schemaUrl - */ - /** - * Constructs a new ScopeLogs. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a ScopeLogs. - * @implements IScopeLogs - * @constructor - * @param {opentelemetry.proto.logs.v1.IScopeLogs=} [properties] Properties to set - */ - function ScopeLogs(properties) { - this.logRecords = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ScopeLogs scope. - * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - */ - ScopeLogs.prototype.scope = null; - /** - * ScopeLogs logRecords. - * @member {Array.} logRecords - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - */ - ScopeLogs.prototype.logRecords = $util.emptyArray; - /** - * ScopeLogs schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - */ - ScopeLogs.prototype.schemaUrl = null; - /** - * Creates a new ScopeLogs instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.IScopeLogs=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs instance - */ - ScopeLogs.create = function create(properties) { - return new ScopeLogs(properties); - }; - /** - * Encodes the specified ScopeLogs message. Does not implicitly {@link opentelemetry.proto.logs.v1.ScopeLogs.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.IScopeLogs} message ScopeLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeLogs.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); - if (message.logRecords != null && message.logRecords.length) for (var i = 0; i < message.logRecords.length; ++i) $root.opentelemetry.proto.logs.v1.LogRecord.encode(message.logRecords[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ScopeLogs message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.ScopeLogs.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.IScopeLogs} message ScopeLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeLogs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ScopeLogs message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeLogs.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ScopeLogs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.logRecords && message.logRecords.length)) message.logRecords = []; - message.logRecords.push($root.opentelemetry.proto.logs.v1.LogRecord.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ScopeLogs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeLogs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ScopeLogs message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScopeLogs.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) { - var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error) return "scope." + error; - } - if (message.logRecords != null && message.hasOwnProperty("logRecords")) { - if (!Array.isArray(message.logRecords)) return "logRecords: array expected"; - for (var i = 0; i < message.logRecords.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.LogRecord.verify(message.logRecords[i]); - if (error) return "logRecords." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ScopeLogs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs - */ - ScopeLogs.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.ScopeLogs) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.ScopeLogs(); - if (object$1.scope != null) { - if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected"); - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); - } - if (object$1.logRecords) { - if (!Array.isArray(object$1.logRecords)) throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected"); - message.logRecords = []; - for (var i = 0; i < object$1.logRecords.length; ++i) { - if (typeof object$1.logRecords[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected"); - message.logRecords[i] = $root.opentelemetry.proto.logs.v1.LogRecord.fromObject(object$1.logRecords[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ScopeLogs message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.ScopeLogs} message ScopeLogs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScopeLogs.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.logRecords = []; - if (options.defaults) { - object$1.scope = null; - object$1.schemaUrl = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); - if (message.logRecords && message.logRecords.length) { - object$1.logRecords = []; - for (var j = 0; j < message.logRecords.length; ++j) object$1.logRecords[j] = $root.opentelemetry.proto.logs.v1.LogRecord.toObject(message.logRecords[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ScopeLogs to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - * @returns {Object.} JSON object - */ - ScopeLogs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ScopeLogs - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScopeLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ScopeLogs"; - }; - return ScopeLogs; - })(); - /** - * SeverityNumber enum. - * @name opentelemetry.proto.logs.v1.SeverityNumber - * @enum {number} - * @property {number} SEVERITY_NUMBER_UNSPECIFIED=0 SEVERITY_NUMBER_UNSPECIFIED value - * @property {number} SEVERITY_NUMBER_TRACE=1 SEVERITY_NUMBER_TRACE value - * @property {number} SEVERITY_NUMBER_TRACE2=2 SEVERITY_NUMBER_TRACE2 value - * @property {number} SEVERITY_NUMBER_TRACE3=3 SEVERITY_NUMBER_TRACE3 value - * @property {number} SEVERITY_NUMBER_TRACE4=4 SEVERITY_NUMBER_TRACE4 value - * @property {number} SEVERITY_NUMBER_DEBUG=5 SEVERITY_NUMBER_DEBUG value - * @property {number} SEVERITY_NUMBER_DEBUG2=6 SEVERITY_NUMBER_DEBUG2 value - * @property {number} SEVERITY_NUMBER_DEBUG3=7 SEVERITY_NUMBER_DEBUG3 value - * @property {number} SEVERITY_NUMBER_DEBUG4=8 SEVERITY_NUMBER_DEBUG4 value - * @property {number} SEVERITY_NUMBER_INFO=9 SEVERITY_NUMBER_INFO value - * @property {number} SEVERITY_NUMBER_INFO2=10 SEVERITY_NUMBER_INFO2 value - * @property {number} SEVERITY_NUMBER_INFO3=11 SEVERITY_NUMBER_INFO3 value - * @property {number} SEVERITY_NUMBER_INFO4=12 SEVERITY_NUMBER_INFO4 value - * @property {number} SEVERITY_NUMBER_WARN=13 SEVERITY_NUMBER_WARN value - * @property {number} SEVERITY_NUMBER_WARN2=14 SEVERITY_NUMBER_WARN2 value - * @property {number} SEVERITY_NUMBER_WARN3=15 SEVERITY_NUMBER_WARN3 value - * @property {number} SEVERITY_NUMBER_WARN4=16 SEVERITY_NUMBER_WARN4 value - * @property {number} SEVERITY_NUMBER_ERROR=17 SEVERITY_NUMBER_ERROR value - * @property {number} SEVERITY_NUMBER_ERROR2=18 SEVERITY_NUMBER_ERROR2 value - * @property {number} SEVERITY_NUMBER_ERROR3=19 SEVERITY_NUMBER_ERROR3 value - * @property {number} SEVERITY_NUMBER_ERROR4=20 SEVERITY_NUMBER_ERROR4 value - * @property {number} SEVERITY_NUMBER_FATAL=21 SEVERITY_NUMBER_FATAL value - * @property {number} SEVERITY_NUMBER_FATAL2=22 SEVERITY_NUMBER_FATAL2 value - * @property {number} SEVERITY_NUMBER_FATAL3=23 SEVERITY_NUMBER_FATAL3 value - * @property {number} SEVERITY_NUMBER_FATAL4=24 SEVERITY_NUMBER_FATAL4 value - */ - v1.SeverityNumber = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_NUMBER_UNSPECIFIED"] = 0; - values[valuesById[1] = "SEVERITY_NUMBER_TRACE"] = 1; - values[valuesById[2] = "SEVERITY_NUMBER_TRACE2"] = 2; - values[valuesById[3] = "SEVERITY_NUMBER_TRACE3"] = 3; - values[valuesById[4] = "SEVERITY_NUMBER_TRACE4"] = 4; - values[valuesById[5] = "SEVERITY_NUMBER_DEBUG"] = 5; - values[valuesById[6] = "SEVERITY_NUMBER_DEBUG2"] = 6; - values[valuesById[7] = "SEVERITY_NUMBER_DEBUG3"] = 7; - values[valuesById[8] = "SEVERITY_NUMBER_DEBUG4"] = 8; - values[valuesById[9] = "SEVERITY_NUMBER_INFO"] = 9; - values[valuesById[10] = "SEVERITY_NUMBER_INFO2"] = 10; - values[valuesById[11] = "SEVERITY_NUMBER_INFO3"] = 11; - values[valuesById[12] = "SEVERITY_NUMBER_INFO4"] = 12; - values[valuesById[13] = "SEVERITY_NUMBER_WARN"] = 13; - values[valuesById[14] = "SEVERITY_NUMBER_WARN2"] = 14; - values[valuesById[15] = "SEVERITY_NUMBER_WARN3"] = 15; - values[valuesById[16] = "SEVERITY_NUMBER_WARN4"] = 16; - values[valuesById[17] = "SEVERITY_NUMBER_ERROR"] = 17; - values[valuesById[18] = "SEVERITY_NUMBER_ERROR2"] = 18; - values[valuesById[19] = "SEVERITY_NUMBER_ERROR3"] = 19; - values[valuesById[20] = "SEVERITY_NUMBER_ERROR4"] = 20; - values[valuesById[21] = "SEVERITY_NUMBER_FATAL"] = 21; - values[valuesById[22] = "SEVERITY_NUMBER_FATAL2"] = 22; - values[valuesById[23] = "SEVERITY_NUMBER_FATAL3"] = 23; - values[valuesById[24] = "SEVERITY_NUMBER_FATAL4"] = 24; - return values; - })(); - /** - * LogRecordFlags enum. - * @name opentelemetry.proto.logs.v1.LogRecordFlags - * @enum {number} - * @property {number} LOG_RECORD_FLAGS_DO_NOT_USE=0 LOG_RECORD_FLAGS_DO_NOT_USE value - * @property {number} LOG_RECORD_FLAGS_TRACE_FLAGS_MASK=255 LOG_RECORD_FLAGS_TRACE_FLAGS_MASK value - */ - v1.LogRecordFlags = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_RECORD_FLAGS_DO_NOT_USE"] = 0; - values[valuesById[255] = "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"] = 255; - return values; - })(); - v1.LogRecord = (function() { - /** - * Properties of a LogRecord. - * @memberof opentelemetry.proto.logs.v1 - * @interface ILogRecord - * @property {number|Long|null} [timeUnixNano] LogRecord timeUnixNano - * @property {number|Long|null} [observedTimeUnixNano] LogRecord observedTimeUnixNano - * @property {opentelemetry.proto.logs.v1.SeverityNumber|null} [severityNumber] LogRecord severityNumber - * @property {string|null} [severityText] LogRecord severityText - * @property {opentelemetry.proto.common.v1.IAnyValue|null} [body] LogRecord body - * @property {Array.|null} [attributes] LogRecord attributes - * @property {number|null} [droppedAttributesCount] LogRecord droppedAttributesCount - * @property {number|null} [flags] LogRecord flags - * @property {Uint8Array|null} [traceId] LogRecord traceId - * @property {Uint8Array|null} [spanId] LogRecord spanId - * @property {string|null} [eventName] LogRecord eventName - */ - /** - * Constructs a new LogRecord. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a LogRecord. - * @implements ILogRecord - * @constructor - * @param {opentelemetry.proto.logs.v1.ILogRecord=} [properties] Properties to set - */ - function LogRecord(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * LogRecord timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.timeUnixNano = null; - /** - * LogRecord observedTimeUnixNano. - * @member {number|Long|null|undefined} observedTimeUnixNano - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.observedTimeUnixNano = null; - /** - * LogRecord severityNumber. - * @member {opentelemetry.proto.logs.v1.SeverityNumber|null|undefined} severityNumber - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.severityNumber = null; - /** - * LogRecord severityText. - * @member {string|null|undefined} severityText - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.severityText = null; - /** - * LogRecord body. - * @member {opentelemetry.proto.common.v1.IAnyValue|null|undefined} body - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.body = null; - /** - * LogRecord attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.attributes = $util.emptyArray; - /** - * LogRecord droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.droppedAttributesCount = null; - /** - * LogRecord flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.flags = null; - /** - * LogRecord traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.traceId = null; - /** - * LogRecord spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.spanId = null; - /** - * LogRecord eventName. - * @member {string|null|undefined} eventName - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.eventName = null; - /** - * Creates a new LogRecord instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.ILogRecord=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord instance - */ - LogRecord.create = function create(properties) { - return new LogRecord(properties); - }; - /** - * Encodes the specified LogRecord message. Does not implicitly {@link opentelemetry.proto.logs.v1.LogRecord.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.ILogRecord} message LogRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogRecord.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(9).fixed64(message.timeUnixNano); - if (message.severityNumber != null && Object.hasOwnProperty.call(message, "severityNumber")) writer.uint32(16).int32(message.severityNumber); - if (message.severityText != null && Object.hasOwnProperty.call(message, "severityText")) writer.uint32(26).string(message.severityText); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.body, writer.uint32(42).fork()).ldelim(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(50).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(56).uint32(message.droppedAttributesCount); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(69).fixed32(message.flags); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(74).bytes(message.traceId); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(82).bytes(message.spanId); - if (message.observedTimeUnixNano != null && Object.hasOwnProperty.call(message, "observedTimeUnixNano")) writer.uint32(89).fixed64(message.observedTimeUnixNano); - if (message.eventName != null && Object.hasOwnProperty.call(message, "eventName")) writer.uint32(98).string(message.eventName); - return writer; - }; - /** - * Encodes the specified LogRecord message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.LogRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.ILogRecord} message LogRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a LogRecord message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogRecord.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.timeUnixNano = reader.fixed64(); - break; - case 11: - message.observedTimeUnixNano = reader.fixed64(); - break; - case 2: - message.severityNumber = reader.int32(); - break; - case 3: - message.severityText = reader.string(); - break; - case 5: - message.body = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 7: - message.droppedAttributesCount = reader.uint32(); - break; - case 8: - message.flags = reader.fixed32(); - break; - case 9: - message.traceId = reader.bytes(); - break; - case 10: - message.spanId = reader.bytes(); - break; - case 12: - message.eventName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a LogRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a LogRecord message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) { - if (!$util.isInteger(message.observedTimeUnixNano) && !(message.observedTimeUnixNano && $util.isInteger(message.observedTimeUnixNano.low) && $util.isInteger(message.observedTimeUnixNano.high))) return "observedTimeUnixNano: integer|Long expected"; - } - if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) switch (message.severityNumber) { - default: return "severityNumber: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: break; - } - if (message.severityText != null && message.hasOwnProperty("severityText")) { - if (!$util.isString(message.severityText)) return "severityText: string expected"; - } - if (message.body != null && message.hasOwnProperty("body")) { - var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.body); - if (error) return "body." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.eventName != null && message.hasOwnProperty("eventName")) { - if (!$util.isString(message.eventName)) return "eventName: string expected"; - } - return null; - }; - /** - * Creates a LogRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord - */ - LogRecord.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.LogRecord) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.LogRecord(); - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.observedTimeUnixNano != null) { - if ($util.Long) (message.observedTimeUnixNano = $util.Long.fromValue(object$1.observedTimeUnixNano)).unsigned = false; - else if (typeof object$1.observedTimeUnixNano === "string") message.observedTimeUnixNano = parseInt(object$1.observedTimeUnixNano, 10); - else if (typeof object$1.observedTimeUnixNano === "number") message.observedTimeUnixNano = object$1.observedTimeUnixNano; - else if (typeof object$1.observedTimeUnixNano === "object") message.observedTimeUnixNano = new $util.LongBits(object$1.observedTimeUnixNano.low >>> 0, object$1.observedTimeUnixNano.high >>> 0).toNumber(); - } - switch (object$1.severityNumber) { - default: - if (typeof object$1.severityNumber === "number") { - message.severityNumber = object$1.severityNumber; - break; - } - break; - case "SEVERITY_NUMBER_UNSPECIFIED": - case 0: - message.severityNumber = 0; - break; - case "SEVERITY_NUMBER_TRACE": - case 1: - message.severityNumber = 1; - break; - case "SEVERITY_NUMBER_TRACE2": - case 2: - message.severityNumber = 2; - break; - case "SEVERITY_NUMBER_TRACE3": - case 3: - message.severityNumber = 3; - break; - case "SEVERITY_NUMBER_TRACE4": - case 4: - message.severityNumber = 4; - break; - case "SEVERITY_NUMBER_DEBUG": - case 5: - message.severityNumber = 5; - break; - case "SEVERITY_NUMBER_DEBUG2": - case 6: - message.severityNumber = 6; - break; - case "SEVERITY_NUMBER_DEBUG3": - case 7: - message.severityNumber = 7; - break; - case "SEVERITY_NUMBER_DEBUG4": - case 8: - message.severityNumber = 8; - break; - case "SEVERITY_NUMBER_INFO": - case 9: - message.severityNumber = 9; - break; - case "SEVERITY_NUMBER_INFO2": - case 10: - message.severityNumber = 10; - break; - case "SEVERITY_NUMBER_INFO3": - case 11: - message.severityNumber = 11; - break; - case "SEVERITY_NUMBER_INFO4": - case 12: - message.severityNumber = 12; - break; - case "SEVERITY_NUMBER_WARN": - case 13: - message.severityNumber = 13; - break; - case "SEVERITY_NUMBER_WARN2": - case 14: - message.severityNumber = 14; - break; - case "SEVERITY_NUMBER_WARN3": - case 15: - message.severityNumber = 15; - break; - case "SEVERITY_NUMBER_WARN4": - case 16: - message.severityNumber = 16; - break; - case "SEVERITY_NUMBER_ERROR": - case 17: - message.severityNumber = 17; - break; - case "SEVERITY_NUMBER_ERROR2": - case 18: - message.severityNumber = 18; - break; - case "SEVERITY_NUMBER_ERROR3": - case 19: - message.severityNumber = 19; - break; - case "SEVERITY_NUMBER_ERROR4": - case 20: - message.severityNumber = 20; - break; - case "SEVERITY_NUMBER_FATAL": - case 21: - message.severityNumber = 21; - break; - case "SEVERITY_NUMBER_FATAL2": - case 22: - message.severityNumber = 22; - break; - case "SEVERITY_NUMBER_FATAL3": - case 23: - message.severityNumber = 23; - break; - case "SEVERITY_NUMBER_FATAL4": - case 24: - message.severityNumber = 24; - break; - } - if (object$1.severityText != null) message.severityText = String(object$1.severityText); - if (object$1.body != null) { - if (typeof object$1.body !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected"); - message.body = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.body); - } - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.eventName != null) message.eventName = String(object$1.eventName); - return message; - }; - /** - * Creates a plain object from a LogRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.LogRecord} message LogRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogRecord.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - object$1.severityNumber = options.enums === String ? "SEVERITY_NUMBER_UNSPECIFIED" : 0; - object$1.severityText = ""; - object$1.body = null; - object$1.droppedAttributesCount = 0; - object$1.flags = 0; - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.observedTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.observedTimeUnixNano = options.longs === String ? "0" : 0; - object$1.eventName = ""; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) object$1.severityNumber = options.enums === String ? $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] === void 0 ? message.severityNumber : $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] : message.severityNumber; - if (message.severityText != null && message.hasOwnProperty("severityText")) object$1.severityText = message.severityText; - if (message.body != null && message.hasOwnProperty("body")) object$1.body = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.body, options); - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) if (typeof message.observedTimeUnixNano === "number") object$1.observedTimeUnixNano = options.longs === String ? String(message.observedTimeUnixNano) : message.observedTimeUnixNano; - else object$1.observedTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.observedTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.observedTimeUnixNano.low >>> 0, message.observedTimeUnixNano.high >>> 0).toNumber() : message.observedTimeUnixNano; - if (message.eventName != null && message.hasOwnProperty("eventName")) object$1.eventName = message.eventName; - return object$1; - }; - /** - * Converts this LogRecord to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - * @returns {Object.} JSON object - */ - LogRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for LogRecord - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogRecord"; - }; - return LogRecord; - })(); - return v1; - })(); - return logs; - })(); - return proto; - })(); - return opentelemetry; - })(); - module.exports = $root; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/hex-to-binary.js -var require_hex_to_binary = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hexToBinary = void 0; - function intValue(charCode) { - if (charCode >= 48 && charCode <= 57) return charCode - 48; - if (charCode >= 97 && charCode <= 102) return charCode - 87; - return charCode - 55; - } - function hexToBinary(hexStr) { - const buf = new Uint8Array(hexStr.length / 2); - let offset = 0; - for (let i = 0; i < hexStr.length; i += 2) { - const hi = intValue(hexStr.charCodeAt(i)); - const lo = intValue(hexStr.charCodeAt(i + 1)); - buf[offset++] = hi << 4 | lo; - } - return buf; - } - exports.hexToBinary = hexToBinary; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js -var require_utils$5 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getOtlpEncoder = exports.encodeAsString = exports.encodeAsLongBits = exports.toLongBits = exports.hrTimeToNanos = void 0; - const core_1 = require_src$8(); - const hex_to_binary_1 = require_hex_to_binary(); - function hrTimeToNanos(hrTime) { - const NANOSECONDS = BigInt(1e9); - return BigInt(hrTime[0]) * NANOSECONDS + BigInt(hrTime[1]); - } - exports.hrTimeToNanos = hrTimeToNanos; - function toLongBits(value) { - return { - low: Number(BigInt.asUintN(32, value)), - high: Number(BigInt.asUintN(32, value >> BigInt(32))) - }; - } - exports.toLongBits = toLongBits; - function encodeAsLongBits(hrTime) { - return toLongBits(hrTimeToNanos(hrTime)); - } - exports.encodeAsLongBits = encodeAsLongBits; - function encodeAsString(hrTime) { - return hrTimeToNanos(hrTime).toString(); - } - exports.encodeAsString = encodeAsString; - const encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : core_1.hrTimeToNanoseconds; - function identity(value) { - return value; - } - function optionalHexToBinary(str) { - if (str === void 0) return void 0; - return (0, hex_to_binary_1.hexToBinary)(str); - } - const DEFAULT_ENCODER = { - encodeHrTime: encodeAsLongBits, - encodeSpanContext: hex_to_binary_1.hexToBinary, - encodeOptionalSpanContext: optionalHexToBinary - }; - function getOtlpEncoder(options) { - if (options === void 0) return DEFAULT_ENCODER; - const useLongBits = options.useLongBits ?? true; - const useHex = options.useHex ?? false; - return { - encodeHrTime: useLongBits ? encodeAsLongBits : encodeTimestamp, - encodeSpanContext: useHex ? identity : hex_to_binary_1.hexToBinary, - encodeOptionalSpanContext: useHex ? identity : optionalHexToBinary - }; - } - exports.getOtlpEncoder = getOtlpEncoder; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/internal.js -var require_internal$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toAnyValue = exports.toKeyValue = exports.toAttributes = exports.createInstrumentationScope = exports.createResource = void 0; - function createResource(resource) { - const result = { - attributes: toAttributes(resource.attributes), - droppedAttributesCount: 0 - }; - const schemaUrl = resource.schemaUrl; - if (schemaUrl && schemaUrl !== "") result.schemaUrl = schemaUrl; - return result; - } - exports.createResource = createResource; - function createInstrumentationScope(scope) { - return { - name: scope.name, - version: scope.version - }; - } - exports.createInstrumentationScope = createInstrumentationScope; - function toAttributes(attributes) { - return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key])); - } - exports.toAttributes = toAttributes; - function toKeyValue(key, value) { - return { - key, - value: toAnyValue(value) - }; - } - exports.toKeyValue = toKeyValue; - function toAnyValue(value) { - const t = typeof value; - if (t === "string") return { stringValue: value }; - if (t === "number") { - if (!Number.isInteger(value)) return { doubleValue: value }; - return { intValue: value }; - } - if (t === "boolean") return { boolValue: value }; - if (value instanceof Uint8Array) return { bytesValue: value }; - if (Array.isArray(value)) return { arrayValue: { values: value.map(toAnyValue) } }; - if (t === "object" && value != null) return { kvlistValue: { values: Object.entries(value).map(([k, v]) => toKeyValue(k, v)) } }; - return {}; - } - exports.toAnyValue = toAnyValue; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal.js -var require_internal$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toLogAttributes = exports.createExportLogsServiceRequest = void 0; - const utils_1 = require_utils$5(); - const internal_1 = require_internal$3(); - function createExportLogsServiceRequest(logRecords, options) { - return { resourceLogs: logRecordsToResourceLogs(logRecords, (0, utils_1.getOtlpEncoder)(options)) }; - } - exports.createExportLogsServiceRequest = createExportLogsServiceRequest; - function createResourceMap(logRecords) { - const resourceMap = /* @__PURE__ */ new Map(); - for (const record$1 of logRecords) { - const { resource, instrumentationScope: { name, version: version$1 = "", schemaUrl = "" } } = record$1; - let ismMap = resourceMap.get(resource); - if (!ismMap) { - ismMap = /* @__PURE__ */ new Map(); - resourceMap.set(resource, ismMap); - } - const ismKey = `${name}@${version$1}:${schemaUrl}`; - let records = ismMap.get(ismKey); - if (!records) { - records = []; - ismMap.set(ismKey, records); - } - records.push(record$1); - } - return resourceMap; - } - function logRecordsToResourceLogs(logRecords, encoder) { - const resourceMap = createResourceMap(logRecords); - return Array.from(resourceMap, ([resource, ismMap]) => { - const processedResource = (0, internal_1.createResource)(resource); - return { - resource: processedResource, - scopeLogs: Array.from(ismMap, ([, scopeLogs]) => { - return { - scope: (0, internal_1.createInstrumentationScope)(scopeLogs[0].instrumentationScope), - logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)), - schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl - }; - }), - schemaUrl: processedResource.schemaUrl - }; - }); - } - function toLogRecord(log, encoder) { - return { - timeUnixNano: encoder.encodeHrTime(log.hrTime), - observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved), - severityNumber: toSeverityNumber(log.severityNumber), - severityText: log.severityText, - body: (0, internal_1.toAnyValue)(log.body), - eventName: log.eventName, - attributes: toLogAttributes(log.attributes), - droppedAttributesCount: log.droppedAttributesCount, - flags: log.spanContext?.traceFlags, - traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId), - spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId) - }; - } - function toSeverityNumber(severityNumber) { - return severityNumber; - } - function toLogAttributes(attributes) { - return Object.keys(attributes).map((key) => (0, internal_1.toKeyValue)(key, attributes[key])); - } - exports.toLogAttributes = toLogAttributes; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js -var require_logs$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufLogsSerializer = void 0; - const root = require_root(); - const internal_1 = require_internal$2(); - const logsResponseType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; - const logsRequestType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; - exports.ProtobufLogsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportLogsServiceRequest)(arg); - return logsRequestType.encode(request).finish(); - }, - deserializeResponse: (arg) => { - return logsResponseType.decode(arg); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/index.js -var require_protobuf$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufLogsSerializer = void 0; - var logs_1 = require_logs$1(); - Object.defineProperty(exports, "ProtobufLogsSerializer", { - enumerable: true, - get: function() { - return logs_1.ProtobufLogsSerializer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js -var require_AggregationTemporality = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AggregationTemporality = void 0; - (function(AggregationTemporality) { - AggregationTemporality[AggregationTemporality["DELTA"] = 0] = "DELTA"; - AggregationTemporality[AggregationTemporality["CUMULATIVE"] = 1] = "CUMULATIVE"; - })(exports.AggregationTemporality || (exports.AggregationTemporality = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js -var require_MetricData = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DataPointType = exports.InstrumentType = void 0; - (function(InstrumentType) { - InstrumentType["COUNTER"] = "COUNTER"; - InstrumentType["GAUGE"] = "GAUGE"; - InstrumentType["HISTOGRAM"] = "HISTOGRAM"; - InstrumentType["UP_DOWN_COUNTER"] = "UP_DOWN_COUNTER"; - InstrumentType["OBSERVABLE_COUNTER"] = "OBSERVABLE_COUNTER"; - InstrumentType["OBSERVABLE_GAUGE"] = "OBSERVABLE_GAUGE"; - InstrumentType["OBSERVABLE_UP_DOWN_COUNTER"] = "OBSERVABLE_UP_DOWN_COUNTER"; - })(exports.InstrumentType || (exports.InstrumentType = {})); - (function(DataPointType) { - /** - * A histogram data point contains a histogram statistics of collected - * values with a list of explicit bucket boundaries and statistics such - * as min, max, count, and sum of all collected values. - */ - DataPointType[DataPointType["HISTOGRAM"] = 0] = "HISTOGRAM"; - /** - * An exponential histogram data point contains a histogram statistics of - * collected values where bucket boundaries are automatically calculated - * using an exponential function, and statistics such as min, max, count, - * and sum of all collected values. - */ - DataPointType[DataPointType["EXPONENTIAL_HISTOGRAM"] = 1] = "EXPONENTIAL_HISTOGRAM"; - /** - * A gauge metric data point has only a single numeric value. - */ - DataPointType[DataPointType["GAUGE"] = 2] = "GAUGE"; - /** - * A sum metric data point has a single numeric value and a - * monotonicity-indicator. - */ - DataPointType[DataPointType["SUM"] = 3] = "SUM"; - })(exports.DataPointType || (exports.DataPointType = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/utils.js -var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.equalsCaseInsensitive = exports.binarySearchUB = exports.setEquals = exports.FlatMap = exports.isPromiseAllSettledRejectionResult = exports.PromiseAllSettled = exports.callWithTimeout = exports.TimeoutError = exports.instrumentationScopeId = exports.hashAttributes = exports.isNotNullish = void 0; - function isNotNullish(item) { - return item !== void 0 && item !== null; - } - exports.isNotNullish = isNotNullish; - /** - * Converting the unordered attributes into unique identifier string. - * @param attributes user provided unordered Attributes. - */ - function hashAttributes(attributes) { - let keys = Object.keys(attributes); - if (keys.length === 0) return ""; - keys = keys.sort(); - return JSON.stringify(keys.map((key) => [key, attributes[key]])); - } - exports.hashAttributes = hashAttributes; - /** - * Converting the instrumentation scope object to a unique identifier string. - * @param instrumentationScope - */ - function instrumentationScopeId(instrumentationScope) { - return `${instrumentationScope.name}:${instrumentationScope.version ?? ""}:${instrumentationScope.schemaUrl ?? ""}`; - } - exports.instrumentationScopeId = instrumentationScopeId; - /** - * Error that is thrown on timeouts. - */ - var TimeoutError = class TimeoutError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, TimeoutError.prototype); - } - }; - exports.TimeoutError = TimeoutError; - /** - * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise - * rejects, and resolves if the specified promise resolves. - * - *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. - * - * @param promise promise to use with timeout. - * @param timeout the timeout in milliseconds until the returned promise is rejected. - */ - function callWithTimeout(promise, timeout) { - let timeoutHandle; - const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { - timeoutHandle = setTimeout(function timeoutHandler() { - reject(new TimeoutError("Operation timed out.")); - }, timeout); - }); - return Promise.race([promise, timeoutPromise]).then((result) => { - clearTimeout(timeoutHandle); - return result; - }, (reason) => { - clearTimeout(timeoutHandle); - throw reason; - }); - } - exports.callWithTimeout = callWithTimeout; - /** - * Node.js v12.9 lower and browser compatible `Promise.allSettled`. - */ - async function PromiseAllSettled(promises) { - return Promise.all(promises.map(async (p) => { - try { - return { - status: "fulfilled", - value: await p - }; - } catch (e) { - return { - status: "rejected", - reason: e - }; - } - })); - } - exports.PromiseAllSettled = PromiseAllSettled; - function isPromiseAllSettledRejectionResult(it) { - return it.status === "rejected"; - } - exports.isPromiseAllSettledRejectionResult = isPromiseAllSettledRejectionResult; - /** - * Node.js v11.0 lower and browser compatible `Array.prototype.flatMap`. - */ - function FlatMap(arr, fn) { - const result = []; - arr.forEach((it) => { - result.push(...fn(it)); - }); - return result; - } - exports.FlatMap = FlatMap; - function setEquals(lhs, rhs) { - if (lhs.size !== rhs.size) return false; - for (const item of lhs) if (!rhs.has(item)) return false; - return true; - } - exports.setEquals = setEquals; - /** - * Binary search the sorted array to the find upper bound for the value. - * @param arr - * @param value - * @returns - */ - function binarySearchUB(arr, value) { - let lo = 0; - let hi = arr.length - 1; - let ret = arr.length; - while (hi >= lo) { - const mid = lo + Math.trunc((hi - lo) / 2); - if (arr[mid] < value) lo = mid + 1; - else { - ret = mid; - hi = mid - 1; - } - } - return ret; - } - exports.binarySearchUB = binarySearchUB; - function equalsCaseInsensitive(lhs, rhs) { - return lhs.toLowerCase() === rhs.toLowerCase(); - } - exports.equalsCaseInsensitive = equalsCaseInsensitive; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js -var require_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AggregatorKind = void 0; - (function(AggregatorKind) { - AggregatorKind[AggregatorKind["DROP"] = 0] = "DROP"; - AggregatorKind[AggregatorKind["SUM"] = 1] = "SUM"; - AggregatorKind[AggregatorKind["LAST_VALUE"] = 2] = "LAST_VALUE"; - AggregatorKind[AggregatorKind["HISTOGRAM"] = 3] = "HISTOGRAM"; - AggregatorKind[AggregatorKind["EXPONENTIAL_HISTOGRAM"] = 4] = "EXPONENTIAL_HISTOGRAM"; - })(exports.AggregatorKind || (exports.AggregatorKind = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Drop.js -var require_Drop = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DropAggregator = void 0; - const types_1 = require_types$1(); - /** Basic aggregator for None which keeps no recorded value. */ - var DropAggregator = class { - kind = types_1.AggregatorKind.DROP; - createAccumulation() {} - merge(_previous, _delta) {} - diff(_previous, _current) {} - toMetricData(_descriptor, _aggregationTemporality, _accumulationByAttributes, _endTime) {} - }; - exports.DropAggregator = DropAggregator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Histogram.js -var require_Histogram = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.HistogramAggregator = exports.HistogramAccumulation = void 0; - const types_1 = require_types$1(); - const MetricData_1 = require_MetricData(); - const utils_1 = require_utils$4(); - function createNewEmptyCheckpoint(boundaries) { - const counts = boundaries.map(() => 0); - counts.push(0); - return { - buckets: { - boundaries, - counts - }, - sum: 0, - count: 0, - hasMinMax: false, - min: Infinity, - max: -Infinity - }; - } - var HistogramAccumulation = class { - startTime; - _boundaries; - _recordMinMax; - _current; - constructor(startTime, _boundaries, _recordMinMax = true, _current = createNewEmptyCheckpoint(_boundaries)) { - this.startTime = startTime; - this._boundaries = _boundaries; - this._recordMinMax = _recordMinMax; - this._current = _current; - } - record(value) { - if (Number.isNaN(value)) return; - this._current.count += 1; - this._current.sum += value; - if (this._recordMinMax) { - this._current.min = Math.min(value, this._current.min); - this._current.max = Math.max(value, this._current.max); - this._current.hasMinMax = true; - } - const idx = (0, utils_1.binarySearchUB)(this._boundaries, value); - this._current.buckets.counts[idx] += 1; - } - setStartTime(startTime) { - this.startTime = startTime; - } - toPointValue() { - return this._current; - } - }; - exports.HistogramAccumulation = HistogramAccumulation; - /** - * Basic aggregator which observes events and counts them in pre-defined buckets - * and provides the total sum and count of all observations. - */ - var HistogramAggregator = class { - _boundaries; - _recordMinMax; - kind = types_1.AggregatorKind.HISTOGRAM; - /** - * @param _boundaries sorted upper bounds of recorded values. - * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. - */ - constructor(_boundaries, _recordMinMax) { - this._boundaries = _boundaries; - this._recordMinMax = _recordMinMax; - } - createAccumulation(startTime) { - return new HistogramAccumulation(startTime, this._boundaries, this._recordMinMax); - } - /** - * Return the result of the merge of two histogram accumulations. As long as one Aggregator - * instance produces all Accumulations with constant boundaries we don't need to worry about - * merging accumulations with different boundaries. - */ - merge(previous, delta) { - const previousValue = previous.toPointValue(); - const deltaValue = delta.toPointValue(); - const previousCounts = previousValue.buckets.counts; - const deltaCounts = deltaValue.buckets.counts; - const mergedCounts = new Array(previousCounts.length); - for (let idx = 0; idx < previousCounts.length; idx++) mergedCounts[idx] = previousCounts[idx] + deltaCounts[idx]; - let min = Infinity; - let max = -Infinity; - if (this._recordMinMax) { - if (previousValue.hasMinMax && deltaValue.hasMinMax) { - min = Math.min(previousValue.min, deltaValue.min); - max = Math.max(previousValue.max, deltaValue.max); - } else if (previousValue.hasMinMax) { - min = previousValue.min; - max = previousValue.max; - } else if (deltaValue.hasMinMax) { - min = deltaValue.min; - max = deltaValue.max; - } - } - return new HistogramAccumulation(previous.startTime, previousValue.buckets.boundaries, this._recordMinMax, { - buckets: { - boundaries: previousValue.buckets.boundaries, - counts: mergedCounts - }, - count: previousValue.count + deltaValue.count, - sum: previousValue.sum + deltaValue.sum, - hasMinMax: this._recordMinMax && (previousValue.hasMinMax || deltaValue.hasMinMax), - min, - max - }); - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - */ - diff(previous, current) { - const previousValue = previous.toPointValue(); - const currentValue = current.toPointValue(); - const previousCounts = previousValue.buckets.counts; - const currentCounts = currentValue.buckets.counts; - const diffedCounts = new Array(previousCounts.length); - for (let idx = 0; idx < previousCounts.length; idx++) diffedCounts[idx] = currentCounts[idx] - previousCounts[idx]; - return new HistogramAccumulation(current.startTime, previousValue.buckets.boundaries, this._recordMinMax, { - buckets: { - boundaries: previousValue.buckets.boundaries, - counts: diffedCounts - }, - count: currentValue.count - previousValue.count, - sum: currentValue.sum - previousValue.sum, - hasMinMax: false, - min: Infinity, - max: -Infinity - }); - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.HISTOGRAM, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - const pointValue = accumulation.toPointValue(); - const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: { - min: pointValue.hasMinMax ? pointValue.min : void 0, - max: pointValue.hasMinMax ? pointValue.max : void 0, - sum: !allowsNegativeValues ? pointValue.sum : void 0, - buckets: pointValue.buckets, - count: pointValue.count - } - }; - }) - }; - } - }; - exports.HistogramAggregator = HistogramAggregator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/Buckets.js -var require_Buckets = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Buckets = void 0; - var Buckets = class Buckets { - backing; - indexBase; - indexStart; - indexEnd; - /** - * The term index refers to the number of the exponential histogram bucket - * used to determine its boundaries. The lower boundary of a bucket is - * determined by base ** index and the upper boundary of a bucket is - * determined by base ** (index + 1). index values are signed to account - * for values less than or equal to 1. - * - * indexBase is the index of the 0th position in the - * backing array, i.e., backing[0] is the count - * in the bucket with index `indexBase`. - * - * indexStart is the smallest index value represented - * in the backing array. - * - * indexEnd is the largest index value represented in - * the backing array. - */ - constructor(backing = new BucketsBacking(), indexBase = 0, indexStart = 0, indexEnd = 0) { - this.backing = backing; - this.indexBase = indexBase; - this.indexStart = indexStart; - this.indexEnd = indexEnd; - } - /** - * Offset is the bucket index of the smallest entry in the counts array - * @returns {number} - */ - get offset() { - return this.indexStart; - } - /** - * Buckets is a view into the backing array. - * @returns {number} - */ - get length() { - if (this.backing.length === 0) return 0; - if (this.indexEnd === this.indexStart && this.at(0) === 0) return 0; - return this.indexEnd - this.indexStart + 1; - } - /** - * An array of counts, where count[i] carries the count - * of the bucket at index (offset+i). count[i] is the count of - * values greater than base^(offset+i) and less than or equal to - * base^(offset+i+1). - * @returns {number} The logical counts based on the backing array - */ - counts() { - return Array.from({ length: this.length }, (_, i) => this.at(i)); - } - /** - * At returns the count of the bucket at a position in the logical - * array of counts. - * @param position - * @returns {number} - */ - at(position) { - const bias = this.indexBase - this.indexStart; - if (position < bias) position += this.backing.length; - position -= bias; - return this.backing.countAt(position); - } - /** - * incrementBucket increments the backing array index by `increment` - * @param bucketIndex - * @param increment - */ - incrementBucket(bucketIndex, increment) { - this.backing.increment(bucketIndex, increment); - } - /** - * decrementBucket decrements the backing array index by `decrement` - * if decrement is greater than the current value, it's set to 0. - * @param bucketIndex - * @param decrement - */ - decrementBucket(bucketIndex, decrement) { - this.backing.decrement(bucketIndex, decrement); - } - /** - * trim removes leading and / or trailing zero buckets (which can occur - * after diffing two histos) and rotates the backing array so that the - * smallest non-zero index is in the 0th position of the backing array - */ - trim() { - for (let i = 0; i < this.length; i++) if (this.at(i) !== 0) { - this.indexStart += i; - break; - } else if (i === this.length - 1) { - this.indexStart = this.indexEnd = this.indexBase = 0; - return; - } - for (let i = this.length - 1; i >= 0; i--) if (this.at(i) !== 0) { - this.indexEnd -= this.length - i - 1; - break; - } - this._rotate(); - } - /** - * downscale first rotates, then collapses 2**`by`-to-1 buckets. - * @param by - */ - downscale(by) { - this._rotate(); - const size = 1 + this.indexEnd - this.indexStart; - const each = 1 << by; - let inpos = 0; - let outpos = 0; - for (let pos = this.indexStart; pos <= this.indexEnd;) { - let mod = pos % each; - if (mod < 0) mod += each; - for (let i = mod; i < each && inpos < size; i++) { - this._relocateBucket(outpos, inpos); - inpos++; - pos++; - } - outpos++; - } - this.indexStart >>= by; - this.indexEnd >>= by; - this.indexBase = this.indexStart; - } - /** - * Clone returns a deep copy of Buckets - * @returns {Buckets} - */ - clone() { - return new Buckets(this.backing.clone(), this.indexBase, this.indexStart, this.indexEnd); - } - /** - * _rotate shifts the backing array contents so that indexStart == - * indexBase to simplify the downscale logic. - */ - _rotate() { - const bias = this.indexBase - this.indexStart; - if (bias === 0) return; - else if (bias > 0) { - this.backing.reverse(0, this.backing.length); - this.backing.reverse(0, bias); - this.backing.reverse(bias, this.backing.length); - } else { - this.backing.reverse(0, this.backing.length); - this.backing.reverse(0, this.backing.length + bias); - } - this.indexBase = this.indexStart; - } - /** - * _relocateBucket adds the count in counts[src] to counts[dest] and - * resets count[src] to zero. - */ - _relocateBucket(dest, src) { - if (dest === src) return; - this.incrementBucket(dest, this.backing.emptyBucket(src)); - } - }; - exports.Buckets = Buckets; - /** - * BucketsBacking holds the raw buckets and some utility methods to - * manage them. - */ - var BucketsBacking = class BucketsBacking { - _counts; - constructor(_counts = [0]) { - this._counts = _counts; - } - /** - * length returns the physical size of the backing array, which - * is >= buckets.length() - */ - get length() { - return this._counts.length; - } - /** - * countAt returns the count in a specific bucket - */ - countAt(pos) { - return this._counts[pos]; - } - /** - * growTo grows a backing array and copies old entries - * into their correct new positions. - */ - growTo(newSize, oldPositiveLimit, newPositiveLimit) { - const tmp = new Array(newSize).fill(0); - tmp.splice(newPositiveLimit, this._counts.length - oldPositiveLimit, ...this._counts.slice(oldPositiveLimit)); - tmp.splice(0, oldPositiveLimit, ...this._counts.slice(0, oldPositiveLimit)); - this._counts = tmp; - } - /** - * reverse the items in the backing array in the range [from, limit). - */ - reverse(from, limit) { - const num = Math.floor((from + limit) / 2) - from; - for (let i = 0; i < num; i++) { - const tmp = this._counts[from + i]; - this._counts[from + i] = this._counts[limit - i - 1]; - this._counts[limit - i - 1] = tmp; - } - } - /** - * emptyBucket empties the count from a bucket, for - * moving into another. - */ - emptyBucket(src) { - const tmp = this._counts[src]; - this._counts[src] = 0; - return tmp; - } - /** - * increments a bucket by `increment` - */ - increment(bucketIndex, increment) { - this._counts[bucketIndex] += increment; - } - /** - * decrements a bucket by `decrement` - */ - decrement(bucketIndex, decrement) { - if (this._counts[bucketIndex] >= decrement) this._counts[bucketIndex] -= decrement; - else this._counts[bucketIndex] = 0; - } - /** - * clone returns a deep copy of BucketsBacking - */ - clone() { - return new BucketsBacking([...this._counts]); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js -var require_ieee754 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSignificand = exports.getNormalBase2 = exports.MIN_VALUE = exports.MAX_NORMAL_EXPONENT = exports.MIN_NORMAL_EXPONENT = exports.SIGNIFICAND_WIDTH = void 0; - /** - * The functions and constants in this file allow us to interact - * with the internal representation of an IEEE 64-bit floating point - * number. We need to work with all 64-bits, thus, care needs to be - * taken when working with Javascript's bitwise operators (<<, >>, &, - * |, etc) as they truncate operands to 32-bits. In order to work around - * this we work with the 64-bits as two 32-bit halves, perform bitwise - * operations on them independently, and combine the results (if needed). - */ - exports.SIGNIFICAND_WIDTH = 52; - /** - * EXPONENT_MASK is set to 1 for the hi 32-bits of an IEEE 754 - * floating point exponent: 0x7ff00000. - */ - const EXPONENT_MASK = 2146435072; - /** - * SIGNIFICAND_MASK is the mask for the significand portion of the hi 32-bits - * of an IEEE 754 double-precision floating-point value: 0xfffff - */ - const SIGNIFICAND_MASK = 1048575; - /** - * EXPONENT_BIAS is the exponent bias specified for encoding - * the IEEE 754 double-precision floating point exponent: 1023 - */ - const EXPONENT_BIAS = 1023; - /** - * MIN_NORMAL_EXPONENT is the minimum exponent of a normalized - * floating point: -1022. - */ - exports.MIN_NORMAL_EXPONENT = -EXPONENT_BIAS + 1; - /** - * MAX_NORMAL_EXPONENT is the maximum exponent of a normalized - * floating point: 1023. - */ - exports.MAX_NORMAL_EXPONENT = EXPONENT_BIAS; - /** - * MIN_VALUE is the smallest normal number - */ - exports.MIN_VALUE = Math.pow(2, -1022); - /** - * getNormalBase2 extracts the normalized base-2 fractional exponent. - * This returns k for the equation f x 2**k where f is - * in the range [1, 2). Note that this function is not called for - * subnormal numbers. - * @param {number} value - the value to determine normalized base-2 fractional - * exponent for - * @returns {number} the normalized base-2 exponent - */ - function getNormalBase2(value) { - const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); - dv.setFloat64(0, value); - return ((dv.getUint32(0) & EXPONENT_MASK) >> 20) - EXPONENT_BIAS; - } - exports.getNormalBase2 = getNormalBase2; - /** - * GetSignificand returns the 52 bit (unsigned) significand as a signed value. - * @param {number} value - the floating point number to extract the significand from - * @returns {number} The 52-bit significand - */ - function getSignificand(value) { - const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); - dv.setFloat64(0, value); - const hiBits = dv.getUint32(0); - const loBits = dv.getUint32(4); - return (hiBits & SIGNIFICAND_MASK) * Math.pow(2, 32) + loBits; - } - exports.getSignificand = getSignificand; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js -var require_util = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.nextGreaterSquare = exports.ldexp = void 0; - /** - * Note: other languages provide this as a built in function. This is - * a naive, but functionally correct implementation. This is used sparingly, - * when creating a new mapping in a running application. - * - * ldexp returns frac × 2**exp. With the following special cases: - * ldexp(±0, exp) = ±0 - * ldexp(±Inf, exp) = ±Inf - * ldexp(NaN, exp) = NaN - * @param frac - * @param exp - * @returns {number} - */ - function ldexp(frac, exp) { - if (frac === 0 || frac === Number.POSITIVE_INFINITY || frac === Number.NEGATIVE_INFINITY || Number.isNaN(frac)) return frac; - return frac * Math.pow(2, exp); - } - exports.ldexp = ldexp; - /** - * Computes the next power of two that is greater than or equal to v. - * This implementation more efficient than, but functionally equivalent - * to Math.pow(2, Math.ceil(Math.log(x)/Math.log(2))). - * @param v - * @returns {number} - */ - function nextGreaterSquare(v) { - v--; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - v++; - return v; - } - exports.nextGreaterSquare = nextGreaterSquare; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/types.js -var require_types = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MappingError = void 0; - var MappingError = class extends Error {}; - exports.MappingError = MappingError; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js -var require_ExponentMapping = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExponentMapping = void 0; - const ieee754 = require_ieee754(); - const util = require_util(); - const types_1 = require_types(); - /** - * ExponentMapping implements exponential mapping functions for - * scales <=0. For scales > 0 LogarithmMapping should be used. - */ - var ExponentMapping = class { - _shift; - constructor(scale) { - this._shift = -scale; - } - /** - * Maps positive floating point values to indexes corresponding to scale - * @param value - * @returns {number} index for provided value at the current scale - */ - mapToIndex(value) { - if (value < ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex(); - return ieee754.getNormalBase2(value) + this._rightShift(ieee754.getSignificand(value) - 1, ieee754.SIGNIFICAND_WIDTH) >> this._shift; - } - /** - * Returns the lower bucket boundary for the given index for scale - * - * @param index - * @returns {number} - */ - lowerBoundary(index) { - const minIndex = this._minNormalLowerBoundaryIndex(); - if (index < minIndex) throw new types_1.MappingError(`underflow: ${index} is < minimum lower boundary: ${minIndex}`); - const maxIndex = this._maxNormalLowerBoundaryIndex(); - if (index > maxIndex) throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); - return util.ldexp(1, index << this._shift); - } - /** - * The scale used by this mapping - * @returns {number} - */ - get scale() { - if (this._shift === 0) return 0; - return -this._shift; - } - _minNormalLowerBoundaryIndex() { - let index = ieee754.MIN_NORMAL_EXPONENT >> this._shift; - if (this._shift < 2) index--; - return index; - } - _maxNormalLowerBoundaryIndex() { - return ieee754.MAX_NORMAL_EXPONENT >> this._shift; - } - _rightShift(value, shift) { - return Math.floor(value * Math.pow(2, -shift)); - } - }; - exports.ExponentMapping = ExponentMapping; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js -var require_LogarithmMapping = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.LogarithmMapping = void 0; - const ieee754 = require_ieee754(); - const util = require_util(); - const types_1 = require_types(); - /** - * LogarithmMapping implements exponential mapping functions for scale > 0. - * For scales <= 0 the exponent mapping should be used. - */ - var LogarithmMapping = class { - _scale; - _scaleFactor; - _inverseFactor; - constructor(scale) { - this._scale = scale; - this._scaleFactor = util.ldexp(Math.LOG2E, scale); - this._inverseFactor = util.ldexp(Math.LN2, -scale); - } - /** - * Maps positive floating point values to indexes corresponding to scale - * @param value - * @returns {number} index for provided value at the current scale - */ - mapToIndex(value) { - if (value <= ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex() - 1; - if (ieee754.getSignificand(value) === 0) return (ieee754.getNormalBase2(value) << this._scale) - 1; - const index = Math.floor(Math.log(value) * this._scaleFactor); - const maxIndex = this._maxNormalLowerBoundaryIndex(); - if (index >= maxIndex) return maxIndex; - return index; - } - /** - * Returns the lower bucket boundary for the given index for scale - * - * @param index - * @returns {number} - */ - lowerBoundary(index) { - const maxIndex = this._maxNormalLowerBoundaryIndex(); - if (index >= maxIndex) { - if (index === maxIndex) return 2 * Math.exp((index - (1 << this._scale)) / this._scaleFactor); - throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); - } - const minIndex = this._minNormalLowerBoundaryIndex(); - if (index <= minIndex) { - if (index === minIndex) return ieee754.MIN_VALUE; - else if (index === minIndex - 1) return Math.exp((index + (1 << this._scale)) / this._scaleFactor) / 2; - throw new types_1.MappingError(`overflow: ${index} is < minimum lower boundary: ${minIndex}`); - } - return Math.exp(index * this._inverseFactor); - } - /** - * The scale used by this mapping - * @returns {number} - */ - get scale() { - return this._scale; - } - _minNormalLowerBoundaryIndex() { - return ieee754.MIN_NORMAL_EXPONENT << this._scale; - } - _maxNormalLowerBoundaryIndex() { - return (ieee754.MAX_NORMAL_EXPONENT + 1 << this._scale) - 1; - } - }; - exports.LogarithmMapping = LogarithmMapping; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/getMapping.js -var require_getMapping = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMapping = void 0; - const ExponentMapping_1 = require_ExponentMapping(); - const LogarithmMapping_1 = require_LogarithmMapping(); - const types_1 = require_types(); - const MIN_SCALE = -10; - const MAX_SCALE = 20; - const PREBUILT_MAPPINGS = Array.from({ length: 31 }, (_, i) => { - if (i > 10) return new LogarithmMapping_1.LogarithmMapping(i - 10); - return new ExponentMapping_1.ExponentMapping(i - 10); - }); - /** - * getMapping returns an appropriate mapping for the given scale. For scales -10 - * to 0 the underlying type will be ExponentMapping. For scales 1 to 20 the - * underlying type will be LogarithmMapping. - * @param scale a number in the range [-10, 20] - * @returns {Mapping} - */ - function getMapping(scale) { - if (scale > MAX_SCALE || scale < MIN_SCALE) throw new types_1.MappingError(`expected scale >= ${MIN_SCALE} && <= ${MAX_SCALE}, got: ${scale}`); - return PREBUILT_MAPPINGS[scale + 10]; - } - exports.getMapping = getMapping; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js -var require_ExponentialHistogram = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = void 0; - const types_1 = require_types$1(); - const MetricData_1 = require_MetricData(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const Buckets_1 = require_Buckets(); - const getMapping_1 = require_getMapping(); - const util_1 = require_util(); - var HighLow = class HighLow { - low; - high; - static combine(h1, h2) { - return new HighLow(Math.min(h1.low, h2.low), Math.max(h1.high, h2.high)); - } - constructor(low, high) { - this.low = low; - this.high = high; - } - }; - const MAX_SCALE = 20; - const DEFAULT_MAX_SIZE = 160; - const MIN_MAX_SIZE = 2; - var ExponentialHistogramAccumulation = class ExponentialHistogramAccumulation { - startTime; - _maxSize; - _recordMinMax; - _sum; - _count; - _zeroCount; - _min; - _max; - _positive; - _negative; - _mapping; - constructor(startTime, _maxSize = DEFAULT_MAX_SIZE, _recordMinMax = true, _sum = 0, _count = 0, _zeroCount = 0, _min = Number.POSITIVE_INFINITY, _max = Number.NEGATIVE_INFINITY, _positive = new Buckets_1.Buckets(), _negative = new Buckets_1.Buckets(), _mapping = (0, getMapping_1.getMapping)(MAX_SCALE)) { - this.startTime = startTime; - this._maxSize = _maxSize; - this._recordMinMax = _recordMinMax; - this._sum = _sum; - this._count = _count; - this._zeroCount = _zeroCount; - this._min = _min; - this._max = _max; - this._positive = _positive; - this._negative = _negative; - this._mapping = _mapping; - if (this._maxSize < MIN_MAX_SIZE) { - api_1.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \ - changing to the minimum size of: ${MIN_MAX_SIZE}`); - this._maxSize = MIN_MAX_SIZE; - } - } - /** - * record updates a histogram with a single count - * @param {Number} value - */ - record(value) { - this.updateByIncrement(value, 1); - } - /** - * Sets the start time for this accumulation - * @param {HrTime} startTime - */ - setStartTime(startTime) { - this.startTime = startTime; - } - /** - * Returns the datapoint representation of this accumulation - * @param {HrTime} startTime - */ - toPointValue() { - return { - hasMinMax: this._recordMinMax, - min: this.min, - max: this.max, - sum: this.sum, - positive: { - offset: this.positive.offset, - bucketCounts: this.positive.counts() - }, - negative: { - offset: this.negative.offset, - bucketCounts: this.negative.counts() - }, - count: this.count, - scale: this.scale, - zeroCount: this.zeroCount - }; - } - /** - * @returns {Number} The sum of values recorded by this accumulation - */ - get sum() { - return this._sum; - } - /** - * @returns {Number} The minimum value recorded by this accumulation - */ - get min() { - return this._min; - } - /** - * @returns {Number} The maximum value recorded by this accumulation - */ - get max() { - return this._max; - } - /** - * @returns {Number} The count of values recorded by this accumulation - */ - get count() { - return this._count; - } - /** - * @returns {Number} The number of 0 values recorded by this accumulation - */ - get zeroCount() { - return this._zeroCount; - } - /** - * @returns {Number} The scale used by this accumulation - */ - get scale() { - if (this._count === this._zeroCount) return 0; - return this._mapping.scale; - } - /** - * positive holds the positive values - * @returns {Buckets} - */ - get positive() { - return this._positive; - } - /** - * negative holds the negative values by their absolute value - * @returns {Buckets} - */ - get negative() { - return this._negative; - } - /** - * updateByIncr supports updating a histogram with a non-negative - * increment. - * @param value - * @param increment - */ - updateByIncrement(value, increment) { - if (Number.isNaN(value)) return; - if (value > this._max) this._max = value; - if (value < this._min) this._min = value; - this._count += increment; - if (value === 0) { - this._zeroCount += increment; - return; - } - this._sum += value * increment; - if (value > 0) this._updateBuckets(this._positive, value, increment); - else this._updateBuckets(this._negative, -value, increment); - } - /** - * merge combines data from previous value into self - * @param {ExponentialHistogramAccumulation} previous - */ - merge(previous) { - if (this._count === 0) { - this._min = previous.min; - this._max = previous.max; - } else if (previous.count !== 0) { - if (previous.min < this.min) this._min = previous.min; - if (previous.max > this.max) this._max = previous.max; - } - this.startTime = previous.startTime; - this._sum += previous.sum; - this._count += previous.count; - this._zeroCount += previous.zeroCount; - const minScale = this._minScale(previous); - this._downscale(this.scale - minScale); - this._mergeBuckets(this.positive, previous, previous.positive, minScale); - this._mergeBuckets(this.negative, previous, previous.negative, minScale); - } - /** - * diff subtracts other from self - * @param {ExponentialHistogramAccumulation} other - */ - diff(other) { - this._min = Infinity; - this._max = -Infinity; - this._sum -= other.sum; - this._count -= other.count; - this._zeroCount -= other.zeroCount; - const minScale = this._minScale(other); - this._downscale(this.scale - minScale); - this._diffBuckets(this.positive, other, other.positive, minScale); - this._diffBuckets(this.negative, other, other.negative, minScale); - } - /** - * clone returns a deep copy of self - * @returns {ExponentialHistogramAccumulation} - */ - clone() { - return new ExponentialHistogramAccumulation(this.startTime, this._maxSize, this._recordMinMax, this._sum, this._count, this._zeroCount, this._min, this._max, this.positive.clone(), this.negative.clone(), this._mapping); - } - /** - * _updateBuckets maps the incoming value to a bucket index for the current - * scale. If the bucket index is outside of the range of the backing array, - * it will rescale the backing array and update the mapping for the new scale. - */ - _updateBuckets(buckets, value, increment) { - let index = this._mapping.mapToIndex(value); - let rescalingNeeded = false; - let high = 0; - let low = 0; - if (buckets.length === 0) { - buckets.indexStart = index; - buckets.indexEnd = buckets.indexStart; - buckets.indexBase = buckets.indexStart; - } else if (index < buckets.indexStart && buckets.indexEnd - index >= this._maxSize) { - rescalingNeeded = true; - low = index; - high = buckets.indexEnd; - } else if (index > buckets.indexEnd && index - buckets.indexStart >= this._maxSize) { - rescalingNeeded = true; - low = buckets.indexStart; - high = index; - } - if (rescalingNeeded) { - const change = this._changeScale(high, low); - this._downscale(change); - index = this._mapping.mapToIndex(value); - } - this._incrementIndexBy(buckets, index, increment); - } - /** - * _incrementIndexBy increments the count of the bucket specified by `index`. - * If the index is outside of the range [buckets.indexStart, buckets.indexEnd] - * the boundaries of the backing array will be adjusted and more buckets will - * be added if needed. - */ - _incrementIndexBy(buckets, index, increment) { - if (increment === 0) return; - if (buckets.length === 0) buckets.indexStart = buckets.indexEnd = buckets.indexBase = index; - if (index < buckets.indexStart) { - const span = buckets.indexEnd - index; - if (span >= buckets.backing.length) this._grow(buckets, span + 1); - buckets.indexStart = index; - } else if (index > buckets.indexEnd) { - const span = index - buckets.indexStart; - if (span >= buckets.backing.length) this._grow(buckets, span + 1); - buckets.indexEnd = index; - } - let bucketIndex = index - buckets.indexBase; - if (bucketIndex < 0) bucketIndex += buckets.backing.length; - buckets.incrementBucket(bucketIndex, increment); - } - /** - * grow resizes the backing array by doubling in size up to maxSize. - * This extends the array with a bunch of zeros and copies the - * existing counts to the same position. - */ - _grow(buckets, needed) { - const size = buckets.backing.length; - const bias = buckets.indexBase - buckets.indexStart; - const oldPositiveLimit = size - bias; - let newSize = (0, util_1.nextGreaterSquare)(needed); - if (newSize > this._maxSize) newSize = this._maxSize; - const newPositiveLimit = newSize - bias; - buckets.backing.growTo(newSize, oldPositiveLimit, newPositiveLimit); - } - /** - * _changeScale computes how much downscaling is needed by shifting the - * high and low values until they are separated by no more than size. - */ - _changeScale(high, low) { - let change = 0; - while (high - low >= this._maxSize) { - high >>= 1; - low >>= 1; - change++; - } - return change; - } - /** - * _downscale subtracts `change` from the current mapping scale. - */ - _downscale(change) { - if (change === 0) return; - if (change < 0) throw new Error(`impossible change of scale: ${this.scale}`); - const newScale = this._mapping.scale - change; - this._positive.downscale(change); - this._negative.downscale(change); - this._mapping = (0, getMapping_1.getMapping)(newScale); - } - /** - * _minScale is used by diff and merge to compute an ideal combined scale - */ - _minScale(other) { - const minScale = Math.min(this.scale, other.scale); - const highLowPos = HighLow.combine(this._highLowAtScale(this.positive, this.scale, minScale), this._highLowAtScale(other.positive, other.scale, minScale)); - const highLowNeg = HighLow.combine(this._highLowAtScale(this.negative, this.scale, minScale), this._highLowAtScale(other.negative, other.scale, minScale)); - return Math.min(minScale - this._changeScale(highLowPos.high, highLowPos.low), minScale - this._changeScale(highLowNeg.high, highLowNeg.low)); - } - /** - * _highLowAtScale is used by diff and merge to compute an ideal combined scale. - */ - _highLowAtScale(buckets, currentScale, newScale) { - if (buckets.length === 0) return new HighLow(0, -1); - const shift = currentScale - newScale; - return new HighLow(buckets.indexStart >> shift, buckets.indexEnd >> shift); - } - /** - * _mergeBuckets translates index values from another histogram and - * adds the values into the corresponding buckets of this histogram. - */ - _mergeBuckets(ours, other, theirs, scale) { - const theirOffset = theirs.offset; - const theirChange = other.scale - scale; - for (let i = 0; i < theirs.length; i++) this._incrementIndexBy(ours, theirOffset + i >> theirChange, theirs.at(i)); - } - /** - * _diffBuckets translates index values from another histogram and - * subtracts the values in the corresponding buckets of this histogram. - */ - _diffBuckets(ours, other, theirs, scale) { - const theirOffset = theirs.offset; - const theirChange = other.scale - scale; - for (let i = 0; i < theirs.length; i++) { - let bucketIndex = (theirOffset + i >> theirChange) - ours.indexBase; - if (bucketIndex < 0) bucketIndex += ours.backing.length; - ours.decrementBucket(bucketIndex, theirs.at(i)); - } - ours.trim(); - } - }; - exports.ExponentialHistogramAccumulation = ExponentialHistogramAccumulation; - /** - * Aggregator for ExponentialHistogramAccumulations - */ - var ExponentialHistogramAggregator = class { - _maxSize; - _recordMinMax; - kind = types_1.AggregatorKind.EXPONENTIAL_HISTOGRAM; - /** - * @param _maxSize Maximum number of buckets for each of the positive - * and negative ranges, exclusive of the zero-bucket. - * @param _recordMinMax If set to true, min and max will be recorded. - * Otherwise, min and max will not be recorded. - */ - constructor(_maxSize, _recordMinMax) { - this._maxSize = _maxSize; - this._recordMinMax = _recordMinMax; - } - createAccumulation(startTime) { - return new ExponentialHistogramAccumulation(startTime, this._maxSize, this._recordMinMax); - } - /** - * Return the result of the merge of two exponential histogram accumulations. - */ - merge(previous, delta) { - const result = delta.clone(); - result.merge(previous); - return result; - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - */ - diff(previous, current) { - const result = current.clone(); - result.diff(previous); - return result; - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.EXPONENTIAL_HISTOGRAM, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - const pointValue = accumulation.toPointValue(); - const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: { - min: pointValue.hasMinMax ? pointValue.min : void 0, - max: pointValue.hasMinMax ? pointValue.max : void 0, - sum: !allowsNegativeValues ? pointValue.sum : void 0, - positive: { - offset: pointValue.positive.offset, - bucketCounts: pointValue.positive.bucketCounts - }, - negative: { - offset: pointValue.negative.offset, - bucketCounts: pointValue.negative.bucketCounts - }, - count: pointValue.count, - scale: pointValue.scale, - zeroCount: pointValue.zeroCount - } - }; - }) - }; - } - }; - exports.ExponentialHistogramAggregator = ExponentialHistogramAggregator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/LastValue.js -var require_LastValue = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.LastValueAggregator = exports.LastValueAccumulation = void 0; - const types_1 = require_types$1(); - const core_1 = require_src$8(); - const MetricData_1 = require_MetricData(); - var LastValueAccumulation = class { - startTime; - _current; - sampleTime; - constructor(startTime, _current = 0, sampleTime = [0, 0]) { - this.startTime = startTime; - this._current = _current; - this.sampleTime = sampleTime; - } - record(value) { - this._current = value; - this.sampleTime = (0, core_1.millisToHrTime)(Date.now()); - } - setStartTime(startTime) { - this.startTime = startTime; - } - toPointValue() { - return this._current; - } - }; - exports.LastValueAccumulation = LastValueAccumulation; - /** Basic aggregator which calculates a LastValue from individual measurements. */ - var LastValueAggregator = class { - kind = types_1.AggregatorKind.LAST_VALUE; - createAccumulation(startTime) { - return new LastValueAccumulation(startTime); - } - /** - * Returns the result of the merge of the given accumulations. - * - * Return the newly captured (delta) accumulation for LastValueAggregator. - */ - merge(previous, delta) { - const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(delta.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? delta : previous; - return new LastValueAccumulation(previous.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - * - * A delta aggregation is not meaningful to LastValueAggregator, just return - * the newly captured (delta) accumulation for LastValueAggregator. - */ - diff(previous, current) { - const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(current.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? current : previous; - return new LastValueAccumulation(current.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.GAUGE, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: accumulation.toPointValue() - }; - }) - }; - } - }; - exports.LastValueAggregator = LastValueAggregator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Sum.js -var require_Sum = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SumAggregator = exports.SumAccumulation = void 0; - const types_1 = require_types$1(); - const MetricData_1 = require_MetricData(); - var SumAccumulation = class { - startTime; - monotonic; - _current; - reset; - constructor(startTime, monotonic, _current = 0, reset = false) { - this.startTime = startTime; - this.monotonic = monotonic; - this._current = _current; - this.reset = reset; - } - record(value) { - if (this.monotonic && value < 0) return; - this._current += value; - } - setStartTime(startTime) { - this.startTime = startTime; - } - toPointValue() { - return this._current; - } - }; - exports.SumAccumulation = SumAccumulation; - /** Basic aggregator which calculates a Sum from individual measurements. */ - var SumAggregator = class { - monotonic; - kind = types_1.AggregatorKind.SUM; - constructor(monotonic) { - this.monotonic = monotonic; - } - createAccumulation(startTime) { - return new SumAccumulation(startTime, this.monotonic); - } - /** - * Returns the result of the merge of the given accumulations. - */ - merge(previous, delta) { - const prevPv = previous.toPointValue(); - const deltaPv = delta.toPointValue(); - if (delta.reset) return new SumAccumulation(delta.startTime, this.monotonic, deltaPv, delta.reset); - return new SumAccumulation(previous.startTime, this.monotonic, prevPv + deltaPv); - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - */ - diff(previous, current) { - const prevPv = previous.toPointValue(); - const currPv = current.toPointValue(); - /** - * If the SumAggregator is a monotonic one and the previous point value is - * greater than the current one, a reset is deemed to be happened. - * Return the current point value to prevent the value from been reset. - */ - if (this.monotonic && prevPv > currPv) return new SumAccumulation(current.startTime, this.monotonic, currPv, true); - return new SumAccumulation(current.startTime, this.monotonic, currPv - prevPv); - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.SUM, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: accumulation.toPointValue() - }; - }), - isMonotonic: this.monotonic - }; - } - }; - exports.SumAggregator = SumAggregator; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/index.js -var require_aggregator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SumAggregator = exports.SumAccumulation = exports.LastValueAggregator = exports.LastValueAccumulation = exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = exports.HistogramAggregator = exports.HistogramAccumulation = exports.DropAggregator = void 0; - var Drop_1 = require_Drop(); - Object.defineProperty(exports, "DropAggregator", { - enumerable: true, - get: function() { - return Drop_1.DropAggregator; - } - }); - var Histogram_1 = require_Histogram(); - Object.defineProperty(exports, "HistogramAccumulation", { - enumerable: true, - get: function() { - return Histogram_1.HistogramAccumulation; - } - }); - Object.defineProperty(exports, "HistogramAggregator", { - enumerable: true, - get: function() { - return Histogram_1.HistogramAggregator; - } - }); - var ExponentialHistogram_1 = require_ExponentialHistogram(); - Object.defineProperty(exports, "ExponentialHistogramAccumulation", { - enumerable: true, - get: function() { - return ExponentialHistogram_1.ExponentialHistogramAccumulation; - } - }); - Object.defineProperty(exports, "ExponentialHistogramAggregator", { - enumerable: true, - get: function() { - return ExponentialHistogram_1.ExponentialHistogramAggregator; - } - }); - var LastValue_1 = require_LastValue(); - Object.defineProperty(exports, "LastValueAccumulation", { - enumerable: true, - get: function() { - return LastValue_1.LastValueAccumulation; - } - }); - Object.defineProperty(exports, "LastValueAggregator", { - enumerable: true, - get: function() { - return LastValue_1.LastValueAggregator; - } - }); - var Sum_1 = require_Sum(); - Object.defineProperty(exports, "SumAccumulation", { - enumerable: true, - get: function() { - return Sum_1.SumAccumulation; - } - }); - Object.defineProperty(exports, "SumAggregator", { - enumerable: true, - get: function() { - return Sum_1.SumAggregator; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Aggregation.js -var require_Aggregation = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_AGGREGATION = exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = exports.HISTOGRAM_AGGREGATION = exports.LAST_VALUE_AGGREGATION = exports.SUM_AGGREGATION = exports.DROP_AGGREGATION = exports.DefaultAggregation = exports.ExponentialHistogramAggregation = exports.ExplicitBucketHistogramAggregation = exports.HistogramAggregation = exports.LastValueAggregation = exports.SumAggregation = exports.DropAggregation = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const aggregator_1 = require_aggregator(); - const MetricData_1 = require_MetricData(); - /** - * The default drop aggregation. - */ - var DropAggregation = class DropAggregation { - static DEFAULT_INSTANCE = new aggregator_1.DropAggregator(); - createAggregator(_instrument) { - return DropAggregation.DEFAULT_INSTANCE; - } - }; - exports.DropAggregation = DropAggregation; - /** - * The default sum aggregation. - */ - var SumAggregation = class SumAggregation { - static MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(true); - static NON_MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(false); - createAggregator(instrument) { - switch (instrument.type) { - case MetricData_1.InstrumentType.COUNTER: - case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: - case MetricData_1.InstrumentType.HISTOGRAM: return SumAggregation.MONOTONIC_INSTANCE; - default: return SumAggregation.NON_MONOTONIC_INSTANCE; - } - } - }; - exports.SumAggregation = SumAggregation; - /** - * The default last value aggregation. - */ - var LastValueAggregation = class LastValueAggregation { - static DEFAULT_INSTANCE = new aggregator_1.LastValueAggregator(); - createAggregator(_instrument) { - return LastValueAggregation.DEFAULT_INSTANCE; - } - }; - exports.LastValueAggregation = LastValueAggregation; - /** - * The default histogram aggregation. - - */ - var HistogramAggregation = class HistogramAggregation { - static DEFAULT_INSTANCE = new aggregator_1.HistogramAggregator([ - 0, - 5, - 10, - 25, - 50, - 75, - 100, - 250, - 500, - 750, - 1e3, - 2500, - 5e3, - 7500, - 1e4 - ], true); - createAggregator(_instrument) { - return HistogramAggregation.DEFAULT_INSTANCE; - } - }; - exports.HistogramAggregation = HistogramAggregation; - /** - * The explicit bucket histogram aggregation. - */ - var ExplicitBucketHistogramAggregation = class { - _recordMinMax; - _boundaries; - /** - * @param boundaries the bucket boundaries of the histogram aggregation - * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. - */ - constructor(boundaries, _recordMinMax = true) { - this._recordMinMax = _recordMinMax; - if (boundaries == null) throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array"); - boundaries = boundaries.concat(); - boundaries = boundaries.sort((a, b) => a - b); - const minusInfinityIndex = boundaries.lastIndexOf(-Infinity); - let infinityIndex = boundaries.indexOf(Infinity); - if (infinityIndex === -1) infinityIndex = void 0; - this._boundaries = boundaries.slice(minusInfinityIndex + 1, infinityIndex); - } - createAggregator(_instrument) { - return new aggregator_1.HistogramAggregator(this._boundaries, this._recordMinMax); - } - }; - exports.ExplicitBucketHistogramAggregation = ExplicitBucketHistogramAggregation; - var ExponentialHistogramAggregation = class { - _maxSize; - _recordMinMax; - constructor(_maxSize = 160, _recordMinMax = true) { - this._maxSize = _maxSize; - this._recordMinMax = _recordMinMax; - } - createAggregator(_instrument) { - return new aggregator_1.ExponentialHistogramAggregator(this._maxSize, this._recordMinMax); - } - }; - exports.ExponentialHistogramAggregation = ExponentialHistogramAggregation; - /** - * The default aggregation. - */ - var DefaultAggregation = class { - _resolve(instrument) { - switch (instrument.type) { - case MetricData_1.InstrumentType.COUNTER: - case MetricData_1.InstrumentType.UP_DOWN_COUNTER: - case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: - case MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: return exports.SUM_AGGREGATION; - case MetricData_1.InstrumentType.GAUGE: - case MetricData_1.InstrumentType.OBSERVABLE_GAUGE: return exports.LAST_VALUE_AGGREGATION; - case MetricData_1.InstrumentType.HISTOGRAM: - if (instrument.advice.explicitBucketBoundaries) return new ExplicitBucketHistogramAggregation(instrument.advice.explicitBucketBoundaries); - return exports.HISTOGRAM_AGGREGATION; - } - api.diag.warn(`Unable to recognize instrument type: ${instrument.type}`); - return exports.DROP_AGGREGATION; - } - createAggregator(instrument) { - return this._resolve(instrument).createAggregator(instrument); - } - }; - exports.DefaultAggregation = DefaultAggregation; - exports.DROP_AGGREGATION = new DropAggregation(); - exports.SUM_AGGREGATION = new SumAggregation(); - exports.LAST_VALUE_AGGREGATION = new LastValueAggregation(); - exports.HISTOGRAM_AGGREGATION = new HistogramAggregation(); - exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = new ExponentialHistogramAggregation(); - exports.DEFAULT_AGGREGATION = new DefaultAggregation(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AggregationOption.js -var require_AggregationOption = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toAggregation = exports.AggregationType = void 0; - const Aggregation_1 = require_Aggregation(); - var AggregationType; - (function(AggregationType) { - AggregationType[AggregationType["DEFAULT"] = 0] = "DEFAULT"; - AggregationType[AggregationType["DROP"] = 1] = "DROP"; - AggregationType[AggregationType["SUM"] = 2] = "SUM"; - AggregationType[AggregationType["LAST_VALUE"] = 3] = "LAST_VALUE"; - AggregationType[AggregationType["EXPLICIT_BUCKET_HISTOGRAM"] = 4] = "EXPLICIT_BUCKET_HISTOGRAM"; - AggregationType[AggregationType["EXPONENTIAL_HISTOGRAM"] = 5] = "EXPONENTIAL_HISTOGRAM"; - })(AggregationType = exports.AggregationType || (exports.AggregationType = {})); - function toAggregation(option) { - switch (option.type) { - case AggregationType.DEFAULT: return Aggregation_1.DEFAULT_AGGREGATION; - case AggregationType.DROP: return Aggregation_1.DROP_AGGREGATION; - case AggregationType.SUM: return Aggregation_1.SUM_AGGREGATION; - case AggregationType.LAST_VALUE: return Aggregation_1.LAST_VALUE_AGGREGATION; - case AggregationType.EXPONENTIAL_HISTOGRAM: { - const expOption = option; - return new Aggregation_1.ExponentialHistogramAggregation(expOption.options?.maxSize, expOption.options?.recordMinMax); - } - case AggregationType.EXPLICIT_BUCKET_HISTOGRAM: { - const expOption = option; - if (expOption.options == null) return Aggregation_1.HISTOGRAM_AGGREGATION; - else return new Aggregation_1.ExplicitBucketHistogramAggregation(expOption.options?.boundaries, expOption.options?.recordMinMax); - } - default: throw new Error("Unsupported Aggregation"); - } - } - exports.toAggregation = toAggregation; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationSelector.js -var require_AggregationSelector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = exports.DEFAULT_AGGREGATION_SELECTOR = void 0; - const AggregationTemporality_1 = require_AggregationTemporality(); - const AggregationOption_1 = require_AggregationOption(); - const DEFAULT_AGGREGATION_SELECTOR = (_instrumentType) => { - return { type: AggregationOption_1.AggregationType.DEFAULT }; - }; - exports.DEFAULT_AGGREGATION_SELECTOR = DEFAULT_AGGREGATION_SELECTOR; - const DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = (_instrumentType) => AggregationTemporality_1.AggregationTemporality.CUMULATIVE; - exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReader.js -var require_MetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricReader = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const utils_1 = require_utils$4(); - const AggregationSelector_1 = require_AggregationSelector(); - /** - * A registered reader of metrics that, when linked to a {@link MetricProducer}, offers global - * control over metrics. - */ - var MetricReader = class { - _shutdown = false; - _metricProducers; - _sdkMetricProducer; - _aggregationTemporalitySelector; - _aggregationSelector; - _cardinalitySelector; - constructor(options) { - this._aggregationSelector = options?.aggregationSelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_SELECTOR; - this._aggregationTemporalitySelector = options?.aggregationTemporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; - this._metricProducers = options?.metricProducers ?? []; - this._cardinalitySelector = options?.cardinalitySelector; - } - setMetricProducer(metricProducer) { - if (this._sdkMetricProducer) throw new Error("MetricReader can not be bound to a MeterProvider again."); - this._sdkMetricProducer = metricProducer; - this.onInitialized(); - } - selectAggregation(instrumentType) { - return this._aggregationSelector(instrumentType); - } - selectAggregationTemporality(instrumentType) { - return this._aggregationTemporalitySelector(instrumentType); - } - selectCardinalityLimit(instrumentType) { - return this._cardinalitySelector ? this._cardinalitySelector(instrumentType) : 2e3; - } - /** - * Handle once the SDK has initialized this {@link MetricReader} - * Overriding this method is optional. - */ - onInitialized() {} - async collect(options) { - if (this._sdkMetricProducer === void 0) throw new Error("MetricReader is not bound to a MetricProducer"); - if (this._shutdown) throw new Error("MetricReader is shutdown"); - const [sdkCollectionResults, ...additionalCollectionResults] = await Promise.all([this._sdkMetricProducer.collect({ timeoutMillis: options?.timeoutMillis }), ...this._metricProducers.map((producer) => producer.collect({ timeoutMillis: options?.timeoutMillis }))]); - const errors = sdkCollectionResults.errors.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.errors)); - return { - resourceMetrics: { - resource: sdkCollectionResults.resourceMetrics.resource, - scopeMetrics: sdkCollectionResults.resourceMetrics.scopeMetrics.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.resourceMetrics.scopeMetrics)) - }, - errors - }; - } - async shutdown(options) { - if (this._shutdown) { - api.diag.error("Cannot call shutdown twice."); - return; - } - if (options?.timeoutMillis == null) await this.onShutdown(); - else await (0, utils_1.callWithTimeout)(this.onShutdown(), options.timeoutMillis); - this._shutdown = true; - } - async forceFlush(options) { - if (this._shutdown) { - api.diag.warn("Cannot forceFlush on already shutdown MetricReader."); - return; - } - if (options?.timeoutMillis == null) { - await this.onForceFlush(); - return; - } - await (0, utils_1.callWithTimeout)(this.onForceFlush(), options.timeoutMillis); - } - }; - exports.MetricReader = MetricReader; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/PeriodicExportingMetricReader.js -var require_PeriodicExportingMetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PeriodicExportingMetricReader = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$8(); - const MetricReader_1 = require_MetricReader(); - const utils_1 = require_utils$4(); - /** - * {@link MetricReader} which collects metrics based on a user-configurable time interval, and passes the metrics to - * the configured {@link PushMetricExporter} - */ - var PeriodicExportingMetricReader = class extends MetricReader_1.MetricReader { - _interval; - _exporter; - _exportInterval; - _exportTimeout; - constructor(options) { - super({ - aggregationSelector: options.exporter.selectAggregation?.bind(options.exporter), - aggregationTemporalitySelector: options.exporter.selectAggregationTemporality?.bind(options.exporter), - metricProducers: options.metricProducers - }); - if (options.exportIntervalMillis !== void 0 && options.exportIntervalMillis <= 0) throw Error("exportIntervalMillis must be greater than 0"); - if (options.exportTimeoutMillis !== void 0 && options.exportTimeoutMillis <= 0) throw Error("exportTimeoutMillis must be greater than 0"); - if (options.exportTimeoutMillis !== void 0 && options.exportIntervalMillis !== void 0 && options.exportIntervalMillis < options.exportTimeoutMillis) throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis"); - this._exportInterval = options.exportIntervalMillis ?? 6e4; - this._exportTimeout = options.exportTimeoutMillis ?? 3e4; - this._exporter = options.exporter; - } - async _runOnce() { - try { - await (0, utils_1.callWithTimeout)(this._doRun(), this._exportTimeout); - } catch (err) { - if (err instanceof utils_1.TimeoutError) { - api.diag.error("Export took longer than %s milliseconds and timed out.", this._exportTimeout); - return; - } - (0, core_1.globalErrorHandler)(err); - } - } - async _doRun() { - const { resourceMetrics, errors } = await this.collect({ timeoutMillis: this._exportTimeout }); - if (errors.length > 0) api.diag.error("PeriodicExportingMetricReader: metrics collection errors", ...errors); - if (resourceMetrics.resource.asyncAttributesPending) try { - await resourceMetrics.resource.waitForAsyncAttributes?.(); - } catch (e) { - api.diag.debug("Error while resolving async portion of resource: ", e); - (0, core_1.globalErrorHandler)(e); - } - if (resourceMetrics.scopeMetrics.length === 0) return; - const result = await core_1.internal._export(this._exporter, resourceMetrics); - if (result.code !== core_1.ExportResultCode.SUCCESS) throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result.error})`); - } - onInitialized() { - this._interval = setInterval(() => { - this._runOnce(); - }, this._exportInterval); - (0, core_1.unrefTimer)(this._interval); - } - async onForceFlush() { - await this._runOnce(); - await this._exporter.forceFlush(); - } - async onShutdown() { - if (this._interval) clearInterval(this._interval); - await this.onForceFlush(); - await this._exporter.shutdown(); - } - }; - exports.PeriodicExportingMetricReader = PeriodicExportingMetricReader; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/InMemoryMetricExporter.js -var require_InMemoryMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.InMemoryMetricExporter = void 0; - const core_1 = require_src$8(); - /** - * In-memory Metrics Exporter is a Push Metric Exporter - * which accumulates metrics data in the local memory and - * allows to inspect it (useful for e.g. unit tests). - */ - var InMemoryMetricExporter = class { - _shutdown = false; - _aggregationTemporality; - _metrics = []; - constructor(aggregationTemporality) { - this._aggregationTemporality = aggregationTemporality; - } - /** - * @inheritedDoc - */ - export(metrics$1, resultCallback) { - if (this._shutdown) { - setTimeout(() => resultCallback({ code: core_1.ExportResultCode.FAILED }), 0); - return; - } - this._metrics.push(metrics$1); - setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); - } - /** - * Returns all the collected resource metrics - * @returns ResourceMetrics[] - */ - getMetrics() { - return this._metrics; - } - forceFlush() { - return Promise.resolve(); - } - reset() { - this._metrics = []; - } - selectAggregationTemporality(_instrumentType) { - return this._aggregationTemporality; - } - shutdown() { - this._shutdown = true; - return Promise.resolve(); - } - }; - exports.InMemoryMetricExporter = InMemoryMetricExporter; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/ConsoleMetricExporter.js -var require_ConsoleMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConsoleMetricExporter = void 0; - const core_1 = require_src$8(); - const AggregationSelector_1 = require_AggregationSelector(); - /** - * This is an implementation of {@link PushMetricExporter} that prints metrics to the - * console. This class can be used for diagnostic purposes. - * - * NOTE: This {@link PushMetricExporter} is intended for diagnostics use only, output rendered to the console may change at any time. - */ - var ConsoleMetricExporter = class ConsoleMetricExporter { - _shutdown = false; - _temporalitySelector; - constructor(options) { - this._temporalitySelector = options?.temporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; - } - export(metrics$1, resultCallback) { - if (this._shutdown) { - setImmediate(resultCallback, { code: core_1.ExportResultCode.FAILED }); - return; - } - return ConsoleMetricExporter._sendMetrics(metrics$1, resultCallback); - } - forceFlush() { - return Promise.resolve(); - } - selectAggregationTemporality(_instrumentType) { - return this._temporalitySelector(_instrumentType); - } - shutdown() { - this._shutdown = true; - return Promise.resolve(); - } - static _sendMetrics(metrics$1, done) { - for (const scopeMetrics of metrics$1.scopeMetrics) for (const metric of scopeMetrics.metrics) console.dir({ - descriptor: metric.descriptor, - dataPointType: metric.dataPointType, - dataPoints: metric.dataPoints - }, { depth: null }); - done({ code: core_1.ExportResultCode.SUCCESS }); - } - }; - exports.ConsoleMetricExporter = ConsoleMetricExporter; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js -var require_default_service_name$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = void 0; - function defaultServiceName() { - return `unknown_service:${process.argv0}`; - } - exports.defaultServiceName = defaultServiceName; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/node/index.js -var require_node$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = void 0; - var default_service_name_1 = require_default_service_name$1(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return default_service_name_1.defaultServiceName; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/index.js -var require_platform$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = void 0; - var node_1 = require_node$4(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return node_1.defaultServiceName; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/utils.js -var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.identity = exports.isPromiseLike = void 0; - const isPromiseLike = (val) => { - return val !== null && typeof val === "object" && typeof val.then === "function"; - }; - exports.isPromiseLike = isPromiseLike; - function identity(_) { - return _; - } - exports.identity = identity; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js -var require_ResourceImpl$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$8(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const platform_1 = require_platform$4(); - const utils_1 = require_utils$3(); - var ResourceImpl = class ResourceImpl { - _rawAttributes; - _asyncAttributesPending = false; - _schemaUrl; - _memoizedAttributes; - static FromAttributeList(attributes, options) { - const res = new ResourceImpl({}, options); - res._rawAttributes = guardedRawAttributes(attributes); - res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; - return res; - } - constructor(resource, options) { - const attributes = resource.attributes ?? {}; - this._rawAttributes = Object.entries(attributes).map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) this._asyncAttributesPending = true; - return [k, v]; - }); - this._rawAttributes = guardedRawAttributes(this._rawAttributes); - this._schemaUrl = validateSchemaUrl(options?.schemaUrl); - } - get asyncAttributesPending() { - return this._asyncAttributesPending; - } - async waitForAsyncAttributes() { - if (!this.asyncAttributesPending) return; - for (let i = 0; i < this._rawAttributes.length; i++) { - const [k, v] = this._rawAttributes[i]; - this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; - } - this._asyncAttributesPending = false; - } - get attributes() { - if (this.asyncAttributesPending) api_1.diag.error("Accessing resource attributes before async attributes settled"); - if (this._memoizedAttributes) return this._memoizedAttributes; - const attrs = {}; - for (const [k, v] of this._rawAttributes) { - if ((0, utils_1.isPromiseLike)(v)) { - api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); - continue; - } - if (v != null) attrs[k] ??= v; - } - if (!this._asyncAttributesPending) this._memoizedAttributes = attrs; - return attrs; - } - getRawAttributes() { - return this._rawAttributes; - } - get schemaUrl() { - return this._schemaUrl; - } - merge(resource) { - if (resource == null) return this; - const mergedSchemaUrl = mergeSchemaUrl(this, resource); - const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0; - return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); - } - }; - function resourceFromAttributes(attributes, options) { - return ResourceImpl.FromAttributeList(Object.entries(attributes), options); - } - exports.resourceFromAttributes = resourceFromAttributes; - function resourceFromDetectedResource(detectedResource, options) { - return new ResourceImpl(detectedResource, options); - } - exports.resourceFromDetectedResource = resourceFromDetectedResource; - function emptyResource() { - return resourceFromAttributes({}); - } - exports.emptyResource = emptyResource; - function defaultResource() { - return resourceFromAttributes({ - [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), - [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] - }); - } - exports.defaultResource = defaultResource; - function guardedRawAttributes(attributes) { - return attributes.map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) return [k, v.catch((err) => { - api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); - })]; - return [k, v]; - }); - } - function validateSchemaUrl(schemaUrl) { - if (typeof schemaUrl === "string" || schemaUrl === void 0) return schemaUrl; - api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); - } - function mergeSchemaUrl(old, updating) { - const oldSchemaUrl = old?.schemaUrl; - const updatingSchemaUrl = updating?.schemaUrl; - const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === ""; - const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === ""; - if (isOldEmpty) return updatingSchemaUrl; - if (isUpdatingEmpty) return oldSchemaUrl; - if (oldSchemaUrl === updatingSchemaUrl) return oldSchemaUrl; - api_1.diag.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", oldSchemaUrl, updatingSchemaUrl); - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detect-resources.js -var require_detect_resources$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.detectResources = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const ResourceImpl_1 = require_ResourceImpl$1(); - /** - * Runs all resource detectors and returns the results merged into a single Resource. - * - * @param config Configuration for resource detection - */ - const detectResources = (config$1 = {}) => { - return (config$1.detectors || []).map((d) => { - try { - const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config$1)); - api_1.diag.debug(`${d.constructor.name} found resource.`, resource); - return resource; - } catch (e) { - api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); - return (0, ResourceImpl_1.emptyResource)(); - } - }).reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); - }; - exports.detectResources = detectResources; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js -var require_EnvDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.envDetector = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const core_1 = require_src$8(); - /** - * EnvDetector can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. - */ - var EnvDetector = class { - _MAX_LENGTH = 255; - _COMMA_SEPARATOR = ","; - _LABEL_KEY_VALUE_SPLITTER = "="; - _ERROR_MESSAGE_INVALID_CHARS = "should be a ASCII string with a length greater than 0 and not exceed " + this._MAX_LENGTH + " characters."; - _ERROR_MESSAGE_INVALID_VALUE = "should be a ASCII string with a length not exceed " + this._MAX_LENGTH + " characters."; - /** - * Returns a {@link Resource} populated with attributes from the - * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async - * function to conform to the Detector interface. - * - * @param config The resource detection config - */ - detect(_config) { - const attributes = {}; - const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); - const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); - if (rawAttributes) try { - const parsedAttributes = this._parseResourceAttributes(rawAttributes); - Object.assign(attributes, parsedAttributes); - } catch (e) { - api_1.diag.debug(`EnvDetector failed: ${e.message}`); - } - if (serviceName) attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; - return { attributes }; - } - /** - * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment - * variable. - * - * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing - * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and - * paths are accepted as attribute keys. Values may be quoted or unquoted in - * general. If a value contains whitespace, =, or " characters, it must - * always be quoted. - * - * @param rawEnvAttributes The resource attributes as a comma-separated list - * of key/value pairs. - * @returns The sanitized resource attributes. - */ - _parseResourceAttributes(rawEnvAttributes) { - if (!rawEnvAttributes) return {}; - const attributes = {}; - const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); - for (const rawAttribute of rawAttributes) { - const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); - if (keyValuePair.length !== 2) continue; - let [key, value] = keyValuePair; - key = key.trim(); - value = value.trim().split(/^"|"$/).join(""); - if (!this._isValidAndNotEmpty(key)) throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); - if (!this._isValid(value)) throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); - attributes[key] = decodeURIComponent(value); - } - return attributes; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid. - */ - _isValid(name) { - return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); - } - _isBaggageOctetString(str) { - for (let i = 0; i < str.length; i++) { - const ch = str.charCodeAt(i); - if (ch < 33 || ch === 44 || ch === 59 || ch === 92 || ch > 126) return false; - } - return true; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length greater than 0 and not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid and not empty. - */ - _isValidAndNotEmpty(str) { - return str.length > 0 && this._isValid(str); - } - }; - exports.envDetector = new EnvDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js -var require_semconv$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; - /** - * The cloud account ID the resource is assigned to. - * - * @example 111111111111 - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; - /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * @example us-east-1c - * - * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; - /** - * Name of the cloud provider. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; - /** - * The geographical region the resource is running. - * - * @example us-central1 - * @example us-east-1 - * - * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_REGION = "cloud.region"; - /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. - * - * @example a3bf90e006b2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_ID = "container.id"; - /** - * Name of the image the container was built on. - * - * @example gcr.io/opentelemetry/operator - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; - /** - * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. - * - * @example ["v1.27.1", "3.5.7-0"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; - /** - * Container name used by container runtime. - * - * @example opentelemetry-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_NAME = "container.name"; - /** - * The CPU architecture the host system is running on. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ARCH = "host.arch"; - /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. - * - * @example fdbf79e8af94cb7f9e8df36789187052 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ID = "host.id"; - /** - * VM image ID or host OS image ID. For Cloud, this value is from the provider. - * - * @example ami-07b06b442921831e5 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_ID = "host.image.id"; - /** - * Name of the VM image or OS install the host was instantiated from. - * - * @example infra-ami-eks-worker-node-7d4ec78312 - * @example CentOS-8-x86_64-1905 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; - /** - * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 0.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; - /** - * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - * - * @example opentelemetry-test - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_NAME = "host.name"; - /** - * Type of host. For Cloud, this must be the machine type. - * - * @example n1-standard-1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_TYPE = "host.type"; - /** - * The name of the cluster. - * - * @example opentelemetry-cluster - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; - /** - * The name of the Deployment. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; - /** - * The name of the namespace that the pod is running in. - * - * @example default - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; - /** - * The name of the Pod. - * - * @example opentelemetry-pod-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; - /** - * The operating system type. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OS_TYPE = "os.type"; - /** - * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 14.2.1 - * @example 18.04.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OS_VERSION = "os.version"; - /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - * - * @example cmd/otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_COMMAND = "process.command"; - /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - * - * @example ["cmd/otecol", "--config=config.yaml"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; - /** - * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`. - * - * @example otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; - /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - * - * @example /usr/bin/cmd/otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; - /** - * The username of the user that owns the process. - * - * @example root - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_OWNER = "process.owner"; - /** - * Process identifier (PID). - * - * @example 1234 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_PID = "process.pid"; - /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - * - * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; - /** - * The name of the runtime of this process. - * - * @example OpenJDK Runtime Environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; - /** - * The version of the runtime of this process, as returned by the runtime without modification. - * - * @example "14.0.2" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; - /** - * The string ID of the service instance. - * - * @example 627cc493-f310-47de-96bd-71410b7dec09 - * - * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words - * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to - * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled - * service). - * - * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC - * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of - * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and - * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. - * - * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is - * needed. Similar to what can be seen in the man page for the - * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying - * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it - * or not via another resource attribute. - * - * For applications running behind an application server (like unicorn), we do not recommend using one identifier - * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker - * thread in unicorn) to have its own instance.id. - * - * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the - * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will - * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. - * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance - * for that telemetry. This is typically the case for scraping receivers, as they know the target address and - * port. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; - /** - * A namespace for `service.name`. - * - * @example Shop - * - * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; - /** - * Additional description of the web engine (e.g. detailed version and edition information). - * - * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; - /** - * The name of the web engine. - * - * @example WildFly - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_NAME = "webengine.name"; - /** - * The version of the web engine. - * - * @example 21.0.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_VERSION = "webengine.version"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js -var require_execAsync$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.execAsync = void 0; - const child_process$1 = __require("child_process"); - const util$1 = __require("util"); - exports.execAsync = util$1.promisify(child_process$1.exec); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js -var require_getMachineId_darwin$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const execAsync_1 = require_execAsync$1(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID")); - if (!idLine) return; - const parts = idLine.split("\" = \""); - if (parts.length === 2) return parts[1].slice(0, -1); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js -var require_getMachineId_linux$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1$3 = __require("fs"); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - for (const path$1 of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try { - return (await fs_1$3.promises.readFile(path$1, { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js -var require_getMachineId_bsd$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1$2 = __require("fs"); - const execAsync_1 = require_execAsync$1(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - return (await fs_1$2.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - try { - return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js -var require_getMachineId_win$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$4 = __require("process"); - const execAsync_1 = require_execAsync$1(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; - let command = "%windir%\\System32\\REG.exe"; - if (process$4.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process$4.env) command = "%windir%\\sysnative\\cmd.exe /c " + command; - try { - const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ"); - if (parts.length === 2) return parts[1].trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js -var require_getMachineId_unsupported$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - api_1.diag.debug("could not read machine-id: unsupported platform"); - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js -var require_getMachineId$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$3 = __require("process"); - let getMachineIdImpl; - async function getMachineId() { - if (!getMachineIdImpl) switch (process$3.platform) { - case "darwin": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_darwin$1()))).getMachineId; - break; - case "linux": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_linux$1()))).getMachineId; - break; - case "freebsd": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_bsd$1()))).getMachineId; - break; - case "win32": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_win$1()))).getMachineId; - break; - default: - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_unsupported$1()))).getMachineId; - break; - } - return getMachineIdImpl(); - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js -var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeType = exports.normalizeArch = void 0; - const normalizeArch = (nodeArchString) => { - switch (nodeArchString) { - case "arm": return "arm32"; - case "ppc": return "ppc32"; - case "x64": return "amd64"; - default: return nodeArchString; - } - }; - exports.normalizeArch = normalizeArch; - const normalizeType = (nodePlatform) => { - switch (nodePlatform) { - case "sunos": return "solaris"; - case "win32": return "windows"; - default: return nodePlatform; - } - }; - exports.normalizeType = normalizeType; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js -var require_HostDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hostDetector = void 0; - const semconv_1 = require_semconv$2(); - const os_1$3 = __require("os"); - const getMachineId_1 = require_getMachineId$1(); - const utils_1 = require_utils$2(); - /** - * HostDetector detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ - var HostDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_HOST_NAME]: (0, os_1$3.hostname)(), - [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1$3.arch)()), - [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() - } }; - } - }; - exports.hostDetector = new HostDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js -var require_OSDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.osDetector = void 0; - const semconv_1 = require_semconv$2(); - const os_1$2 = __require("os"); - const utils_1 = require_utils$2(); - /** - * OSDetector detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ - var OSDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1$2.platform)()), - [semconv_1.ATTR_OS_VERSION]: (0, os_1$2.release)() - } }; - } - }; - exports.osDetector = new OSDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js -var require_ProcessDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.processDetector = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semconv_1 = require_semconv$2(); - const os$1 = __require("os"); - /** - * ProcessDetector will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. - */ - var ProcessDetector = class { - detect(_config) { - const attributes = { - [semconv_1.ATTR_PROCESS_PID]: process.pid, - [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, - [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, - [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ - process.argv[0], - ...process.execArgv, - ...process.argv.slice(1) - ], - [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, - [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", - [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" - }; - if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; - try { - const userInfo = os$1.userInfo(); - attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; - } catch (e) { - api_1.diag.debug(`error obtaining process owner: ${e}`); - } - return { attributes }; - } - }; - exports.processDetector = new ProcessDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js -var require_ServiceInstanceIdDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = void 0; - const semconv_1 = require_semconv$2(); - const crypto_1$1 = __require("crypto"); - /** - * ServiceInstanceIdDetector detects the resources related to the service instance ID. - */ - var ServiceInstanceIdDetector = class { - detect(_config) { - return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1$1.randomUUID)() } }; - } - }; - /** - * @experimental - */ - exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js -var require_node$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var HostDetector_1 = require_HostDetector$1(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return HostDetector_1.hostDetector; - } - }); - var OSDetector_1 = require_OSDetector$1(); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return OSDetector_1.osDetector; - } - }); - var ProcessDetector_1 = require_ProcessDetector$1(); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return ProcessDetector_1.processDetector; - } - }); - var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector$1(); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js -var require_platform$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var node_1 = require_node$3(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return node_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return node_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return node_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return node_1.serviceInstanceIdDetector; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js -var require_NoopDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.NoopDetector = void 0; - var NoopDetector = class { - detect() { - return { attributes: {} }; - } - }; - exports.NoopDetector = NoopDetector; - exports.noopDetector = new NoopDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/index.js -var require_detectors$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; - var EnvDetector_1 = require_EnvDetector$1(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return EnvDetector_1.envDetector; - } - }); - var platform_1 = require_platform$3(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return platform_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return platform_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return platform_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return platform_1.serviceInstanceIdDetector; - } - }); - var NoopDetector_1 = require_NoopDetector$1(); - Object.defineProperty(exports, "noopDetector", { - enumerable: true, - get: function() { - return NoopDetector_1.noopDetector; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/index.js -var require_src$7 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0; - var detect_resources_1 = require_detect_resources$1(); - Object.defineProperty(exports, "detectResources", { - enumerable: true, - get: function() { - return detect_resources_1.detectResources; - } - }); - var detectors_1 = require_detectors$1(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return detectors_1.envDetector; - } - }); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return detectors_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return detectors_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return detectors_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return detectors_1.serviceInstanceIdDetector; - } - }); - var ResourceImpl_1 = require_ResourceImpl$1(); - Object.defineProperty(exports, "resourceFromAttributes", { - enumerable: true, - get: function() { - return ResourceImpl_1.resourceFromAttributes; - } - }); - Object.defineProperty(exports, "defaultResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.defaultResource; - } - }); - Object.defineProperty(exports, "emptyResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.emptyResource; - } - }); - var platform_1 = require_platform$4(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return platform_1.defaultServiceName; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/ViewRegistry.js -var require_ViewRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ViewRegistry = void 0; - var ViewRegistry = class { - _registeredViews = []; - addView(view) { - this._registeredViews.push(view); - } - findViews(instrument, meter) { - return this._registeredViews.filter((registeredView) => { - return this._matchInstrument(registeredView.instrumentSelector, instrument) && this._matchMeter(registeredView.meterSelector, meter); - }); - } - _matchInstrument(selector, instrument) { - return (selector.getType() === void 0 || instrument.type === selector.getType()) && selector.getNameFilter().match(instrument.name) && selector.getUnitFilter().match(instrument.unit); - } - _matchMeter(selector, meter) { - return selector.getNameFilter().match(meter.name) && (meter.version === void 0 || selector.getVersionFilter().match(meter.version)) && (meter.schemaUrl === void 0 || selector.getSchemaUrlFilter().match(meter.schemaUrl)); - } - }; - exports.ViewRegistry = ViewRegistry; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js -var require_InstrumentDescriptor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isValidName = exports.isDescriptorCompatibleWith = exports.createInstrumentDescriptorWithView = exports.createInstrumentDescriptor = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const utils_1 = require_utils$4(); - function createInstrumentDescriptor(name, type, options) { - if (!isValidName(name)) api_1.diag.warn(`Invalid metric name: "${name}". The metric name should be a ASCII string with a length no greater than 255 characters.`); - return { - name, - type, - description: options?.description ?? "", - unit: options?.unit ?? "", - valueType: options?.valueType ?? api_1.ValueType.DOUBLE, - advice: options?.advice ?? {} - }; - } - exports.createInstrumentDescriptor = createInstrumentDescriptor; - function createInstrumentDescriptorWithView(view, instrument) { - return { - name: view.name ?? instrument.name, - description: view.description ?? instrument.description, - type: instrument.type, - unit: instrument.unit, - valueType: instrument.valueType, - advice: instrument.advice - }; - } - exports.createInstrumentDescriptorWithView = createInstrumentDescriptorWithView; - function isDescriptorCompatibleWith(descriptor, otherDescriptor) { - return (0, utils_1.equalsCaseInsensitive)(descriptor.name, otherDescriptor.name) && descriptor.unit === otherDescriptor.unit && descriptor.type === otherDescriptor.type && descriptor.valueType === otherDescriptor.valueType; - } - exports.isDescriptorCompatibleWith = isDescriptorCompatibleWith; - const NAME_REGEXP = /^[a-z][a-z0-9_.\-/]{0,254}$/i; - function isValidName(name) { - return name.match(NAME_REGEXP) != null; - } - exports.isValidName = isValidName; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Instruments.js -var require_Instruments = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isObservableInstrument = exports.ObservableUpDownCounterInstrument = exports.ObservableGaugeInstrument = exports.ObservableCounterInstrument = exports.ObservableInstrument = exports.HistogramInstrument = exports.GaugeInstrument = exports.CounterInstrument = exports.UpDownCounterInstrument = exports.SyncInstrument = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$8(); - var SyncInstrument = class { - _writableMetricStorage; - _descriptor; - constructor(_writableMetricStorage, _descriptor) { - this._writableMetricStorage = _writableMetricStorage; - this._descriptor = _descriptor; - } - _record(value, attributes = {}, context$1 = api_1.context.active()) { - if (typeof value !== "number") { - api_1.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${value}`); - return; - } - if (this._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { - api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`); - value = Math.trunc(value); - if (!Number.isInteger(value)) return; - } - this._writableMetricStorage.record(value, attributes, context$1, (0, core_1.millisToHrTime)(Date.now())); - } - }; - exports.SyncInstrument = SyncInstrument; - /** - * The class implements {@link UpDownCounter} interface. - */ - var UpDownCounterInstrument = class extends SyncInstrument { - /** - * Increment value of counter by the input. Inputs may be negative. - */ - add(value, attributes, ctx) { - this._record(value, attributes, ctx); - } - }; - exports.UpDownCounterInstrument = UpDownCounterInstrument; - /** - * The class implements {@link Counter} interface. - */ - var CounterInstrument = class extends SyncInstrument { - /** - * Increment value of counter by the input. Inputs may not be negative. - */ - add(value, attributes, ctx) { - if (value < 0) { - api_1.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${value}`); - return; - } - this._record(value, attributes, ctx); - } - }; - exports.CounterInstrument = CounterInstrument; - /** - * The class implements {@link Gauge} interface. - */ - var GaugeInstrument = class extends SyncInstrument { - /** - * Records a measurement. - */ - record(value, attributes, ctx) { - this._record(value, attributes, ctx); - } - }; - exports.GaugeInstrument = GaugeInstrument; - /** - * The class implements {@link Histogram} interface. - */ - var HistogramInstrument = class extends SyncInstrument { - /** - * Records a measurement. Value of the measurement must not be negative. - */ - record(value, attributes, ctx) { - if (value < 0) { - api_1.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${value}`); - return; - } - this._record(value, attributes, ctx); - } - }; - exports.HistogramInstrument = HistogramInstrument; - var ObservableInstrument = class { - _observableRegistry; - /** @internal */ - _metricStorages; - /** @internal */ - _descriptor; - constructor(descriptor, metricStorages, _observableRegistry) { - this._observableRegistry = _observableRegistry; - this._descriptor = descriptor; - this._metricStorages = metricStorages; - } - /** - * @see {Observable.addCallback} - */ - addCallback(callback) { - this._observableRegistry.addCallback(callback, this); - } - /** - * @see {Observable.removeCallback} - */ - removeCallback(callback) { - this._observableRegistry.removeCallback(callback, this); - } - }; - exports.ObservableInstrument = ObservableInstrument; - var ObservableCounterInstrument = class extends ObservableInstrument {}; - exports.ObservableCounterInstrument = ObservableCounterInstrument; - var ObservableGaugeInstrument = class extends ObservableInstrument {}; - exports.ObservableGaugeInstrument = ObservableGaugeInstrument; - var ObservableUpDownCounterInstrument = class extends ObservableInstrument {}; - exports.ObservableUpDownCounterInstrument = ObservableUpDownCounterInstrument; - function isObservableInstrument(it) { - return it instanceof ObservableInstrument; - } - exports.isObservableInstrument = isObservableInstrument; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Meter.js -var require_Meter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Meter = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); - const Instruments_1 = require_Instruments(); - const MetricData_1 = require_MetricData(); - /** - * This class implements the {@link IMeter} interface. - */ - var Meter = class { - _meterSharedState; - constructor(_meterSharedState) { - this._meterSharedState = _meterSharedState; - } - /** - * Create a {@link Gauge} instrument. - */ - createGauge(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.GAUGE, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.GaugeInstrument(storage, descriptor); - } - /** - * Create a {@link Histogram} instrument. - */ - createHistogram(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.HISTOGRAM, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.HistogramInstrument(storage, descriptor); - } - /** - * Create a {@link Counter} instrument. - */ - createCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.COUNTER, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.CounterInstrument(storage, descriptor); - } - /** - * Create a {@link UpDownCounter} instrument. - */ - createUpDownCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.UP_DOWN_COUNTER, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.UpDownCounterInstrument(storage, descriptor); - } - /** - * Create a {@link ObservableGauge} instrument. - */ - createObservableGauge(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_GAUGE, options); - const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); - return new Instruments_1.ObservableGaugeInstrument(descriptor, storages, this._meterSharedState.observableRegistry); - } - /** - * Create a {@link ObservableCounter} instrument. - */ - createObservableCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_COUNTER, options); - const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); - return new Instruments_1.ObservableCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); - } - /** - * Create a {@link ObservableUpDownCounter} instrument. - */ - createObservableUpDownCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER, options); - const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); - return new Instruments_1.ObservableUpDownCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); - } - /** - * @see {@link Meter.addBatchObservableCallback} - */ - addBatchObservableCallback(callback, observables) { - this._meterSharedState.observableRegistry.addBatchCallback(callback, observables); - } - /** - * @see {@link Meter.removeBatchObservableCallback} - */ - removeBatchObservableCallback(callback, observables) { - this._meterSharedState.observableRegistry.removeBatchCallback(callback, observables); - } - }; - exports.Meter = Meter; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorage.js -var require_MetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricStorage = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); - /** - * Internal interface. - * - * Represents a storage from which we can collect metrics. - */ - var MetricStorage = class { - _instrumentDescriptor; - constructor(_instrumentDescriptor) { - this._instrumentDescriptor = _instrumentDescriptor; - } - getInstrumentDescriptor() { - return this._instrumentDescriptor; - } - updateDescription(description) { - this._instrumentDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(this._instrumentDescriptor.name, this._instrumentDescriptor.type, { - description, - valueType: this._instrumentDescriptor.valueType, - unit: this._instrumentDescriptor.unit, - advice: this._instrumentDescriptor.advice - }); - } - }; - exports.MetricStorage = MetricStorage; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/HashMap.js -var require_HashMap = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AttributeHashMap = exports.HashMap = void 0; - const utils_1 = require_utils$4(); - var HashMap = class { - _hash; - _valueMap = /* @__PURE__ */ new Map(); - _keyMap = /* @__PURE__ */ new Map(); - constructor(_hash) { - this._hash = _hash; - } - get(key, hashCode) { - hashCode ??= this._hash(key); - return this._valueMap.get(hashCode); - } - getOrDefault(key, defaultFactory) { - const hash = this._hash(key); - if (this._valueMap.has(hash)) return this._valueMap.get(hash); - const val = defaultFactory(); - if (!this._keyMap.has(hash)) this._keyMap.set(hash, key); - this._valueMap.set(hash, val); - return val; - } - set(key, value, hashCode) { - hashCode ??= this._hash(key); - if (!this._keyMap.has(hashCode)) this._keyMap.set(hashCode, key); - this._valueMap.set(hashCode, value); - } - has(key, hashCode) { - hashCode ??= this._hash(key); - return this._valueMap.has(hashCode); - } - *keys() { - const keyIterator = this._keyMap.entries(); - let next = keyIterator.next(); - while (next.done !== true) { - yield [next.value[1], next.value[0]]; - next = keyIterator.next(); - } - } - *entries() { - const valueIterator = this._valueMap.entries(); - let next = valueIterator.next(); - while (next.done !== true) { - yield [ - this._keyMap.get(next.value[0]), - next.value[1], - next.value[0] - ]; - next = valueIterator.next(); - } - } - get size() { - return this._valueMap.size; - } - }; - exports.HashMap = HashMap; - var AttributeHashMap = class extends HashMap { - constructor() { - super(utils_1.hashAttributes); - } - }; - exports.AttributeHashMap = AttributeHashMap; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/DeltaMetricProcessor.js -var require_DeltaMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DeltaMetricProcessor = void 0; - const utils_1 = require_utils$4(); - const HashMap_1 = require_HashMap(); - /** - * Internal interface. - * - * Allows synchronous collection of metrics. This processor should allow - * allocation of new aggregation cells for metrics and convert cumulative - * recording to delta data points. - */ - var DeltaMetricProcessor = class { - _aggregator; - _activeCollectionStorage = new HashMap_1.AttributeHashMap(); - _cumulativeMemoStorage = new HashMap_1.AttributeHashMap(); - _cardinalityLimit; - _overflowAttributes = { "otel.metric.overflow": true }; - _overflowHashCode; - constructor(_aggregator, aggregationCardinalityLimit) { - this._aggregator = _aggregator; - this._cardinalityLimit = (aggregationCardinalityLimit ?? 2e3) - 1; - this._overflowHashCode = (0, utils_1.hashAttributes)(this._overflowAttributes); - } - record(value, attributes, _context, collectionTime) { - let accumulation = this._activeCollectionStorage.get(attributes); - if (!accumulation) { - if (this._activeCollectionStorage.size >= this._cardinalityLimit) { - this._activeCollectionStorage.getOrDefault(this._overflowAttributes, () => this._aggregator.createAccumulation(collectionTime))?.record(value); - return; - } - accumulation = this._aggregator.createAccumulation(collectionTime); - this._activeCollectionStorage.set(attributes, accumulation); - } - accumulation?.record(value); - } - batchCumulate(measurements, collectionTime) { - Array.from(measurements.entries()).forEach(([attributes, value, hashCode]) => { - const accumulation = this._aggregator.createAccumulation(collectionTime); - accumulation?.record(value); - let delta = accumulation; - if (this._cumulativeMemoStorage.has(attributes, hashCode)) { - const previous = this._cumulativeMemoStorage.get(attributes, hashCode); - delta = this._aggregator.diff(previous, accumulation); - } else if (this._cumulativeMemoStorage.size >= this._cardinalityLimit) { - attributes = this._overflowAttributes; - hashCode = this._overflowHashCode; - if (this._cumulativeMemoStorage.has(attributes, hashCode)) { - const previous = this._cumulativeMemoStorage.get(attributes, hashCode); - delta = this._aggregator.diff(previous, accumulation); - } - } - if (this._activeCollectionStorage.has(attributes, hashCode)) { - const active = this._activeCollectionStorage.get(attributes, hashCode); - delta = this._aggregator.merge(active, delta); - } - this._cumulativeMemoStorage.set(attributes, accumulation, hashCode); - this._activeCollectionStorage.set(attributes, delta, hashCode); - }); - } - /** - * Returns a collection of delta metrics. Start time is the when first - * time event collected. - */ - collect() { - const unreportedDelta = this._activeCollectionStorage; - this._activeCollectionStorage = new HashMap_1.AttributeHashMap(); - return unreportedDelta; - } - }; - exports.DeltaMetricProcessor = DeltaMetricProcessor; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/TemporalMetricProcessor.js -var require_TemporalMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TemporalMetricProcessor = void 0; - const AggregationTemporality_1 = require_AggregationTemporality(); - const HashMap_1 = require_HashMap(); - /** - * Internal interface. - * - * Provides unique reporting for each collector. Allows synchronous collection - * of metrics and reports given temporality values. - */ - var TemporalMetricProcessor = class TemporalMetricProcessor { - _aggregator; - _unreportedAccumulations = /* @__PURE__ */ new Map(); - _reportHistory = /* @__PURE__ */ new Map(); - constructor(_aggregator, collectorHandles) { - this._aggregator = _aggregator; - collectorHandles.forEach((handle) => { - this._unreportedAccumulations.set(handle, []); - }); - } - /** - * Builds the {@link MetricData} streams to report against a specific MetricCollector. - * @param collector The information of the MetricCollector. - * @param collectors The registered collectors. - * @param instrumentDescriptor The instrumentation descriptor that these metrics generated with. - * @param currentAccumulations The current accumulation of metric data from instruments. - * @param collectionTime The current collection timestamp. - * @returns The {@link MetricData} points or `null`. - */ - buildMetrics(collector, instrumentDescriptor, currentAccumulations, collectionTime) { - this._stashAccumulations(currentAccumulations); - const unreportedAccumulations = this._getMergedUnreportedAccumulations(collector); - let result = unreportedAccumulations; - let aggregationTemporality; - if (this._reportHistory.has(collector)) { - const last = this._reportHistory.get(collector); - const lastCollectionTime = last.collectionTime; - aggregationTemporality = last.aggregationTemporality; - if (aggregationTemporality === AggregationTemporality_1.AggregationTemporality.CUMULATIVE) result = TemporalMetricProcessor.merge(last.accumulations, unreportedAccumulations, this._aggregator); - else result = TemporalMetricProcessor.calibrateStartTime(last.accumulations, unreportedAccumulations, lastCollectionTime); - } else aggregationTemporality = collector.selectAggregationTemporality(instrumentDescriptor.type); - this._reportHistory.set(collector, { - accumulations: result, - collectionTime, - aggregationTemporality - }); - const accumulationRecords = AttributesMapToAccumulationRecords(result); - if (accumulationRecords.length === 0) return; - return this._aggregator.toMetricData(instrumentDescriptor, aggregationTemporality, accumulationRecords, collectionTime); - } - _stashAccumulations(currentAccumulation) { - const registeredCollectors = this._unreportedAccumulations.keys(); - for (const collector of registeredCollectors) { - let stash = this._unreportedAccumulations.get(collector); - if (stash === void 0) { - stash = []; - this._unreportedAccumulations.set(collector, stash); - } - stash.push(currentAccumulation); - } - } - _getMergedUnreportedAccumulations(collector) { - let result = new HashMap_1.AttributeHashMap(); - const unreportedList = this._unreportedAccumulations.get(collector); - this._unreportedAccumulations.set(collector, []); - if (unreportedList === void 0) return result; - for (const it of unreportedList) result = TemporalMetricProcessor.merge(result, it, this._aggregator); - return result; - } - static merge(last, current, aggregator) { - const result = last; - const iterator = current.entries(); - let next = iterator.next(); - while (next.done !== true) { - const [key, record$1, hash] = next.value; - if (last.has(key, hash)) { - const lastAccumulation = last.get(key, hash); - const accumulation = aggregator.merge(lastAccumulation, record$1); - result.set(key, accumulation, hash); - } else result.set(key, record$1, hash); - next = iterator.next(); - } - return result; - } - /** - * Calibrate the reported metric streams' startTime to lastCollectionTime. Leaves - * the new stream to be the initial observation time unchanged. - */ - static calibrateStartTime(last, current, lastCollectionTime) { - for (const [key, hash] of last.keys()) current.get(key, hash)?.setStartTime(lastCollectionTime); - return current; - } - }; - exports.TemporalMetricProcessor = TemporalMetricProcessor; - function AttributesMapToAccumulationRecords(map) { - return Array.from(map.entries()); - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/AsyncMetricStorage.js -var require_AsyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AsyncMetricStorage = void 0; - const MetricStorage_1 = require_MetricStorage(); - const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); - const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); - const HashMap_1 = require_HashMap(); - /** - * Internal interface. - * - * Stores and aggregates {@link MetricData} for asynchronous instruments. - */ - var AsyncMetricStorage = class extends MetricStorage_1.MetricStorage { - _attributesProcessor; - _aggregationCardinalityLimit; - _deltaMetricStorage; - _temporalMetricStorage; - constructor(_instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { - super(_instrumentDescriptor); - this._attributesProcessor = _attributesProcessor; - this._aggregationCardinalityLimit = _aggregationCardinalityLimit; - this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); - this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); - } - record(measurements, observationTime) { - const processed = new HashMap_1.AttributeHashMap(); - Array.from(measurements.entries()).forEach(([attributes, value]) => { - processed.set(this._attributesProcessor.process(attributes), value); - }); - this._deltaMetricStorage.batchCumulate(processed, observationTime); - } - /** - * Collects the metrics from this storage. The ObservableCallback is invoked - * during the collection. - * - * Note: This is a stateful operation and may reset any interval-related - * state for the MetricCollector. - */ - collect(collector, collectionTime) { - const accumulations = this._deltaMetricStorage.collect(); - return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); - } - }; - exports.AsyncMetricStorage = AsyncMetricStorage; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/RegistrationConflicts.js -var require_RegistrationConflicts = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getConflictResolutionRecipe = exports.getDescriptionResolutionRecipe = exports.getTypeConflictResolutionRecipe = exports.getUnitConflictResolutionRecipe = exports.getValueTypeConflictResolutionRecipe = exports.getIncompatibilityDetails = void 0; - function getIncompatibilityDetails(existing, otherDescriptor) { - let incompatibility = ""; - if (existing.unit !== otherDescriptor.unit) incompatibility += `\t- Unit '${existing.unit}' does not match '${otherDescriptor.unit}'\n`; - if (existing.type !== otherDescriptor.type) incompatibility += `\t- Type '${existing.type}' does not match '${otherDescriptor.type}'\n`; - if (existing.valueType !== otherDescriptor.valueType) incompatibility += `\t- Value Type '${existing.valueType}' does not match '${otherDescriptor.valueType}'\n`; - if (existing.description !== otherDescriptor.description) incompatibility += `\t- Description '${existing.description}' does not match '${otherDescriptor.description}'\n`; - return incompatibility; - } - exports.getIncompatibilityDetails = getIncompatibilityDetails; - function getValueTypeConflictResolutionRecipe(existing, otherDescriptor) { - return `\t- use valueType '${existing.valueType}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; - } - exports.getValueTypeConflictResolutionRecipe = getValueTypeConflictResolutionRecipe; - function getUnitConflictResolutionRecipe(existing, otherDescriptor) { - return `\t- use unit '${existing.unit}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; - } - exports.getUnitConflictResolutionRecipe = getUnitConflictResolutionRecipe; - function getTypeConflictResolutionRecipe(existing, otherDescriptor) { - const selector = { - name: otherDescriptor.name, - type: otherDescriptor.type, - unit: otherDescriptor.unit - }; - const selectorString = JSON.stringify(selector); - return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}'`; - } - exports.getTypeConflictResolutionRecipe = getTypeConflictResolutionRecipe; - function getDescriptionResolutionRecipe(existing, otherDescriptor) { - const selector = { - name: otherDescriptor.name, - type: otherDescriptor.type, - unit: otherDescriptor.unit - }; - const selectorString = JSON.stringify(selector); - return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}' - \t- OR - create a new view with the name ${existing.name} and description '${existing.description}' and InstrumentSelector ${selectorString} - \t- OR - create a new view with the name ${otherDescriptor.name} and description '${existing.description}' and InstrumentSelector ${selectorString}`; - } - exports.getDescriptionResolutionRecipe = getDescriptionResolutionRecipe; - function getConflictResolutionRecipe(existing, otherDescriptor) { - if (existing.valueType !== otherDescriptor.valueType) return getValueTypeConflictResolutionRecipe(existing, otherDescriptor); - if (existing.unit !== otherDescriptor.unit) return getUnitConflictResolutionRecipe(existing, otherDescriptor); - if (existing.type !== otherDescriptor.type) return getTypeConflictResolutionRecipe(existing, otherDescriptor); - if (existing.description !== otherDescriptor.description) return getDescriptionResolutionRecipe(existing, otherDescriptor); - return ""; - } - exports.getConflictResolutionRecipe = getConflictResolutionRecipe; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorageRegistry.js -var require_MetricStorageRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricStorageRegistry = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const RegistrationConflicts_1 = require_RegistrationConflicts(); - /** - * Internal class for storing {@link MetricStorage} - */ - var MetricStorageRegistry = class MetricStorageRegistry { - _sharedRegistry = /* @__PURE__ */ new Map(); - _perCollectorRegistry = /* @__PURE__ */ new Map(); - static create() { - return new MetricStorageRegistry(); - } - getStorages(collector) { - let storages = []; - for (const metricStorages of this._sharedRegistry.values()) storages = storages.concat(metricStorages); - const perCollectorStorages = this._perCollectorRegistry.get(collector); - if (perCollectorStorages != null) for (const metricStorages of perCollectorStorages.values()) storages = storages.concat(metricStorages); - return storages; - } - register(storage) { - this._registerStorage(storage, this._sharedRegistry); - } - registerForCollector(collector, storage) { - let storageMap = this._perCollectorRegistry.get(collector); - if (storageMap == null) { - storageMap = /* @__PURE__ */ new Map(); - this._perCollectorRegistry.set(collector, storageMap); - } - this._registerStorage(storage, storageMap); - } - findOrUpdateCompatibleStorage(expectedDescriptor) { - const storages = this._sharedRegistry.get(expectedDescriptor.name); - if (storages === void 0) return null; - return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); - } - findOrUpdateCompatibleCollectorStorage(collector, expectedDescriptor) { - const storageMap = this._perCollectorRegistry.get(collector); - if (storageMap === void 0) return null; - const storages = storageMap.get(expectedDescriptor.name); - if (storages === void 0) return null; - return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); - } - _registerStorage(storage, storageMap) { - const descriptor = storage.getInstrumentDescriptor(); - const storages = storageMap.get(descriptor.name); - if (storages === void 0) { - storageMap.set(descriptor.name, [storage]); - return; - } - storages.push(storage); - } - _findOrUpdateCompatibleStorage(expectedDescriptor, existingStorages) { - let compatibleStorage = null; - for (const existingStorage of existingStorages) { - const existingDescriptor = existingStorage.getInstrumentDescriptor(); - if ((0, InstrumentDescriptor_1.isDescriptorCompatibleWith)(existingDescriptor, expectedDescriptor)) { - if (existingDescriptor.description !== expectedDescriptor.description) { - if (expectedDescriptor.description.length > existingDescriptor.description.length) existingStorage.updateDescription(expectedDescriptor.description); - api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered, but has a different description and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "The longer description will be used.\nTo resolve the conflict:", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); - } - compatibleStorage = existingStorage; - } else api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "To resolve the conflict:\n", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); - } - return compatibleStorage; - } - }; - exports.MetricStorageRegistry = MetricStorageRegistry; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MultiWritableMetricStorage.js -var require_MultiWritableMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MultiMetricStorage = void 0; - /** - * Internal interface. - */ - var MultiMetricStorage = class { - _backingStorages; - constructor(_backingStorages) { - this._backingStorages = _backingStorages; - } - record(value, attributes, context$1, recordTime) { - this._backingStorages.forEach((it) => { - it.record(value, attributes, context$1, recordTime); - }); - } - }; - exports.MultiMetricStorage = MultiMetricStorage; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/ObservableResult.js -var require_ObservableResult = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BatchObservableResultImpl = exports.ObservableResultImpl = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const HashMap_1 = require_HashMap(); - const Instruments_1 = require_Instruments(); - /** - * The class implements {@link ObservableResult} interface. - */ - var ObservableResultImpl = class { - _instrumentName; - _valueType; - /** - * @internal - */ - _buffer = new HashMap_1.AttributeHashMap(); - constructor(_instrumentName, _valueType) { - this._instrumentName = _instrumentName; - this._valueType = _valueType; - } - /** - * Observe a measurement of the value associated with the given attributes. - */ - observe(value, attributes = {}) { - if (typeof value !== "number") { - api_1.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${value}`); - return; - } - if (this._valueType === api_1.ValueType.INT && !Number.isInteger(value)) { - api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`); - value = Math.trunc(value); - if (!Number.isInteger(value)) return; - } - this._buffer.set(attributes, value); - } - }; - exports.ObservableResultImpl = ObservableResultImpl; - /** - * The class implements {@link BatchObservableCallback} interface. - */ - var BatchObservableResultImpl = class { - /** - * @internal - */ - _buffer = /* @__PURE__ */ new Map(); - /** - * Observe a measurement of the value associated with the given attributes. - */ - observe(metric, value, attributes = {}) { - if (!(0, Instruments_1.isObservableInstrument)(metric)) return; - let map = this._buffer.get(metric); - if (map == null) { - map = new HashMap_1.AttributeHashMap(); - this._buffer.set(metric, map); - } - if (typeof value !== "number") { - api_1.diag.warn(`non-number value provided to metric ${metric._descriptor.name}: ${value}`); - return; - } - if (metric._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { - api_1.diag.warn(`INT value type cannot accept a floating-point value for ${metric._descriptor.name}, ignoring the fractional digits.`); - value = Math.trunc(value); - if (!Number.isInteger(value)) return; - } - map.set(attributes, value); - } - }; - exports.BatchObservableResultImpl = BatchObservableResultImpl; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/ObservableRegistry.js -var require_ObservableRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ObservableRegistry = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const Instruments_1 = require_Instruments(); - const ObservableResult_1 = require_ObservableResult(); - const utils_1 = require_utils$4(); - /** - * An internal interface for managing ObservableCallbacks. - * - * Every registered callback associated with a set of instruments are be evaluated - * exactly once during collection prior to reading data for that instrument. - */ - var ObservableRegistry = class { - _callbacks = []; - _batchCallbacks = []; - addCallback(callback, instrument) { - if (this._findCallback(callback, instrument) >= 0) return; - this._callbacks.push({ - callback, - instrument - }); - } - removeCallback(callback, instrument) { - const idx = this._findCallback(callback, instrument); - if (idx < 0) return; - this._callbacks.splice(idx, 1); - } - addBatchCallback(callback, instruments) { - const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); - if (observableInstruments.size === 0) { - api_1.diag.error("BatchObservableCallback is not associated with valid instruments", instruments); - return; - } - if (this._findBatchCallback(callback, observableInstruments) >= 0) return; - this._batchCallbacks.push({ - callback, - instruments: observableInstruments - }); - } - removeBatchCallback(callback, instruments) { - const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); - const idx = this._findBatchCallback(callback, observableInstruments); - if (idx < 0) return; - this._batchCallbacks.splice(idx, 1); - } - /** - * @returns a promise of rejected reasons for invoking callbacks. - */ - async observe(collectionTime, timeoutMillis) { - const callbackFutures = this._observeCallbacks(collectionTime, timeoutMillis); - const batchCallbackFutures = this._observeBatchCallbacks(collectionTime, timeoutMillis); - return (await (0, utils_1.PromiseAllSettled)([...callbackFutures, ...batchCallbackFutures])).filter(utils_1.isPromiseAllSettledRejectionResult).map((it) => it.reason); - } - _observeCallbacks(observationTime, timeoutMillis) { - return this._callbacks.map(async ({ callback, instrument }) => { - const observableResult = new ObservableResult_1.ObservableResultImpl(instrument._descriptor.name, instrument._descriptor.valueType); - let callPromise = Promise.resolve(callback(observableResult)); - if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); - await callPromise; - instrument._metricStorages.forEach((metricStorage) => { - metricStorage.record(observableResult._buffer, observationTime); - }); - }); - } - _observeBatchCallbacks(observationTime, timeoutMillis) { - return this._batchCallbacks.map(async ({ callback, instruments }) => { - const observableResult = new ObservableResult_1.BatchObservableResultImpl(); - let callPromise = Promise.resolve(callback(observableResult)); - if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); - await callPromise; - instruments.forEach((instrument) => { - const buffer = observableResult._buffer.get(instrument); - if (buffer == null) return; - instrument._metricStorages.forEach((metricStorage) => { - metricStorage.record(buffer, observationTime); - }); - }); - }); - } - _findCallback(callback, instrument) { - return this._callbacks.findIndex((record$1) => { - return record$1.callback === callback && record$1.instrument === instrument; - }); - } - _findBatchCallback(callback, instruments) { - return this._batchCallbacks.findIndex((record$1) => { - return record$1.callback === callback && (0, utils_1.setEquals)(record$1.instruments, instruments); - }); - } - }; - exports.ObservableRegistry = ObservableRegistry; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/SyncMetricStorage.js -var require_SyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SyncMetricStorage = void 0; - const MetricStorage_1 = require_MetricStorage(); - const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); - const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); - /** - * Internal interface. - * - * Stores and aggregates {@link MetricData} for synchronous instruments. - */ - var SyncMetricStorage = class extends MetricStorage_1.MetricStorage { - _attributesProcessor; - _aggregationCardinalityLimit; - _deltaMetricStorage; - _temporalMetricStorage; - constructor(instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { - super(instrumentDescriptor); - this._attributesProcessor = _attributesProcessor; - this._aggregationCardinalityLimit = _aggregationCardinalityLimit; - this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); - this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); - } - record(value, attributes, context$1, recordTime) { - attributes = this._attributesProcessor.process(attributes, context$1); - this._deltaMetricStorage.record(value, attributes, context$1, recordTime); - } - /** - * Collects the metrics from this storage. - * - * Note: This is a stateful operation and may reset any interval-related - * state for the MetricCollector. - */ - collect(collector, collectionTime) { - const accumulations = this._deltaMetricStorage.collect(); - return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); - } - }; - exports.SyncMetricStorage = SyncMetricStorage; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AttributesProcessor.js -var require_AttributesProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.createMultiAttributesProcessor = exports.createNoopAttributesProcessor = void 0; - var NoopAttributesProcessor = class { - process(incoming, _context) { - return incoming; - } - }; - var MultiAttributesProcessor = class { - _processors; - constructor(_processors) { - this._processors = _processors; - } - process(incoming, context$1) { - let filteredAttributes = incoming; - for (const processor of this._processors) filteredAttributes = processor.process(filteredAttributes, context$1); - return filteredAttributes; - } - }; - var AllowListProcessor = class { - _allowedAttributeNames; - constructor(_allowedAttributeNames) { - this._allowedAttributeNames = _allowedAttributeNames; - } - process(incoming, _context) { - const filteredAttributes = {}; - Object.keys(incoming).filter((attributeName) => this._allowedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); - return filteredAttributes; - } - }; - var DenyListProcessor = class { - _deniedAttributeNames; - constructor(_deniedAttributeNames) { - this._deniedAttributeNames = _deniedAttributeNames; - } - process(incoming, _context) { - const filteredAttributes = {}; - Object.keys(incoming).filter((attributeName) => !this._deniedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); - return filteredAttributes; - } - }; - /** - * @internal - * - * Create an {@link IAttributesProcessor} that acts as a simple pass-through for attributes. - */ - function createNoopAttributesProcessor() { - return NOOP; - } - exports.createNoopAttributesProcessor = createNoopAttributesProcessor; - /** - * @internal - * - * Create an {@link IAttributesProcessor} that applies all processors from the provided list in order. - * - * @param processors Processors to apply in order. - */ - function createMultiAttributesProcessor(processors) { - return new MultiAttributesProcessor(processors); - } - exports.createMultiAttributesProcessor = createMultiAttributesProcessor; - /** - * Create an {@link IAttributesProcessor} that filters by allowed attribute names and drops any names that are not in the - * allow list. - */ - function createAllowListAttributesProcessor(attributeAllowList) { - return new AllowListProcessor(attributeAllowList); - } - exports.createAllowListAttributesProcessor = createAllowListAttributesProcessor; - /** - * Create an {@link IAttributesProcessor} that drops attributes based on the names provided in the deny list - */ - function createDenyListAttributesProcessor(attributeDenyList) { - return new DenyListProcessor(attributeDenyList); - } - exports.createDenyListAttributesProcessor = createDenyListAttributesProcessor; - const NOOP = new NoopAttributesProcessor(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterSharedState.js -var require_MeterSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterSharedState = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); - const Meter_1 = require_Meter(); - const utils_1 = require_utils$4(); - const AsyncMetricStorage_1 = require_AsyncMetricStorage(); - const MetricStorageRegistry_1 = require_MetricStorageRegistry(); - const MultiWritableMetricStorage_1 = require_MultiWritableMetricStorage(); - const ObservableRegistry_1 = require_ObservableRegistry(); - const SyncMetricStorage_1 = require_SyncMetricStorage(); - const AttributesProcessor_1 = require_AttributesProcessor(); - /** - * An internal record for shared meter provider states. - */ - var MeterSharedState = class { - _meterProviderSharedState; - _instrumentationScope; - metricStorageRegistry = new MetricStorageRegistry_1.MetricStorageRegistry(); - observableRegistry = new ObservableRegistry_1.ObservableRegistry(); - meter; - constructor(_meterProviderSharedState, _instrumentationScope) { - this._meterProviderSharedState = _meterProviderSharedState; - this._instrumentationScope = _instrumentationScope; - this.meter = new Meter_1.Meter(this); - } - registerMetricStorage(descriptor) { - const storages = this._registerMetricStorage(descriptor, SyncMetricStorage_1.SyncMetricStorage); - if (storages.length === 1) return storages[0]; - return new MultiWritableMetricStorage_1.MultiMetricStorage(storages); - } - registerAsyncMetricStorage(descriptor) { - return this._registerMetricStorage(descriptor, AsyncMetricStorage_1.AsyncMetricStorage); - } - /** - * @param collector opaque handle of {@link MetricCollector} which initiated the collection. - * @param collectionTime the HrTime at which the collection was initiated. - * @param options options for collection. - * @returns the list of metric data collected. - */ - async collect(collector, collectionTime, options) { - /** - * 1. Call all observable callbacks first. - * 2. Collect metric result for the collector. - */ - const errors = await this.observableRegistry.observe(collectionTime, options?.timeoutMillis); - const storages = this.metricStorageRegistry.getStorages(collector); - if (storages.length === 0) return null; - const metricDataList = storages.map((metricStorage) => { - return metricStorage.collect(collector, collectionTime); - }).filter(utils_1.isNotNullish); - if (metricDataList.length === 0) return { errors }; - return { - scopeMetrics: { - scope: this._instrumentationScope, - metrics: metricDataList - }, - errors - }; - } - _registerMetricStorage(descriptor, MetricStorageType) { - let storages = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationScope).map((view) => { - const viewDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptorWithView)(view, descriptor); - const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleStorage(viewDescriptor); - if (compatibleStorage != null) return compatibleStorage; - const viewStorage = new MetricStorageType(viewDescriptor, view.aggregation.createAggregator(viewDescriptor), view.attributesProcessor, this._meterProviderSharedState.metricCollectors, view.aggregationCardinalityLimit); - this.metricStorageRegistry.register(viewStorage); - return viewStorage; - }); - if (storages.length === 0) { - const collectorStorages = this._meterProviderSharedState.selectAggregations(descriptor.type).map(([collector, aggregation]) => { - const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(collector, descriptor); - if (compatibleStorage != null) return compatibleStorage; - const aggregator = aggregation.createAggregator(descriptor); - const cardinalityLimit = collector.selectCardinalityLimit(descriptor.type); - const storage = new MetricStorageType(descriptor, aggregator, (0, AttributesProcessor_1.createNoopAttributesProcessor)(), [collector], cardinalityLimit); - this.metricStorageRegistry.registerForCollector(collector, storage); - return storage; - }); - storages = storages.concat(collectorStorages); - } - return storages; - } - }; - exports.MeterSharedState = MeterSharedState; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterProviderSharedState.js -var require_MeterProviderSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterProviderSharedState = void 0; - const utils_1 = require_utils$4(); - const ViewRegistry_1 = require_ViewRegistry(); - const MeterSharedState_1 = require_MeterSharedState(); - const AggregationOption_1 = require_AggregationOption(); - /** - * An internal record for shared meter provider states. - */ - var MeterProviderSharedState = class { - resource; - viewRegistry = new ViewRegistry_1.ViewRegistry(); - metricCollectors = []; - meterSharedStates = /* @__PURE__ */ new Map(); - constructor(resource) { - this.resource = resource; - } - getMeterSharedState(instrumentationScope) { - const id = (0, utils_1.instrumentationScopeId)(instrumentationScope); - let meterSharedState = this.meterSharedStates.get(id); - if (meterSharedState == null) { - meterSharedState = new MeterSharedState_1.MeterSharedState(this, instrumentationScope); - this.meterSharedStates.set(id, meterSharedState); - } - return meterSharedState; - } - selectAggregations(instrumentType) { - const result = []; - for (const collector of this.metricCollectors) result.push([collector, (0, AggregationOption_1.toAggregation)(collector.selectAggregation(instrumentType))]); - return result; - } - }; - exports.MeterProviderSharedState = MeterProviderSharedState; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricCollector.js -var require_MetricCollector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricCollector = void 0; - const core_1 = require_src$8(); - /** - * An internal opaque interface that the MetricReader receives as - * MetricProducer. It acts as the storage key to the internal metric stream - * state for each MetricReader. - */ - var MetricCollector = class { - _sharedState; - _metricReader; - constructor(_sharedState, _metricReader) { - this._sharedState = _sharedState; - this._metricReader = _metricReader; - } - async collect(options) { - const collectionTime = (0, core_1.millisToHrTime)(Date.now()); - const scopeMetrics = []; - const errors = []; - const meterCollectionPromises = Array.from(this._sharedState.meterSharedStates.values()).map(async (meterSharedState) => { - const current = await meterSharedState.collect(this, collectionTime, options); - if (current?.scopeMetrics != null) scopeMetrics.push(current.scopeMetrics); - if (current?.errors != null) errors.push(...current.errors); - }); - await Promise.all(meterCollectionPromises); - return { - resourceMetrics: { - resource: this._sharedState.resource, - scopeMetrics - }, - errors - }; - } - /** - * Delegates for MetricReader.forceFlush. - */ - async forceFlush(options) { - await this._metricReader.forceFlush(options); - } - /** - * Delegates for MetricReader.shutdown. - */ - async shutdown(options) { - await this._metricReader.shutdown(options); - } - selectAggregationTemporality(instrumentType) { - return this._metricReader.selectAggregationTemporality(instrumentType); - } - selectAggregation(instrumentType) { - return this._metricReader.selectAggregation(instrumentType); - } - /** - * Select the cardinality limit for the given {@link InstrumentType} for this - * collector. - */ - selectCardinalityLimit(instrumentType) { - return this._metricReader.selectCardinalityLimit?.(instrumentType) ?? 2e3; - } - }; - exports.MetricCollector = MetricCollector; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Predicate.js -var require_Predicate = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExactPredicate = exports.PatternPredicate = void 0; - const ESCAPE = /[\^$\\.+?()[\]{}|]/g; - /** - * Wildcard pattern predicate, supports patterns like `*`, `foo*`, `*bar`. - */ - var PatternPredicate = class PatternPredicate { - _matchAll; - _regexp; - constructor(pattern) { - if (pattern === "*") { - this._matchAll = true; - this._regexp = /.*/; - } else { - this._matchAll = false; - this._regexp = new RegExp(PatternPredicate.escapePattern(pattern)); - } - } - match(str) { - if (this._matchAll) return true; - return this._regexp.test(str); - } - static escapePattern(pattern) { - return `^${pattern.replace(ESCAPE, "\\$&").replace("*", ".*")}$`; - } - static hasWildcard(pattern) { - return pattern.includes("*"); - } - }; - exports.PatternPredicate = PatternPredicate; - var ExactPredicate = class { - _matchAll; - _pattern; - constructor(pattern) { - this._matchAll = pattern === void 0; - this._pattern = pattern; - } - match(str) { - if (this._matchAll) return true; - if (str === this._pattern) return true; - return false; - } - }; - exports.ExactPredicate = ExactPredicate; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/InstrumentSelector.js -var require_InstrumentSelector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.InstrumentSelector = void 0; - const Predicate_1 = require_Predicate(); - var InstrumentSelector = class { - _nameFilter; - _type; - _unitFilter; - constructor(criteria) { - this._nameFilter = new Predicate_1.PatternPredicate(criteria?.name ?? "*"); - this._type = criteria?.type; - this._unitFilter = new Predicate_1.ExactPredicate(criteria?.unit); - } - getType() { - return this._type; - } - getNameFilter() { - return this._nameFilter; - } - getUnitFilter() { - return this._unitFilter; - } - }; - exports.InstrumentSelector = InstrumentSelector; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/MeterSelector.js -var require_MeterSelector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterSelector = void 0; - const Predicate_1 = require_Predicate(); - var MeterSelector = class { - _nameFilter; - _versionFilter; - _schemaUrlFilter; - constructor(criteria) { - this._nameFilter = new Predicate_1.ExactPredicate(criteria?.name); - this._versionFilter = new Predicate_1.ExactPredicate(criteria?.version); - this._schemaUrlFilter = new Predicate_1.ExactPredicate(criteria?.schemaUrl); - } - getNameFilter() { - return this._nameFilter; - } - /** - * TODO: semver filter? no spec yet. - */ - getVersionFilter() { - return this._versionFilter; - } - getSchemaUrlFilter() { - return this._schemaUrlFilter; - } - }; - exports.MeterSelector = MeterSelector; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/View.js -var require_View = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.View = void 0; - const Predicate_1 = require_Predicate(); - const AttributesProcessor_1 = require_AttributesProcessor(); - const InstrumentSelector_1 = require_InstrumentSelector(); - const MeterSelector_1 = require_MeterSelector(); - const AggregationOption_1 = require_AggregationOption(); - function isSelectorNotProvided(options) { - return options.instrumentName == null && options.instrumentType == null && options.instrumentUnit == null && options.meterName == null && options.meterVersion == null && options.meterSchemaUrl == null; - } - function validateViewOptions(viewOptions) { - if (isSelectorNotProvided(viewOptions)) throw new Error("Cannot create view with no selector arguments supplied"); - if (viewOptions.name != null && (viewOptions?.instrumentName == null || Predicate_1.PatternPredicate.hasWildcard(viewOptions.instrumentName))) throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter."); - } - /** - * Can be passed to a {@link MeterProvider} to select instruments and alter their metric stream. - */ - var View = class { - name; - description; - aggregation; - attributesProcessor; - instrumentSelector; - meterSelector; - aggregationCardinalityLimit; - /** - * Create a new {@link View} instance. - * - * Parameters can be categorized as two types: - * Instrument selection criteria: Used to describe the instrument(s) this view will be applied to. - * Will be treated as additive (the Instrument has to meet all the provided criteria to be selected). - * - * Metric stream altering: Alter the metric stream of instruments selected by instrument selection criteria. - * - * @param viewOptions {@link ViewOptions} for altering the metric stream and instrument selection. - * @param viewOptions.name - * Alters the metric stream: - * This will be used as the name of the metrics stream. - * If not provided, the original Instrument name will be used. - * @param viewOptions.description - * Alters the metric stream: - * This will be used as the description of the metrics stream. - * If not provided, the original Instrument description will be used by default. - * @param viewOptions.attributesProcessors - * Alters the metric stream: - * If provided, the attributes will be modified as defined by the added processors. - * If not provided, all attribute keys will be used by default. - * @param viewOptions.aggregationCardinalityLimit - * Alters the metric stream: - * Sets a limit on the number of unique attribute combinations (cardinality) that can be aggregated. - * If not provided, the default limit of 2000 will be used. - * @param viewOptions.aggregation - * Alters the metric stream: - * Alters the {@link Aggregation} of the metric stream. - * @param viewOptions.instrumentName - * Instrument selection criteria: - * Original name of the Instrument(s) with wildcard support. - * @param viewOptions.instrumentType - * Instrument selection criteria: - * The original type of the Instrument(s). - * @param viewOptions.instrumentUnit - * Instrument selection criteria: - * The unit of the Instrument(s). - * @param viewOptions.meterName - * Instrument selection criteria: - * The name of the Meter. No wildcard support, name must match the meter exactly. - * @param viewOptions.meterVersion - * Instrument selection criteria: - * The version of the Meter. No wildcard support, version must match exactly. - * @param viewOptions.meterSchemaUrl - * Instrument selection criteria: - * The schema URL of the Meter. No wildcard support, schema URL must match exactly. - * - * @example - * // Create a view that changes the Instrument 'my.instrument' to use to an - * // ExplicitBucketHistogramAggregation with the boundaries [20, 30, 40] - * new View({ - * aggregation: new ExplicitBucketHistogramAggregation([20, 30, 40]), - * instrumentName: 'my.instrument' - * }) - */ - constructor(viewOptions) { - validateViewOptions(viewOptions); - if (viewOptions.attributesProcessors != null) this.attributesProcessor = (0, AttributesProcessor_1.createMultiAttributesProcessor)(viewOptions.attributesProcessors); - else this.attributesProcessor = (0, AttributesProcessor_1.createNoopAttributesProcessor)(); - this.name = viewOptions.name; - this.description = viewOptions.description; - this.aggregation = (0, AggregationOption_1.toAggregation)(viewOptions.aggregation ?? { type: AggregationOption_1.AggregationType.DEFAULT }); - this.instrumentSelector = new InstrumentSelector_1.InstrumentSelector({ - name: viewOptions.instrumentName, - type: viewOptions.instrumentType, - unit: viewOptions.instrumentUnit - }); - this.meterSelector = new MeterSelector_1.MeterSelector({ - name: viewOptions.meterName, - version: viewOptions.meterVersion, - schemaUrl: viewOptions.meterSchemaUrl - }); - this.aggregationCardinalityLimit = viewOptions.aggregationCardinalityLimit; - } - }; - exports.View = View; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider.js -var require_MeterProvider = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterProvider = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const resources_1 = require_src$7(); - const MeterProviderSharedState_1 = require_MeterProviderSharedState(); - const MetricCollector_1 = require_MetricCollector(); - const View_1 = require_View(); - /** - * This class implements the {@link MeterProvider} interface. - */ - var MeterProvider = class { - _sharedState; - _shutdown = false; - constructor(options) { - this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState(options?.resource ?? (0, resources_1.defaultResource)()); - if (options?.views != null && options.views.length > 0) for (const viewOption of options.views) this._sharedState.viewRegistry.addView(new View_1.View(viewOption)); - if (options?.readers != null && options.readers.length > 0) for (const metricReader of options.readers) { - const collector = new MetricCollector_1.MetricCollector(this._sharedState, metricReader); - metricReader.setMetricProducer(collector); - this._sharedState.metricCollectors.push(collector); - } - } - /** - * Get a meter with the configuration of the MeterProvider. - */ - getMeter(name, version$1 = "", options = {}) { - if (this._shutdown) { - api_1.diag.warn("A shutdown MeterProvider cannot provide a Meter"); - return (0, api_1.createNoopMeter)(); - } - return this._sharedState.getMeterSharedState({ - name, - version: version$1, - schemaUrl: options.schemaUrl - }).meter; - } - /** - * Shut down the MeterProvider and all registered - * MetricReaders. - * - * Returns a promise which is resolved when all flushes are complete. - */ - async shutdown(options) { - if (this._shutdown) { - api_1.diag.warn("shutdown may only be called once per MeterProvider"); - return; - } - this._shutdown = true; - await Promise.all(this._sharedState.metricCollectors.map((collector) => { - return collector.shutdown(options); - })); - } - /** - * Notifies all registered MetricReaders to flush any buffered data. - * - * Returns a promise which is resolved when all flushes are complete. - */ - async forceFlush(options) { - if (this._shutdown) { - api_1.diag.warn("invalid attempt to force flush after MeterProvider shutdown"); - return; - } - await Promise.all(this._sharedState.metricCollectors.map((collector) => { - return collector.forceFlush(options); - })); - } - }; - exports.MeterProvider = MeterProvider; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/index.js -var require_src$6 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TimeoutError = exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.AggregationType = exports.MeterProvider = exports.ConsoleMetricExporter = exports.InMemoryMetricExporter = exports.PeriodicExportingMetricReader = exports.MetricReader = exports.InstrumentType = exports.DataPointType = exports.AggregationTemporality = void 0; - var AggregationTemporality_1 = require_AggregationTemporality(); - Object.defineProperty(exports, "AggregationTemporality", { - enumerable: true, - get: function() { - return AggregationTemporality_1.AggregationTemporality; - } - }); - var MetricData_1 = require_MetricData(); - Object.defineProperty(exports, "DataPointType", { - enumerable: true, - get: function() { - return MetricData_1.DataPointType; - } - }); - Object.defineProperty(exports, "InstrumentType", { - enumerable: true, - get: function() { - return MetricData_1.InstrumentType; - } - }); - var MetricReader_1 = require_MetricReader(); - Object.defineProperty(exports, "MetricReader", { - enumerable: true, - get: function() { - return MetricReader_1.MetricReader; - } - }); - var PeriodicExportingMetricReader_1 = require_PeriodicExportingMetricReader(); - Object.defineProperty(exports, "PeriodicExportingMetricReader", { - enumerable: true, - get: function() { - return PeriodicExportingMetricReader_1.PeriodicExportingMetricReader; - } - }); - var InMemoryMetricExporter_1 = require_InMemoryMetricExporter(); - Object.defineProperty(exports, "InMemoryMetricExporter", { - enumerable: true, - get: function() { - return InMemoryMetricExporter_1.InMemoryMetricExporter; - } - }); - var ConsoleMetricExporter_1 = require_ConsoleMetricExporter(); - Object.defineProperty(exports, "ConsoleMetricExporter", { - enumerable: true, - get: function() { - return ConsoleMetricExporter_1.ConsoleMetricExporter; - } - }); - var MeterProvider_1 = require_MeterProvider(); - Object.defineProperty(exports, "MeterProvider", { - enumerable: true, - get: function() { - return MeterProvider_1.MeterProvider; - } - }); - var AggregationOption_1 = require_AggregationOption(); - Object.defineProperty(exports, "AggregationType", { - enumerable: true, - get: function() { - return AggregationOption_1.AggregationType; - } - }); - var AttributesProcessor_1 = require_AttributesProcessor(); - Object.defineProperty(exports, "createAllowListAttributesProcessor", { - enumerable: true, - get: function() { - return AttributesProcessor_1.createAllowListAttributesProcessor; - } - }); - Object.defineProperty(exports, "createDenyListAttributesProcessor", { - enumerable: true, - get: function() { - return AttributesProcessor_1.createDenyListAttributesProcessor; - } - }); - var utils_1 = require_utils$4(); - Object.defineProperty(exports, "TimeoutError", { - enumerable: true, - get: function() { - return utils_1.TimeoutError; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal-types.js -var require_internal_types = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.EAggregationTemporality = void 0; - (function(EAggregationTemporality) { - EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"; - /** DELTA is an AggregationTemporality for a metric aggregator which reports - changes since last report time. Successive metrics contain aggregation of - values from continuous and non-overlapping intervals. - - The values for a DELTA metric are based only on the time interval - associated with one measurement cycle. There is no dependency on - previous measurements like is the case for CUMULATIVE metrics. - - For example, consider a system measuring the number of requests that - it receives and reports the sum of these requests every second as a - DELTA metric: - - 1. The system starts receiving at time=t_0. - 2. A request is received, the system measures 1 request. - 3. A request is received, the system measures 1 request. - 4. A request is received, the system measures 1 request. - 5. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0 to - t_0+1 with a value of 3. - 6. A request is received, the system measures 1 request. - 7. A request is received, the system measures 1 request. - 8. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0+1 to - t_0+2 with a value of 2. */ - EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA"; - /** CUMULATIVE is an AggregationTemporality for a metric aggregator which - reports changes since a fixed start time. This means that current values - of a CUMULATIVE metric depend on all previous measurements since the - start time. Because of this, the sender is required to retain this state - in some form. If this state is lost or invalidated, the CUMULATIVE metric - values MUST be reset and a new fixed start time following the last - reported measurement time sent MUST be used. - - For example, consider a system measuring the number of requests that - it receives and reports the sum of these requests every second as a - CUMULATIVE metric: - - 1. The system starts receiving at time=t_0. - 2. A request is received, the system measures 1 request. - 3. A request is received, the system measures 1 request. - 4. A request is received, the system measures 1 request. - 5. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0 to - t_0+1 with a value of 3. - 6. A request is received, the system measures 1 request. - 7. A request is received, the system measures 1 request. - 8. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0 to - t_0+2 with a value of 5. - 9. The system experiences a fault and loses state. - 10. The system recovers and resumes receiving at time=t_1. - 11. A request is received, the system measures 1 request. - 12. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_1 to - t_0+1 with a value of 1. - - Note: Even though, when reporting changes since last report time, using - CUMULATIVE is valid, it is not recommended. This may cause problems for - systems that do not use start_time to determine when the aggregation - value was reset (e.g. Prometheus). */ - EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"; - })(exports.EAggregationTemporality || (exports.EAggregationTemporality = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal.js -var require_internal$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createExportMetricsServiceRequest = exports.toMetric = exports.toScopeMetrics = exports.toResourceMetrics = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const sdk_metrics_1 = require_src$6(); - const internal_types_1 = require_internal_types(); - const utils_1 = require_utils$5(); - const internal_1 = require_internal$3(); - function toResourceMetrics(resourceMetrics, options) { - const encoder = (0, utils_1.getOtlpEncoder)(options); - const processedResource = (0, internal_1.createResource)(resourceMetrics.resource); - return { - resource: processedResource, - schemaUrl: processedResource.schemaUrl, - scopeMetrics: toScopeMetrics(resourceMetrics.scopeMetrics, encoder) - }; - } - exports.toResourceMetrics = toResourceMetrics; - function toScopeMetrics(scopeMetrics, encoder) { - return Array.from(scopeMetrics.map((metrics$1) => ({ - scope: (0, internal_1.createInstrumentationScope)(metrics$1.scope), - metrics: metrics$1.metrics.map((metricData) => toMetric(metricData, encoder)), - schemaUrl: metrics$1.scope.schemaUrl - }))); - } - exports.toScopeMetrics = toScopeMetrics; - function toMetric(metricData, encoder) { - const out = { - name: metricData.descriptor.name, - description: metricData.descriptor.description, - unit: metricData.descriptor.unit - }; - const aggregationTemporality = toAggregationTemporality(metricData.aggregationTemporality); - switch (metricData.dataPointType) { - case sdk_metrics_1.DataPointType.SUM: - out.sum = { - aggregationTemporality, - isMonotonic: metricData.isMonotonic, - dataPoints: toSingularDataPoints(metricData, encoder) - }; - break; - case sdk_metrics_1.DataPointType.GAUGE: - out.gauge = { dataPoints: toSingularDataPoints(metricData, encoder) }; - break; - case sdk_metrics_1.DataPointType.HISTOGRAM: - out.histogram = { - aggregationTemporality, - dataPoints: toHistogramDataPoints(metricData, encoder) - }; - break; - case sdk_metrics_1.DataPointType.EXPONENTIAL_HISTOGRAM: - out.exponentialHistogram = { - aggregationTemporality, - dataPoints: toExponentialHistogramDataPoints(metricData, encoder) - }; - break; - } - return out; - } - exports.toMetric = toMetric; - function toSingularDataPoint(dataPoint, valueType, encoder) { - const out = { - attributes: (0, internal_1.toAttributes)(dataPoint.attributes), - startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), - timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) - }; - switch (valueType) { - case api_1.ValueType.INT: - out.asInt = dataPoint.value; - break; - case api_1.ValueType.DOUBLE: - out.asDouble = dataPoint.value; - break; - } - return out; - } - function toSingularDataPoints(metricData, encoder) { - return metricData.dataPoints.map((dataPoint) => { - return toSingularDataPoint(dataPoint, metricData.descriptor.valueType, encoder); - }); - } - function toHistogramDataPoints(metricData, encoder) { - return metricData.dataPoints.map((dataPoint) => { - const histogram = dataPoint.value; - return { - attributes: (0, internal_1.toAttributes)(dataPoint.attributes), - bucketCounts: histogram.buckets.counts, - explicitBounds: histogram.buckets.boundaries, - count: histogram.count, - sum: histogram.sum, - min: histogram.min, - max: histogram.max, - startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), - timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) - }; - }); - } - function toExponentialHistogramDataPoints(metricData, encoder) { - return metricData.dataPoints.map((dataPoint) => { - const histogram = dataPoint.value; - return { - attributes: (0, internal_1.toAttributes)(dataPoint.attributes), - count: histogram.count, - min: histogram.min, - max: histogram.max, - sum: histogram.sum, - positive: { - offset: histogram.positive.offset, - bucketCounts: histogram.positive.bucketCounts - }, - negative: { - offset: histogram.negative.offset, - bucketCounts: histogram.negative.bucketCounts - }, - scale: histogram.scale, - zeroCount: histogram.zeroCount, - startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), - timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) - }; - }); - } - function toAggregationTemporality(temporality) { - switch (temporality) { - case sdk_metrics_1.AggregationTemporality.DELTA: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA; - case sdk_metrics_1.AggregationTemporality.CUMULATIVE: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE; - } - } - function createExportMetricsServiceRequest(resourceMetrics, options) { - return { resourceMetrics: resourceMetrics.map((metrics$1) => toResourceMetrics(metrics$1, options)) }; - } - exports.createExportMetricsServiceRequest = createExportMetricsServiceRequest; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics.js -var require_metrics$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufMetricsSerializer = void 0; - const root = require_root(); - const internal_1 = require_internal$1(); - const metricsResponseType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; - const metricsRequestType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; - exports.ProtobufMetricsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportMetricsServiceRequest)([arg]); - return metricsRequestType.encode(request).finish(); - }, - deserializeResponse: (arg) => { - return metricsResponseType.decode(arg); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/index.js -var require_protobuf$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufMetricsSerializer = void 0; - var metrics_1 = require_metrics$1(); - Object.defineProperty(exports, "ProtobufMetricsSerializer", { - enumerable: true, - get: function() { - return metrics_1.ProtobufMetricsSerializer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js -var require_internal = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.createExportTraceServiceRequest = exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = void 0; - const internal_1 = require_internal$3(); - const utils_1 = require_utils$5(); - function sdkSpanToOtlpSpan(span, encoder) { - const ctx = span.spanContext(); - const status = span.status; - const parentSpanId = span.parentSpanContext?.spanId ? encoder.encodeSpanContext(span.parentSpanContext?.spanId) : void 0; - return { - traceId: encoder.encodeSpanContext(ctx.traceId), - spanId: encoder.encodeSpanContext(ctx.spanId), - parentSpanId, - traceState: ctx.traceState?.serialize(), - name: span.name, - kind: span.kind == null ? 0 : span.kind + 1, - startTimeUnixNano: encoder.encodeHrTime(span.startTime), - endTimeUnixNano: encoder.encodeHrTime(span.endTime), - attributes: (0, internal_1.toAttributes)(span.attributes), - droppedAttributesCount: span.droppedAttributesCount, - events: span.events.map((event) => toOtlpSpanEvent(event, encoder)), - droppedEventsCount: span.droppedEventsCount, - status: { - code: status.code, - message: status.message - }, - links: span.links.map((link) => toOtlpLink(link, encoder)), - droppedLinksCount: span.droppedLinksCount - }; - } - exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan; - function toOtlpLink(link, encoder) { - return { - attributes: link.attributes ? (0, internal_1.toAttributes)(link.attributes) : [], - spanId: encoder.encodeSpanContext(link.context.spanId), - traceId: encoder.encodeSpanContext(link.context.traceId), - traceState: link.context.traceState?.serialize(), - droppedAttributesCount: link.droppedAttributesCount || 0 - }; - } - exports.toOtlpLink = toOtlpLink; - function toOtlpSpanEvent(timedEvent, encoder) { - return { - attributes: timedEvent.attributes ? (0, internal_1.toAttributes)(timedEvent.attributes) : [], - name: timedEvent.name, - timeUnixNano: encoder.encodeHrTime(timedEvent.time), - droppedAttributesCount: timedEvent.droppedAttributesCount || 0 - }; - } - exports.toOtlpSpanEvent = toOtlpSpanEvent; - function createExportTraceServiceRequest(spans, options) { - return { resourceSpans: spanRecordsToResourceSpans(spans, (0, utils_1.getOtlpEncoder)(options)) }; - } - exports.createExportTraceServiceRequest = createExportTraceServiceRequest; - function createResourceMap(readableSpans) { - const resourceMap = /* @__PURE__ */ new Map(); - for (const record$1 of readableSpans) { - let ilsMap = resourceMap.get(record$1.resource); - if (!ilsMap) { - ilsMap = /* @__PURE__ */ new Map(); - resourceMap.set(record$1.resource, ilsMap); - } - const instrumentationScopeKey = `${record$1.instrumentationScope.name}@${record$1.instrumentationScope.version || ""}:${record$1.instrumentationScope.schemaUrl || ""}`; - let records = ilsMap.get(instrumentationScopeKey); - if (!records) { - records = []; - ilsMap.set(instrumentationScopeKey, records); - } - records.push(record$1); - } - return resourceMap; - } - function spanRecordsToResourceSpans(readableSpans, encoder) { - const resourceMap = createResourceMap(readableSpans); - const out = []; - const entryIterator = resourceMap.entries(); - let entry = entryIterator.next(); - while (!entry.done) { - const [resource, ilmMap] = entry.value; - const scopeResourceSpans = []; - const ilmIterator = ilmMap.values(); - let ilmEntry = ilmIterator.next(); - while (!ilmEntry.done) { - const scopeSpans = ilmEntry.value; - if (scopeSpans.length > 0) { - const spans = scopeSpans.map((readableSpan) => sdkSpanToOtlpSpan(readableSpan, encoder)); - scopeResourceSpans.push({ - scope: (0, internal_1.createInstrumentationScope)(scopeSpans[0].instrumentationScope), - spans, - schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl - }); - } - ilmEntry = ilmIterator.next(); - } - const processedResource = (0, internal_1.createResource)(resource); - const transformedSpans = { - resource: processedResource, - scopeSpans: scopeResourceSpans, - schemaUrl: processedResource.schemaUrl - }; - out.push(transformedSpans); - entry = entryIterator.next(); - } - return out; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace.js -var require_trace$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufTraceSerializer = void 0; - const root = require_root(); - const internal_1 = require_internal(); - const traceResponseType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; - const traceRequestType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; - exports.ProtobufTraceSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportTraceServiceRequest)(arg); - return traceRequestType.encode(request).finish(); - }, - deserializeResponse: (arg) => { - return traceResponseType.decode(arg); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/index.js -var require_protobuf = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufTraceSerializer = void 0; - var trace_1 = require_trace$1(); - Object.defineProperty(exports, "ProtobufTraceSerializer", { - enumerable: true, - get: function() { - return trace_1.ProtobufTraceSerializer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js -var require_logs = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonLogsSerializer = void 0; - const internal_1 = require_internal$2(); - exports.JsonLogsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportLogsServiceRequest)(arg, { - useHex: true, - useLongBits: false - }); - return new TextEncoder().encode(JSON.stringify(request)); - }, - deserializeResponse: (arg) => { - if (arg.length === 0) return {}; - const decoder = new TextDecoder(); - return JSON.parse(decoder.decode(arg)); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/index.js -var require_json$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonLogsSerializer = void 0; - var logs_1 = require_logs(); - Object.defineProperty(exports, "JsonLogsSerializer", { - enumerable: true, - get: function() { - return logs_1.JsonLogsSerializer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/metrics.js -var require_metrics = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonMetricsSerializer = void 0; - const internal_1 = require_internal$1(); - exports.JsonMetricsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportMetricsServiceRequest)([arg], { useLongBits: false }); - return new TextEncoder().encode(JSON.stringify(request)); - }, - deserializeResponse: (arg) => { - if (arg.length === 0) return {}; - const decoder = new TextDecoder(); - return JSON.parse(decoder.decode(arg)); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/index.js -var require_json$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonMetricsSerializer = void 0; - var metrics_1 = require_metrics(); - Object.defineProperty(exports, "JsonMetricsSerializer", { - enumerable: true, - get: function() { - return metrics_1.JsonMetricsSerializer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/trace.js -var require_trace = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonTraceSerializer = void 0; - const internal_1 = require_internal(); - exports.JsonTraceSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportTraceServiceRequest)(arg, { - useHex: true, - useLongBits: false - }); - return new TextEncoder().encode(JSON.stringify(request)); - }, - deserializeResponse: (arg) => { - if (arg.length === 0) return {}; - const decoder = new TextDecoder(); - return JSON.parse(decoder.decode(arg)); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/index.js -var require_json = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonTraceSerializer = void 0; - var trace_1 = require_trace(); - Object.defineProperty(exports, "JsonTraceSerializer", { - enumerable: true, - get: function() { - return trace_1.JsonTraceSerializer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/index.js -var require_src$5 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonTraceSerializer = exports.JsonMetricsSerializer = exports.JsonLogsSerializer = exports.ProtobufTraceSerializer = exports.ProtobufMetricsSerializer = exports.ProtobufLogsSerializer = void 0; - var protobuf_1 = require_protobuf$2(); - Object.defineProperty(exports, "ProtobufLogsSerializer", { - enumerable: true, - get: function() { - return protobuf_1.ProtobufLogsSerializer; - } - }); - var protobuf_2 = require_protobuf$1(); - Object.defineProperty(exports, "ProtobufMetricsSerializer", { - enumerable: true, - get: function() { - return protobuf_2.ProtobufMetricsSerializer; - } - }); - var protobuf_3 = require_protobuf(); - Object.defineProperty(exports, "ProtobufTraceSerializer", { - enumerable: true, - get: function() { - return protobuf_3.ProtobufTraceSerializer; - } - }); - var json_1 = require_json$2(); - Object.defineProperty(exports, "JsonLogsSerializer", { - enumerable: true, - get: function() { - return json_1.JsonLogsSerializer; - } - }); - var json_2 = require_json$1(); - Object.defineProperty(exports, "JsonMetricsSerializer", { - enumerable: true, - get: function() { - return json_2.JsonMetricsSerializer; - } - }); - var json_3 = require_json(); - Object.defineProperty(exports, "JsonTraceSerializer", { - enumerable: true, - get: function() { - return json_3.JsonTraceSerializer; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js -/** -* Parses headers from config leaving only those that have defined values -* @param partialHeaders -*/ -function validateAndNormalizeHeaders(partialHeaders) { - return () => { - const headers = {}; - Object.entries(partialHeaders?.() ?? {}).forEach(([key, value]) => { - if (typeof value !== "undefined") headers[key] = String(value); - else diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`); - }); - return headers; - }; -} -var init_util = __esmMin((() => { - init_esm$2(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js -function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) { - const requiredHeaders = { ...defaultHeaders() }; - const headers = {}; - return () => { - if (fallbackHeaders != null) Object.assign(headers, fallbackHeaders()); - if (userProvidedHeaders != null) Object.assign(headers, userProvidedHeaders()); - return Object.assign(headers, requiredHeaders); - }; -} -function validateUserProvidedUrl(url) { - if (url == null) return; - try { - const base = globalThis.location?.href; - return new URL(url, base).href; - } catch { - throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`); - } -} -/** -* @param userProvidedConfiguration Configuration options provided by the user in code. -* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. -* @param defaultConfiguration The defaults as defined by the exporter specification -*/ -function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { - return { - ...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), - headers: mergeHeaders(validateAndNormalizeHeaders(userProvidedConfiguration.headers), fallbackConfiguration.headers, defaultConfiguration.headers), - url: validateUserProvidedUrl(userProvidedConfiguration.url) ?? fallbackConfiguration.url ?? defaultConfiguration.url - }; -} -function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { - return { - ...getSharedConfigurationDefaults(), - headers: () => requiredHeaders, - url: "http://localhost:4318/" + signalResourcePath - }; -} -var init_otlp_http_configuration = __esmMin((() => { - init_shared_configuration(); - init_util(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-configuration.js -function httpAgentFactoryFromOptions(options) { - return async (protocol) => { - const { Agent } = await (protocol === "http:" ? import("http") : import("https")); - return new Agent(options); - }; -} -/** -* @param userProvidedConfiguration Configuration options provided by the user in code. -* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. -* @param defaultConfiguration The defaults as defined by the exporter specification -*/ -function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { - return { - ...mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), - agentFactory: userProvidedConfiguration.agentFactory ?? fallbackConfiguration.agentFactory ?? defaultConfiguration.agentFactory - }; -} -function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { - return { - ...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath), - agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }) - }; -} -var init_otlp_node_http_configuration = __esmMin((() => { - init_otlp_http_configuration(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js -function isExportRetryable(statusCode) { - return [ - 429, - 502, - 503, - 504 - ].includes(statusCode); -} -function parseRetryAfterToMills(retryAfter) { - if (retryAfter == null) return; - const seconds = Number.parseInt(retryAfter, 10); - if (Number.isInteger(seconds)) return seconds > 0 ? seconds * 1e3 : -1; - const delay = new Date(retryAfter).getTime() - Date.now(); - if (delay >= 0) return delay; - return 0; -} -var init_is_export_retryable = __esmMin((() => {})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js -/** -* Sends data using http -* @param request -* @param params -* @param agent -* @param data -* @param onDone -* @param timeoutMillis -*/ -function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) { - const parsedUrl = new URL(params.url); - const req = request({ - hostname: parsedUrl.hostname, - port: parsedUrl.port, - path: parsedUrl.pathname, - method: "POST", - headers: { ...params.headers() }, - agent - }, (res) => { - const responseData = []; - res.on("data", (chunk) => responseData.push(chunk)); - res.on("end", () => { - if (res.statusCode && res.statusCode < 299) onDone({ - status: "success", - data: Buffer.concat(responseData) - }); - else if (res.statusCode && isExportRetryable(res.statusCode)) onDone({ - status: "retryable", - retryInMillis: parseRetryAfterToMills(res.headers["retry-after"]) - }); - else onDone({ - status: "failure", - error: new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString()) - }); - }); - }); - req.setTimeout(timeoutMillis, () => { - req.destroy(); - onDone({ - status: "failure", - error: /* @__PURE__ */ new Error("Request Timeout") - }); - }); - req.on("error", (error) => { - onDone({ - status: "failure", - error - }); - }); - compressAndSend(req, params.compression, data, (error) => { - onDone({ - status: "failure", - error - }); - }); -} -function compressAndSend(req, compression, data, onError) { - let dataStream = readableFromUint8Array(data); - if (compression === "gzip") { - req.setHeader("Content-Encoding", "gzip"); - dataStream = dataStream.on("error", onError).pipe(zlib.createGzip()).on("error", onError); - } - dataStream.pipe(req).on("error", onError); -} -function readableFromUint8Array(buff) { - const readable = new Readable(); - readable.push(buff); - readable.push(null); - return readable; -} -var init_http_transport_utils = __esmMin((() => { - init_is_export_retryable(); - init_types(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-exporter-transport.js -async function requestFunctionFactory(protocol) { - const { request } = await (protocol === "http:" ? import("http") : import("https")); - return request; -} -function createHttpExporterTransport(parameters) { - return new HttpExporterTransport(parameters); -} -var HttpExporterTransport; -var init_http_exporter_transport = __esmMin((() => { - init_http_transport_utils(); - HttpExporterTransport = class { - _parameters; - _utils = null; - constructor(_parameters) { - this._parameters = _parameters; - } - async send(data, timeoutMillis) { - const { agent, request } = await this._loadUtils(); - return new Promise((resolve) => { - sendWithHttp(request, this._parameters, agent, data, (result) => { - resolve(result); - }, timeoutMillis); - }); - } - shutdown() {} - async _loadUtils() { - let utils = this._utils; - if (utils === null) { - const protocol = new URL(this._parameters.url).protocol; - const [agent, request] = await Promise.all([this._parameters.agentFactory(protocol), requestFunctionFactory(protocol)]); - utils = this._utils = { - agent, - request - }; - } - return utils; - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js -/** -* Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER] -*/ -function getJitter() { - return Math.random() * (2 * JITTER) - JITTER; -} -/** -* Creates an Exporter Transport that retries on 'retryable' response. -*/ -function createRetryingTransport(options) { - return new RetryingTransport(options.transport); -} -var MAX_ATTEMPTS, INITIAL_BACKOFF, MAX_BACKOFF, BACKOFF_MULTIPLIER, JITTER, RetryingTransport; -var init_retrying_transport = __esmMin((() => { - MAX_ATTEMPTS = 5; - INITIAL_BACKOFF = 1e3; - MAX_BACKOFF = 5e3; - BACKOFF_MULTIPLIER = 1.5; - JITTER = .2; - RetryingTransport = class { - _transport; - constructor(_transport) { - this._transport = _transport; - } - retry(data, timeoutMillis, inMillis) { - return new Promise((resolve, reject) => { - setTimeout(() => { - this._transport.send(data, timeoutMillis).then(resolve, reject); - }, inMillis); - }); - } - async send(data, timeoutMillis) { - const deadline = Date.now() + timeoutMillis; - let result = await this._transport.send(data, timeoutMillis); - let attempts = MAX_ATTEMPTS; - let nextBackoff = INITIAL_BACKOFF; - while (result.status === "retryable" && attempts > 0) { - attempts--; - const backoff = Math.max(Math.min(nextBackoff, MAX_BACKOFF) + getJitter(), 0); - nextBackoff = nextBackoff * BACKOFF_MULTIPLIER; - const retryInMillis = result.retryInMillis ?? backoff; - const remainingTimeoutMillis = deadline - Date.now(); - if (retryInMillis > remainingTimeoutMillis) return result; - result = await this.retry(data, remainingTimeoutMillis, retryInMillis); - } - return result; - } - shutdown() { - return this._transport.shutdown(); - } - }; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-http-export-delegate.js -function createOtlpHttpExportDelegate(options, serializer) { - return createOtlpExportDelegate({ - transport: createRetryingTransport({ transport: createHttpExporterTransport(options) }), - serializer, - promiseHandler: createBoundedQueueExportPromiseHandler(options) - }, { timeout: options.timeoutMillis }); -} -var init_otlp_http_export_delegate = __esmMin((() => { - init_otlp_export_delegate(); - init_http_exporter_transport(); - init_bounded_queue_export_promise_handler(); - init_retrying_transport(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-env-configuration.js -function parseAndValidateTimeoutFromEnv(timeoutEnvVar) { - const envTimeout = process.env[timeoutEnvVar]?.trim(); - if (envTimeout != null && envTimeout !== "") { - const definedTimeout = Number(envTimeout); - if (Number.isFinite(definedTimeout) && definedTimeout > 0) return definedTimeout; - diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`); - } -} -function getTimeoutFromEnv(signalIdentifier) { - const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`); - const nonSpecificTimeout = parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT"); - return specificTimeout ?? nonSpecificTimeout; -} -function parseAndValidateCompressionFromEnv(compressionEnvVar) { - const compression = process.env[compressionEnvVar]?.trim(); - if (compression === "") return; - if (compression == null || compression === "none" || compression === "gzip") return compression; - diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`); -} -function getCompressionFromEnv(signalIdentifier) { - const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`); - const nonSpecificCompression = parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION"); - return specificCompression ?? nonSpecificCompression; -} -function getSharedConfigurationFromEnvironment(signalIdentifier) { - return { - timeoutMillis: getTimeoutFromEnv(signalIdentifier), - compression: getCompressionFromEnv(signalIdentifier) - }; -} -var init_shared_env_configuration = __esmMin((() => { - init_esm$2(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js -function getStaticHeadersFromEnv(signalIdentifier) { - const signalSpecificRawHeaders = (0, import_src$4.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`); - const nonSignalSpecificRawHeaders = (0, import_src$4.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"); - const signalSpecificHeaders = (0, import_src$4.parseKeyPairsIntoRecord)(signalSpecificRawHeaders); - const nonSignalSpecificHeaders = (0, import_src$4.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders); - if (Object.keys(signalSpecificHeaders).length === 0 && Object.keys(nonSignalSpecificHeaders).length === 0) return; - return Object.assign({}, (0, import_src$4.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders), (0, import_src$4.parseKeyPairsIntoRecord)(signalSpecificRawHeaders)); -} -function appendRootPathToUrlIfNeeded(url) { - try { - return new URL(url).toString(); - } catch { - diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); - return; - } -} -function appendResourcePathToUrl(url, path$1) { - try { - new URL(url); - } catch { - diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); - return; - } - if (!url.endsWith("/")) url = url + "/"; - url += path$1; - try { - new URL(url); - } catch { - diag.warn(`Configuration: Provided URL appended with '${path$1}' is not a valid URL, using 'undefined' instead of '${url}'`); - return; - } - return url; -} -function getNonSpecificUrlFromEnv(signalResourcePath) { - const envUrl = (0, import_src$4.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT"); - if (envUrl === void 0) return; - return appendResourcePathToUrl(envUrl, signalResourcePath); -} -function getSpecificUrlFromEnv(signalIdentifier) { - const envUrl = (0, import_src$4.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`); - if (envUrl === void 0) return; - return appendRootPathToUrlIfNeeded(envUrl); -} -/** -* Reads and returns configuration from the environment -* -* @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS) -* @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs) -*/ -function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) { - return { - ...getSharedConfigurationFromEnvironment(signalIdentifier), - url: getSpecificUrlFromEnv(signalIdentifier) ?? getNonSpecificUrlFromEnv(signalResourcePath), - headers: wrapStaticHeadersInFunction(getStaticHeadersFromEnv(signalIdentifier)) - }; -} -var import_src$4; -var init_otlp_node_http_env_configuration = __esmMin((() => { - import_src$4 = require_src$8(); - init_esm$2(); - init_shared_env_configuration(); - init_shared_configuration(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-node-http-options.js -function convertLegacyAgentOptions(config$1) { - if (typeof config$1.httpAgentOptions === "function") return config$1.httpAgentOptions; - let legacy = config$1.httpAgentOptions; - if (config$1.keepAlive != null) legacy = { - keepAlive: config$1.keepAlive, - ...legacy - }; - if (legacy != null) return httpAgentFactoryFromOptions(legacy); - else return; -} -/** -* @deprecated this will be removed in 2.0 -* @param config -* @param signalIdentifier -* @param signalResourcePath -* @param requiredHeaders -*/ -function convertLegacyHttpOptions(config$1, signalIdentifier, signalResourcePath, requiredHeaders) { - if (config$1.metadata) diag.warn("Metadata cannot be set when using http"); - return mergeOtlpNodeHttpConfigurationWithDefaults({ - url: config$1.url, - headers: wrapStaticHeadersInFunction(config$1.headers), - concurrencyLimit: config$1.concurrencyLimit, - timeoutMillis: config$1.timeoutMillis, - compression: config$1.compression, - agentFactory: convertLegacyAgentOptions(config$1) - }, getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath), getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath)); -} -var init_convert_legacy_node_http_options = __esmMin((() => { - init_esm$2(); - init_shared_configuration(); - init_otlp_node_http_configuration(); - init_index_node_http(); - init_otlp_node_http_env_configuration(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index-node-http.js -var index_node_http_exports = /* @__PURE__ */ __exportAll({ - convertLegacyHttpOptions: () => convertLegacyHttpOptions, - createOtlpHttpExportDelegate: () => createOtlpHttpExportDelegate, - getSharedConfigurationFromEnvironment: () => getSharedConfigurationFromEnvironment, - httpAgentFactoryFromOptions: () => httpAgentFactoryFromOptions -}); -var init_index_node_http = __esmMin((() => { - init_otlp_node_http_configuration(); - init_otlp_http_export_delegate(); - init_shared_env_configuration(); - init_convert_legacy_node_http_options(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js -var require_OTLPTraceExporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - const otlp_exporter_base_1 = (init_esm(), __toCommonJS(esm_exports)); - const version_1 = require_version$1(); - const otlp_transformer_1 = require_src$5(); - const node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports)); - /** - * Collector Trace Exporter for Node - */ - var OTLPTraceExporter = class extends otlp_exporter_base_1.OTLPExporterBase { - constructor(config$1 = {}) { - super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config$1, "TRACES", "v1/traces", { - "User-Agent": `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`, - "Content-Type": "application/json" - }), otlp_transformer_1.JsonTraceSerializer)); - } - }; - exports.OTLPTraceExporter = OTLPTraceExporter; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js -var require_node$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - var OTLPTraceExporter_1 = require_OTLPTraceExporter(); - Object.defineProperty(exports, "OTLPTraceExporter", { - enumerable: true, - get: function() { - return OTLPTraceExporter_1.OTLPTraceExporter; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js -var require_platform$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - var node_1 = require_node$2(); - Object.defineProperty(exports, "OTLPTraceExporter", { - enumerable: true, - get: function() { - return node_1.OTLPTraceExporter; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js -var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - var platform_1 = require_platform$2(); - Object.defineProperty(exports, "OTLPTraceExporter", { - enumerable: true, - get: function() { - return platform_1.OTLPTraceExporter; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/default-service-name.js -var require_default_service_name = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports._clearDefaultServiceNameCache = exports.defaultServiceName = void 0; - let serviceName; - /** - * Returns the default service name for OpenTelemetry resources. - * In Node.js environments, returns "unknown_service:". - * In browser/edge environments, returns "unknown_service". - */ - function defaultServiceName() { - if (serviceName === void 0) try { - const argv0 = globalThis.process.argv0; - serviceName = argv0 ? `unknown_service:${argv0}` : "unknown_service"; - } catch { - serviceName = "unknown_service"; - } - return serviceName; - } - exports.defaultServiceName = defaultServiceName; - /** @internal For testing purposes only */ - function _clearDefaultServiceNameCache() { - serviceName = void 0; - } - exports._clearDefaultServiceNameCache = _clearDefaultServiceNameCache; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/utils.js -var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isPromiseLike = void 0; - const isPromiseLike = (val) => { - return val !== null && typeof val === "object" && typeof val.then === "function"; - }; - exports.isPromiseLike = isPromiseLike; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js -var require_ResourceImpl = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const default_service_name_1 = require_default_service_name(); - const utils_1 = require_utils$1(); - var ResourceImpl = class ResourceImpl { - _rawAttributes; - _asyncAttributesPending = false; - _schemaUrl; - _memoizedAttributes; - static FromAttributeList(attributes, options) { - const res = new ResourceImpl({}, options); - res._rawAttributes = guardedRawAttributes(attributes); - res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; - return res; - } - constructor(resource, options) { - const attributes = resource.attributes ?? {}; - this._rawAttributes = Object.entries(attributes).map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) this._asyncAttributesPending = true; - return [k, v]; - }); - this._rawAttributes = guardedRawAttributes(this._rawAttributes); - this._schemaUrl = validateSchemaUrl(options?.schemaUrl); - } - get asyncAttributesPending() { - return this._asyncAttributesPending; - } - async waitForAsyncAttributes() { - if (!this.asyncAttributesPending) return; - for (let i = 0; i < this._rawAttributes.length; i++) { - const [k, v] = this._rawAttributes[i]; - this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; - } - this._asyncAttributesPending = false; - } - get attributes() { - if (this.asyncAttributesPending) api_1.diag.error("Accessing resource attributes before async attributes settled"); - if (this._memoizedAttributes) return this._memoizedAttributes; - const attrs = {}; - for (const [k, v] of this._rawAttributes) { - if ((0, utils_1.isPromiseLike)(v)) { - api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); - continue; - } - if (v != null) attrs[k] ??= v; - } - if (!this._asyncAttributesPending) this._memoizedAttributes = attrs; - return attrs; - } - getRawAttributes() { - return this._rawAttributes; - } - get schemaUrl() { - return this._schemaUrl; - } - merge(resource) { - if (resource == null) return this; - const mergedSchemaUrl = mergeSchemaUrl(this, resource); - const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0; - return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); - } - }; - function resourceFromAttributes(attributes, options) { - return ResourceImpl.FromAttributeList(Object.entries(attributes), options); - } - exports.resourceFromAttributes = resourceFromAttributes; - function resourceFromDetectedResource(detectedResource, options) { - return new ResourceImpl(detectedResource, options); - } - exports.resourceFromDetectedResource = resourceFromDetectedResource; - function emptyResource() { - return resourceFromAttributes({}); - } - exports.emptyResource = emptyResource; - function defaultResource() { - return resourceFromAttributes({ - [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, default_service_name_1.defaultServiceName)(), - [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] - }); - } - exports.defaultResource = defaultResource; - function guardedRawAttributes(attributes) { - return attributes.map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) return [k, v.catch((err) => { - api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); - })]; - return [k, v]; - }); - } - function validateSchemaUrl(schemaUrl) { - if (typeof schemaUrl === "string" || schemaUrl === void 0) return schemaUrl; - api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); - } - function mergeSchemaUrl(old, updating) { - const oldSchemaUrl = old?.schemaUrl; - const updatingSchemaUrl = updating?.schemaUrl; - const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === ""; - const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === ""; - if (isOldEmpty) return updatingSchemaUrl; - if (isUpdatingEmpty) return oldSchemaUrl; - if (oldSchemaUrl === updatingSchemaUrl) return oldSchemaUrl; - api_1.diag.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", oldSchemaUrl, updatingSchemaUrl); - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detect-resources.js -var require_detect_resources = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.detectResources = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const ResourceImpl_1 = require_ResourceImpl(); - /** - * Runs all resource detectors and returns the results merged into a single Resource. - * - * @param config Configuration for resource detection - */ - const detectResources = (config$1 = {}) => { - return (config$1.detectors || []).map((d) => { - try { - const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config$1)); - api_1.diag.debug(`${d.constructor.name} found resource.`, resource); - return resource; - } catch (e) { - api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); - return (0, ResourceImpl_1.emptyResource)(); - } - }).reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); - }; - exports.detectResources = detectResources; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js -var require_EnvDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.envDetector = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const core_1 = require_src$9(); - /** - * EnvDetector can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. - */ - var EnvDetector = class { - _MAX_LENGTH = 255; - _COMMA_SEPARATOR = ","; - _LABEL_KEY_VALUE_SPLITTER = "="; - /** - * Returns a {@link Resource} populated with attributes from the - * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async - * function to conform to the Detector interface. - * - * @param config The resource detection config - */ - detect(_config) { - const attributes = {}; - const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); - const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); - if (rawAttributes) try { - const parsedAttributes = this._parseResourceAttributes(rawAttributes); - Object.assign(attributes, parsedAttributes); - } catch (e) { - api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); - } - if (serviceName) attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; - return { attributes }; - } - /** - * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment - * variable. - * - * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the - * format "key1=value1,key2=value2". The ',' and '=' characters in keys - * and values MUST be percent-encoded. Other characters MAY be percent-encoded. - * - * Per the spec, on any error (e.g., decoding failure), the entire environment - * variable value is discarded. - * - * @param rawEnvAttributes The resource attributes as a comma-separated list - * of key/value pairs. - * @returns The parsed resource attributes. - * @throws Error if parsing fails (caller handles by discarding all attributes) - */ - _parseResourceAttributes(rawEnvAttributes) { - if (!rawEnvAttributes) return {}; - const attributes = {}; - const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR).filter((attr) => attr.trim() !== ""); - for (const rawAttribute of rawAttributes) { - const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); - if (keyValuePair.length !== 2) throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); - const [rawKey, rawValue] = keyValuePair; - const key = rawKey.trim(); - const value = rawValue.trim(); - if (key.length === 0) throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); - let decodedKey; - let decodedValue; - try { - decodedKey = decodeURIComponent(key); - decodedValue = decodeURIComponent(value); - } catch (e) { - throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`); - } - if (decodedKey.length > this._MAX_LENGTH) throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); - if (decodedValue.length > this._MAX_LENGTH) throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); - attributes[decodedKey] = decodedValue; - } - return attributes; - } - }; - exports.envDetector = new EnvDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js -var require_semconv$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; - /** - * The cloud account ID the resource is assigned to. - * - * @example 111111111111 - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; - /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * @example us-east-1c - * - * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; - /** - * Name of the cloud provider. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; - /** - * The geographical region the resource is running. - * - * @example us-central1 - * @example us-east-1 - * - * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_REGION = "cloud.region"; - /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. - * - * @example a3bf90e006b2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_ID = "container.id"; - /** - * Name of the image the container was built on. - * - * @example gcr.io/opentelemetry/operator - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; - /** - * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. - * - * @example ["v1.27.1", "3.5.7-0"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; - /** - * Container name used by container runtime. - * - * @example opentelemetry-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_NAME = "container.name"; - /** - * The CPU architecture the host system is running on. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ARCH = "host.arch"; - /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. - * - * @example fdbf79e8af94cb7f9e8df36789187052 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ID = "host.id"; - /** - * VM image ID or host OS image ID. For Cloud, this value is from the provider. - * - * @example ami-07b06b442921831e5 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_ID = "host.image.id"; - /** - * Name of the VM image or OS install the host was instantiated from. - * - * @example infra-ami-eks-worker-node-7d4ec78312 - * @example CentOS-8-x86_64-1905 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; - /** - * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 0.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; - /** - * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - * - * @example opentelemetry-test - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_NAME = "host.name"; - /** - * Type of host. For Cloud, this must be the machine type. - * - * @example n1-standard-1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_TYPE = "host.type"; - /** - * The name of the cluster. - * - * @example opentelemetry-cluster - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; - /** - * The name of the Deployment. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; - /** - * The name of the namespace that the pod is running in. - * - * @example default - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; - /** - * The name of the Pod. - * - * @example opentelemetry-pod-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; - /** - * The operating system type. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OS_TYPE = "os.type"; - /** - * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 14.2.1 - * @example 18.04.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OS_VERSION = "os.version"; - /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - * - * @example cmd/otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_COMMAND = "process.command"; - /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - * - * @example ["cmd/otecol", "--config=config.yaml"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; - /** - * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`. - * - * @example otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; - /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - * - * @example /usr/bin/cmd/otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; - /** - * The username of the user that owns the process. - * - * @example root - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_OWNER = "process.owner"; - /** - * Process identifier (PID). - * - * @example 1234 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_PID = "process.pid"; - /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - * - * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; - /** - * The name of the runtime of this process. - * - * @example OpenJDK Runtime Environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; - /** - * The version of the runtime of this process, as returned by the runtime without modification. - * - * @example "14.0.2" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; - /** - * The string ID of the service instance. - * - * @example 627cc493-f310-47de-96bd-71410b7dec09 - * - * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words - * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to - * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled - * service). - * - * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC - * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of - * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and - * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. - * - * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is - * needed. Similar to what can be seen in the man page for the - * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying - * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it - * or not via another resource attribute. - * - * For applications running behind an application server (like unicorn), we do not recommend using one identifier - * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker - * thread in unicorn) to have its own instance.id. - * - * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the - * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will - * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. - * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance - * for that telemetry. This is typically the case for scraping receivers, as they know the target address and - * port. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; - /** - * A namespace for `service.name`. - * - * @example Shop - * - * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; - /** - * Additional description of the web engine (e.g. detailed version and edition information). - * - * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; - /** - * The name of the web engine. - * - * @example WildFly - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_NAME = "webengine.name"; - /** - * The version of the web engine. - * - * @example 21.0.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_VERSION = "webengine.version"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js -var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.execAsync = void 0; - const child_process = __require("child_process"); - const util = __require("util"); - exports.execAsync = util.promisify(child_process.exec); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js -var require_getMachineId_darwin = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const execAsync_1 = require_execAsync(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID")); - if (!idLine) return; - const parts = idLine.split("\" = \""); - if (parts.length === 2) return parts[1].slice(0, -1); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js -var require_getMachineId_linux = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1$1 = __require("fs"); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - for (const path$1 of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try { - return (await fs_1$1.promises.readFile(path$1, { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js -var require_getMachineId_bsd = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1 = __require("fs"); - const execAsync_1 = require_execAsync(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - return (await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - try { - return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js -var require_getMachineId_win = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$2 = __require("process"); - const execAsync_1 = require_execAsync(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; - let command = "%windir%\\System32\\REG.exe"; - if (process$2.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process$2.env) command = "%windir%\\sysnative\\cmd.exe /c " + command; - try { - const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ"); - if (parts.length === 2) return parts[1].trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js -var require_getMachineId_unsupported = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - api_1.diag.debug("could not read machine-id: unsupported platform"); - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js -var require_getMachineId = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$1 = __require("process"); - let getMachineIdImpl; - async function getMachineId() { - if (!getMachineIdImpl) switch (process$1.platform) { - case "darwin": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_darwin()))).getMachineId; - break; - case "linux": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_linux()))).getMachineId; - break; - case "freebsd": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_bsd()))).getMachineId; - break; - case "win32": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_win()))).getMachineId; - break; - default: - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_unsupported()))).getMachineId; - break; - } - return getMachineIdImpl(); - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js -var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeType = exports.normalizeArch = void 0; - const normalizeArch = (nodeArchString) => { - switch (nodeArchString) { - case "arm": return "arm32"; - case "ppc": return "ppc32"; - case "x64": return "amd64"; - default: return nodeArchString; - } - }; - exports.normalizeArch = normalizeArch; - const normalizeType = (nodePlatform) => { - switch (nodePlatform) { - case "sunos": return "solaris"; - case "win32": return "windows"; - default: return nodePlatform; - } - }; - exports.normalizeType = normalizeType; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js -var require_HostDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hostDetector = void 0; - const semconv_1 = require_semconv$1(); - const os_1$1 = __require("os"); - const getMachineId_1 = require_getMachineId(); - const utils_1 = require_utils(); - /** - * HostDetector detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ - var HostDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_HOST_NAME]: (0, os_1$1.hostname)(), - [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1$1.arch)()), - [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() - } }; - } - }; - exports.hostDetector = new HostDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js -var require_OSDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.osDetector = void 0; - const semconv_1 = require_semconv$1(); - const os_1 = __require("os"); - const utils_1 = require_utils(); - /** - * OSDetector detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ - var OSDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), - [semconv_1.ATTR_OS_VERSION]: (0, os_1.release)() - } }; - } - }; - exports.osDetector = new OSDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js -var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.processDetector = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semconv_1 = require_semconv$1(); - const os = __require("os"); - /** - * ProcessDetector will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. - */ - var ProcessDetector = class { - detect(_config) { - const attributes = { - [semconv_1.ATTR_PROCESS_PID]: process.pid, - [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, - [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, - [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ - process.argv[0], - ...process.execArgv, - ...process.argv.slice(1) - ], - [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, - [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", - [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" - }; - if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; - try { - const userInfo = os.userInfo(); - attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; - } catch (e) { - api_1.diag.debug(`error obtaining process owner: ${e}`); - } - return { attributes }; - } - }; - exports.processDetector = new ProcessDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js -var require_ServiceInstanceIdDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = void 0; - const semconv_1 = require_semconv$1(); - const crypto_1 = __require("crypto"); - /** - * ServiceInstanceIdDetector detects the resources related to the service instance ID. - */ - var ServiceInstanceIdDetector = class { - detect(_config) { - return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)() } }; - } - }; - /** - * @experimental - */ - exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js -var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var HostDetector_1 = require_HostDetector(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return HostDetector_1.hostDetector; - } - }); - var OSDetector_1 = require_OSDetector(); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return OSDetector_1.osDetector; - } - }); - var ProcessDetector_1 = require_ProcessDetector(); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return ProcessDetector_1.processDetector; - } - }); - var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector(); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js -var require_platform$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var node_1 = require_node$1(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return node_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return node_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return node_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return node_1.serviceInstanceIdDetector; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js -var require_NoopDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.NoopDetector = void 0; - var NoopDetector = class { - detect() { - return { attributes: {} }; - } - }; - exports.NoopDetector = NoopDetector; - exports.noopDetector = new NoopDetector(); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/index.js -var require_detectors = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; - var EnvDetector_1 = require_EnvDetector(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return EnvDetector_1.envDetector; - } - }); - var platform_1 = require_platform$1(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return platform_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return platform_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return platform_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return platform_1.serviceInstanceIdDetector; - } - }); - var NoopDetector_1 = require_NoopDetector(); - Object.defineProperty(exports, "noopDetector", { - enumerable: true, - get: function() { - return NoopDetector_1.noopDetector; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/index.js -var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0; - var detect_resources_1 = require_detect_resources(); - Object.defineProperty(exports, "detectResources", { - enumerable: true, - get: function() { - return detect_resources_1.detectResources; - } - }); - var detectors_1 = require_detectors(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return detectors_1.envDetector; - } - }); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return detectors_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return detectors_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return detectors_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return detectors_1.serviceInstanceIdDetector; - } - }); - var ResourceImpl_1 = require_ResourceImpl(); - Object.defineProperty(exports, "resourceFromAttributes", { - enumerable: true, - get: function() { - return ResourceImpl_1.resourceFromAttributes; - } - }); - Object.defineProperty(exports, "defaultResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.defaultResource; - } - }); - Object.defineProperty(exports, "emptyResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.emptyResource; - } - }); - var default_service_name_1 = require_default_service_name(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return default_service_name_1.defaultServiceName; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/enums.js -var require_enums = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExceptionEventName = void 0; - exports.ExceptionEventName = "exception"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Span.js -var require_Span = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SpanImpl = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const enums_1 = require_enums(); - /** - * This class represents a span. - */ - var SpanImpl = class { - _spanContext; - kind; - parentSpanContext; - attributes = {}; - links = []; - events = []; - startTime; - resource; - instrumentationScope; - _droppedAttributesCount = 0; - _droppedEventsCount = 0; - _droppedLinksCount = 0; - _attributesCount = 0; - name; - status = { code: api_1.SpanStatusCode.UNSET }; - endTime = [0, 0]; - _ended = false; - _duration = [-1, -1]; - _spanProcessor; - _spanLimits; - _attributeValueLengthLimit; - _recordEndMetrics; - _performanceStartTime; - _performanceOffset; - _startTimeProvided; - /** - * Constructs a new SpanImpl instance. - */ - constructor(opts) { - const now = Date.now(); - this._spanContext = opts.spanContext; - this._performanceStartTime = core_1.otperformance.now(); - this._performanceOffset = now - (this._performanceStartTime + core_1.otperformance.timeOrigin); - this._startTimeProvided = opts.startTime != null; - this._spanLimits = opts.spanLimits; - this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0; - this._spanProcessor = opts.spanProcessor; - this.name = opts.name; - this.parentSpanContext = opts.parentSpanContext; - this.kind = opts.kind; - if (opts.links) for (const link of opts.links) this.addLink(link); - this.startTime = this._getTime(opts.startTime ?? now); - this.resource = opts.resource; - this.instrumentationScope = opts.scope; - this._recordEndMetrics = opts.recordEndMetrics; - if (opts.attributes != null) this.setAttributes(opts.attributes); - this._spanProcessor.onStart(this, opts.context); - } - spanContext() { - return this._spanContext; - } - setAttribute(key, value) { - if (value == null || this._isSpanEnded()) return this; - if (key.length === 0) { - api_1.diag.warn(`Invalid attribute key: ${key}`); - return this; - } - if (!(0, core_1.isAttributeValue)(value)) { - api_1.diag.warn(`Invalid attribute value set for key: ${key}`); - return this; - } - const { attributeCountLimit } = this._spanLimits; - const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key); - if (attributeCountLimit !== void 0 && this._attributesCount >= attributeCountLimit && isNewKey) { - this._droppedAttributesCount++; - return this; - } - this.attributes[key] = this._truncateToSize(value); - if (isNewKey) this._attributesCount++; - return this; - } - setAttributes(attributes) { - for (const key in attributes) if (Object.prototype.hasOwnProperty.call(attributes, key)) this.setAttribute(key, attributes[key]); - return this; - } - /** - * - * @param name Span Name - * @param [attributesOrStartTime] Span attributes or start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [timeStamp] Specified time stamp for the event - */ - addEvent(name, attributesOrStartTime, timeStamp) { - if (this._isSpanEnded()) return this; - const { eventCountLimit } = this._spanLimits; - if (eventCountLimit === 0) { - api_1.diag.warn("No events allowed."); - this._droppedEventsCount++; - return this; - } - if (eventCountLimit !== void 0 && this.events.length >= eventCountLimit) { - if (this._droppedEventsCount === 0) api_1.diag.debug("Dropping extra events."); - this.events.shift(); - this._droppedEventsCount++; - } - if ((0, core_1.isTimeInput)(attributesOrStartTime)) { - if (!(0, core_1.isTimeInput)(timeStamp)) timeStamp = attributesOrStartTime; - attributesOrStartTime = void 0; - } - const sanitized = (0, core_1.sanitizeAttributes)(attributesOrStartTime); - const { attributePerEventCountLimit } = this._spanLimits; - const attributes = {}; - let droppedAttributesCount = 0; - let eventAttributesCount = 0; - for (const attr in sanitized) { - if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; - const attrVal = sanitized[attr]; - if (attributePerEventCountLimit !== void 0 && eventAttributesCount >= attributePerEventCountLimit) { - droppedAttributesCount++; - continue; - } - attributes[attr] = this._truncateToSize(attrVal); - eventAttributesCount++; - } - this.events.push({ - name, - attributes, - time: this._getTime(timeStamp), - droppedAttributesCount - }); - return this; - } - addLink(link) { - if (this._isSpanEnded()) return this; - const { linkCountLimit } = this._spanLimits; - if (linkCountLimit === 0) { - this._droppedLinksCount++; - return this; - } - if (linkCountLimit !== void 0 && this.links.length >= linkCountLimit) { - if (this._droppedLinksCount === 0) api_1.diag.debug("Dropping extra links."); - this.links.shift(); - this._droppedLinksCount++; - } - const { attributePerLinkCountLimit } = this._spanLimits; - const sanitized = (0, core_1.sanitizeAttributes)(link.attributes); - const attributes = {}; - let droppedAttributesCount = 0; - let linkAttributesCount = 0; - for (const attr in sanitized) { - if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; - const attrVal = sanitized[attr]; - if (attributePerLinkCountLimit !== void 0 && linkAttributesCount >= attributePerLinkCountLimit) { - droppedAttributesCount++; - continue; - } - attributes[attr] = this._truncateToSize(attrVal); - linkAttributesCount++; - } - const processedLink = { context: link.context }; - if (linkAttributesCount > 0) processedLink.attributes = attributes; - if (droppedAttributesCount > 0) processedLink.droppedAttributesCount = droppedAttributesCount; - this.links.push(processedLink); - return this; - } - addLinks(links) { - for (const link of links) this.addLink(link); - return this; - } - setStatus(status) { - if (this._isSpanEnded()) return this; - if (status.code === api_1.SpanStatusCode.UNSET) return this; - if (this.status.code === api_1.SpanStatusCode.OK) return this; - const newStatus = { code: status.code }; - if (status.code === api_1.SpanStatusCode.ERROR) { - if (typeof status.message === "string") newStatus.message = status.message; - else if (status.message != null) api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); - } - this.status = newStatus; - return this; - } - updateName(name) { - if (this._isSpanEnded()) return this; - this.name = name; - return this; - } - end(endTime) { - if (this._isSpanEnded()) { - api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); - return; - } - this.endTime = this._getTime(endTime); - this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); - if (this._duration[0] < 0) { - api_1.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.", this.startTime, this.endTime); - this.endTime = this.startTime.slice(); - this._duration = [0, 0]; - } - if (this._droppedEventsCount > 0) api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); - if (this._droppedLinksCount > 0) api_1.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`); - if (this._spanProcessor.onEnding) this._spanProcessor.onEnding(this); - this._recordEndMetrics?.(); - this._ended = true; - this._spanProcessor.onEnd(this); - } - _getTime(inp) { - if (typeof inp === "number" && inp <= core_1.otperformance.now()) return (0, core_1.hrTime)(inp + this._performanceOffset); - if (typeof inp === "number") return (0, core_1.millisToHrTime)(inp); - if (inp instanceof Date) return (0, core_1.millisToHrTime)(inp.getTime()); - if ((0, core_1.isTimeInputHrTime)(inp)) return inp; - if (this._startTimeProvided) return (0, core_1.millisToHrTime)(Date.now()); - const msDuration = core_1.otperformance.now() - this._performanceStartTime; - return (0, core_1.addHrTimes)(this.startTime, (0, core_1.millisToHrTime)(msDuration)); - } - isRecording() { - return this._ended === false; - } - recordException(exception, time$2) { - const attributes = {}; - if (typeof exception === "string") attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception; - else if (exception) { - if (exception.code) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.code.toString(); - else if (exception.name) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.name; - if (exception.message) attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception.message; - if (exception.stack) attributes[semantic_conventions_1.ATTR_EXCEPTION_STACKTRACE] = exception.stack; - } - if (attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] || attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]) this.addEvent(enums_1.ExceptionEventName, attributes, time$2); - else api_1.diag.warn(`Failed to record an exception ${exception}`); - } - get duration() { - return this._duration; - } - get ended() { - return this._ended; - } - get droppedAttributesCount() { - return this._droppedAttributesCount; - } - get droppedEventsCount() { - return this._droppedEventsCount; - } - get droppedLinksCount() { - return this._droppedLinksCount; - } - _isSpanEnded() { - if (this._ended) { - const error = /* @__PURE__ */ new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); - api_1.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error); - } - return this._ended; - } - _truncateToLimitUtil(value, limit) { - if (value.length <= limit) return value; - return value.substring(0, limit); - } - /** - * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then - * return string with truncated to {@code attributeValueLengthLimit} characters - * - * If the given attribute value is array of strings then - * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters - * - * Otherwise return same Attribute {@code value} - * - * @param value Attribute value - * @returns truncated attribute value if required, otherwise same value - */ - _truncateToSize(value) { - const limit = this._attributeValueLengthLimit; - if (limit <= 0) { - api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); - return value; - } - if (typeof value === "string") return this._truncateToLimitUtil(value, limit); - if (Array.isArray(value)) return value.map((val) => typeof val === "string" ? this._truncateToLimitUtil(val, limit) : val); - return value; - } - }; - exports.SpanImpl = SpanImpl; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Sampler.js -var require_Sampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SamplingDecision = void 0; - (function(SamplingDecision$1) { - /** - * `Span.isRecording() === false`, span will not be recorded and all events - * and attributes will be dropped. - */ - SamplingDecision$1[SamplingDecision$1["NOT_RECORD"] = 0] = "NOT_RECORD"; - /** - * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} - * MUST NOT be set. - */ - SamplingDecision$1[SamplingDecision$1["RECORD"] = 1] = "RECORD"; - /** - * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} - * MUST be set. - */ - SamplingDecision$1[SamplingDecision$1["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; - })(exports.SamplingDecision || (exports.SamplingDecision = {})); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOffSampler.js -var require_AlwaysOffSampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AlwaysOffSampler = void 0; - const Sampler_1 = require_Sampler(); - /** Sampler that samples no traces. */ - var AlwaysOffSampler = class { - shouldSample() { - return { decision: Sampler_1.SamplingDecision.NOT_RECORD }; - } - toString() { - return "AlwaysOffSampler"; - } - }; - exports.AlwaysOffSampler = AlwaysOffSampler; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOnSampler.js -var require_AlwaysOnSampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AlwaysOnSampler = void 0; - const Sampler_1 = require_Sampler(); - /** Sampler that samples all traces. */ - var AlwaysOnSampler = class { - shouldSample() { - return { decision: Sampler_1.SamplingDecision.RECORD_AND_SAMPLED }; - } - toString() { - return "AlwaysOnSampler"; - } - }; - exports.AlwaysOnSampler = AlwaysOnSampler; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/ParentBasedSampler.js -var require_ParentBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ParentBasedSampler = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const AlwaysOffSampler_1 = require_AlwaysOffSampler(); - const AlwaysOnSampler_1 = require_AlwaysOnSampler(); - /** - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ - var ParentBasedSampler = class { - _root; - _remoteParentSampled; - _remoteParentNotSampled; - _localParentSampled; - _localParentNotSampled; - constructor(config$1) { - this._root = config$1.root; - if (!this._root) { - (0, core_1.globalErrorHandler)(/* @__PURE__ */ new Error("ParentBasedSampler must have a root sampler configured")); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = config$1.remoteParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = config$1.remoteParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = config$1.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = config$1.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context$1, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context$1); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) return this._root.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._remoteParentSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - return this._remoteParentNotSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._localParentSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - return this._localParentNotSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } - }; - exports.ParentBasedSampler = ParentBasedSampler; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/TraceIdRatioBasedSampler.js -var require_TraceIdRatioBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TraceIdRatioBasedSampler = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const Sampler_1 = require_Sampler(); - /** Sampler that samples a given fraction of traces based of trace id deterministically. */ - var TraceIdRatioBasedSampler = class { - _ratio; - _upperBound; - constructor(ratio = 0) { - this._ratio = this._normalize(ratio); - this._upperBound = Math.floor(this._ratio * 4294967295); - } - shouldSample(context$1, traceId) { - return { decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED : Sampler_1.SamplingDecision.NOT_RECORD }; - } - toString() { - return `TraceIdRatioBased{${this._ratio}}`; - } - _normalize(ratio) { - if (typeof ratio !== "number" || isNaN(ratio)) return 0; - return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; - } - _accumulate(traceId) { - let accumulation = 0; - for (let i = 0; i < 32; i += 8) { - let part = 0; - for (let j = 0; j < 8; j++) { - const c = traceId.charCodeAt(i + j); - const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87; - part = part << 4 | v; - } - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } - }; - exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/config.js -var require_config = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const AlwaysOffSampler_1 = require_AlwaysOffSampler(); - const AlwaysOnSampler_1 = require_AlwaysOnSampler(); - const ParentBasedSampler_1 = require_ParentBasedSampler(); - const TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); - var TracesSamplerValues; - (function(TracesSamplerValues) { - TracesSamplerValues["AlwaysOff"] = "always_off"; - TracesSamplerValues["AlwaysOn"] = "always_on"; - TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; - TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; - TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; - TracesSamplerValues["TraceIdRatio"] = "traceidratio"; - })(TracesSamplerValues || (TracesSamplerValues = {})); - const DEFAULT_RATIO = 1; - /** - * Load default configuration. For fields with primitive values, any user-provided - * value will override the corresponding default value. For fields with - * non-primitive values (like `spanLimits`), the user-provided value will be - * used to extend the default value. - */ - function loadDefaultConfig() { - return { - sampler: buildSamplerFromEnv(), - forceFlushTimeoutMillis: 3e4, - generalLimits: { - attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, - attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? 128 - }, - spanLimits: { - attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, - attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? 128, - linkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT") ?? 128, - eventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT") ?? 128, - attributePerEventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT") ?? 128, - attributePerLinkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT") ?? 128 - } - }; - } - exports.loadDefaultConfig = loadDefaultConfig; - /** - * Based on environment, builds a sampler, complies with specification. - */ - function buildSamplerFromEnv() { - const sampler = (0, core_1.getStringFromEnv)("OTEL_TRACES_SAMPLER") ?? TracesSamplerValues.ParentBasedAlwaysOn; - switch (sampler) { - case TracesSamplerValues.AlwaysOn: return new AlwaysOnSampler_1.AlwaysOnSampler(); - case TracesSamplerValues.AlwaysOff: return new AlwaysOffSampler_1.AlwaysOffSampler(); - case TracesSamplerValues.ParentBasedAlwaysOn: return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOnSampler_1.AlwaysOnSampler() }); - case TracesSamplerValues.ParentBasedAlwaysOff: return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOffSampler_1.AlwaysOffSampler() }); - case TracesSamplerValues.TraceIdRatio: return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()); - case TracesSamplerValues.ParentBasedTraceIdRatio: return new ParentBasedSampler_1.ParentBasedSampler({ root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()) }); - default: - api_1.diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`); - return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOnSampler_1.AlwaysOnSampler() }); - } - } - exports.buildSamplerFromEnv = buildSamplerFromEnv; - function getSamplerProbabilityFromEnv() { - const probability = (0, core_1.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG"); - if (probability == null) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - if (probability < 0 || probability > 1) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - return probability; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js -var require_utility = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.reconfigureLimits = exports.mergeConfig = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = void 0; - const config_1 = require_config(); - const core_1 = require_src$9(); - exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; - exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; - /** - * Function to merge Default configuration (as specified in './config') with - * user provided configurations. - */ - function mergeConfig(userConfig) { - const perInstanceDefaults = { sampler: (0, config_1.buildSamplerFromEnv)() }; - const DEFAULT_CONFIG = (0, config_1.loadDefaultConfig)(); - const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig); - target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); - target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); - return target; - } - exports.mergeConfig = mergeConfig; - /** - * When general limits are provided and model specific limits are not, - * configures the model specific limits by using the values from the general ones. - * @param userConfig User provided tracer configuration - */ - function reconfigureLimits(userConfig) { - const spanLimits = Object.assign({}, userConfig.spanLimits); - /** - * Reassign span attribute count limit to use first non null value defined by user or use default value - */ - spanLimits.attributeCountLimit = userConfig.spanLimits?.attributeCountLimit ?? userConfig.generalLimits?.attributeCountLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT; - /** - * Reassign span attribute value length limit to use first non null value defined by user or use default value - */ - spanLimits.attributeValueLengthLimit = userConfig.spanLimits?.attributeValueLengthLimit ?? userConfig.generalLimits?.attributeValueLengthLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; - return Object.assign({}, userConfig, { spanLimits }); - } - exports.reconfigureLimits = reconfigureLimits; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/BatchSpanProcessorBase.js -var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BatchSpanProcessorBase = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - /** - * Implementation of the {@link SpanProcessor} that batches spans exported by - * the SDK then pushes them to the exporter pipeline. - */ - var BatchSpanProcessorBase = class { - _maxExportBatchSize; - _maxQueueSize; - _scheduledDelayMillis; - _exportTimeoutMillis; - _exporter; - _isExporting = false; - _finishedSpans = []; - _timer; - _shutdownOnce; - _droppedSpansCount = 0; - constructor(exporter, config$1) { - this._exporter = exporter; - this._maxExportBatchSize = typeof config$1?.maxExportBatchSize === "number" ? config$1.maxExportBatchSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE") ?? 512; - this._maxQueueSize = typeof config$1?.maxQueueSize === "number" ? config$1.maxQueueSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE") ?? 2048; - this._scheduledDelayMillis = typeof config$1?.scheduledDelayMillis === "number" ? config$1.scheduledDelayMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY") ?? 5e3; - this._exportTimeoutMillis = typeof config$1?.exportTimeoutMillis === "number" ? config$1.exportTimeoutMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT") ?? 3e4; - this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); - if (this._maxExportBatchSize > this._maxQueueSize) { - api_1.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"); - this._maxExportBatchSize = this._maxQueueSize; - } - } - forceFlush() { - if (this._shutdownOnce.isCalled) return this._shutdownOnce.promise; - return this._flushAll(); - } - onStart(_span, _parentContext) {} - onEnd(span) { - if (this._shutdownOnce.isCalled) return; - if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) return; - this._addToBuffer(span); - } - shutdown() { - return this._shutdownOnce.call(); - } - _shutdown() { - return Promise.resolve().then(() => { - return this.onShutdown(); - }).then(() => { - return this._flushAll(); - }).then(() => { - return this._exporter.shutdown(); - }); - } - /** Add a span in the buffer. */ - _addToBuffer(span) { - if (this._finishedSpans.length >= this._maxQueueSize) { - if (this._droppedSpansCount === 0) api_1.diag.debug("maxQueueSize reached, dropping spans"); - this._droppedSpansCount++; - return; - } - if (this._droppedSpansCount > 0) { - api_1.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`); - this._droppedSpansCount = 0; - } - this._finishedSpans.push(span); - this._maybeStartTimer(); - } - /** - * Send all spans to the exporter respecting the batch size limit - * This function is used only on forceFlush or shutdown, - * for all other cases _flush should be used - * */ - _flushAll() { - return new Promise((resolve, reject) => { - const promises = []; - const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); - for (let i = 0, j = count; i < j; i++) promises.push(this._flushOneBatch()); - Promise.all(promises).then(() => { - resolve(); - }).catch(reject); - }); - } - _flushOneBatch() { - this._clearTimer(); - if (this._finishedSpans.length === 0) return Promise.resolve(); - return new Promise((resolve, reject) => { - const timer = setTimeout(() => { - reject(/* @__PURE__ */ new Error("Timeout")); - }, this._exportTimeoutMillis); - api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { - let spans; - if (this._finishedSpans.length <= this._maxExportBatchSize) { - spans = this._finishedSpans; - this._finishedSpans = []; - } else spans = this._finishedSpans.splice(0, this._maxExportBatchSize); - const doExport = () => this._exporter.export(spans, (result) => { - clearTimeout(timer); - if (result.code === core_1.ExportResultCode.SUCCESS) resolve(); - else reject(result.error ?? /* @__PURE__ */ new Error("BatchSpanProcessor: span export failed")); - }); - let pendingResources = null; - for (let i = 0, len = spans.length; i < len; i++) { - const span = spans[i]; - if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) { - pendingResources ??= []; - pendingResources.push(span.resource.waitForAsyncAttributes()); - } - } - if (pendingResources === null) doExport(); - else Promise.all(pendingResources).then(doExport, (err) => { - (0, core_1.globalErrorHandler)(err); - reject(err); - }); - }); - }); - } - _maybeStartTimer() { - if (this._isExporting) return; - const flush = () => { - this._isExporting = true; - this._flushOneBatch().finally(() => { - this._isExporting = false; - if (this._finishedSpans.length > 0) { - this._clearTimer(); - this._maybeStartTimer(); - } - }).catch((e) => { - this._isExporting = false; - (0, core_1.globalErrorHandler)(e); - }); - }; - if (this._finishedSpans.length >= this._maxExportBatchSize) return flush(); - if (this._timer !== void 0) return; - this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); - if (typeof this._timer !== "number") this._timer.unref(); - } - _clearTimer() { - if (this._timer !== void 0) { - clearTimeout(this._timer); - this._timer = void 0; - } - } - }; - exports.BatchSpanProcessorBase = BatchSpanProcessorBase; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/export/BatchSpanProcessor.js -var require_BatchSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BatchSpanProcessor = void 0; - const BatchSpanProcessorBase_1 = require_BatchSpanProcessorBase(); - var BatchSpanProcessor = class extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { - onShutdown() {} - }; - exports.BatchSpanProcessor = BatchSpanProcessor; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/RandomIdGenerator.js -var require_RandomIdGenerator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RandomIdGenerator = void 0; - const SPAN_ID_BYTES = 8; - const TRACE_ID_BYTES = 16; - var RandomIdGenerator = class { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - generateSpanId = getIdGenerator(SPAN_ID_BYTES); - }; - exports.RandomIdGenerator = RandomIdGenerator; - const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); - function getIdGenerator(bytes) { - return function generateId() { - for (let i = 0; i < bytes / 4; i++) SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i * 4); - for (let i = 0; i < bytes; i++) if (SHARED_BUFFER[i] > 0) break; - else if (i === bytes - 1) SHARED_BUFFER[bytes - 1] = 1; - return SHARED_BUFFER.toString("hex", 0, bytes); - }; - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js -var require_node = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; - var BatchSpanProcessor_1 = require_BatchSpanProcessor(); - Object.defineProperty(exports, "BatchSpanProcessor", { - enumerable: true, - get: function() { - return BatchSpanProcessor_1.BatchSpanProcessor; - } - }); - var RandomIdGenerator_1 = require_RandomIdGenerator(); - Object.defineProperty(exports, "RandomIdGenerator", { - enumerable: true, - get: function() { - return RandomIdGenerator_1.RandomIdGenerator; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/index.js -var require_platform = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; - var node_1 = require_node(); - Object.defineProperty(exports, "BatchSpanProcessor", { - enumerable: true, - get: function() { - return node_1.BatchSpanProcessor; - } - }); - Object.defineProperty(exports, "RandomIdGenerator", { - enumerable: true, - get: function() { - return node_1.RandomIdGenerator; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/semconv.js -var require_semconv = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.METRIC_OTEL_SDK_SPAN_STARTED = exports.METRIC_OTEL_SDK_SPAN_LIVE = exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = void 0; - /** - * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = "otel.span.parent.origin"; - /** - * The result value of the sampler for this span - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = "otel.span.sampling_result"; - /** - * The number of created spans with `recording=true` for which the end operation has not been called yet. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.METRIC_OTEL_SDK_SPAN_LIVE = "otel.sdk.span.live"; - /** - * The number of created spans. - * - * @note Implementations **MUST** record this metric for all spans, even for non-recording ones. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.METRIC_OTEL_SDK_SPAN_STARTED = "otel.sdk.span.started"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/TracerMetrics.js -var require_TracerMetrics = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TracerMetrics = void 0; - const Sampler_1 = require_Sampler(); - const semconv_1 = require_semconv(); - /** - * Generates `otel.sdk.span.*` metrics. - * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics - */ - var TracerMetrics = class { - startedSpans; - liveSpans; - constructor(meter) { - this.startedSpans = meter.createCounter(semconv_1.METRIC_OTEL_SDK_SPAN_STARTED, { - unit: "{span}", - description: "The number of created spans." - }); - this.liveSpans = meter.createUpDownCounter(semconv_1.METRIC_OTEL_SDK_SPAN_LIVE, { - unit: "{span}", - description: "The number of currently live spans." - }); - } - startSpan(parentSpanCtx, samplingDecision) { - const samplingDecisionStr = samplingDecisionToString(samplingDecision); - this.startedSpans.add(1, { - [semconv_1.ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx), - [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr - }); - if (samplingDecision === Sampler_1.SamplingDecision.NOT_RECORD) return () => {}; - const liveSpanAttributes = { [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr }; - this.liveSpans.add(1, liveSpanAttributes); - return () => { - this.liveSpans.add(-1, liveSpanAttributes); - }; - } - }; - exports.TracerMetrics = TracerMetrics; - function parentOrigin(parentSpanContext) { - if (!parentSpanContext) return "none"; - if (parentSpanContext.isRemote) return "remote"; - return "local"; - } - function samplingDecisionToString(decision) { - switch (decision) { - case Sampler_1.SamplingDecision.RECORD_AND_SAMPLED: return "RECORD_AND_SAMPLE"; - case Sampler_1.SamplingDecision.RECORD: return "RECORD_ONLY"; - case Sampler_1.SamplingDecision.NOT_RECORD: return "DROP"; - } - } -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/version.js -var require_version = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.VERSION = void 0; - exports.VERSION = "2.7.1"; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Tracer.js -var require_Tracer = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Tracer = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const Span_1 = require_Span(); - const utility_1 = require_utility(); - const platform_1 = require_platform(); - const TracerMetrics_1 = require_TracerMetrics(); - const version_1 = require_version(); - /** - * This class represents a basic tracer. - */ - var Tracer = class { - _sampler; - _generalLimits; - _spanLimits; - _idGenerator; - instrumentationScope; - _resource; - _spanProcessor; - _tracerMetrics; - /** - * Constructs a new Tracer instance. - */ - constructor(instrumentationScope, config$1, resource, spanProcessor) { - const localConfig = (0, utility_1.mergeConfig)(config$1); - this._sampler = localConfig.sampler; - this._generalLimits = localConfig.generalLimits; - this._spanLimits = localConfig.spanLimits; - this._idGenerator = config$1.idGenerator || new platform_1.RandomIdGenerator(); - this._resource = resource; - this._spanProcessor = spanProcessor; - this.instrumentationScope = instrumentationScope; - const meter = localConfig.meterProvider ? localConfig.meterProvider.getMeter("@opentelemetry/sdk-trace", version_1.VERSION) : api.createNoopMeter(); - this._tracerMetrics = new TracerMetrics_1.TracerMetrics(meter); - } - /** - * Starts a new Span or returns the default NoopSpan based on the sampling - * decision. - */ - startSpan(name, options = {}, context$1 = api.context.active()) { - if (options.root) context$1 = api.trace.deleteSpan(context$1); - const parentSpan = api.trace.getSpan(context$1); - if ((0, core_1.isTracingSuppressed)(context$1)) { - api.diag.debug("Instrumentation suppressed, returning Noop Span"); - return api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); - } - const parentSpanContext = parentSpan?.spanContext(); - const spanId = this._idGenerator.generateSpanId(); - let validParentSpanContext; - let traceId; - let traceState; - if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) traceId = this._idGenerator.generateTraceId(); - else { - traceId = parentSpanContext.traceId; - traceState = parentSpanContext.traceState; - validParentSpanContext = parentSpanContext; - } - const spanKind = options.kind ?? api.SpanKind.INTERNAL; - const links = (options.links ?? []).map((link) => { - return { - context: link.context, - attributes: (0, core_1.sanitizeAttributes)(link.attributes) - }; - }); - const attributes = (0, core_1.sanitizeAttributes)(options.attributes); - const samplingResult = this._sampler.shouldSample(context$1, traceId, name, spanKind, attributes, links); - const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision); - traceState = samplingResult.traceState ?? traceState; - const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE; - const spanContext = { - traceId, - spanId, - traceFlags, - traceState - }; - if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { - api.diag.debug("Recording is off, propagating context in a non-recording span"); - return api.trace.wrapSpanContext(spanContext); - } - const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); - return new Span_1.SpanImpl({ - resource: this._resource, - scope: this.instrumentationScope, - context: context$1, - spanContext, - name, - kind: spanKind, - links, - parentSpanContext: validParentSpanContext, - attributes: initAttributes, - startTime: options.startTime, - spanProcessor: this._spanProcessor, - spanLimits: this._spanLimits, - recordEndMetrics - }); - } - startActiveSpan(name, arg2, arg3, arg4) { - let opts; - let ctx; - let fn; - if (arguments.length < 2) return; - else if (arguments.length === 2) fn = arg2; - else if (arguments.length === 3) { - opts = arg2; - fn = arg3; - } else { - opts = arg2; - ctx = arg3; - fn = arg4; - } - const parentContext = ctx ?? api.context.active(); - const span = this.startSpan(name, opts, parentContext); - const contextWithSpanSet = api.trace.setSpan(parentContext, span); - return api.context.with(contextWithSpanSet, fn, void 0, span); - } - /** Returns the active {@link GeneralLimits}. */ - getGeneralLimits() { - return this._generalLimits; - } - /** Returns the active {@link SpanLimits}. */ - getSpanLimits() { - return this._spanLimits; - } - }; - exports.Tracer = Tracer; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/MultiSpanProcessor.js -var require_MultiSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MultiSpanProcessor = void 0; - const core_1 = require_src$9(); - /** - * Implementation of the {@link SpanProcessor} that simply forwards all - * received events to a list of {@link SpanProcessor}s. - */ - var MultiSpanProcessor = class { - _spanProcessors; - constructor(spanProcessors) { - this._spanProcessors = spanProcessors; - } - forceFlush() { - const promises = []; - for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.forceFlush()); - return new Promise((resolve) => { - Promise.all(promises).then(() => { - resolve(); - }).catch((error) => { - (0, core_1.globalErrorHandler)(error || /* @__PURE__ */ new Error("MultiSpanProcessor: forceFlush failed")); - resolve(); - }); - }); - } - onStart(span, context$1) { - for (const spanProcessor of this._spanProcessors) spanProcessor.onStart(span, context$1); - } - onEnding(span) { - for (const spanProcessor of this._spanProcessors) if (spanProcessor.onEnding) spanProcessor.onEnding(span); - } - onEnd(span) { - for (const spanProcessor of this._spanProcessors) spanProcessor.onEnd(span); - } - shutdown() { - const promises = []; - for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.shutdown()); - return new Promise((resolve, reject) => { - Promise.all(promises).then(() => { - resolve(); - }, reject); - }); - } - }; - exports.MultiSpanProcessor = MultiSpanProcessor; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js -var require_BasicTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BasicTracerProvider = exports.ForceFlushState = void 0; - const core_1 = require_src$9(); - const resources_1 = require_src$3(); - const Tracer_1 = require_Tracer(); - const config_1 = require_config(); - const MultiSpanProcessor_1 = require_MultiSpanProcessor(); - const utility_1 = require_utility(); - var ForceFlushState; - (function(ForceFlushState) { - ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved"; - ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout"; - ForceFlushState[ForceFlushState["error"] = 2] = "error"; - ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved"; - })(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); - /** - * This class represents a basic tracer provider which platform libraries can extend - */ - var BasicTracerProvider = class { - _config; - _tracers = /* @__PURE__ */ new Map(); - _resource; - _activeSpanProcessor; - constructor(config$1 = {}) { - const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config$1)); - this._resource = mergedConfig.resource ?? (0, resources_1.defaultResource)(); - this._config = Object.assign({}, mergedConfig, { resource: this._resource }); - const spanProcessors = []; - if (config$1.spanProcessors?.length) spanProcessors.push(...config$1.spanProcessors); - this._activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(spanProcessors); - } - getTracer(name, version$1, options) { - const key = `${name}@${version$1 || ""}:${options?.schemaUrl || ""}`; - if (!this._tracers.has(key)) this._tracers.set(key, new Tracer_1.Tracer({ - name, - version: version$1, - schemaUrl: options?.schemaUrl - }, this._config, this._resource, this._activeSpanProcessor)); - return this._tracers.get(key); - } - forceFlush() { - const timeout = this._config.forceFlushTimeoutMillis; - const promises = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => { - return new Promise((resolve) => { - let state; - const timeoutInterval = setTimeout(() => { - resolve(/* @__PURE__ */ new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); - state = ForceFlushState.timeout; - }, timeout); - spanProcessor.forceFlush().then(() => { - clearTimeout(timeoutInterval); - if (state !== ForceFlushState.timeout) { - state = ForceFlushState.resolved; - resolve(state); - } - }).catch((error) => { - clearTimeout(timeoutInterval); - state = ForceFlushState.error; - resolve(error); - }); - }); - }); - return new Promise((resolve, reject) => { - Promise.all(promises).then((results) => { - const errors = results.filter((result) => result !== ForceFlushState.resolved); - if (errors.length > 0) reject(errors); - else resolve(); - }).catch((error) => reject([error])); - }); - } - shutdown() { - return this._activeSpanProcessor.shutdown(); - } - }; - exports.BasicTracerProvider = BasicTracerProvider; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/ConsoleSpanExporter.js -var require_ConsoleSpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConsoleSpanExporter = void 0; - const core_1 = require_src$9(); - /** - * This is implementation of {@link SpanExporter} that prints spans to the - * console. This class can be used for diagnostic purposes. - * - * NOTE: This {@link SpanExporter} is intended for diagnostics use only, output rendered to the console may change at any time. - */ - var ConsoleSpanExporter = class { - /** - * Export spans. - * @param spans - * @param resultCallback - */ - export(spans, resultCallback) { - return this._sendSpans(spans, resultCallback); - } - /** - * Shutdown the exporter. - */ - shutdown() { - this._sendSpans([]); - return this.forceFlush(); - } - /** - * Exports any pending spans in exporter - */ - forceFlush() { - return Promise.resolve(); - } - /** - * converts span info into more readable format - * @param span - */ - _exportInfo(span) { - return { - resource: { attributes: span.resource.attributes }, - instrumentationScope: span.instrumentationScope, - traceId: span.spanContext().traceId, - parentSpanContext: span.parentSpanContext, - traceState: span.spanContext().traceState?.serialize(), - name: span.name, - id: span.spanContext().spanId, - kind: span.kind, - timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), - duration: (0, core_1.hrTimeToMicroseconds)(span.duration), - attributes: span.attributes, - status: span.status, - events: span.events, - links: span.links - }; - } - /** - * Showing spans in console - * @param spans - * @param done - */ - _sendSpans(spans, done) { - for (const span of spans) console.dir(this._exportInfo(span), { depth: 3 }); - if (done) return done({ code: core_1.ExportResultCode.SUCCESS }); - } - }; - exports.ConsoleSpanExporter = ConsoleSpanExporter; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/InMemorySpanExporter.js -var require_InMemorySpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.InMemorySpanExporter = void 0; - const core_1 = require_src$9(); - /** - * This class can be used for testing purposes. It stores the exported spans - * in a list in memory that can be retrieved using the `getFinishedSpans()` - * method. - */ - var InMemorySpanExporter = class { - _finishedSpans = []; - /** - * Indicates if the exporter has been "shutdown." - * When false, exported spans will not be stored in-memory. - */ - _stopped = false; - export(spans, resultCallback) { - if (this._stopped) return resultCallback({ - code: core_1.ExportResultCode.FAILED, - error: /* @__PURE__ */ new Error("Exporter has been stopped") - }); - this._finishedSpans.push(...spans); - setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); - } - shutdown() { - this._stopped = true; - this._finishedSpans = []; - return this.forceFlush(); - } - /** - * Exports any pending spans in the exporter - */ - forceFlush() { - return Promise.resolve(); - } - reset() { - this._finishedSpans = []; - } - getFinishedSpans() { - return this._finishedSpans; - } - }; - exports.InMemorySpanExporter = InMemorySpanExporter; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/SimpleSpanProcessor.js -var require_SimpleSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SimpleSpanProcessor = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - /** - * An implementation of the {@link SpanProcessor} that converts the {@link Span} - * to {@link ReadableSpan} and passes it to the configured exporter. - * - * Only spans that are sampled are converted. - * - * NOTE: This {@link SpanProcessor} exports every ended span individually instead of batching spans together, which causes significant performance overhead with most exporters. For production use, please consider using the {@link BatchSpanProcessor} instead. - */ - var SimpleSpanProcessor = class { - _exporter; - _shutdownOnce; - _pendingExports; - constructor(exporter) { - this._exporter = exporter; - this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); - this._pendingExports = /* @__PURE__ */ new Set(); - } - async forceFlush() { - await Promise.all(Array.from(this._pendingExports)); - if (this._exporter.forceFlush) await this._exporter.forceFlush(); - } - onStart(_span, _parentContext) {} - onEnd(span) { - if (this._shutdownOnce.isCalled) return; - if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) return; - const pendingExport = this._doExport(span).catch((err) => (0, core_1.globalErrorHandler)(err)); - this._pendingExports.add(pendingExport); - pendingExport.finally(() => this._pendingExports.delete(pendingExport)); - } - async _doExport(span) { - if (span.resource.asyncAttributesPending) await span.resource.waitForAsyncAttributes?.(); - const result = await core_1.internal._export(this._exporter, [span]); - if (result.code !== core_1.ExportResultCode.SUCCESS) throw result.error ?? /* @__PURE__ */ new Error(`SimpleSpanProcessor: span export failed (status ${result})`); - } - shutdown() { - return this._shutdownOnce.call(); - } - _shutdown() { - return this._exporter.shutdown(); - } - }; - exports.SimpleSpanProcessor = SimpleSpanProcessor; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js -var require_NoopSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.NoopSpanProcessor = void 0; - /** No-op implementation of SpanProcessor */ - var NoopSpanProcessor = class { - onStart(_span, _context) {} - onEnd(_span) {} - shutdown() { - return Promise.resolve(); - } - forceFlush() { - return Promise.resolve(); - } - }; - exports.NoopSpanProcessor = NoopSpanProcessor; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/index.js -var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.BasicTracerProvider = void 0; - var BasicTracerProvider_1 = require_BasicTracerProvider(); - Object.defineProperty(exports, "BasicTracerProvider", { - enumerable: true, - get: function() { - return BasicTracerProvider_1.BasicTracerProvider; - } - }); - var platform_1 = require_platform(); - Object.defineProperty(exports, "BatchSpanProcessor", { - enumerable: true, - get: function() { - return platform_1.BatchSpanProcessor; - } - }); - Object.defineProperty(exports, "RandomIdGenerator", { - enumerable: true, - get: function() { - return platform_1.RandomIdGenerator; - } - }); - var ConsoleSpanExporter_1 = require_ConsoleSpanExporter(); - Object.defineProperty(exports, "ConsoleSpanExporter", { - enumerable: true, - get: function() { - return ConsoleSpanExporter_1.ConsoleSpanExporter; - } - }); - var InMemorySpanExporter_1 = require_InMemorySpanExporter(); - Object.defineProperty(exports, "InMemorySpanExporter", { - enumerable: true, - get: function() { - return InMemorySpanExporter_1.InMemorySpanExporter; - } - }); - var SimpleSpanProcessor_1 = require_SimpleSpanProcessor(); - Object.defineProperty(exports, "SimpleSpanProcessor", { - enumerable: true, - get: function() { - return SimpleSpanProcessor_1.SimpleSpanProcessor; - } - }); - var NoopSpanProcessor_1 = require_NoopSpanProcessor(); - Object.defineProperty(exports, "NoopSpanProcessor", { - enumerable: true, - get: function() { - return NoopSpanProcessor_1.NoopSpanProcessor; - } - }); - var AlwaysOffSampler_1 = require_AlwaysOffSampler(); - Object.defineProperty(exports, "AlwaysOffSampler", { - enumerable: true, - get: function() { - return AlwaysOffSampler_1.AlwaysOffSampler; - } - }); - var AlwaysOnSampler_1 = require_AlwaysOnSampler(); - Object.defineProperty(exports, "AlwaysOnSampler", { - enumerable: true, - get: function() { - return AlwaysOnSampler_1.AlwaysOnSampler; - } - }); - var ParentBasedSampler_1 = require_ParentBasedSampler(); - Object.defineProperty(exports, "ParentBasedSampler", { - enumerable: true, - get: function() { - return ParentBasedSampler_1.ParentBasedSampler; - } - }); - var TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); - Object.defineProperty(exports, "TraceIdRatioBasedSampler", { - enumerable: true, - get: function() { - return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; - } - }); - var Sampler_1 = require_Sampler(); - Object.defineProperty(exports, "SamplingDecision", { - enumerable: true, - get: function() { - return Sampler_1.SamplingDecision; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@langfuse+otel@5.4.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.7.1_@opentelemetry+_e259bc6b5059078fd5966601016fecbc/node_modules/@langfuse/otel/dist/index.mjs -var import_src$1 = require_src$9(); -var import_src$2 = require_src$4(); -var import_src$3 = require_src$2(); + if (!baggageKey.startsWith(LANGFUSE_BAGGAGE_PREFIX)) + return; + const suffix = baggageKey.slice(LANGFUSE_BAGGAGE_PREFIX.length); + if (suffix.startsWith("metadata_")) { + const metadataKey = suffix.slice("metadata_".length); + return `${"langfuse.trace.metadata"}.${metadataKey}`; + } + switch (suffix) { + case "user_id": + return getSpanKeyForPropagatedKey("userId"); + case "session_id": + return getSpanKeyForPropagatedKey("sessionId"); + case "version": + return getSpanKeyForPropagatedKey("version"); + case "trace_name": + return getSpanKeyForPropagatedKey("traceName"); + case "tags": + return getSpanKeyForPropagatedKey("tags"); + case "experiment_id": + return getSpanKeyForPropagatedKey("experimentId"); + case "experiment_name": + return getSpanKeyForPropagatedKey("experimentName"); + case "experiment_metadata": + return getSpanKeyForPropagatedKey("experimentMetadata"); + case "experiment_dataset_id": + return getSpanKeyForPropagatedKey("experimentDatasetId"); + case "experiment_item_id": + return getSpanKeyForPropagatedKey("experimentItemId"); + case "experiment_item_metadata": + return getSpanKeyForPropagatedKey("experimentItemMetadata"); + case "experiment_item_root_observation_id": + return getSpanKeyForPropagatedKey("experimentItemRootObservationId"); + } +} + +// node_modules/@langfuse/otel/dist/index.mjs +var import_core9 = __toESM(require_src3(), 1); +var import_exporter_trace_otlp_http = __toESM(require_src12(), 1); +var import_sdk_trace_base = __toESM(require_src14(), 1); var MediaService = class { - constructor(params) { - this.pendingMediaUploads = /* @__PURE__ */ new Set(); - this.apiClient = params.apiClient; - } - get logger() { - return getGlobalLogger(); - } - async flush() { - await Promise.all(Array.from(this.pendingMediaUploads)); - } - async process(span) { - var _a$3; - const mediaAttributes = [ - LangfuseOtelSpanAttributes.OBSERVATION_INPUT, - LangfuseOtelSpanAttributes.TRACE_INPUT, - LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT, - LangfuseOtelSpanAttributes.TRACE_OUTPUT, - LangfuseOtelSpanAttributes.OBSERVATION_METADATA, - LangfuseOtelSpanAttributes.TRACE_METADATA - ]; - for (const mediaAttribute of mediaAttributes) { - const mediaRelevantAttributeKeys = Object.keys(span.attributes).filter((attributeName) => attributeName.startsWith(mediaAttribute)); - for (const key of mediaRelevantAttributeKeys) { - const value = span.attributes[key]; - if (typeof value !== "string") { - this.logger.warn(`Span attribute ${mediaAttribute} is not a stringified object. Skipping media handling.`); - continue; - } - let mediaReplacedValue = value; - const foundMedia = [...new Set((_a$3 = value.match(/data:[^;]+;base64,[A-Za-z0-9+/]+=*/g)) != null ? _a$3 : [])]; - if (foundMedia.length === 0) continue; - for (const mediaDataUri of foundMedia) { - const media = new LangfuseMedia({ - base64DataUri: mediaDataUri, - source: "base64_data_uri" - }); - const langfuseMediaTag = await media.getTag(); - if (!langfuseMediaTag) { - this.logger.warn("Failed to create Langfuse media tag. Skipping media item."); - continue; - } - this.scheduleUpload({ - span, - media, - field: mediaAttribute.includes("input") ? "input" : mediaAttribute.includes("output") ? "output" : "metadata" - }); - mediaReplacedValue = mediaReplacedValue.replaceAll(mediaDataUri, langfuseMediaTag); - } - span.attributes[key] = mediaReplacedValue; - } - } - if (span.instrumentationScope.name === "ai") for (const mediaAttribute of ["ai.prompt.messages", "ai.prompt"]) { - const value = span.attributes[mediaAttribute]; - if (!value || typeof value !== "string") continue; - let mediaReplacedValue = value; - try { - const parsed = JSON.parse(value); - if (Array.isArray(parsed)) { - for (const message of parsed) if (Array.isArray(message["content"])) { - const contentParts = message["content"]; - for (const part of contentParts) if (part["type"] === "file") { - let base64Content = null; - if (part["data"] != null && part["mediaType"] != null && typeof part["data"] !== "object" && !String(part["data"]).startsWith("http")) base64Content = part["data"]; - if (part["image"] != null && part["mediaType"] != null && !part["image"].startsWith("http")) base64Content = part["image"]; - if (!base64Content) continue; - const media = new LangfuseMedia({ - contentType: part["mediaType"], - contentBytes: base64ToBytes(base64Content), - source: "bytes" - }); - const langfuseMediaTag = await media.getTag(); - if (!langfuseMediaTag) { - this.logger.warn("Failed to create Langfuse media tag. Skipping media item."); - continue; - } - this.scheduleUpload({ - span, - media, - field: "input" - }); - mediaReplacedValue = mediaReplacedValue.replaceAll(base64Content, langfuseMediaTag); - } - } - } - span.attributes[mediaAttribute] = mediaReplacedValue; - } catch (err) { - this.logger.warn(`Failed to handle media for AI SDK attribute ${mediaAttribute} for span ${span.spanContext().spanId}`, err); - } - } - } - scheduleUpload(params) { - const { span, field, media } = params; - const uploadPromise = this.handleUpload({ - media, - traceId: span.spanContext().traceId, - observationId: span.spanContext().spanId, - field - }).catch((err) => { - this.logger.error("Media upload failed with error: ", err); - }); - this.pendingMediaUploads.add(uploadPromise); - uploadPromise.finally(() => { - this.pendingMediaUploads.delete(uploadPromise); - }); - } - async handleUpload({ media, traceId, observationId, field }) { - try { - const contentSha256Hash = await media.getSha256Hash(); - if (!media.contentLength || !media._contentType || !contentSha256Hash || !media._contentBytes) return; - const { uploadUrl, mediaId } = await this.apiClient.media.getUploadUrl({ - contentLength: media.contentLength, - traceId, - observationId, - field, - contentType: media._contentType, - sha256Hash: contentSha256Hash - }); - if (!uploadUrl) { - this.logger.debug(`Media status: Media with ID ${mediaId} already uploaded. Skipping duplicate upload.`); - return; - } - const clientSideMediaId = await media.getId(); - if (clientSideMediaId !== mediaId) { - this.logger.error(`Media integrity error: Media ID mismatch between SDK (${clientSideMediaId}) and Server (${mediaId}). Upload cancelled. Please check media ID generation logic.`); - return; - } - this.logger.debug(`Uploading media ${mediaId}...`); - const startTime = Date.now(); - const uploadResponse = await this.uploadWithBackoff({ - uploadUrl, - contentBytes: media._contentBytes, - contentType: media._contentType, - contentSha256Hash, - maxRetries: 3, - baseDelay: 1e3 - }); - if (!uploadResponse) throw Error("Media upload process failed"); - await this.apiClient.media.patch(mediaId, { - uploadedAt: (/* @__PURE__ */ new Date()).toISOString(), - uploadHttpStatus: uploadResponse.status, - uploadHttpError: await uploadResponse.text(), - uploadTimeMs: Date.now() - startTime - }); - this.logger.debug(`Media upload status reported for ${mediaId}`); - } catch (err) { - this.logger.error(`Error processing media item: ${err}`); - } - } - async uploadWithBackoff(params) { - const { uploadUrl, contentType, contentSha256Hash, contentBytes, maxRetries, baseDelay } = params; - for (let attempt = 0; attempt <= maxRetries; attempt++) try { - let parsedHostname; - try { - parsedHostname = new URL(uploadUrl).hostname; - } catch { - parsedHostname = ""; - } - const headers = parsedHostname === "storage.googleapis.com" || parsedHostname.endsWith(".storage.googleapis.com") ? { "Content-Type": contentType } : { - "Content-Type": contentType, - "x-amz-checksum-sha256": contentSha256Hash, - "x-ms-blob-type": "BlockBlob" - }; - const uploadResponse = await fetch(uploadUrl, { - method: "PUT", - body: contentBytes, - headers - }); - if (attempt < maxRetries && uploadResponse.status !== 200 && uploadResponse.status !== 201) throw new Error(`Upload failed with status ${uploadResponse.status}`); - return uploadResponse; - } catch (e) { - if (attempt === maxRetries) throw e; - const delay = baseDelay * Math.pow(2, attempt); - const jitter = Math.random() * 1e3; - await new Promise((resolve) => setTimeout(resolve, delay + jitter)); - } - } + constructor(params) { + this.pendingMediaUploads = /* @__PURE__ */ new Set; + this.apiClient = params.apiClient; + } + get logger() { + return getGlobalLogger(); + } + async flush() { + await Promise.all(Array.from(this.pendingMediaUploads)); + } + async process(span) { + var _a4; + const mediaAttributes = [ + LangfuseOtelSpanAttributes.OBSERVATION_INPUT, + LangfuseOtelSpanAttributes.TRACE_INPUT, + LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT, + LangfuseOtelSpanAttributes.TRACE_OUTPUT, + LangfuseOtelSpanAttributes.OBSERVATION_METADATA, + LangfuseOtelSpanAttributes.TRACE_METADATA + ]; + for (const mediaAttribute of mediaAttributes) { + const mediaRelevantAttributeKeys = Object.keys(span.attributes).filter((attributeName) => attributeName.startsWith(mediaAttribute)); + for (const key of mediaRelevantAttributeKeys) { + const value = span.attributes[key]; + if (typeof value !== "string") { + this.logger.warn(`Span attribute ${mediaAttribute} is not a stringified object. Skipping media handling.`); + continue; + } + let mediaReplacedValue = value; + const regex = /data:[^;]+;base64,[A-Za-z0-9+/]+=*/g; + const foundMedia = [...new Set((_a4 = value.match(regex)) != null ? _a4 : [])]; + if (foundMedia.length === 0) + continue; + for (const mediaDataUri of foundMedia) { + const media = new LangfuseMedia({ + base64DataUri: mediaDataUri, + source: "base64_data_uri" + }); + const langfuseMediaTag = await media.getTag(); + if (!langfuseMediaTag) { + this.logger.warn("Failed to create Langfuse media tag. Skipping media item."); + continue; + } + this.scheduleUpload({ + span, + media, + field: mediaAttribute.includes("input") ? "input" : mediaAttribute.includes("output") ? "output" : "metadata" + }); + mediaReplacedValue = mediaReplacedValue.replaceAll(mediaDataUri, langfuseMediaTag); + } + span.attributes[key] = mediaReplacedValue; + } + } + if (span.instrumentationScope.name === "ai") { + const aiSDKMediaAttributes = ["ai.prompt.messages", "ai.prompt"]; + for (const mediaAttribute of aiSDKMediaAttributes) { + const value = span.attributes[mediaAttribute]; + if (!value || typeof value !== "string") { + continue; + } + let mediaReplacedValue = value; + try { + const parsed = JSON.parse(value); + if (Array.isArray(parsed)) { + for (const message of parsed) { + if (Array.isArray(message["content"])) { + const contentParts = message["content"]; + for (const part of contentParts) { + if (part["type"] === "file") { + let base64Content = null; + if (part["data"] != null && part["mediaType"] != null && typeof part["data"] !== "object" && !String(part["data"]).startsWith("http")) { + base64Content = part["data"]; + } + if (part["image"] != null && part["mediaType"] != null && !part["image"].startsWith("http")) { + base64Content = part["image"]; + } + if (!base64Content) + continue; + const media = new LangfuseMedia({ + contentType: part["mediaType"], + contentBytes: base64ToBytes(base64Content), + source: "bytes" + }); + const langfuseMediaTag = await media.getTag(); + if (!langfuseMediaTag) { + this.logger.warn("Failed to create Langfuse media tag. Skipping media item."); + continue; + } + this.scheduleUpload({ + span, + media, + field: "input" + }); + mediaReplacedValue = mediaReplacedValue.replaceAll(base64Content, langfuseMediaTag); + } + } + } + } + } + span.attributes[mediaAttribute] = mediaReplacedValue; + } catch (err) { + this.logger.warn(`Failed to handle media for AI SDK attribute ${mediaAttribute} for span ${span.spanContext().spanId}`, err); + } + } + } + } + scheduleUpload(params) { + const { span, field, media } = params; + const uploadPromise = this.handleUpload({ + media, + traceId: span.spanContext().traceId, + observationId: span.spanContext().spanId, + field + }).catch((err) => { + this.logger.error("Media upload failed with error: ", err); + }); + this.pendingMediaUploads.add(uploadPromise); + uploadPromise.finally(() => { + this.pendingMediaUploads.delete(uploadPromise); + }); + } + async handleUpload({ + media, + traceId, + observationId, + field + }) { + try { + const contentSha256Hash = await media.getSha256Hash(); + if (!media.contentLength || !media._contentType || !contentSha256Hash || !media._contentBytes) { + return; + } + const { uploadUrl, mediaId } = await this.apiClient.media.getUploadUrl({ + contentLength: media.contentLength, + traceId, + observationId, + field, + contentType: media._contentType, + sha256Hash: contentSha256Hash + }); + if (!uploadUrl) { + this.logger.debug(`Media status: Media with ID ${mediaId} already uploaded. Skipping duplicate upload.`); + return; + } + const clientSideMediaId = await media.getId(); + if (clientSideMediaId !== mediaId) { + this.logger.error(`Media integrity error: Media ID mismatch between SDK (${clientSideMediaId}) and Server (${mediaId}). Upload cancelled. Please check media ID generation logic.`); + return; + } + this.logger.debug(`Uploading media ${mediaId}...`); + const startTime = Date.now(); + const uploadResponse = await this.uploadWithBackoff({ + uploadUrl, + contentBytes: media._contentBytes, + contentType: media._contentType, + contentSha256Hash, + maxRetries: 3, + baseDelay: 1000 + }); + if (!uploadResponse) { + throw Error("Media upload process failed"); + } + await this.apiClient.media.patch(mediaId, { + uploadedAt: (/* @__PURE__ */ new Date()).toISOString(), + uploadHttpStatus: uploadResponse.status, + uploadHttpError: await uploadResponse.text(), + uploadTimeMs: Date.now() - startTime + }); + this.logger.debug(`Media upload status reported for ${mediaId}`); + } catch (err) { + this.logger.error(`Error processing media item: ${err}`); + } + } + async uploadWithBackoff(params) { + const { + uploadUrl, + contentType, + contentSha256Hash, + contentBytes, + maxRetries, + baseDelay + } = params; + for (let attempt = 0;attempt <= maxRetries; attempt++) { + try { + let parsedHostname; + try { + parsedHostname = new URL(uploadUrl).hostname; + } catch { + parsedHostname = ""; + } + const isSelfHostedGcsBucket = parsedHostname === "storage.googleapis.com" || parsedHostname.endsWith(".storage.googleapis.com"); + const headers = isSelfHostedGcsBucket ? { "Content-Type": contentType } : { + "Content-Type": contentType, + "x-amz-checksum-sha256": contentSha256Hash, + "x-ms-blob-type": "BlockBlob" + }; + const uploadResponse = await fetch(uploadUrl, { + method: "PUT", + body: contentBytes, + headers + }); + if (attempt < maxRetries && uploadResponse.status !== 200 && uploadResponse.status !== 201) { + throw new Error(`Upload failed with status ${uploadResponse.status}`); + } + return uploadResponse; + } catch (e) { + if (attempt === maxRetries) { + throw e; + } + const delay = baseDelay * Math.pow(2, attempt); + const jitter = Math.random() * 1000; + await new Promise((resolve) => setTimeout(resolve, delay + jitter)); + } + } + } }; var KNOWN_LLM_INSTRUMENTATION_SCOPE_PREFIXES = [ - LANGFUSE_TRACER_NAME, - "agent_framework", - "ai", - "haystack", - "langsmith", - "litellm", - "openinference", - "opentelemetry.instrumentation.anthropic", - "opentelemetry.instrumentation.aws_bedrock", - "opentelemetry.instrumentation.bedrock", - "opentelemetry.instrumentation.gemini", - "opentelemetry.instrumentation.google_genai", - "opentelemetry.instrumentation.google_generativeai", - "opentelemetry.instrumentation.openai", - "opentelemetry.instrumentation.openai_v2", - "opentelemetry.instrumentation.vertex_ai", - "opentelemetry.instrumentation.vertexai", - "strands-agents", - "vllm" + LANGFUSE_TRACER_NAME, + "agent_framework", + "ai", + "haystack", + "langsmith", + "litellm", + "openinference", + "opentelemetry.instrumentation.anthropic", + "opentelemetry.instrumentation.aws_bedrock", + "opentelemetry.instrumentation.bedrock", + "opentelemetry.instrumentation.gemini", + "opentelemetry.instrumentation.google_genai", + "opentelemetry.instrumentation.google_generativeai", + "opentelemetry.instrumentation.openai", + "opentelemetry.instrumentation.openai_v2", + "opentelemetry.instrumentation.vertex_ai", + "opentelemetry.instrumentation.vertexai", + "strands-agents", + "vllm" ]; var EXACT_LLM_INSTRUMENTATION_SCOPES = /* @__PURE__ */ new Set(["ai"]); function isLangfuseSpan(span) { - return span.instrumentationScope.name === LANGFUSE_TRACER_NAME; + return span.instrumentationScope.name === LANGFUSE_TRACER_NAME; } function isGenAISpan(span) { - return Object.keys(span.attributes).some((attributeKey) => attributeKey.startsWith("gen_ai.")); + return Object.keys(span.attributes).some((attributeKey) => attributeKey.startsWith("gen_ai.")); } function isKnownLLMInstrumentor(span) { - const scope = span.instrumentationScope.name; - return KNOWN_LLM_INSTRUMENTATION_SCOPE_PREFIXES.some((prefix) => scope === prefix || !EXACT_LLM_INSTRUMENTATION_SCOPES.has(prefix) && scope.startsWith(`${prefix}.`)); + const scope = span.instrumentationScope.name; + return KNOWN_LLM_INSTRUMENTATION_SCOPE_PREFIXES.some((prefix) => scope === prefix || !EXACT_LLM_INSTRUMENTATION_SCOPES.has(prefix) && scope.startsWith(`${prefix}.`)); } function isDefaultExportSpan(span) { - return isLangfuseSpan(span) || isGenAISpan(span) || isKnownLLMInstrumentor(span); + return isLangfuseSpan(span) || isGenAISpan(span) || isKnownLLMInstrumentor(span); } var LangfuseSpanProcessor = class { - /** - * Creates a new LangfuseSpanProcessor instance. - * - * @param params - Configuration parameters for the processor - * - * @example - * ```typescript - * const processor = new LangfuseSpanProcessor({ - * publicKey: 'pk_...', - * secretKey: 'sk_...', - * environment: 'staging', - * flushAt: 10, - * flushInterval: 2, - * mask: ({ data }) => { - * // Custom masking logic - * return typeof data === 'string' - * ? data.replace(/secret_\w+/g, 'secret_***') - * : data; - * }, - * shouldExportSpan: ({ otelSpan }) => { - * // Full override of default filtering: - * // export only spans from specific services - * return otelSpan.name.startsWith("my-service"); - * } - * }); - * ``` - */ - constructor(params) { - this.pendingEndedSpans = /* @__PURE__ */ new Set(); - this.spanExportExpectationById = /* @__PURE__ */ new Map(); - var _a$3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m; - const logger = getGlobalLogger(); - const publicKey = (_a$3 = params == null ? void 0 : params.publicKey) != null ? _a$3 : getEnv("LANGFUSE_PUBLIC_KEY"); - const secretKey = (_b = params == null ? void 0 : params.secretKey) != null ? _b : getEnv("LANGFUSE_SECRET_KEY"); - const baseUrl = (_e = (_d = (_c = params == null ? void 0 : params.baseUrl) != null ? _c : getEnv("LANGFUSE_BASE_URL")) != null ? _d : getEnv("LANGFUSE_BASEURL")) != null ? _e : "https://cloud.langfuse.com"; - if (!(params == null ? void 0 : params.exporter) && !publicKey) logger.warn("No exporter configured and no public key provided in constructor or as LANGFUSE_PUBLIC_KEY env var. Span exports will fail."); - if (!(params == null ? void 0 : params.exporter) && !secretKey) logger.warn("No exporter configured and no secret key provided in constructor or as LANGFUSE_SECRET_KEY env var. Span exports will fail."); - const flushAt = (_f = params == null ? void 0 : params.flushAt) != null ? _f : getEnv("LANGFUSE_FLUSH_AT"); - const flushIntervalSeconds = (_g = params == null ? void 0 : params.flushInterval) != null ? _g : getEnv("LANGFUSE_FLUSH_INTERVAL"); - const authHeaderValue = base64Encode(`${publicKey}:${secretKey}`); - const timeoutSeconds = (_i = params == null ? void 0 : params.timeout) != null ? _i : Number((_h = getEnv("LANGFUSE_TIMEOUT")) != null ? _h : 5); - const exporter = (_j = params == null ? void 0 : params.exporter) != null ? _j : new import_src$2.OTLPTraceExporter({ - url: `${baseUrl}/api/public/otel/v1/traces`, - headers: { - Authorization: `Basic ${authHeaderValue}`, - "x-langfuse-sdk-name": "javascript", - "x-langfuse-sdk-version": LANGFUSE_SDK_VERSION, - "x-langfuse-public-key": publicKey != null ? publicKey : "", - ...params == null ? void 0 : params.additionalHeaders - }, - timeoutMillis: timeoutSeconds * 1e3 - }); - this.processor = (params == null ? void 0 : params.exportMode) === "immediate" ? new import_src$3.SimpleSpanProcessor(exporter) : new import_src$3.BatchSpanProcessor(exporter, { - maxExportBatchSize: flushAt ? Number(flushAt) : void 0, - scheduledDelayMillis: flushIntervalSeconds ? Number(flushIntervalSeconds) * 1e3 : void 0 - }); - this.publicKey = publicKey; - this.baseUrl = baseUrl; - this.environment = (_k = params == null ? void 0 : params.environment) != null ? _k : getEnv("LANGFUSE_TRACING_ENVIRONMENT"); - this.release = (_l = params == null ? void 0 : params.release) != null ? _l : getEnv("LANGFUSE_RELEASE"); - this.mask = params == null ? void 0 : params.mask; - this.shouldExportSpan = (_m = params == null ? void 0 : params.shouldExportSpan) != null ? _m : ({ otelSpan }) => isDefaultExportSpan(otelSpan); - this.apiClient = new LangfuseAPIClient({ - baseUrl: this.baseUrl, - username: this.publicKey, - password: secretKey, - xLangfusePublicKey: this.publicKey, - xLangfuseSdkVersion: LANGFUSE_SDK_VERSION, - xLangfuseSdkName: "javascript", - environment: "", - headers: params == null ? void 0 : params.additionalHeaders - }); - this.mediaService = new MediaService({ apiClient: this.apiClient }); - logger.debug("Initialized LangfuseSpanProcessor with params:", { - publicKey, - baseUrl, - environment: this.environment, - release: this.release, - timeoutSeconds, - flushAt, - flushIntervalSeconds - }); - } - get logger() { - return getGlobalLogger(); - } - /** - * Called when a span is started. Adds environment, release, and propagated attributes to the span. - * - * @param span - The span that was started - * @param parentContext - The parent context - * - * @override - */ - onStart(span, parentContext) { - span.setAttributes({ - [LangfuseOtelSpanAttributes.ENVIRONMENT]: this.environment, - [LangfuseOtelSpanAttributes.RELEASE]: this.release, - ...getPropagatedAttributesFromContext(parentContext) - }); - try { - this.markAppRootCandidate(span, parentContext); - } catch (err) { - this.logger.debug("App-root start-time check failed. Span will not be marked as app root.", { spanName: span.name }, err); - } - return this.processor.onStart(span, parentContext); - } - /** - * Called when a span ends. Processes the span for export to Langfuse. - * - * This method: - * 1. Checks if the span should be exported using shouldExportSpan - * (custom override or default smart filter) - * 2. Applies data masking to sensitive attributes - * 3. Handles media content extraction and upload - * 4. Logs span details in debug mode - * 5. Passes the span to the parent processor for export - * - * @param span - The span that ended - * - * @override - */ - onEnd(span) { - this.spanExportExpectationById.delete(span.spanContext().spanId); - const processEndedSpanPromise = this.processEndedSpan(span).catch((err) => { - this.logger.error(err); - }); - this.pendingEndedSpans.add(processEndedSpanPromise); - processEndedSpanPromise.finally(() => this.pendingEndedSpans.delete(processEndedSpanPromise)); - } - async flush() { - await Promise.all(Array.from(this.pendingEndedSpans)); - await this.mediaService.flush(); - } - /** - * Forces an immediate flush of all pending spans and media uploads. - * - * @returns Promise that resolves when all pending operations are complete - * - * @override - */ - async forceFlush() { - await this.flush(); - return this.processor.forceFlush(); - } - /** - * Gracefully shuts down the processor, ensuring all pending operations are completed. - * - * @returns Promise that resolves when shutdown is complete - * - * @override - */ - async shutdown() { - await this.flush(); - return this.processor.shutdown(); - } - async processEndedSpan(span) { - var _a$3, _b; - try { - if (this.shouldExportSpan({ otelSpan: span }) === false) { - this.logger.debug("Dropped span due to shouldExportSpan filter.", { - spanName: span.name, - instrumentationScope: span.instrumentationScope.name - }); - return; - } - } catch (err) { - this.logger.error("shouldExportSpan failed with error. Dropping span.", { - spanName: span.name, - instrumentationScope: span.instrumentationScope.name - }, err); - return; - } - await this.applyMaskInPlace(span); - await this.mediaService.process(span); - if (this.logger.isLevelEnabled(LogLevel.DEBUG)) this.logger.debug(`Processed span: + constructor(params) { + this.pendingEndedSpans = /* @__PURE__ */ new Set; + this.spanExportExpectationById = /* @__PURE__ */ new Map; + var _a4, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m; + const logger = getGlobalLogger(); + const publicKey = (_a4 = params == null ? undefined : params.publicKey) != null ? _a4 : getEnv("LANGFUSE_PUBLIC_KEY"); + const secretKey = (_b = params == null ? undefined : params.secretKey) != null ? _b : getEnv("LANGFUSE_SECRET_KEY"); + const baseUrl = (_e = (_d = (_c = params == null ? undefined : params.baseUrl) != null ? _c : getEnv("LANGFUSE_BASE_URL")) != null ? _d : getEnv("LANGFUSE_BASEURL")) != null ? _e : "https://cloud.langfuse.com"; + if (!(params == null ? undefined : params.exporter) && !publicKey) { + logger.warn("No exporter configured and no public key provided in constructor or as LANGFUSE_PUBLIC_KEY env var. Span exports will fail."); + } + if (!(params == null ? undefined : params.exporter) && !secretKey) { + logger.warn("No exporter configured and no secret key provided in constructor or as LANGFUSE_SECRET_KEY env var. Span exports will fail."); + } + const flushAt = (_f = params == null ? undefined : params.flushAt) != null ? _f : getEnv("LANGFUSE_FLUSH_AT"); + const flushIntervalSeconds = (_g = params == null ? undefined : params.flushInterval) != null ? _g : getEnv("LANGFUSE_FLUSH_INTERVAL"); + const authHeaderValue = base64Encode(`${publicKey}:${secretKey}`); + const timeoutSeconds = (_i = params == null ? undefined : params.timeout) != null ? _i : Number((_h = getEnv("LANGFUSE_TIMEOUT")) != null ? _h : 5); + const exporter = (_j = params == null ? undefined : params.exporter) != null ? _j : new import_exporter_trace_otlp_http.OTLPTraceExporter({ + url: `${baseUrl}/api/public/otel/v1/traces`, + headers: { + Authorization: `Basic ${authHeaderValue}`, + "x-langfuse-sdk-name": "javascript", + "x-langfuse-sdk-version": LANGFUSE_SDK_VERSION, + "x-langfuse-public-key": publicKey != null ? publicKey : "", + ...params == null ? undefined : params.additionalHeaders + }, + timeoutMillis: timeoutSeconds * 1000 + }); + this.processor = (params == null ? undefined : params.exportMode) === "immediate" ? new import_sdk_trace_base.SimpleSpanProcessor(exporter) : new import_sdk_trace_base.BatchSpanProcessor(exporter, { + maxExportBatchSize: flushAt ? Number(flushAt) : undefined, + scheduledDelayMillis: flushIntervalSeconds ? Number(flushIntervalSeconds) * 1000 : undefined + }); + this.publicKey = publicKey; + this.baseUrl = baseUrl; + this.environment = (_k = params == null ? undefined : params.environment) != null ? _k : getEnv("LANGFUSE_TRACING_ENVIRONMENT"); + this.release = (_l = params == null ? undefined : params.release) != null ? _l : getEnv("LANGFUSE_RELEASE"); + this.mask = params == null ? undefined : params.mask; + this.shouldExportSpan = (_m = params == null ? undefined : params.shouldExportSpan) != null ? _m : ({ otelSpan }) => isDefaultExportSpan(otelSpan); + this.apiClient = new LangfuseAPIClient({ + baseUrl: this.baseUrl, + username: this.publicKey, + password: secretKey, + xLangfusePublicKey: this.publicKey, + xLangfuseSdkVersion: LANGFUSE_SDK_VERSION, + xLangfuseSdkName: "javascript", + environment: "", + headers: params == null ? undefined : params.additionalHeaders + }); + this.mediaService = new MediaService({ apiClient: this.apiClient }); + logger.debug("Initialized LangfuseSpanProcessor with params:", { + publicKey, + baseUrl, + environment: this.environment, + release: this.release, + timeoutSeconds, + flushAt, + flushIntervalSeconds + }); + } + get logger() { + return getGlobalLogger(); + } + onStart(span, parentContext) { + span.setAttributes({ + [LangfuseOtelSpanAttributes.ENVIRONMENT]: this.environment, + [LangfuseOtelSpanAttributes.RELEASE]: this.release, + ...getPropagatedAttributesFromContext(parentContext) + }); + try { + this.markAppRootCandidate(span, parentContext); + } catch (err) { + this.logger.debug("App-root start-time check failed. Span will not be marked as app root.", { spanName: span.name }, err); + } + return this.processor.onStart(span, parentContext); + } + onEnd(span) { + this.spanExportExpectationById.delete(span.spanContext().spanId); + const processEndedSpanPromise = this.processEndedSpan(span).catch((err) => { + this.logger.error(err); + }); + this.pendingEndedSpans.add(processEndedSpanPromise); + processEndedSpanPromise.finally(() => this.pendingEndedSpans.delete(processEndedSpanPromise)); + } + async flush() { + await Promise.all(Array.from(this.pendingEndedSpans)); + await this.mediaService.flush(); + } + async forceFlush() { + await this.flush(); + return this.processor.forceFlush(); + } + async shutdown() { + await this.flush(); + return this.processor.shutdown(); + } + async processEndedSpan(span) { + var _a4, _b; + try { + if (this.shouldExportSpan({ otelSpan: span }) === false) { + this.logger.debug("Dropped span due to shouldExportSpan filter.", { + spanName: span.name, + instrumentationScope: span.instrumentationScope.name + }); + return; + } + } catch (err) { + this.logger.error("shouldExportSpan failed with error. Dropping span.", { + spanName: span.name, + instrumentationScope: span.instrumentationScope.name + }, err); + return; + } + await this.applyMaskInPlace(span); + await this.mediaService.process(span); + if (this.logger.isLevelEnabled(LogLevel.DEBUG)) { + this.logger.debug(`Processed span: ${JSON.stringify({ - name: span.name, - traceId: span.spanContext().traceId, - spanId: span.spanContext().spanId, - parentSpanId: (_b = (_a$3 = span.parentSpanContext) == null ? void 0 : _a$3.spanId) != null ? _b : null, - attributes: span.attributes, - startTime: new Date((0, import_src$1.hrTimeToMilliseconds)(span.startTime)), - endTime: new Date((0, import_src$1.hrTimeToMilliseconds)(span.endTime)), - durationMs: (0, import_src$1.hrTimeToMilliseconds)(span.duration), - kind: span.kind, - status: span.status, - resource: span.resource.attributes, - instrumentationScope: span.instrumentationScope - }, null, 2)}`); - this.processor.onEnd(span); - } - markAppRootCandidate(span, parentContext) { - var _a$3; - const traceId = span.spanContext().traceId; - const spanId = span.spanContext().spanId; - const parentSpanId = (_a$3 = span.parentSpanContext) == null ? void 0 : _a$3.spanId; - const expectedExportedAtStart = this.isExpectedExportedAtStart(span); - const propagatedClaim = getLangfuseTraceIdFromBaggage(parentContext); - const isParentExpectedExported = parentSpanId !== void 0 ? this.spanExportExpectationById.get(parentSpanId) === true : false; - const suppressedByParentClaim = propagatedClaim === traceId; - this.spanExportExpectationById.set(spanId, expectedExportedAtStart); - if (expectedExportedAtStart && !isParentExpectedExported && !suppressedByParentClaim) span.setAttribute(LangfuseOtelSpanAttributes.IS_APP_ROOT, true); - } - isExpectedExportedAtStart(span) { - const readable = span; - try { - return this.shouldExportSpan({ otelSpan: readable }) === true; - } catch (err) { - this.logger.debug("shouldExportSpan threw during app-root start-time check. Span will not be marked as app root.", { - spanName: span.name, - instrumentationScope: readable.instrumentationScope.name - }, err); - return false; - } - } - async applyMaskInPlace(span) { - const maskCandidates = [ - LangfuseOtelSpanAttributes.OBSERVATION_INPUT, - LangfuseOtelSpanAttributes.TRACE_INPUT, - LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT, - LangfuseOtelSpanAttributes.TRACE_OUTPUT, - LangfuseOtelSpanAttributes.OBSERVATION_METADATA, - LangfuseOtelSpanAttributes.TRACE_METADATA - ]; - for (const maskCandidate of maskCandidates) if (maskCandidate in span.attributes) span.attributes[maskCandidate] = await this.applyMask(span.attributes[maskCandidate]); - } - async applyMask(data) { - if (!this.mask) return data; - try { - return await this.mask({ data }); - } catch (err) { - this.logger.warn(`Applying mask function failed due to error, fully masking property. Error: ${err}`); - return ""; - } - } + name: span.name, + traceId: span.spanContext().traceId, + spanId: span.spanContext().spanId, + parentSpanId: (_b = (_a4 = span.parentSpanContext) == null ? undefined : _a4.spanId) != null ? _b : null, + attributes: span.attributes, + startTime: new Date(import_core9.hrTimeToMilliseconds(span.startTime)), + endTime: new Date(import_core9.hrTimeToMilliseconds(span.endTime)), + durationMs: import_core9.hrTimeToMilliseconds(span.duration), + kind: span.kind, + status: span.status, + resource: span.resource.attributes, + instrumentationScope: span.instrumentationScope + }, null, 2)}`); + } + this.processor.onEnd(span); + } + markAppRootCandidate(span, parentContext) { + var _a4; + const traceId = span.spanContext().traceId; + const spanId = span.spanContext().spanId; + const parentSpanId = (_a4 = span.parentSpanContext) == null ? undefined : _a4.spanId; + const expectedExportedAtStart = this.isExpectedExportedAtStart(span); + const propagatedClaim = getLangfuseTraceIdFromBaggage(parentContext); + const isParentExpectedExported = parentSpanId !== undefined ? this.spanExportExpectationById.get(parentSpanId) === true : false; + const suppressedByParentClaim = propagatedClaim === traceId; + this.spanExportExpectationById.set(spanId, expectedExportedAtStart); + const markAppRoot = expectedExportedAtStart && !isParentExpectedExported && !suppressedByParentClaim; + if (markAppRoot) { + span.setAttribute(LangfuseOtelSpanAttributes.IS_APP_ROOT, true); + } + } + isExpectedExportedAtStart(span) { + const readable = span; + try { + return this.shouldExportSpan({ otelSpan: readable }) === true; + } catch (err) { + this.logger.debug("shouldExportSpan threw during app-root start-time check. Span will not be marked as app root.", { + spanName: span.name, + instrumentationScope: readable.instrumentationScope.name + }, err); + return false; + } + } + async applyMaskInPlace(span) { + const maskCandidates = [ + LangfuseOtelSpanAttributes.OBSERVATION_INPUT, + LangfuseOtelSpanAttributes.TRACE_INPUT, + LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT, + LangfuseOtelSpanAttributes.TRACE_OUTPUT, + LangfuseOtelSpanAttributes.OBSERVATION_METADATA, + LangfuseOtelSpanAttributes.TRACE_METADATA + ]; + for (const maskCandidate of maskCandidates) { + if (maskCandidate in span.attributes) { + span.attributes[maskCandidate] = await this.applyMask(span.attributes[maskCandidate]); + } + } + } + async applyMask(data) { + if (!this.mask) + return data; + try { + return await this.mask({ data }); + } catch (err) { + this.logger.warn(`Applying mask function failed due to error, fully masking property. Error: ${err}`); + return ""; + } + } }; -//#endregion -//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js -var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AbstractAsyncHooksContextManager = void 0; - const events_1 = __require("events"); - const ADD_LISTENER_METHODS = [ - "addListener", - "on", - "once", - "prependListener", - "prependOnceListener" - ]; - var AbstractAsyncHooksContextManager = class { - /** - * Binds a the certain context or the active one to the target function and then returns the target - * @param context A context (span) to be bind to target - * @param target a function or event emitter. When target or one of its callbacks is called, - * the provided context will be used as the active context for the duration of the call. - */ - bind(context$1, target) { - if (target instanceof events_1.EventEmitter) return this._bindEventEmitter(context$1, target); - if (typeof target === "function") return this._bindFunction(context$1, target); - return target; - } - _bindFunction(context$1, target) { - const manager = this; - const contextWrapper = function(...args) { - return manager.with(context$1, () => target.apply(this, args)); - }; - Object.defineProperty(contextWrapper, "length", { - enumerable: false, - configurable: true, - writable: false, - value: target.length - }); - /** - * It isn't possible to tell Typescript that contextWrapper is the same as T - * so we forced to cast as any here. - */ - return contextWrapper; - } - /** - * By default, EventEmitter call their callback with their context, which we do - * not want, instead we will bind a specific context to all callbacks that - * go through it. - * @param context the context we want to bind - * @param ee EventEmitter an instance of EventEmitter to patch - */ - _bindEventEmitter(context$1, ee) { - if (this._getPatchMap(ee) !== void 0) return ee; - this._createPatchMap(ee); - ADD_LISTENER_METHODS.forEach((methodName) => { - if (ee[methodName] === void 0) return; - ee[methodName] = this._patchAddListener(ee, ee[methodName], context$1); - }); - if (typeof ee.removeListener === "function") ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); - if (typeof ee.off === "function") ee.off = this._patchRemoveListener(ee, ee.off); - if (typeof ee.removeAllListeners === "function") ee.removeAllListeners = this._patchRemoveAllListeners(ee, ee.removeAllListeners); - return ee; - } - /** - * Patch methods that remove a given listener so that we match the "patched" - * version of that listener (the one that propagate context). - * @param ee EventEmitter instance - * @param original reference to the patched method - */ - _patchRemoveListener(ee, original) { - const contextManager = this; - return function(event, listener) { - const events = contextManager._getPatchMap(ee)?.[event]; - if (events === void 0) return original.call(this, event, listener); - const patchedListener = events.get(listener); - return original.call(this, event, patchedListener || listener); - }; - } - /** - * Patch methods that remove all listeners so we remove our - * internal references for a given event. - * @param ee EventEmitter instance - * @param original reference to the patched method - */ - _patchRemoveAllListeners(ee, original) { - const contextManager = this; - return function(event) { - const map = contextManager._getPatchMap(ee); - if (map !== void 0) { - if (arguments.length === 0) contextManager._createPatchMap(ee); - else if (map[event] !== void 0) delete map[event]; - } - return original.apply(this, arguments); - }; - } - /** - * Patch methods on an event emitter instance that can add listeners so we - * can force them to propagate a given context. - * @param ee EventEmitter instance - * @param original reference to the patched method - * @param [context] context to propagate when calling listeners - */ - _patchAddListener(ee, original, context$1) { - const contextManager = this; - return function(event, listener) { - /** - * This check is required to prevent double-wrapping the listener. - * The implementation for ee.once wraps the listener and calls ee.on. - * Without this check, we would wrap that wrapped listener. - * This causes an issue because ee.removeListener depends on the onceWrapper - * to properly remove the listener. If we wrap their wrapper, we break - * that detection. - */ - if (contextManager._wrapped) return original.call(this, event, listener); - let map = contextManager._getPatchMap(ee); - if (map === void 0) map = contextManager._createPatchMap(ee); - let listeners = map[event]; - if (listeners === void 0) { - listeners = /* @__PURE__ */ new WeakMap(); - map[event] = listeners; - } - const patchedListener = contextManager.bind(context$1, listener); - listeners.set(listener, patchedListener); - /** - * See comment at the start of this function for the explanation of this property. - */ - contextManager._wrapped = true; - try { - return original.call(this, event, patchedListener); - } finally { - contextManager._wrapped = false; - } - }; - } - _createPatchMap(ee) { - const map = Object.create(null); - ee[this._kOtListeners] = map; - return map; - } - _getPatchMap(ee) { - return ee[this._kOtListeners]; - } - _kOtListeners = Symbol("OtListeners"); - _wrapped = false; - }; - exports.AbstractAsyncHooksContextManager = AbstractAsyncHooksContextManager; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncHooksContextManager.js -var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AsyncHooksContextManager = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const asyncHooks = __require("async_hooks"); - const AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); - /** - * @deprecated Use AsyncLocalStorageContextManager instead. - */ - var AsyncHooksContextManager = class extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { - _asyncHook; - _contexts = /* @__PURE__ */ new Map(); - _stack = []; - constructor() { - super(); - this._asyncHook = asyncHooks.createHook({ - init: this._init.bind(this), - before: this._before.bind(this), - after: this._after.bind(this), - destroy: this._destroy.bind(this), - promiseResolve: this._destroy.bind(this) - }); - } - active() { - return this._stack[this._stack.length - 1] ?? api_1.ROOT_CONTEXT; - } - with(context$1, fn, thisArg, ...args) { - this._enterContext(context$1); - try { - return fn.call(thisArg, ...args); - } finally { - this._exitContext(); - } - } - enable() { - this._asyncHook.enable(); - return this; - } - disable() { - this._asyncHook.disable(); - this._contexts.clear(); - this._stack = []; - return this; - } - /** - * Init hook will be called when userland create a async context, setting the - * context as the current one if it exist. - * @param uid id of the async context - * @param type the resource type - */ - _init(uid, type) { - if (type === "TIMERWRAP") return; - const context$1 = this._stack[this._stack.length - 1]; - if (context$1 !== void 0) this._contexts.set(uid, context$1); - } - /** - * Destroy hook will be called when a given context is no longer used so we can - * remove its attached context. - * @param uid uid of the async context - */ - _destroy(uid) { - this._contexts.delete(uid); - } - /** - * Before hook is called just before executing a async context. - * @param uid uid of the async context - */ - _before(uid) { - const context$1 = this._contexts.get(uid); - if (context$1 !== void 0) this._enterContext(context$1); - } - /** - * After hook is called just after completing the execution of a async context. - */ - _after() { - this._exitContext(); - } - /** - * Set the given context as active - */ - _enterContext(context$1) { - this._stack.push(context$1); - } - /** - * Remove the context at the root of the stack - */ - _exitContext() { - this._stack.pop(); - } - }; - exports.AsyncHooksContextManager = AsyncHooksContextManager; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js -var require_AsyncLocalStorageContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AsyncLocalStorageContextManager = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const async_hooks_1 = __require("async_hooks"); - const AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); - var AsyncLocalStorageContextManager = class extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { - _asyncLocalStorage; - constructor() { - super(); - this._asyncLocalStorage = new async_hooks_1.AsyncLocalStorage(); - } - active() { - return this._asyncLocalStorage.getStore() ?? api_1.ROOT_CONTEXT; - } - with(context$1, fn, thisArg, ...args) { - const cb = thisArg == null ? fn : fn.bind(thisArg); - return this._asyncLocalStorage.run(context$1, cb, ...args); - } - enable() { - return this; - } - disable() { - this._asyncLocalStorage.disable(); - return this; - } - }; - exports.AsyncLocalStorageContextManager = AsyncLocalStorageContextManager; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/index.js -var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AsyncLocalStorageContextManager = exports.AsyncHooksContextManager = void 0; - var AsyncHooksContextManager_1 = require_AsyncHooksContextManager(); - Object.defineProperty(exports, "AsyncHooksContextManager", { - enumerable: true, - get: function() { - return AsyncHooksContextManager_1.AsyncHooksContextManager; - } - }); - var AsyncLocalStorageContextManager_1 = require_AsyncLocalStorageContextManager(); - Object.defineProperty(exports, "AsyncLocalStorageContextManager", { - enumerable: true, - get: function() { - return AsyncLocalStorageContextManager_1.AsyncLocalStorageContextManager; - } - }); -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/NodeTracerProvider.js -var require_NodeTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.NodeTracerProvider = void 0; - const context_async_hooks_1 = require_src$1(); - const sdk_trace_base_1 = require_src$2(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - function setupContextManager(contextManager) { - if (contextManager === null) return; - if (contextManager === void 0) { - const defaultContextManager = new context_async_hooks_1.AsyncLocalStorageContextManager(); - defaultContextManager.enable(); - api_1.context.setGlobalContextManager(defaultContextManager); - return; - } - contextManager.enable(); - api_1.context.setGlobalContextManager(contextManager); - } - function setupPropagator(propagator) { - if (propagator === null) return; - if (propagator === void 0) { - api_1.propagation.setGlobalPropagator(new core_1.CompositePropagator({ propagators: [new core_1.W3CTraceContextPropagator(), new core_1.W3CBaggagePropagator()] })); - return; - } - api_1.propagation.setGlobalPropagator(propagator); - } - /** - * Register this TracerProvider for use with the OpenTelemetry API. - * Undefined values may be replaced with defaults, and - * null values will be skipped. - * - * @param config Configuration object for SDK registration - */ - var NodeTracerProvider = class extends sdk_trace_base_1.BasicTracerProvider { - constructor(config$1 = {}) { - super(config$1); - } - /** - * Register this TracerProvider for use with the OpenTelemetry API. - * Undefined values may be replaced with defaults, and - * null values will be skipped. - * - * @param config Configuration object for SDK registration - */ - register(config$1 = {}) { - api_1.trace.setGlobalTracerProvider(this); - setupContextManager(config$1.contextManager); - setupPropagator(config$1.propagator); - } - }; - exports.NodeTracerProvider = NodeTracerProvider; -})); - -//#endregion -//#region node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/index.js -var require_src = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TraceIdRatioBasedSampler = exports.SimpleSpanProcessor = exports.SamplingDecision = exports.RandomIdGenerator = exports.ParentBasedSampler = exports.NoopSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.BatchSpanProcessor = exports.BasicTracerProvider = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NodeTracerProvider = void 0; - var NodeTracerProvider_1 = require_NodeTracerProvider(); - Object.defineProperty(exports, "NodeTracerProvider", { - enumerable: true, - get: function() { - return NodeTracerProvider_1.NodeTracerProvider; - } - }); - var sdk_trace_base_1 = require_src$2(); - Object.defineProperty(exports, "AlwaysOffSampler", { - enumerable: true, - get: function() { - return sdk_trace_base_1.AlwaysOffSampler; - } - }); - Object.defineProperty(exports, "AlwaysOnSampler", { - enumerable: true, - get: function() { - return sdk_trace_base_1.AlwaysOnSampler; - } - }); - Object.defineProperty(exports, "BasicTracerProvider", { - enumerable: true, - get: function() { - return sdk_trace_base_1.BasicTracerProvider; - } - }); - Object.defineProperty(exports, "BatchSpanProcessor", { - enumerable: true, - get: function() { - return sdk_trace_base_1.BatchSpanProcessor; - } - }); - Object.defineProperty(exports, "ConsoleSpanExporter", { - enumerable: true, - get: function() { - return sdk_trace_base_1.ConsoleSpanExporter; - } - }); - Object.defineProperty(exports, "InMemorySpanExporter", { - enumerable: true, - get: function() { - return sdk_trace_base_1.InMemorySpanExporter; - } - }); - Object.defineProperty(exports, "NoopSpanProcessor", { - enumerable: true, - get: function() { - return sdk_trace_base_1.NoopSpanProcessor; - } - }); - Object.defineProperty(exports, "ParentBasedSampler", { - enumerable: true, - get: function() { - return sdk_trace_base_1.ParentBasedSampler; - } - }); - Object.defineProperty(exports, "RandomIdGenerator", { - enumerable: true, - get: function() { - return sdk_trace_base_1.RandomIdGenerator; - } - }); - Object.defineProperty(exports, "SamplingDecision", { - enumerable: true, - get: function() { - return sdk_trace_base_1.SamplingDecision; - } - }); - Object.defineProperty(exports, "SimpleSpanProcessor", { - enumerable: true, - get: function() { - return sdk_trace_base_1.SimpleSpanProcessor; - } - }); - Object.defineProperty(exports, "TraceIdRatioBasedSampler", { - enumerable: true, - get: function() { - return sdk_trace_base_1.TraceIdRatioBasedSampler; - } - }); -})); - -//#endregion -//#region src/instrumentation.ts -var import_src = require_src(); -/** -* Configure an isolated OpenTelemetry tracer provider wired to Langfuse. -* -* We register a dedicated `NodeTracerProvider` (rather than the full auto- -* instrumenting `NodeSDK`) so the bundle stays small and free of dynamic -* instrumentation loading. Registering the provider also installs the -* AsyncLocalStorage context manager that `propagateAttributes` relies on. -* -* We use `exportMode: "batched"` and flush once at the end: the whole -* transcript is converted in-process, so batching every span into one (or a -* few) requests is far faster than one request per span — important for the -* hook's timeout budget. `shutdown()` below calls `forceFlush()` before the -* process exits. -*/ -function setupInstrumentation(config$1) { - const spanProcessor = new LangfuseSpanProcessor({ - publicKey: config$1.public_key, - secretKey: config$1.secret_key, - baseUrl: config$1.base_url, - environment: config$1.environment, - exportMode: "batched", - shouldExportSpan: () => true - }); - const provider = new import_src.NodeTracerProvider({ spanProcessors: [spanProcessor] }); - provider.register(); - return { shutdown: async () => { - await spanProcessor.forceFlush(); - await provider.shutdown(); - } }; -} - -//#endregion -//#region node_modules/.pnpm/@langfuse+tracing@5.4.1_@opentelemetry+api@1.9.1/node_modules/@langfuse/tracing/dist/index.mjs -init_esm$2(); -function createTraceAttributes({ input, output } = {}) { - const attributes = { - [LangfuseOtelSpanAttributes.TRACE_INPUT]: _serialize(input), - [LangfuseOtelSpanAttributes.TRACE_OUTPUT]: _serialize(output) - }; - return Object.fromEntries(Object.entries(attributes).filter(([_, v]) => v != null)); +// src/instrumentation.ts +var import_sdk_trace_node = __toESM(require_src16(), 1); +function setupInstrumentation(config2) { + const spanProcessor = new LangfuseSpanProcessor({ + publicKey: config2.public_key, + secretKey: config2.secret_key, + baseUrl: config2.base_url, + environment: config2.environment, + exportMode: "batched", + shouldExportSpan: () => true + }); + const provider = new import_sdk_trace_node.NodeTracerProvider({ + spanProcessors: [spanProcessor] + }); + provider.register(); + return { + shutdown: async () => { + await spanProcessor.forceFlush(); + await provider.shutdown(); + } + }; +} + +// node_modules/@langfuse/tracing/dist/index.mjs +var import_api2 = __toESM(require_src(), 1); +var import_api3 = __toESM(require_src(), 1); +function createTraceAttributes({ + input, + output +} = {}) { + const attributes = { + [LangfuseOtelSpanAttributes.TRACE_INPUT]: _serialize(input), + [LangfuseOtelSpanAttributes.TRACE_OUTPUT]: _serialize(output) + }; + return Object.fromEntries(Object.entries(attributes).filter(([_, v]) => v != null)); } function createObservationAttributes(type, attributes) { - const { metadata, input, output, level, statusMessage, version: version$1, completionStartTime, model, modelParameters, usageDetails, costDetails, prompt } = attributes; - let otelAttributes = { - [LangfuseOtelSpanAttributes.OBSERVATION_TYPE]: type, - [LangfuseOtelSpanAttributes.OBSERVATION_LEVEL]: level, - [LangfuseOtelSpanAttributes.OBSERVATION_STATUS_MESSAGE]: statusMessage, - [LangfuseOtelSpanAttributes.VERSION]: version$1, - [LangfuseOtelSpanAttributes.OBSERVATION_INPUT]: _serialize(input), - [LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT]: _serialize(output), - [LangfuseOtelSpanAttributes.OBSERVATION_MODEL]: model, - [LangfuseOtelSpanAttributes.OBSERVATION_USAGE_DETAILS]: _serialize(usageDetails), - [LangfuseOtelSpanAttributes.OBSERVATION_COST_DETAILS]: _serialize(costDetails), - [LangfuseOtelSpanAttributes.OBSERVATION_COMPLETION_START_TIME]: _serialize(completionStartTime), - [LangfuseOtelSpanAttributes.OBSERVATION_MODEL_PARAMETERS]: _serialize(modelParameters), - ...prompt && !prompt.isFallback ? { - [LangfuseOtelSpanAttributes.OBSERVATION_PROMPT_NAME]: prompt.name, - [LangfuseOtelSpanAttributes.OBSERVATION_PROMPT_VERSION]: prompt.version - } : {}, - ..._flattenAndSerializeMetadata(metadata, "observation") - }; - return Object.fromEntries(Object.entries(otelAttributes).filter(([_, v]) => v != null)); + const { + metadata, + input, + output, + level, + statusMessage, + version: version2, + completionStartTime, + model, + modelParameters, + usageDetails, + costDetails, + prompt + } = attributes; + let otelAttributes = { + [LangfuseOtelSpanAttributes.OBSERVATION_TYPE]: type, + [LangfuseOtelSpanAttributes.OBSERVATION_LEVEL]: level, + [LangfuseOtelSpanAttributes.OBSERVATION_STATUS_MESSAGE]: statusMessage, + [LangfuseOtelSpanAttributes.VERSION]: version2, + [LangfuseOtelSpanAttributes.OBSERVATION_INPUT]: _serialize(input), + [LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT]: _serialize(output), + [LangfuseOtelSpanAttributes.OBSERVATION_MODEL]: model, + [LangfuseOtelSpanAttributes.OBSERVATION_USAGE_DETAILS]: _serialize(usageDetails), + [LangfuseOtelSpanAttributes.OBSERVATION_COST_DETAILS]: _serialize(costDetails), + [LangfuseOtelSpanAttributes.OBSERVATION_COMPLETION_START_TIME]: _serialize(completionStartTime), + [LangfuseOtelSpanAttributes.OBSERVATION_MODEL_PARAMETERS]: _serialize(modelParameters), + ...prompt && !prompt.isFallback ? { + [LangfuseOtelSpanAttributes.OBSERVATION_PROMPT_NAME]: prompt.name, + [LangfuseOtelSpanAttributes.OBSERVATION_PROMPT_VERSION]: prompt.version + } : {}, + ..._flattenAndSerializeMetadata(metadata, "observation") + }; + return Object.fromEntries(Object.entries(otelAttributes).filter(([_, v]) => v != null)); } function _serialize(obj) { - try { - if (typeof obj === "string") return obj; - return obj != null ? JSON.stringify(obj) : void 0; - } catch { - return ""; - } + try { + if (typeof obj === "string") + return obj; + return obj != null ? JSON.stringify(obj) : undefined; + } catch { + return ""; + } } function _flattenAndSerializeMetadata(metadata, type) { - const prefix = type === "observation" ? LangfuseOtelSpanAttributes.OBSERVATION_METADATA : LangfuseOtelSpanAttributes.TRACE_METADATA; - const metadataAttributes = {}; - if (metadata === void 0 || metadata === null) return metadataAttributes; - if (typeof metadata !== "object" || Array.isArray(metadata)) { - const serialized = _serialize(metadata); - if (serialized) metadataAttributes[prefix] = serialized; - } else for (const [key, value] of Object.entries(metadata)) { - const serialized = typeof value === "string" ? value : _serialize(value); - if (serialized) metadataAttributes[`${prefix}.${key}`] = serialized; - } - return metadataAttributes; + const prefix = type === "observation" ? LangfuseOtelSpanAttributes.OBSERVATION_METADATA : LangfuseOtelSpanAttributes.TRACE_METADATA; + const metadataAttributes = {}; + if (metadata === undefined || metadata === null) { + return metadataAttributes; + } + if (typeof metadata !== "object" || Array.isArray(metadata)) { + const serialized = _serialize(metadata); + if (serialized) { + metadataAttributes[prefix] = serialized; + } + } else { + for (const [key, value] of Object.entries(metadata)) { + const serialized = typeof value === "string" ? value : _serialize(value); + if (serialized) { + metadataAttributes[`${prefix}.${key}`] = serialized; + } + } + } + return metadataAttributes; } var LANGFUSE_GLOBAL_SYMBOL = Symbol.for("langfuse"); function createState() { - return { isolatedTracerProvider: null }; + return { + isolatedTracerProvider: null + }; } function getGlobalState() { - const initialState = createState(); - try { - const g = globalThis; - if (typeof g !== "object" || g === null) { - getGlobalLogger().warn("globalThis is not available, using fallback state"); - return initialState; - } - if (!g[LANGFUSE_GLOBAL_SYMBOL]) Object.defineProperty(g, LANGFUSE_GLOBAL_SYMBOL, { - value: initialState, - writable: false, - configurable: false, - enumerable: false - }); - return g[LANGFUSE_GLOBAL_SYMBOL]; - } catch (err) { - if (err instanceof Error) getGlobalLogger().error(`Failed to access global state: ${err.message}`); - else getGlobalLogger().error(`Failed to access global state: ${String(err)}`); - return initialState; - } + const initialState = createState(); + try { + const g = globalThis; + if (typeof g !== "object" || g === null) { + getGlobalLogger().warn("globalThis is not available, using fallback state"); + return initialState; + } + if (!g[LANGFUSE_GLOBAL_SYMBOL]) { + Object.defineProperty(g, LANGFUSE_GLOBAL_SYMBOL, { + value: initialState, + writable: false, + configurable: false, + enumerable: false + }); + } + return g[LANGFUSE_GLOBAL_SYMBOL]; + } catch (err) { + if (err instanceof Error) { + getGlobalLogger().error(`Failed to access global state: ${err.message}`); + } else { + getGlobalLogger().error(`Failed to access global state: ${String(err)}`); + } + return initialState; + } } function getLangfuseTracerProvider() { - const { isolatedTracerProvider } = getGlobalState(); - if (isolatedTracerProvider) return isolatedTracerProvider; - return trace.getTracerProvider(); + const { isolatedTracerProvider } = getGlobalState(); + if (isolatedTracerProvider) + return isolatedTracerProvider; + return import_api3.trace.getTracerProvider(); } function getLangfuseTracer() { - return getLangfuseTracerProvider().getTracer(LANGFUSE_TRACER_NAME, LANGFUSE_SDK_VERSION); + return getLangfuseTracerProvider().getTracer(LANGFUSE_TRACER_NAME, LANGFUSE_SDK_VERSION); } var LangfuseBaseObservation = class { - constructor(params) { - this.otelSpan = params.otelSpan; - this.id = params.otelSpan.spanContext().spanId; - this.traceId = params.otelSpan.spanContext().traceId; - this.type = params.type; - if (params.attributes) this.otelSpan.setAttributes(createObservationAttributes(params.type, params.attributes)); - } - /** Gets the Langfuse OpenTelemetry tracer instance */ - get tracer() { - return getLangfuseTracer(); - } - /** - * Ends the observation, marking it as complete. - * - * @param endTime - Optional end time, defaults to current time - */ - end(endTime) { - this.otelSpan.end(endTime); - } - updateOtelSpanAttributes(attributes) { - this.otelSpan.setAttributes(createObservationAttributes(this.type, attributes)); - } - /** - * Set trace-level input and output for the trace this observation belongs to. - * - * @deprecated This is a legacy method for backward compatibility with Langfuse platform - * features that still rely on trace-level input/output (e.g., legacy LLM-as-a-judge - * evaluators). It will be removed in a future major version. - * - * For setting other trace attributes (userId, sessionId, metadata, tags, version), - * use {@link propagateAttributes} instead. - * - * @param attributes - Input and output data to associate with the trace - * @returns The observation instance for method chaining - * - * @example - * ```typescript - * const span = startObservation('my-operation'); - * span.setTraceIO({ - * input: { query: 'user question' }, - * output: { response: 'assistant answer' } - * }); - * ``` - */ - setTraceIO(attributes) { - this.otelSpan.setAttributes(createTraceAttributes(attributes)); - return this; - } - /** - * Make the trace this observation belongs to publicly accessible via its URL. - * - * When a trace is published, anyone with the trace link can view the full trace - * without needing to be logged in to Langfuse. This action cannot be undone - * programmatically - once any span in a trace is published, the entire trace - * becomes public. - * - * @returns The observation instance for method chaining - * - * @example - * ```typescript - * const span = startObservation('my-operation'); - * span.setTraceAsPublic(); - * ``` - */ - setTraceAsPublic() { - this.otelSpan.setAttributes({ [LangfuseOtelSpanAttributes.TRACE_PUBLIC]: true }); - return this; - } - startObservation(name, attributes, options) { - const { asType = "span" } = options || {}; - return startObservation(name, attributes, { - asType, - parentSpanContext: this.otelSpan.spanContext() - }); - } + constructor(params) { + this.otelSpan = params.otelSpan; + this.id = params.otelSpan.spanContext().spanId; + this.traceId = params.otelSpan.spanContext().traceId; + this.type = params.type; + if (params.attributes) { + this.otelSpan.setAttributes(createObservationAttributes(params.type, params.attributes)); + } + } + get tracer() { + return getLangfuseTracer(); + } + end(endTime) { + this.otelSpan.end(endTime); + } + updateOtelSpanAttributes(attributes) { + this.otelSpan.setAttributes(createObservationAttributes(this.type, attributes)); + } + setTraceIO(attributes) { + this.otelSpan.setAttributes(createTraceAttributes(attributes)); + return this; + } + setTraceAsPublic() { + this.otelSpan.setAttributes({ + [LangfuseOtelSpanAttributes.TRACE_PUBLIC]: true + }); + return this; + } + startObservation(name, attributes, options) { + const { asType = "span" } = options || {}; + return startObservation(name, attributes, { + asType, + parentSpanContext: this.otelSpan.spanContext() + }); + } }; var LangfuseSpan = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "span" - }); - } - /** - * Updates this span with new attributes. - * - * @param attributes - Span attributes to set - * @returns This span for method chaining - * - * @example - * ```typescript - * span.update({ - * output: { result: 'success' }, - * level: 'DEFAULT', - * metadata: { duration: 150 } - * }); - * ``` - */ - update(attributes) { - super.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "span" }); + } + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseAgent = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "agent" - }); - } - /** - * Updates this agent observation with new attributes. - * - * @param attributes - Agent attributes to set - * @returns This agent for method chaining - * - * @example - * ```typescript - * agent.update({ - * output: { - * taskCompleted: true, - * iterationsUsed: 5, - * toolsInvoked: ['web-search', 'calculator', 'summarizer'], - * finalResult: 'Research completed with high confidence' - * }, - * metadata: { - * efficiency: 0.85, - * qualityScore: 0.92, - * resourcesConsumed: { tokens: 15000, apiCalls: 12 } - * } - * }); - * ``` - */ - update(attributes) { - super.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "agent" }); + } + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseTool = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "tool" - }); - } - /** - * Updates this tool observation with new attributes. - * - * @param attributes - Tool attributes to set - * @returns This tool for method chaining - * - * @example - * ```typescript - * tool.update({ - * output: { - * result: searchResults, - * count: searchResults.length, - * relevanceScore: 0.89, - * executionTime: 1250 - * }, - * metadata: { - * cacheHit: false, - * apiCost: 0.025, - * rateLimitRemaining: 950 - * } - * }); - * ``` - */ - update(attributes) { - super.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "tool" }); + } + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseChain = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "chain" - }); - } - /** - * Updates this chain observation with new attributes. - * - * @param attributes - Chain attributes to set - * @returns This chain for method chaining - * - * @example - * ```typescript - * chain.update({ - * output: { - * stepsCompleted: 5, - * stepsSuccessful: 4, - * finalResult: processedData, - * pipelineEfficiency: 0.87 - * }, - * metadata: { - * bottleneckStep: 'data-validation', - * parallelizationOpportunities: ['step-2', 'step-3'], - * optimizationSuggestions: ['cache-intermediate-results'] - * } - * }); - * ``` - */ - update(attributes) { - super.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "chain" }); + } + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseRetriever = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "retriever" - }); - } - /** - * Updates this retriever observation with new attributes. - * - * @param attributes - Retriever attributes to set - * @returns This retriever for method chaining - */ - update(attributes) { - super.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "retriever" }); + } + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseEvaluator = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "evaluator" - }); - } - /** - * Updates this evaluator observation with new attributes. - * - * @param attributes - Evaluator attributes to set - * @returns This evaluator for method chaining - */ - update(attributes) { - super.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "evaluator" }); + } + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseGuardrail = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "guardrail" - }); - } - /** - * Updates this guardrail observation with new attributes. - * - * @param attributes - Guardrail attributes to set - * @returns This guardrail for method chaining - */ - update(attributes) { - super.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "guardrail" }); + } + update(attributes) { + super.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseGeneration = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "generation" - }); - } - update(attributes) { - this.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "generation" }); + } + update(attributes) { + this.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseEmbedding = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "embedding" - }); - } - /** - * Updates this embedding observation with new attributes. - * - * @param attributes - Embedding attributes to set - * @returns This embedding for method chaining - */ - update(attributes) { - this.updateOtelSpanAttributes(attributes); - return this; - } + constructor(params) { + super({ ...params, type: "embedding" }); + } + update(attributes) { + this.updateOtelSpanAttributes(attributes); + return this; + } }; var LangfuseEvent = class extends LangfuseBaseObservation { - constructor(params) { - super({ - ...params, - type: "event" - }); - this.otelSpan.end(params.timestamp); - } + constructor(params) { + super({ ...params, type: "event" }); + this.otelSpan.end(params.timestamp); + } }; function createOtelSpan(params) { - return getLangfuseTracer().startSpan(params.name, { startTime: params.startTime }, createParentContext(params.parentSpanContext)); + return getLangfuseTracer().startSpan(params.name, { startTime: params.startTime }, createParentContext(params.parentSpanContext)); } function createParentContext(parentSpanContext) { - if (!parentSpanContext) return; - return trace.setSpanContext(context.active(), parentSpanContext); + if (!parentSpanContext) + return; + return import_api2.trace.setSpanContext(import_api2.context.active(), parentSpanContext); } function startObservation(name, attributes, options) { - var _a$3; - const { asType = "span", ...observationOptions } = options || {}; - const otelSpan = createOtelSpan({ - name, - ...observationOptions - }); - switch (asType) { - case "generation": return new LangfuseGeneration({ - otelSpan, - attributes - }); - case "embedding": return new LangfuseEmbedding({ - otelSpan, - attributes - }); - case "agent": return new LangfuseAgent({ - otelSpan, - attributes - }); - case "tool": return new LangfuseTool({ - otelSpan, - attributes - }); - case "chain": return new LangfuseChain({ - otelSpan, - attributes - }); - case "retriever": return new LangfuseRetriever({ - otelSpan, - attributes - }); - case "evaluator": return new LangfuseEvaluator({ - otelSpan, - attributes - }); - case "guardrail": return new LangfuseGuardrail({ - otelSpan, - attributes - }); - case "event": return new LangfuseEvent({ - otelSpan, - attributes, - timestamp: (_a$3 = observationOptions == null ? void 0 : observationOptions.startTime) != null ? _a$3 : /* @__PURE__ */ new Date() - }); - case "span": - default: return new LangfuseSpan({ - otelSpan, - attributes - }); - } -} - -//#endregion -//#region src/utils.ts -/** Read and JSON-parse the hook payload Claude Code writes to stdin. */ + var _a4; + const { asType = "span", ...observationOptions } = options || {}; + const otelSpan = createOtelSpan({ + name, + ...observationOptions + }); + switch (asType) { + case "generation": + return new LangfuseGeneration({ + otelSpan, + attributes + }); + case "embedding": + return new LangfuseEmbedding({ + otelSpan, + attributes + }); + case "agent": + return new LangfuseAgent({ + otelSpan, + attributes + }); + case "tool": + return new LangfuseTool({ + otelSpan, + attributes + }); + case "chain": + return new LangfuseChain({ + otelSpan, + attributes + }); + case "retriever": + return new LangfuseRetriever({ + otelSpan, + attributes + }); + case "evaluator": + return new LangfuseEvaluator({ + otelSpan, + attributes + }); + case "guardrail": + return new LangfuseGuardrail({ + otelSpan, + attributes + }); + case "event": { + const timestamp = (_a4 = observationOptions == null ? undefined : observationOptions.startTime) != null ? _a4 : /* @__PURE__ */ new Date; + return new LangfuseEvent({ + otelSpan, + attributes, + timestamp + }); + } + case "span": + default: + return new LangfuseSpan({ + otelSpan, + attributes + }); + } +} + +// src/utils.ts function readStdin() { - return new Promise((resolve, reject) => { - let buffer = ""; - process.stdin.setEncoding("utf-8"); - process.stdin.on("data", (chunk) => buffer += chunk); - process.stdin.on("end", () => { - const trimmed = buffer.trim(); - if (!trimmed) { - reject(/* @__PURE__ */ new Error("empty hook stdin")); - return; - } - try { - resolve(JSON.parse(trimmed)); - } catch (error) { - reject(/* @__PURE__ */ new Error(`failed to parse hook stdin: ${error instanceof Error ? error.message : String(error)}`)); - } - }); - process.stdin.once("error", reject); - }); + return new Promise((resolve, reject) => { + let buffer = ""; + process.stdin.setEncoding("utf-8"); + process.stdin.on("data", (chunk) => buffer += chunk); + process.stdin.on("end", () => { + const trimmed = buffer.trim(); + if (!trimmed) { + reject(new Error("empty hook stdin")); + return; + } + try { + resolve(JSON.parse(trimmed)); + } catch (error51) { + reject(new Error(`failed to parse hook stdin: ${error51 instanceof Error ? error51.message : String(error51)}`)); + } + }); + process.stdin.once("error", reject); + }); } function isPrimitive(value) { - const t = typeof value; - return t === "string" || t === "number" || t === "boolean"; + const t = typeof value; + return t === "string" || t === "number" || t === "boolean"; } -/** Stringify a value for display, leaving strings untouched. */ function toText(value) { - if (value == null) return ""; - if (typeof value === "string") return value; - if (isPrimitive(value)) return String(value); - try { - return JSON.stringify(value); - } catch { - return String(value); - } -} -/** Parse a Claude Code ISO 8601 timestamp (with trailing `Z`) into ms epoch. */ + if (value == null) + return ""; + if (typeof value === "string") + return value; + if (isPrimitive(value)) + return String(value); + try { + return JSON.stringify(value); + } catch { + return String(value); + } +} function parseTimestamp(value) { - if (typeof value !== "string" || !value) return void 0; - const ms = Date.parse(value); - return Number.isFinite(ms) ? ms : void 0; -} -/** -* Truncate large text to keep traces lightweight. Returns the (possibly -* shortened) value plus metadata describing what was dropped, or `undefined` -* metadata when nothing was truncated. -*/ + if (typeof value !== "string" || !value) + return; + const ms = Date.parse(value); + return Number.isFinite(ms) ? ms : undefined; +} function truncate(value, maxChars) { - if (value.length <= maxChars) return { text: value }; - return { - text: value.slice(0, maxChars), - meta: { - truncated: true, - originalLength: value.length - } - }; -} -/** Build a clip() that truncates long strings to `maxChars`. */ + if (value.length <= maxChars) + return { text: value }; + return { + text: value.slice(0, maxChars), + meta: { truncated: true, originalLength: value.length } + }; +} function makeClip(maxChars) { - function clip(value) { - if (typeof value !== "string") return value; - const { text, meta: meta$2 } = truncate(value, maxChars); - return meta$2 ? `${text}\n…[truncated ${meta$2.originalLength - text.length} chars]` : text; - } - return clip; -} -let debugEnabled = false; + function clip(value) { + if (typeof value !== "string") + return value; + const { text, meta: meta3 } = truncate(value, maxChars); + return meta3 ? `${text} +…[truncated ${meta3.originalLength - text.length} chars]` : text; + } + return clip; +} +var debugEnabled = false; function setDebug(enabled) { - debugEnabled = enabled; + debugEnabled = enabled; } function debugLog(...args) { - if (!debugEnabled) return; - console.error("[langfuse-claude-code]", ...args); + if (!debugEnabled) + return; + console.error("[langfuse-claude-code]", ...args); } -//#endregion -//#region src/parse.ts +// src/parse.ts function getMessage(row) { - return row.message && typeof row.message === "object" ? row.message : void 0; + return row.message && typeof row.message === "object" ? row.message : undefined; } function getContent(row) { - const msg = getMessage(row); - if (msg && msg.content !== void 0) return msg.content; - return row.content; + const msg = getMessage(row); + if (msg && msg.content !== undefined) + return msg.content; + return row.content; } -/** Resolve a row's role from `type` or `message.role`. */ function getRole(row) { - if (row.type === "user" || row.type === "assistant") return row.type; - const role = getMessage(row)?.role; - if (role === "user" || role === "assistant") return role; + if (row.type === "user" || row.type === "assistant") + return row.type; + const role = getMessage(row)?.role; + if (role === "user" || role === "assistant") + return role; + return; } function blocks(content) { - return Array.isArray(content) ? content : []; + return Array.isArray(content) ? content : []; } -/** Concatenate the text blocks (or a plain string) of a message's content. */ function extractText(content) { - if (typeof content === "string") return content; - return blocks(content).filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).filter(Boolean).join("\n"); + if (typeof content === "string") + return content; + return blocks(content).filter((b) => b.type === "text" && typeof b.text === "string").map((b) => b.text).filter(Boolean).join(` +`); } function getToolUses(content) { - return blocks(content).filter((b) => b.type === "tool_use"); + return blocks(content).filter((b) => b.type === "tool_use"); } function getToolResults(content) { - return blocks(content).filter((b) => b.type === "tool_result"); + return blocks(content).filter((b) => b.type === "tool_result"); } -/** A user row is a tool-result carrier when its content holds tool_result blocks. */ function isToolResultRow(row) { - return getRole(row) === "user" && getToolResults(getContent(row)).length > 0; + return getRole(row) === "user" && getToolResults(getContent(row)).length > 0; } function getModel(row) { - const model = getMessage(row)?.model; - return typeof model === "string" && model ? model : "claude"; + const model = getMessage(row)?.model; + return typeof model === "string" && model ? model : "claude"; } function getMessageId(row) { - const id = getMessage(row)?.id; - return typeof id === "string" && id ? id : void 0; + const id = getMessage(row)?.id; + return typeof id === "string" && id ? id : undefined; } -/** Normalize Anthropic token usage to Langfuse `usageDetails` keys. */ function getUsage(row) { - const usage = getMessage(row)?.usage; - if (!usage || typeof usage !== "object") return void 0; - const u = usage; - const details = {}; - for (const [src, dst] of [ - ["input_tokens", "input"], - ["output_tokens", "output"], - ["cache_read_input_tokens", "cache_read_input_tokens"], - ["cache_creation_input_tokens", "cache_creation_input_tokens"] - ]) { - const v = u[src]; - if (typeof v === "number" && v > 0) details[dst] = v; - } - return Object.keys(details).length > 0 ? details : void 0; -} -/** -* Group transcript rows into turns. -* -* A turn is: one user message (not a tool-result carrier), followed by the -* assistant messages it produced, plus the tool_result rows those tool calls -* resolved to (which arrive as later `user` rows). Assistant messages are -* deduped by `message.id` — Claude Code can rewrite a streaming row in place, -* and the latest copy wins — while preserving first-appearance order. -*/ + const usage = getMessage(row)?.usage; + if (!usage || typeof usage !== "object") + return; + const u = usage; + const details = {}; + const map2 = [ + ["input_tokens", "input"], + ["output_tokens", "output"], + ["cache_read_input_tokens", "cache_read_input_tokens"], + ["cache_creation_input_tokens", "cache_creation_input_tokens"] + ]; + for (const [src, dst] of map2) { + const v = u[src]; + if (typeof v === "number" && v > 0) + details[dst] = v; + } + return Object.keys(details).length > 0 ? details : undefined; +} function buildTurns(rows) { - const turns = []; - let currentUser = null; - let assistantOrder = []; - let assistantLatest = /* @__PURE__ */ new Map(); - let toolResultsById = /* @__PURE__ */ new Map(); - const flush = () => { - if (currentUser === null || assistantLatest.size === 0) return; - const userText = extractText(getContent(currentUser)); - const userTimestamp = parseTimestamp(currentUser.timestamp); - const assistants = assistantOrder.map((id) => assistantLatest.get(id)).filter((m) => m !== void 0); - const steps = assistants.map((am) => { - const amContent = getContent(am); - const amTs = parseTimestamp(am.timestamp); - const toolCalls = getToolUses(amContent).map((tu) => { - const id = String(tu.id ?? ""); - const result = id ? toolResultsById.get(id) : void 0; - return { - id, - name: typeof tu.name === "string" ? tu.name : "unknown", - input: tu.input, - startTime: amTs, - endTime: result?.timestamp, - output: result?.content - }; - }); - return { - text: extractText(amContent) || void 0, - model: getModel(am), - usage: getUsage(am), - toolCalls, - timestamp: amTs - }; - }); - const lastAssistant = assistants[assistants.length - 1]; - const finalAssistantText = extractText(getContent(lastAssistant)) || void 0; - const candidateEnds = [parseTimestamp(lastAssistant.timestamp)]; - for (const tr of toolResultsById.values()) if (tr.timestamp !== void 0) candidateEnds.push(tr.timestamp); - const endTimestamp = candidateEnds.filter((t) => t !== void 0).reduce((max, t) => max === void 0 || t > max ? t : max, void 0); - turns.push({ - userText, - userTimestamp, - finalAssistantText, - endTimestamp, - steps - }); - }; - for (const row of rows) { - if (isToolResultRow(row)) { - const ts = parseTimestamp(row.timestamp); - for (const tr of getToolResults(getContent(row))) if (tr.tool_use_id) toolResultsById.set(String(tr.tool_use_id), { - content: tr.content, - timestamp: ts - }); - continue; - } - const role = getRole(row); - if (role === "user") { - flush(); - currentUser = row; - assistantOrder = []; - assistantLatest = /* @__PURE__ */ new Map(); - toolResultsById = /* @__PURE__ */ new Map(); - continue; - } - if (role === "assistant") { - if (currentUser === null) continue; - const id = getMessageId(row) ?? `noid:${assistantOrder.length}`; - if (!assistantLatest.has(id)) assistantOrder.push(id); - assistantLatest.set(id, row); - continue; - } - } - flush(); - return turns; -} - -//#endregion -//#region src/state.ts -/** Parse newline-delimited JSON transcript text into rows, skipping bad lines. */ + const turns = []; + let currentUser = null; + let assistantOrder = []; + let assistantLatest = new Map; + let toolResultsById = new Map; + const flush = () => { + if (currentUser === null || assistantLatest.size === 0) + return; + const userContent = getContent(currentUser); + const userText = extractText(userContent); + const userTimestamp = parseTimestamp(currentUser.timestamp); + const assistants = assistantOrder.map((id) => assistantLatest.get(id)).filter((m) => m !== undefined); + const steps = assistants.map((am) => { + const amContent = getContent(am); + const amTs = parseTimestamp(am.timestamp); + const toolCalls = getToolUses(amContent).map((tu) => { + const id = String(tu.id ?? ""); + const result = id ? toolResultsById.get(id) : undefined; + return { + id, + name: typeof tu.name === "string" ? tu.name : "unknown", + input: tu.input, + startTime: amTs, + endTime: result?.timestamp, + output: result?.content + }; + }); + return { + text: extractText(amContent) || undefined, + model: getModel(am), + usage: getUsage(am), + toolCalls, + timestamp: amTs + }; + }); + const lastAssistant = assistants[assistants.length - 1]; + const finalAssistantText = extractText(getContent(lastAssistant)) || undefined; + const candidateEnds = [parseTimestamp(lastAssistant.timestamp)]; + for (const tr of toolResultsById.values()) { + if (tr.timestamp !== undefined) + candidateEnds.push(tr.timestamp); + } + const endTimestamp = candidateEnds.filter((t) => t !== undefined).reduce((max, t) => max === undefined || t > max ? t : max, undefined); + turns.push({ userText, userTimestamp, finalAssistantText, endTimestamp, steps }); + }; + for (const row of rows) { + if (isToolResultRow(row)) { + const ts = parseTimestamp(row.timestamp); + for (const tr of getToolResults(getContent(row))) { + if (tr.tool_use_id) { + toolResultsById.set(String(tr.tool_use_id), { content: tr.content, timestamp: ts }); + } + } + continue; + } + const role = getRole(row); + if (role === "user") { + flush(); + currentUser = row; + assistantOrder = []; + assistantLatest = new Map; + toolResultsById = new Map; + continue; + } + if (role === "assistant") { + if (currentUser === null) + continue; + const id = getMessageId(row) ?? `noid:${assistantOrder.length}`; + if (!assistantLatest.has(id)) + assistantOrder.push(id); + assistantLatest.set(id, row); + continue; + } + } + flush(); + return turns; +} + +// src/state.ts +import * as fs2 from "node:fs/promises"; function parseRows(text) { - const rows = []; - for (const raw of text.split("\n")) { - const trimmed = raw.trim(); - if (!trimmed) continue; - try { - rows.push(JSON.parse(trimmed)); - } catch {} - } - return rows; -} -/** Read and parse an entire transcript file (used for subagent transcripts). */ -async function readAllRows(file) { - return parseRows(await fs.readFile(file, "utf-8")); -} -const EMPTY_STATE = { - offset: 0, - turnCount: 0 -}; + const rows = []; + for (const raw of text.split(` +`)) { + const trimmed = raw.trim(); + if (!trimmed) + continue; + try { + rows.push(JSON.parse(trimmed)); + } catch {} + } + return rows; +} +async function readAllRows(file2) { + return parseRows(await fs2.readFile(file2, "utf-8")); +} +var EMPTY_STATE = { offset: 0, turnCount: 0 }; function sidecarPath(transcriptPath) { - return `${transcriptPath}.langfuse`; + return `${transcriptPath}.langfuse`; } async function loadState(transcriptPath) { - try { - const raw = JSON.parse(await fs.readFile(sidecarPath(transcriptPath), "utf-8")); - return { - offset: Number.isFinite(raw.offset) ? Number(raw.offset) : 0, - turnCount: Number.isFinite(raw.turnCount) ? Number(raw.turnCount) : 0 - }; - } catch (error) { - if (error.code !== "ENOENT") debugLog("failed to read state sidecar; starting fresh:", error); - return { ...EMPTY_STATE }; - } + try { + const raw = JSON.parse(await fs2.readFile(sidecarPath(transcriptPath), "utf-8")); + return { + offset: Number.isFinite(raw.offset) ? Number(raw.offset) : 0, + turnCount: Number.isFinite(raw.turnCount) ? Number(raw.turnCount) : 0 + }; + } catch (error51) { + if (error51.code !== "ENOENT") { + debugLog("failed to read state sidecar; starting fresh:", error51); + } + return { ...EMPTY_STATE }; + } } async function saveState(transcriptPath, state) { - try { - await fs.writeFile(sidecarPath(transcriptPath), JSON.stringify(state), "utf-8"); - } catch (error) { - debugLog("failed to write state sidecar:", error); - } -} -/** -* Read transcript rows appended since `state.offset`. -* -* Reads raw bytes from the offset to EOF, then only consumes up to the last -* complete line (the final newline). A partial trailing line — the transcript -* may still be mid-write — is left for the next invocation by not advancing the -* offset past it. If the file shrank (rotation/truncation), we restart from the -* beginning. -*/ + try { + await fs2.writeFile(sidecarPath(transcriptPath), JSON.stringify(state), "utf-8"); + } catch (error51) { + debugLog("failed to write state sidecar:", error51); + } +} async function readNewRows(transcriptPath, state) { - let offset = state.offset; - let size; - try { - size = (await fs.stat(transcriptPath)).size; - } catch (error) { - debugLog("failed to stat transcript:", error); - return { - rows: [], - offset - }; - } - if (size < offset) { - debugLog(`transcript shrank (${size} < ${offset}); restarting from the beginning`); - offset = 0; - } - if (size === offset) return { - rows: [], - offset - }; - const length = size - offset; - const buffer = Buffer.alloc(length); - let fh; - try { - fh = await fs.open(transcriptPath, "r"); - await fh.read(buffer, 0, length, offset); - } catch (error) { - debugLog("failed to read transcript:", error); - return { - rows: [], - offset - }; - } finally { - await fh?.close(); - } - const lastNewline = buffer.lastIndexOf(10); - if (lastNewline < 0) return { - rows: [], - offset - }; - const complete = buffer.subarray(0, lastNewline + 1); - const newOffset = offset + complete.length; - return { - rows: parseRows(complete.toString("utf-8")), - offset: newOffset - }; -} - -//#endregion -//#region src/subagents.ts -/** -* Discover subagent transcripts for a main transcript by reading the sibling -* `subagents/*.meta.json` files. Returns an empty index if there are none (or -* the directory is missing) — subagents are optional. -*/ + let offset = state.offset; + let size; + try { + size = (await fs2.stat(transcriptPath)).size; + } catch (error51) { + debugLog("failed to stat transcript:", error51); + return { rows: [], offset }; + } + if (size < offset) { + debugLog(`transcript shrank (${size} < ${offset}); restarting from the beginning`); + offset = 0; + } + if (size === offset) { + return { rows: [], offset }; + } + const length = size - offset; + const buffer = Buffer.alloc(length); + let fh; + try { + fh = await fs2.open(transcriptPath, "r"); + await fh.read(buffer, 0, length, offset); + } catch (error51) { + debugLog("failed to read transcript:", error51); + return { rows: [], offset }; + } finally { + await fh?.close(); + } + const lastNewline = buffer.lastIndexOf(10); + if (lastNewline < 0) { + return { rows: [], offset }; + } + const complete = buffer.subarray(0, lastNewline + 1); + const newOffset = offset + complete.length; + return { rows: parseRows(complete.toString("utf-8")), offset: newOffset }; +} + +// src/subagents.ts +import * as fs3 from "node:fs/promises"; +import * as path2 from "node:path"; async function discoverSubagents(transcriptPath) { - const index = /* @__PURE__ */ new Map(); - const subDir = path.join(transcriptPath.replace(/\.jsonl$/i, ""), "subagents"); - let entries; - try { - entries = await fs.readdir(subDir, { withFileTypes: true }); - } catch (error) { - if (error.code !== "ENOENT") debugLog("failed to read subagents directory:", error); - return index; - } - for (const entry of entries) { - if (!entry.isFile() || !entry.name.endsWith(".meta.json")) continue; - const metaPath = path.join(subDir, entry.name); - try { - const meta$2 = JSON.parse(await fs.readFile(metaPath, "utf-8")); - if (typeof meta$2.toolUseId !== "string" || !meta$2.toolUseId) continue; - const file = path.join(subDir, entry.name.replace(/\.meta\.json$/, ".jsonl")); - index.set(meta$2.toolUseId, { - file, - agentType: typeof meta$2.agentType === "string" ? meta$2.agentType : "subagent", - description: typeof meta$2.description === "string" ? meta$2.description : void 0, - toolUseId: meta$2.toolUseId - }); - } catch (error) { - debugLog(`failed to parse subagent meta ${entry.name}:`, error); - } - } - if (index.size > 0) debugLog(`discovered ${index.size} subagent transcript(s)`); - return index; -} - -//#endregion -//#region src/trace.ts -/** A Date is required to backdate a span; fall back to `undefined` (= now). */ + const index = new Map; + const subDir = path2.join(transcriptPath.replace(/\.jsonl$/i, ""), "subagents"); + let entries; + try { + entries = await fs3.readdir(subDir, { withFileTypes: true }); + } catch (error51) { + if (error51.code !== "ENOENT") { + debugLog("failed to read subagents directory:", error51); + } + return index; + } + for (const entry of entries) { + if (!entry.isFile() || !entry.name.endsWith(".meta.json")) + continue; + const metaPath = path2.join(subDir, entry.name); + try { + const meta3 = JSON.parse(await fs3.readFile(metaPath, "utf-8")); + if (typeof meta3.toolUseId !== "string" || !meta3.toolUseId) + continue; + const file2 = path2.join(subDir, entry.name.replace(/\.meta\.json$/, ".jsonl")); + index.set(meta3.toolUseId, { + file: file2, + agentType: typeof meta3.agentType === "string" ? meta3.agentType : "subagent", + description: typeof meta3.description === "string" ? meta3.description : undefined, + toolUseId: meta3.toolUseId + }); + } catch (error51) { + debugLog(`failed to parse subagent meta ${entry.name}:`, error51); + } + } + if (index.size > 0) + debugLog(`discovered ${index.size} subagent transcript(s)`); + return index; +} + +// src/trace.ts function asDate(ts) { - return ts !== void 0 ? new Date(ts) : void 0; + return ts !== undefined ? new Date(ts) : undefined; } function buildGenerationOutput(step, clip) { - const output = { role: "assistant" }; - if (step.text) output.content = clip(step.text); - if (step.toolCalls.length > 0) output.tool_calls = step.toolCalls.map((tc) => ({ - id: tc.id, - name: tc.name, - input: clip(tc.input) - })); - return Object.keys(output).length > 1 ? output : void 0; -} -/** -* Emit a sequence of assistant steps (one generation each, with nested tool -* observations) under `parent`. Returns the timestamp the last step ended, so -* the caller can close the parent observation cleanly. -*/ + const output = { role: "assistant" }; + if (step.text) + output.content = clip(step.text); + if (step.toolCalls.length > 0) { + output.tool_calls = step.toolCalls.map((tc) => ({ + id: tc.id, + name: tc.name, + input: clip(tc.input) + })); + } + return Object.keys(output).length > 1 ? output : undefined; +} async function emitSteps(parent, steps, firstInput, startTs, ctx) { - let prevTs = startTs; - let prevToolResults; - for (let idx = 0; idx < steps.length; idx++) { - const step = steps[idx]; - const generation = startObservation("Claude Generation", { - input: idx === 0 ? firstInput : prevToolResults ? { - role: "tool", - tool_results: prevToolResults - } : void 0, - output: buildGenerationOutput(step, ctx.clip), - model: step.model, - usageDetails: step.usage, - metadata: { - "claude.step_index": idx, - "claude.tool_count": step.toolCalls.length - } - }, { - asType: "generation", - startTime: asDate(prevTs ?? step.timestamp), - parentSpanContext: parent.otelSpan.spanContext() - }); - const resultTimes = []; - for (const tc of step.toolCalls) { - await emitToolCall(tc, generation, step.timestamp, ctx); - if (tc.endTime !== void 0) resultTimes.push(tc.endTime); - } - const genEnd = resultTimes.length > 0 ? Math.max(...resultTimes) : step.timestamp ?? prevTs; - generation.end(asDate(genEnd)); - prevToolResults = step.toolCalls.length > 0 ? step.toolCalls.map((tc) => ({ - tool_use_id: tc.id, - tool_name: tc.name, - output: tc.output != null ? ctx.clip(toText(tc.output)) : void 0 - })) : void 0; - if (resultTimes.length > 0) prevTs = Math.max(...resultTimes); - else if (step.timestamp !== void 0) prevTs = step.timestamp; - } - return prevTs; + let prevTs = startTs; + let prevToolResults; + for (let idx = 0;idx < steps.length; idx++) { + const step = steps[idx]; + const input = idx === 0 ? firstInput : prevToolResults ? { role: "tool", tool_results: prevToolResults } : undefined; + const generation = startObservation("Claude Generation", { + input, + output: buildGenerationOutput(step, ctx.clip), + model: step.model, + usageDetails: step.usage, + metadata: { "claude.step_index": idx, "claude.tool_count": step.toolCalls.length } + }, { + asType: "generation", + startTime: asDate(prevTs ?? step.timestamp), + parentSpanContext: parent.otelSpan.spanContext() + }); + const resultTimes = []; + for (const tc of step.toolCalls) { + await emitToolCall(tc, generation, step.timestamp, ctx); + if (tc.endTime !== undefined) + resultTimes.push(tc.endTime); + } + const genEnd = resultTimes.length > 0 ? Math.max(...resultTimes) : step.timestamp ?? prevTs; + generation.end(asDate(genEnd)); + prevToolResults = step.toolCalls.length > 0 ? step.toolCalls.map((tc) => ({ + tool_use_id: tc.id, + tool_name: tc.name, + output: tc.output != null ? ctx.clip(toText(tc.output)) : undefined + })) : undefined; + if (resultTimes.length > 0) + prevTs = Math.max(...resultTimes); + else if (step.timestamp !== undefined) + prevTs = step.timestamp; + } + return prevTs; } async function emitToolCall(tc, parent, fallbackEnd, ctx) { - const tool = startObservation(`Tool: ${tc.name}`, { - input: ctx.clip(tc.input), - output: tc.output != null ? ctx.clip(toText(tc.output)) : void 0, - metadata: { - "claude.tool_id": tc.id, - "claude.tool_name": tc.name - } - }, { - asType: "tool", - startTime: asDate(tc.startTime), - parentSpanContext: parent.otelSpan.spanContext() - }); - const subagent = ctx.subagents.get(tc.id); - if (subagent && !ctx.visited.has(subagent.file)) await emitSubagent(tool, subagent, tc, ctx); - tool.end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); -} -/** Expand a subagent transcript as nested observations under its tool call. */ + const tool = startObservation(`Tool: ${tc.name}`, { + input: ctx.clip(tc.input), + output: tc.output != null ? ctx.clip(toText(tc.output)) : undefined, + metadata: { "claude.tool_id": tc.id, "claude.tool_name": tc.name } + }, { + asType: "tool", + startTime: asDate(tc.startTime), + parentSpanContext: parent.otelSpan.spanContext() + }); + const subagent = ctx.subagents.get(tc.id); + if (subagent && !ctx.visited.has(subagent.file)) { + await emitSubagent(tool, subagent, tc, ctx); + } + tool.end(asDate(tc.endTime ?? tc.startTime ?? fallbackEnd)); +} async function emitSubagent(parentTool, subagent, tc, ctx) { - ctx.visited.add(subagent.file); - let rows; - try { - rows = await readAllRows(subagent.file); - } catch (error) { - debugLog(`failed to read subagent transcript ${subagent.file}:`, error); - return; - } - const turns = buildTurns(rows); - if (turns.length === 0) return; - for (const turn of turns) { - const agent = startObservation(`Subagent: ${subagent.agentType}`, { - input: { - role: "user", - content: ctx.clip(turn.userText) - }, - output: turn.finalAssistantText != null ? { - role: "assistant", - content: ctx.clip(turn.finalAssistantText) - } : void 0, - metadata: { - "claude.subagent_type": subagent.agentType, - "claude.subagent_description": subagent.description, - "claude.spawning_tool_id": tc.id - } - }, { - asType: "agent", - startTime: asDate(turn.userTimestamp), - parentSpanContext: parentTool.otelSpan.spanContext() - }); - const lastTs = await emitSteps(agent, turn.steps, { - role: "user", - content: ctx.clip(turn.userText) - }, turn.userTimestamp, ctx); - agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); - } -} -/** Emit a single turn as a Langfuse observation tree. */ + ctx.visited.add(subagent.file); + let rows; + try { + rows = await readAllRows(subagent.file); + } catch (error51) { + debugLog(`failed to read subagent transcript ${subagent.file}:`, error51); + return; + } + const turns = buildTurns(rows); + if (turns.length === 0) + return; + for (const turn of turns) { + const agent = startObservation(`Subagent: ${subagent.agentType}`, { + input: { role: "user", content: ctx.clip(turn.userText) }, + output: turn.finalAssistantText != null ? { role: "assistant", content: ctx.clip(turn.finalAssistantText) } : undefined, + metadata: { + "claude.subagent_type": subagent.agentType, + "claude.subagent_description": subagent.description, + "claude.spawning_tool_id": tc.id + } + }, { + asType: "agent", + startTime: asDate(turn.userTimestamp), + parentSpanContext: parentTool.otelSpan.spanContext() + }); + const lastTs = await emitSteps(agent, turn.steps, { role: "user", content: ctx.clip(turn.userText) }, turn.userTimestamp, ctx); + agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); + } +} async function emitTurn(turn, turnNum, transcriptPath, ctx) { - const root = startObservation("Claude Code Turn", { - input: { - role: "user", - content: ctx.clip(turn.userText) - }, - output: turn.finalAssistantText != null ? { - role: "assistant", - content: ctx.clip(turn.finalAssistantText) - } : void 0, - metadata: { - "claude.source": "claude-code", - "claude.turn_number": turnNum, - "claude.transcript_path": transcriptPath, - "claude.assistant_message_count": turn.steps.length - } - }, { - asType: "agent", - startTime: asDate(turn.userTimestamp) - }); - const lastTs = await emitSteps(root, turn.steps, { - role: "user", - content: ctx.clip(turn.userText) - }, turn.userTimestamp, ctx); - root.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); -} -/** -* Convert the newly appended part of a Claude Code transcript into Langfuse -* traces. Each turn becomes its own trace, grouped into a Langfuse session via -* the Claude Code session id. Subagent transcripts are nested under the tool -* call that spawned them. State is tracked in a sidecar so each turn is -* uploaded exactly once. -*/ -async function convertTranscript(transcriptPath, sessionId, config$1) { - const state = await loadState(transcriptPath); - const { rows, offset } = await readNewRows(transcriptPath, state); - if (rows.length === 0) { - debugLog("no new transcript rows to process"); - await saveState(transcriptPath, { - ...state, - offset - }); - return; - } - const turns = buildTurns(rows); - debugLog(`parsed ${turns.length} new turn(s) from ${transcriptPath}`); - const subagents = await discoverSubagents(transcriptPath); - let emitted = 0; - for (const turn of turns) { - const turnNum = state.turnCount + emitted + 1; - const ctx = { - clip: makeClip(config$1.max_chars), - subagents, - visited: /* @__PURE__ */ new Set() - }; - try { - await propagateAttributes({ - sessionId, - traceName: "Claude Code Turn", - tags: ["claude-code", ...config$1.tags ?? []], - ...config$1.user_id ? { userId: config$1.user_id } : {}, - ...config$1.metadata ? { metadata: config$1.metadata } : {} - }, async () => { - await emitTurn(turn, turnNum, transcriptPath, ctx); - }); - emitted += 1; - } catch (error) { - debugLog(`failed to emit turn ${turnNum}:`, error); - if (config$1.fail_on_error) throw error; - } - } - await saveState(transcriptPath, { - offset, - turnCount: state.turnCount + emitted - }); -} - -//#endregion -//#region src/index.ts -let failOnError = process.env.CC_LANGFUSE_FAIL_ON_ERROR === "true"; -/** -* Entry point for the Claude Code `Stop` hook. -* -* Claude Code pipes a JSON payload to stdin after every turn. We resolve -* config, bail out unless Langfuse credentials are present, then convert the -* newly appended transcript rows into Langfuse traces. -* -* The hook fails open: any error is logged (in debug mode) and swallowed so a -* tracing problem never blocks the Claude Code session. Set -* `CC_LANGFUSE_FAIL_ON_ERROR=true` while testing if you want Claude Code to -* report hook failures instead. -*/ + const root = startObservation("Claude Code Turn", { + input: { role: "user", content: ctx.clip(turn.userText) }, + output: turn.finalAssistantText != null ? { role: "assistant", content: ctx.clip(turn.finalAssistantText) } : undefined, + metadata: { + "claude.source": "claude-code", + "claude.turn_number": turnNum, + "claude.transcript_path": transcriptPath, + "claude.assistant_message_count": turn.steps.length + } + }, { + asType: "agent", + startTime: asDate(turn.userTimestamp) + }); + const lastTs = await emitSteps(root, turn.steps, { role: "user", content: ctx.clip(turn.userText) }, turn.userTimestamp, ctx); + root.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); +} +async function convertTranscript(transcriptPath, sessionId, config2) { + const state = await loadState(transcriptPath); + const { rows, offset } = await readNewRows(transcriptPath, state); + if (rows.length === 0) { + debugLog("no new transcript rows to process"); + await saveState(transcriptPath, { ...state, offset }); + return; + } + const turns = buildTurns(rows); + debugLog(`parsed ${turns.length} new turn(s) from ${transcriptPath}`); + const subagents = await discoverSubagents(transcriptPath); + let emitted = 0; + for (const turn of turns) { + const turnNum = state.turnCount + emitted + 1; + const ctx = { clip: makeClip(config2.max_chars), subagents, visited: new Set }; + try { + await propagateAttributes({ + sessionId, + traceName: "Claude Code Turn", + tags: ["claude-code", ...config2.tags ?? []], + ...config2.user_id ? { userId: config2.user_id } : {}, + ...config2.metadata ? { metadata: config2.metadata } : {} + }, async () => { + await emitTurn(turn, turnNum, transcriptPath, ctx); + }); + emitted += 1; + } catch (error51) { + debugLog(`failed to emit turn ${turnNum}:`, error51); + if (config2.fail_on_error) + throw error51; + } + } + await saveState(transcriptPath, { offset, turnCount: state.turnCount + emitted }); +} + +// src/index.ts +var failOnError = process.env.CC_LANGFUSE_FAIL_ON_ERROR === "true"; async function runHook() { - let hookInput; - try { - hookInput = await readStdin(); - } catch { - return; - } - const cwd = hookInput.cwd; - const config$1 = await getConfig(cwd ? { cwd } : void 0); - setDebug(config$1.debug); - failOnError = config$1.fail_on_error; - if (!config$1.public_key || !config$1.secret_key) { - debugLog("missing LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY; skipping"); - return; - } - const sessionId = hookInput.session_id ?? hookInput.sessionId; - const transcriptPath = hookInput.transcript_path ?? hookInput.transcriptPath; - if (!sessionId || !transcriptPath) { - debugLog("hook payload missing session_id or transcript_path; skipping"); - return; - } - const instrumentation = setupInstrumentation(config$1); - try { - await convertTranscript(transcriptPath, sessionId, config$1); - } catch (error) { - debugLog("failed to convert transcript:", error); - if (config$1.fail_on_error) throw error; - } finally { - try { - await instrumentation.shutdown(); - } catch (error) { - debugLog("error during flush/shutdown:", error); - if (config$1.fail_on_error) throw error; - } - } -} -runHook().catch((error) => { - if (process.env.CC_LANGFUSE_DEBUG === "true") console.error("[langfuse-claude-code] fatal:", error); - if (failOnError) process.exitCode = 1; -}); - -//#endregion -export { runHook }; \ No newline at end of file + let hookInput; + try { + hookInput = await readStdin(); + } catch { + return; + } + const cwd = hookInput.cwd; + const config2 = await getConfig(cwd ? { cwd } : undefined); + setDebug(config2.debug); + failOnError = config2.fail_on_error; + if (!config2.public_key || !config2.secret_key) { + debugLog("missing LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY; skipping"); + return; + } + const sessionId = hookInput.session_id ?? hookInput.sessionId; + const transcriptPath = hookInput.transcript_path ?? hookInput.transcriptPath; + if (!sessionId || !transcriptPath) { + debugLog("hook payload missing session_id or transcript_path; skipping"); + return; + } + const instrumentation = setupInstrumentation(config2); + try { + await convertTranscript(transcriptPath, sessionId, config2); + } catch (error51) { + debugLog("failed to convert transcript:", error51); + if (config2.fail_on_error) + throw error51; + } finally { + try { + await instrumentation.shutdown(); + } catch (error51) { + debugLog("error during flush/shutdown:", error51); + if (config2.fail_on_error) + throw error51; + } + } +} +runHook().catch((error51) => { + if (process.env.CC_LANGFUSE_DEBUG === "true") { + console.error("[langfuse-claude-code] fatal:", error51); + } + if (failOnError) { + process.exitCode = 1; + } +}); +export { + runHook +}; diff --git a/hooks/hooks.json b/hooks/hooks.json index 6158364..45cb8cc 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -5,7 +5,7 @@ "hooks": [ { "type": "command", - "command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/index.mjs\"", + "command": "bun \"${CLAUDE_PLUGIN_ROOT}/dist/index.mjs\"", "timeout": 30 } ] diff --git a/package.json b/package.json index 2dfd1ad..e7dd807 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langfuse/claude-observability-plugin", - "version": "2.2.0", + "version": "3.0.0", "description": "Claude Code plugin that traces sessions, turns, generations, and tool calls to Langfuse", "keywords": [ "claude-code", @@ -23,14 +23,14 @@ }, "type": "module", "scripts": { - "build": "tsdown --config tsdown.config.ts", - "test": "vitest run", - "test:watch": "vitest", + "build": "bun build src/index.ts --outfile dist/index.mjs --target node --format esm", + "test": "bun test", + "test:watch": "bun test --watch", "format": "prettier --write .", "format:check": "prettier --check .", "lint:tsc": "tsc --noEmit", - "lint:dist": "pnpm run build && git diff --exit-code -- dist/index.mjs", - "lint": "pnpm run format:check && pnpm run lint:tsc && pnpm run lint:dist" + "lint:dist": "bun run build && git diff --exit-code -- dist/index.mjs", + "lint": "bun run format:check && bun run lint:tsc && bun run lint:dist" }, "dependencies": { "@langfuse/otel": "^5.4.1", @@ -43,14 +43,12 @@ "zod": "^4.1.13" }, "devDependencies": { + "@types/bun": "^1.3.14", "@types/node": "^22.10.0", "prettier": "^3.4.2", - "tsdown": "^0.18.0", - "typescript": "^5.7.2", - "vitest": "^4.0.0" + "typescript": "^5.7.2" }, "engines": { - "node": ">=20" - }, - "packageManager": "pnpm@10.33.0" + "bun": ">=1.2" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 4a4a4d7..0000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,1743 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@langfuse/otel': - specifier: ^5.4.1 - version: 5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1)) - '@langfuse/tracing': - specifier: ^5.4.1 - version: 5.4.1(@opentelemetry/api@1.9.1) - '@opentelemetry/api': - specifier: ^1.9.0 - version: 1.9.1 - '@opentelemetry/core': - specifier: ^2.0.1 - version: 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/exporter-trace-otlp-http': - specifier: ^0.205.0 - version: 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': - specifier: ^2.0.1 - version: 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-node': - specifier: ^2.0.1 - version: 2.7.1(@opentelemetry/api@1.9.1) - zod: - specifier: ^4.1.13 - version: 4.4.3 - devDependencies: - '@types/node': - specifier: ^22.10.0 - version: 22.19.20 - prettier: - specifier: ^3.4.2 - version: 3.8.3 - tsdown: - specifier: ^0.18.0 - version: 0.18.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(typescript@5.9.3) - typescript: - specifier: ^5.7.2 - version: 5.9.3 - vitest: - specifier: ^4.0.0 - version: 4.1.8(@opentelemetry/api@1.9.1)(@types/node@22.19.20)(vite@8.0.16(@types/node@22.19.20)) - -packages: - - '@babel/generator@7.29.7': - resolution: {integrity: sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.29.7': - resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.29.7': - resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.29.7': - resolution: {integrity: sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/types@7.29.7': - resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==} - engines: {node: '>=6.9.0'} - - '@emnapi/core@1.10.0': - resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} - - '@emnapi/runtime@1.10.0': - resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} - - '@emnapi/wasi-threads@1.2.1': - resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} - - '@jridgewell/gen-mapping@0.3.13': - resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - - '@jridgewell/sourcemap-codec@1.5.5': - resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - - '@jridgewell/trace-mapping@0.3.31': - resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - - '@langfuse/core@5.4.1': - resolution: {integrity: sha512-TjaRTr9fGqaWuyYKFSezKxN4DWAaK/lq//hRMw8rQKFkZUs6vTgUODxqZTFTR6np5VnLVw+eZLlnHROPKbXqdg==} - peerDependencies: - '@opentelemetry/api': ^1.9.0 - - '@langfuse/otel@5.4.1': - resolution: {integrity: sha512-w69aVC2fTmd7hyCTaX8zhhivHlsGVgZ551XOf6yMSOi3k8tlDML4dinnjJUP/6qTvdH54NYcmAIp5KZRbkouxg==} - engines: {node: '>=20'} - peerDependencies: - '@opentelemetry/api': ^1.9.0 - '@opentelemetry/core': ^2.0.1 - '@opentelemetry/exporter-trace-otlp-http': '>=0.202.0 <1.0.0' - '@opentelemetry/sdk-trace-base': ^2.0.1 - - '@langfuse/tracing@5.4.1': - resolution: {integrity: sha512-nPyoPXXNMaJgaUZgIE0haWI/hrT7l4r/irp0o/FGaBYR2V07EFNvSKFcqOsX1pQvVvB6HyfNlYQm7AoQJj+fqQ==} - engines: {node: '>=20'} - peerDependencies: - '@opentelemetry/api': ^1.9.0 - - '@napi-rs/wasm-runtime@1.1.4': - resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} - peerDependencies: - '@emnapi/core': ^1.7.1 - '@emnapi/runtime': ^1.7.1 - - '@opentelemetry/api-logs@0.205.0': - resolution: {integrity: sha512-wBlPk1nFB37Hsm+3Qy73yQSobVn28F4isnWIBvKpd5IUH/eat8bwcL02H9yzmHyyPmukeccSl2mbN5sDQZYnPg==} - engines: {node: '>=8.0.0'} - - '@opentelemetry/api@1.9.1': - resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==} - engines: {node: '>=8.0.0'} - - '@opentelemetry/context-async-hooks@2.7.1': - resolution: {integrity: sha512-OPFBYuXEn1E4ja3Y6eeA7O+ZnLBNcXTV5Cgsn1VaqBZ6hC5FnpZPLBNme1LJY8ZtF4aOujPKFoeWN4ik487KuQ==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.10.0' - - '@opentelemetry/core@2.1.0': - resolution: {integrity: sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.10.0' - - '@opentelemetry/core@2.7.1': - resolution: {integrity: sha512-QAqIj32AtK6+pEVNG7EOVxHdE06RP+FM5qpiEJ4RtDcFIqKUZHYhl7/7UY5efhwmwNAg7j8QbJVBLxMerc0+gw==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.10.0' - - '@opentelemetry/exporter-trace-otlp-http@0.205.0': - resolution: {integrity: sha512-vr2bwwPCSc9u7rbKc74jR+DXFvyMFQo9o5zs+H/fgbK672Whw/1izUKVf+xfWOdJOvuwTnfWxy+VAY+4TSo74Q==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': ^1.3.0 - - '@opentelemetry/otlp-exporter-base@0.205.0': - resolution: {integrity: sha512-2MN0C1IiKyo34M6NZzD6P9Nv9Dfuz3OJ3rkZwzFmF6xzjDfqqCTatc9v1EpNfaP55iDOCLHFyYNCgs61FFgtUQ==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': ^1.3.0 - - '@opentelemetry/otlp-transformer@0.205.0': - resolution: {integrity: sha512-KmObgqPtk9k/XTlWPJHdMbGCylRAmMJNXIRh6VYJmvlRDMfe+DonH41G7eenG8t4FXn3fxOGh14o/WiMRR6vPg==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': ^1.3.0 - - '@opentelemetry/resources@2.1.0': - resolution: {integrity: sha512-1CJjf3LCvoefUOgegxi8h6r4B/wLSzInyhGP2UmIBYNlo4Qk5CZ73e1eEyWmfXvFtm1ybkmfb2DqWvspsYLrWw==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.10.0' - - '@opentelemetry/resources@2.7.1': - resolution: {integrity: sha512-DeT6KKolmC4e/dRQvMQ/RwlnzhaqeiFOXY5ngoOPJ07GgVVKxZOg9EcrNZb5aTzUn+iCrJldAgOfQm1O/QfPAQ==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.10.0' - - '@opentelemetry/sdk-logs@0.205.0': - resolution: {integrity: sha512-nyqhNQ6eEzPWQU60Nc7+A5LIq8fz3UeIzdEVBQYefB4+msJZ2vuVtRuk9KxPMw1uHoHDtYEwkr2Ct0iG29jU8w==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.4.0 <1.10.0' - - '@opentelemetry/sdk-metrics@2.1.0': - resolution: {integrity: sha512-J9QX459mzqHLL9Y6FZ4wQPRZG4TOpMCyPOh6mkr/humxE1W2S3Bvf4i75yiMW9uyed2Kf5rxmLhTm/UK8vNkAw==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.9.0 <1.10.0' - - '@opentelemetry/sdk-trace-base@2.1.0': - resolution: {integrity: sha512-uTX9FBlVQm4S2gVQO1sb5qyBLq/FPjbp+tmGoxu4tIgtYGmBYB44+KX/725RFDe30yBSaA9Ml9fqphe1hbUyLQ==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.10.0' - - '@opentelemetry/sdk-trace-base@2.7.1': - resolution: {integrity: sha512-NAYIlsF8MPUsKqJMiDQJTMPOmlbawC1Iz/omMLygZ1C9am8fTKYjTaI+OZM+WTY3t3Glo0wnOg/6/pac6RGPPw==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.10.0' - - '@opentelemetry/sdk-trace-node@2.7.1': - resolution: {integrity: sha512-pCpQxU68lV+I9s9svqMyVu5iHdDDUnqUpSxqwyCU8A9ejEsSnMPCbearwsUO4yk08ZJzAIUCFuReMdVQvHrdvg==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.10.0' - - '@opentelemetry/semantic-conventions@1.41.1': - resolution: {integrity: sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==} - engines: {node: '>=14'} - - '@oxc-project/types@0.103.0': - resolution: {integrity: sha512-bkiYX5kaXWwUessFRSoXFkGIQTmc6dLGdxuRTrC+h8PSnIdZyuXHHlLAeTmOue5Br/a0/a7dHH0Gca6eXn9MKg==} - - '@oxc-project/types@0.127.0': - resolution: {integrity: sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==} - - '@oxc-project/types@0.133.0': - resolution: {integrity: sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==} - - '@protobufjs/aspromise@1.1.2': - resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} - - '@protobufjs/base64@1.1.2': - resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} - - '@protobufjs/codegen@2.0.5': - resolution: {integrity: sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==} - - '@protobufjs/eventemitter@1.1.1': - resolution: {integrity: sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==} - - '@protobufjs/fetch@1.1.1': - resolution: {integrity: sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==} - - '@protobufjs/float@1.0.2': - resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} - - '@protobufjs/inquire@1.1.2': - resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==} - - '@protobufjs/path@1.1.2': - resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} - - '@protobufjs/pool@1.1.0': - resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} - - '@protobufjs/utf8@1.1.1': - resolution: {integrity: sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==} - - '@quansync/fs@1.0.0': - resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} - - '@rolldown/binding-android-arm64@1.0.0-beta.57': - resolution: {integrity: sha512-GoOVDy8bjw9z1K30Oo803nSzXJS/vWhFijFsW3kzvZCO8IZwFnNa6pGctmbbJstKl3Fv6UBwyjJQN6msejW0IQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@rolldown/binding-android-arm64@1.0.0-rc.17': - resolution: {integrity: sha512-s70pVGhw4zqGeFnXWvAzJDlvxhlRollagdCCKRgOsgUOH3N1l0LIxf83AtGzmb5SiVM4Hjl5HyarMRfdfj3DaQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@rolldown/binding-android-arm64@1.0.3': - resolution: {integrity: sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@rolldown/binding-darwin-arm64@1.0.0-beta.57': - resolution: {integrity: sha512-9c4FOhRGpl+PX7zBK5p17c5efpF9aSpTPgyigv57hXf5NjQUaJOOiejPLAtFiKNBIfm5Uu6yFkvLKzOafNvlTw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@rolldown/binding-darwin-arm64@1.0.0-rc.17': - resolution: {integrity: sha512-4ksWc9n0mhlZpZ9PMZgTGjeOPRu8MB1Z3Tz0Mo02eWfWCHMW1zN82Qz/pL/rC+yQa+8ZnutMF0JjJe7PjwasYw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@rolldown/binding-darwin-arm64@1.0.3': - resolution: {integrity: sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@rolldown/binding-darwin-x64@1.0.0-beta.57': - resolution: {integrity: sha512-6RsB8Qy4LnGqNGJJC/8uWeLWGOvbRL/KG5aJ8XXpSEupg/KQtlBEiFaYU/Ma5Usj1s+bt3ItkqZYAI50kSplBA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@rolldown/binding-darwin-x64@1.0.0-rc.17': - resolution: {integrity: sha512-SUSDOI6WwUVNcWxd02QEBjLdY1VPHvlEkw6T/8nYG322iYWCTxRb1vzk4E+mWWYehTp7ERibq54LSJGjmouOsw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@rolldown/binding-darwin-x64@1.0.3': - resolution: {integrity: sha512-9YpfeUvSE2RS7wysJ81uOZkXJz7f7Q55H2Gvp3VEw/EsahqDtrphrZ0EwDLK5vvKOzaCrBsjF8JmnMLcUt78Gg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@rolldown/binding-freebsd-x64@1.0.0-beta.57': - resolution: {integrity: sha512-uA9kG7+MYkHTbqwv67Tx+5GV5YcKd33HCJIi0311iYBd25yuwyIqvJfBdt1VVB8tdOlyTb9cPAgfCki8nhwTQg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@rolldown/binding-freebsd-x64@1.0.0-rc.17': - resolution: {integrity: sha512-hwnz3nw9dbJ05EDO/PvcjaaewqqDy7Y1rn1UO81l8iIK1GjenME75dl16ajbvSSMfv66WXSRCYKIqfgq2KCfxw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@rolldown/binding-freebsd-x64@1.0.3': - resolution: {integrity: sha512-yB1IlAsSNHncV6SCTL27/MVGR5htvQsoGxIv5KMGXALp+Ll1wYsn+x98M9MW7qa+NdSbvrrY7ANI4wLJ0n1e6g==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': - resolution: {integrity: sha512-3KkS0cHsllT2T+Te+VZMKHNw6FPQihYsQh+8J4jkzwgvAQpbsbXmrqhkw3YU/QGRrD8qgcOvBr6z5y6Jid+rmw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': - resolution: {integrity: sha512-IS+W7epTcwANmFSQFrS1SivEXHtl1JtuQA9wlxrZTcNi6mx+FDOYrakGevvvTwgj2JvWiK8B29/qD9BELZPyXQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@rolldown/binding-linux-arm-gnueabihf@1.0.3': - resolution: {integrity: sha512-Yi30IVAAfLUCy2MseFjbB1jAMDl1VMCAas5StnYp8da9+CKvMd2H2cbEjWcw5NPaPqzvYkVIaF1nNUG+b7u/sw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': - resolution: {integrity: sha512-A3/wu1RgsHhqP3rVH2+sM81bpk+Qd2XaHTl8LtX5/1LNR7QVBFBCpAoiXwjTdGnI5cMdBVi7Z1pi52euW760Fw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': - resolution: {integrity: sha512-e6usGaHKW5BMNZOymS1UcEYGowQMWcgZ71Z17Sl/h2+ZziNJ1a9n3Zvcz6LdRyIW5572wBCTH/Z+bKuZouGk9Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-arm64-gnu@1.0.3': - resolution: {integrity: sha512-jsO7R8To+AdlYgUmN5sHSCZbfhtMBkO0WUx8iORQnPcMMdgr7qM2DQmMwgabs3GhNztdmoKkMKQFHD6DTMCIQw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': - resolution: {integrity: sha512-d0kIVezTQtazpyWjiJIn5to8JlwfKITDqwsFv0Xc6s31N16CD2PC/Pl2OtKgS7n8WLOJbfqgIp5ixYzTAxCqMg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': - resolution: {integrity: sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-arm64-musl@1.0.3': - resolution: {integrity: sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': - resolution: {integrity: sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-ppc64-gnu@1.0.3': - resolution: {integrity: sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': - resolution: {integrity: sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-s390x-gnu@1.0.3': - resolution: {integrity: sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': - resolution: {integrity: sha512-E199LPijo98yrLjPCmETx8EF43sZf9t3guSrLee/ej1rCCc3zDVTR4xFfN9BRAapGVl7/8hYqbbiQPTkv73kUg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': - resolution: {integrity: sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-gnu@1.0.3': - resolution: {integrity: sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': - resolution: {integrity: sha512-++EQDpk/UJ33kY/BNsh7A7/P1sr/jbMuQ8cE554ZIy+tCUWCivo9zfyjDUoiMdnxqX6HLJEqqGnbGQOvzm2OMQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': - resolution: {integrity: sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-x64-musl@1.0.3': - resolution: {integrity: sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': - resolution: {integrity: sha512-voDEBcNqxbUv/GeXKFtxXVWA+H45P/8Dec4Ii/SbyJyGvCqV1j+nNHfnFUIiRQ2Q40DwPe/djvgYBs9PpETiMA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': - resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@rolldown/binding-openharmony-arm64@1.0.3': - resolution: {integrity: sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@rolldown/binding-wasm32-wasi@1.0.0-beta.57': - resolution: {integrity: sha512-bRhcF7NLlCnpkzLVlVhrDEd0KH22VbTPkPTbMjlYvqhSmarxNIq5vtlQS8qmV7LkPKHrNLWyJW/V/sOyFba26Q==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] - - '@rolldown/binding-wasm32-wasi@1.0.0-rc.17': - resolution: {integrity: sha512-LEXei6vo0E5wTGwpkJ4KoT3OZJRnglwldt5ziLzOlc6qqb55z4tWNq2A+PFqCJuvWWdP53CVhG1Z9NtToDPJrA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [wasm32] - - '@rolldown/binding-wasm32-wasi@1.0.3': - resolution: {integrity: sha512-JTtb8BWFynicNSoPrehsCzBtOKjZ6jhMiPFEmOiuXg1Fl8dn2KHQob+GuPSGR0dryQa1PQJbzjF3dqO/whhjLg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [wasm32] - - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.57': - resolution: {integrity: sha512-rnDVGRks2FQ2hgJ2g15pHtfxqkGFGjJQUDWzYznEkE8Ra2+Vag9OffxdbJMZqBWXHVM0iS4dv8qSiEn7bO+n1Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.17': - resolution: {integrity: sha512-gUmyzBl3SPMa6hrqFUth9sVfcLBlYsbMzBx5PlexMroZStgzGqlZ26pYG89rBb45Mnia+oil6YAIFeEWGWhoZA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@rolldown/binding-win32-arm64-msvc@1.0.3': - resolution: {integrity: sha512-gEdFFEN70A/jxb2svrWsN3aDL7OUtmvlOy+6fa2jxG8K0wQ1ZbdeLGnidov6Yu5/733dI5ySfzFlQ/cb0bSz1g==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': - resolution: {integrity: sha512-OqIUyNid1M4xTj6VRXp/Lht/qIP8fo25QyAZlCP+p6D2ATCEhyW4ZIFLnC9zAGN/HMbXoCzvwfa8Jjg/8J4YEg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': - resolution: {integrity: sha512-3hkiolcUAvPB9FLb3UZdfjVVNWherN1f/skkGWJP/fgSQhYUZpSIRr0/I8ZK9TkF3F7kxvJAk0+IcKvPHk9qQg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@rolldown/binding-win32-x64-msvc@1.0.3': - resolution: {integrity: sha512-eXB7CHuaQdqmJcc3koCNtNPmT/bj2gc999kUFgBxG8Ac0NdgXc4rkCHhqrgrhN3zddvvvrgzj1e90SuSfmyIXA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@rolldown/pluginutils@1.0.0-beta.57': - resolution: {integrity: sha512-aQNelgx14tGA+n2tNSa9x6/jeoCL9fkDeCei7nOKnHx0fEFRRMu5ReiITo+zZD5TzWDGGRjbSYCs93IfRIyTuQ==} - - '@rolldown/pluginutils@1.0.0-rc.17': - resolution: {integrity: sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==} - - '@rolldown/pluginutils@1.0.1': - resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} - - '@standard-schema/spec@1.1.0': - resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - - '@tybys/wasm-util@0.10.2': - resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} - - '@types/chai@5.2.3': - resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} - - '@types/deep-eql@4.0.2': - resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} - - '@types/estree@1.0.9': - resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} - - '@types/node@22.19.20': - resolution: {integrity: sha512-6tELRwSDYWW9EdZhbeZmYGZ1/7Djkt+Ah3/ScEYT9cDord7UJzasR/4D3VONg9tQI5CDp+/CZC1AXj2pCFOvpw==} - - '@vitest/expect@4.1.8': - resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==} - - '@vitest/mocker@4.1.8': - resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==} - peerDependencies: - msw: ^2.4.9 - vite: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - msw: - optional: true - vite: - optional: true - - '@vitest/pretty-format@4.1.8': - resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==} - - '@vitest/runner@4.1.8': - resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==} - - '@vitest/snapshot@4.1.8': - resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==} - - '@vitest/spy@4.1.8': - resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==} - - '@vitest/utils@4.1.8': - resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==} - - ansis@4.3.1: - resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} - engines: {node: '>=14'} - - assertion-error@2.0.1: - resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} - engines: {node: '>=12'} - - ast-kit@2.2.0: - resolution: {integrity: sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw==} - engines: {node: '>=20.19.0'} - - birpc@4.0.0: - resolution: {integrity: sha512-LShSxJP0KTmd101b6DRyGBj57LZxSDYWKitQNW/mi8GRMvZb078Uf9+pveax1DrVL89vm7mWe+TovdI/UDOuPw==} - - cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} - - chai@6.2.2: - resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} - engines: {node: '>=18'} - - convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - - defu@6.1.7: - resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} - - detect-libc@2.1.2: - resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} - engines: {node: '>=8'} - - dts-resolver@2.1.3: - resolution: {integrity: sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw==} - engines: {node: '>=20.19.0'} - peerDependencies: - oxc-resolver: '>=11.0.0' - peerDependenciesMeta: - oxc-resolver: - optional: true - - empathic@2.0.1: - resolution: {integrity: sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==} - engines: {node: '>=14'} - - es-module-lexer@2.1.0: - resolution: {integrity: sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==} - - estree-walker@3.0.3: - resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - - expect-type@1.3.0: - resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} - engines: {node: '>=12.0.0'} - - fdir@6.5.0: - resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} - engines: {node: '>=12.0.0'} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - - get-tsconfig@4.14.0: - resolution: {integrity: sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==} - - hookable@6.1.1: - resolution: {integrity: sha512-U9LYDy1CwhMCnprUfeAZWZGByVbhd54hwepegYTK7Pi5NvqEj63ifz5z+xukznehT7i6NIZRu89Ay1AZmRsLEQ==} - - import-without-cache@0.2.5: - resolution: {integrity: sha512-B6Lc2s6yApwnD2/pMzFh/d5AVjdsDXjgkeJ766FmFuJELIGHNycKRj+l3A39yZPM4CchqNCB4RITEAYB1KUM6A==} - engines: {node: '>=20.19.0'} - - jsesc@3.1.0: - resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} - engines: {node: '>=6'} - hasBin: true - - lightningcss-android-arm64@1.32.0: - resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [android] - - lightningcss-darwin-arm64@1.32.0: - resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [darwin] - - lightningcss-darwin-x64@1.32.0: - resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [darwin] - - lightningcss-freebsd-x64@1.32.0: - resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [freebsd] - - lightningcss-linux-arm-gnueabihf@1.32.0: - resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} - engines: {node: '>= 12.0.0'} - cpu: [arm] - os: [linux] - - lightningcss-linux-arm64-gnu@1.32.0: - resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - lightningcss-linux-arm64-musl@1.32.0: - resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - libc: [musl] - - lightningcss-linux-x64-gnu@1.32.0: - resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - libc: [glibc] - - lightningcss-linux-x64-musl@1.32.0: - resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - libc: [musl] - - lightningcss-win32-arm64-msvc@1.32.0: - resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [win32] - - lightningcss-win32-x64-msvc@1.32.0: - resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [win32] - - lightningcss@1.32.0: - resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} - engines: {node: '>= 12.0.0'} - - long@5.3.2: - resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==} - - magic-string@0.30.21: - resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} - - nanoid@3.3.12: - resolution: {integrity: sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - obug@2.1.2: - resolution: {integrity: sha512-AWGB9WFcRXOQs48Z/udjI5ZcZMHXwX8XPByNpOydgcGsDLIzjGizhoMWJyKAWze7AVW/2W1i+/gPX4YtKe5cyg==} - engines: {node: '>=12.20.0'} - - pathe@2.0.3: - resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} - - picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - - picomatch@4.0.4: - resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} - engines: {node: '>=12'} - - postcss@8.5.15: - resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==} - engines: {node: ^10 || ^12 || >=14} - - prettier@3.8.3: - resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} - engines: {node: '>=14'} - hasBin: true - - protobufjs@7.6.2: - resolution: {integrity: sha512-N9EiLovGEQOJSPF26Ij7qUGvahfEnq0eeYZ02aigIedkmz1qZSwjnP9SBITHJuF/6MYbIW4HDN8zdYjsjqJKXQ==} - engines: {node: '>=12.0.0'} - - quansync@1.0.0: - resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} - - resolve-pkg-maps@1.0.0: - resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - - rolldown-plugin-dts@0.20.0: - resolution: {integrity: sha512-cLAY1kN2ilTYMfZcFlGWbXnu6Nb+8uwUBsi+Mjbh4uIx7IN8uMOmJ7RxrrRgPsO4H7eSz3E+JwGoL1gyugiyUA==} - engines: {node: '>=20.19.0'} - peerDependencies: - '@ts-macro/tsc': ^0.3.6 - '@typescript/native-preview': '>=7.0.0-dev.20250601.1' - rolldown: ^1.0.0-beta.57 - typescript: ^5.0.0 - vue-tsc: ~3.2.0 - peerDependenciesMeta: - '@ts-macro/tsc': - optional: true - '@typescript/native-preview': - optional: true - typescript: - optional: true - vue-tsc: - optional: true - - rolldown@1.0.0-beta.57: - resolution: {integrity: sha512-lMMxcNN71GMsSko8RyeTaFoATHkCh4IWU7pYF73ziMYjhHZWfVesC6GQ+iaJCvZmVjvgSks9Ks1aaqEkBd8udg==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - - rolldown@1.0.0-rc.17: - resolution: {integrity: sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - - rolldown@1.0.3: - resolution: {integrity: sha512-i00lAJ2ks1BYr7rjNjKC7BcqAS7nVfiT3QX1SI5aY+AFHblCmaUf9OE9dbdzDvW6dJxbi2ZCZiy9v3CcwOiX3g==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - - semver@7.8.2: - resolution: {integrity: sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==} - engines: {node: '>=10'} - hasBin: true - - siginfo@2.0.0: - resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} - - source-map-js@1.2.1: - resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} - engines: {node: '>=0.10.0'} - - stackback@0.0.2: - resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - - std-env@4.1.0: - resolution: {integrity: sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==} - - tinybench@2.9.0: - resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} - - tinyexec@1.2.4: - resolution: {integrity: sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==} - engines: {node: '>=18'} - - tinyglobby@0.2.17: - resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} - engines: {node: '>=12.0.0'} - - tinyrainbow@3.1.0: - resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} - engines: {node: '>=14.0.0'} - - tree-kill@1.2.2: - resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true - - tsdown@0.18.4: - resolution: {integrity: sha512-J/tRS6hsZTkvqmt4+xdELUCkQYDuUCXgBv0fw3ImV09WPGbEKfsPD65E+WUjSu3E7Z6tji9XZ1iWs8rbGqB/ZA==} - engines: {node: '>=20.19.0'} - hasBin: true - peerDependencies: - '@arethetypeswrong/core': ^0.18.1 - '@vitejs/devtools': '*' - publint: ^0.3.0 - typescript: ^5.0.0 - unplugin-lightningcss: ^0.4.0 - unplugin-unused: ^0.5.0 - peerDependenciesMeta: - '@arethetypeswrong/core': - optional: true - '@vitejs/devtools': - optional: true - publint: - optional: true - typescript: - optional: true - unplugin-lightningcss: - optional: true - unplugin-unused: - optional: true - - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} - hasBin: true - - unconfig-core@7.5.0: - resolution: {integrity: sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==} - - undici-types@6.21.0: - resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - - unrun@0.2.39: - resolution: {integrity: sha512-h9FxYVpztY/wwq+bauLOh6Y3CWu2IVeRLq5lxzneBiIU9Tn86OGp9xiQrGhnYspAmg5dzdY0Cc8+Y70kuTARCg==} - engines: {node: '>=20.19.0'} - hasBin: true - peerDependencies: - synckit: ^0.11.11 - peerDependenciesMeta: - synckit: - optional: true - - vite@8.0.16: - resolution: {integrity: sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - '@types/node': ^20.19.0 || >=22.12.0 - '@vitejs/devtools': ^0.1.18 - esbuild: ^0.27.0 || ^0.28.0 - jiti: '>=1.21.0' - less: ^4.0.0 - sass: ^1.70.0 - sass-embedded: ^1.70.0 - stylus: '>=0.54.8' - sugarss: ^5.0.0 - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - '@types/node': - optional: true - '@vitejs/devtools': - optional: true - esbuild: - optional: true - jiti: - optional: true - less: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - - vitest@4.1.8: - resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==} - engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@opentelemetry/api': ^1.9.0 - '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.1.8 - '@vitest/browser-preview': 4.1.8 - '@vitest/browser-webdriverio': 4.1.8 - '@vitest/coverage-istanbul': 4.1.8 - '@vitest/coverage-v8': 4.1.8 - '@vitest/ui': 4.1.8 - happy-dom: '*' - jsdom: '*' - vite: ^6.0.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@opentelemetry/api': - optional: true - '@types/node': - optional: true - '@vitest/browser-playwright': - optional: true - '@vitest/browser-preview': - optional: true - '@vitest/browser-webdriverio': - optional: true - '@vitest/coverage-istanbul': - optional: true - '@vitest/coverage-v8': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - - why-is-node-running@2.3.0: - resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} - engines: {node: '>=8'} - hasBin: true - - zod@4.4.3: - resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} - -snapshots: - - '@babel/generator@7.29.7': - dependencies: - '@babel/parser': 7.29.7 - '@babel/types': 7.29.7 - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - jsesc: 3.1.0 - - '@babel/helper-string-parser@7.29.7': {} - - '@babel/helper-validator-identifier@7.29.7': {} - - '@babel/parser@7.29.7': - dependencies: - '@babel/types': 7.29.7 - - '@babel/types@7.29.7': - dependencies: - '@babel/helper-string-parser': 7.29.7 - '@babel/helper-validator-identifier': 7.29.7 - - '@emnapi/core@1.10.0': - dependencies: - '@emnapi/wasi-threads': 1.2.1 - tslib: 2.8.1 - optional: true - - '@emnapi/runtime@1.10.0': - dependencies: - tslib: 2.8.1 - optional: true - - '@emnapi/wasi-threads@1.2.1': - dependencies: - tslib: 2.8.1 - optional: true - - '@jridgewell/gen-mapping@0.3.13': - dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping': 0.3.31 - - '@jridgewell/resolve-uri@3.1.2': {} - - '@jridgewell/sourcemap-codec@1.5.5': {} - - '@jridgewell/trace-mapping@0.3.31': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 - - '@langfuse/core@5.4.1(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - - '@langfuse/otel@5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1))': - dependencies: - '@langfuse/core': 5.4.1(@opentelemetry/api@1.9.1) - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/exporter-trace-otlp-http': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/api@1.9.1) - - '@langfuse/tracing@5.4.1(@opentelemetry/api@1.9.1)': - dependencies: - '@langfuse/core': 5.4.1(@opentelemetry/api@1.9.1) - '@opentelemetry/api': 1.9.1 - - '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@tybys/wasm-util': 0.10.2 - optional: true - - '@opentelemetry/api-logs@0.205.0': - dependencies: - '@opentelemetry/api': 1.9.1 - - '@opentelemetry/api@1.9.1': {} - - '@opentelemetry/context-async-hooks@2.7.1(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - - '@opentelemetry/core@2.1.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/semantic-conventions': 1.41.1 - - '@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/semantic-conventions': 1.41.1 - - '@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/otlp-exporter-base': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/otlp-transformer': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.1.0(@opentelemetry/api@1.9.1) - - '@opentelemetry/otlp-exporter-base@0.205.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/otlp-transformer': 0.205.0(@opentelemetry/api@1.9.1) - - '@opentelemetry/otlp-transformer@0.205.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/api-logs': 0.205.0 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-logs': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-metrics': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.1.0(@opentelemetry/api@1.9.1) - protobufjs: 7.6.2 - - '@opentelemetry/resources@2.1.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/semantic-conventions': 1.41.1 - - '@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/semantic-conventions': 1.41.1 - - '@opentelemetry/sdk-logs@0.205.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/api-logs': 0.205.0 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - - '@opentelemetry/sdk-metrics@2.1.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - - '@opentelemetry/sdk-trace-base@2.1.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/semantic-conventions': 1.41.1 - - '@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/semantic-conventions': 1.41.1 - - '@opentelemetry/sdk-trace-node@2.7.1(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/context-async-hooks': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/api@1.9.1) - - '@opentelemetry/semantic-conventions@1.41.1': {} - - '@oxc-project/types@0.103.0': {} - - '@oxc-project/types@0.127.0': {} - - '@oxc-project/types@0.133.0': {} - - '@protobufjs/aspromise@1.1.2': {} - - '@protobufjs/base64@1.1.2': {} - - '@protobufjs/codegen@2.0.5': {} - - '@protobufjs/eventemitter@1.1.1': {} - - '@protobufjs/fetch@1.1.1': - dependencies: - '@protobufjs/aspromise': 1.1.2 - - '@protobufjs/float@1.0.2': {} - - '@protobufjs/inquire@1.1.2': {} - - '@protobufjs/path@1.1.2': {} - - '@protobufjs/pool@1.1.0': {} - - '@protobufjs/utf8@1.1.1': {} - - '@quansync/fs@1.0.0': - dependencies: - quansync: 1.0.0 - - '@rolldown/binding-android-arm64@1.0.0-beta.57': - optional: true - - '@rolldown/binding-android-arm64@1.0.0-rc.17': - optional: true - - '@rolldown/binding-android-arm64@1.0.3': - optional: true - - '@rolldown/binding-darwin-arm64@1.0.0-beta.57': - optional: true - - '@rolldown/binding-darwin-arm64@1.0.0-rc.17': - optional: true - - '@rolldown/binding-darwin-arm64@1.0.3': - optional: true - - '@rolldown/binding-darwin-x64@1.0.0-beta.57': - optional: true - - '@rolldown/binding-darwin-x64@1.0.0-rc.17': - optional: true - - '@rolldown/binding-darwin-x64@1.0.3': - optional: true - - '@rolldown/binding-freebsd-x64@1.0.0-beta.57': - optional: true - - '@rolldown/binding-freebsd-x64@1.0.0-rc.17': - optional: true - - '@rolldown/binding-freebsd-x64@1.0.3': - optional: true - - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': - optional: true - - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': - optional: true - - '@rolldown/binding-linux-arm-gnueabihf@1.0.3': - optional: true - - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': - optional: true - - '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': - optional: true - - '@rolldown/binding-linux-arm64-gnu@1.0.3': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.0.3': - optional: true - - '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': - optional: true - - '@rolldown/binding-linux-ppc64-gnu@1.0.3': - optional: true - - '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': - optional: true - - '@rolldown/binding-linux-s390x-gnu@1.0.3': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.0.3': - optional: true - - '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': - optional: true - - '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': - optional: true - - '@rolldown/binding-linux-x64-musl@1.0.3': - optional: true - - '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': - optional: true - - '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': - optional: true - - '@rolldown/binding-openharmony-arm64@1.0.3': - optional: true - - '@rolldown/binding-wasm32-wasi@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - optional: true - - '@rolldown/binding-wasm32-wasi@1.0.0-rc.17': - dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - optional: true - - '@rolldown/binding-wasm32-wasi@1.0.3': - dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.57': - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.17': - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.0.3': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.0.3': - optional: true - - '@rolldown/pluginutils@1.0.0-beta.57': {} - - '@rolldown/pluginutils@1.0.0-rc.17': {} - - '@rolldown/pluginutils@1.0.1': {} - - '@standard-schema/spec@1.1.0': {} - - '@tybys/wasm-util@0.10.2': - dependencies: - tslib: 2.8.1 - optional: true - - '@types/chai@5.2.3': - dependencies: - '@types/deep-eql': 4.0.2 - assertion-error: 2.0.1 - - '@types/deep-eql@4.0.2': {} - - '@types/estree@1.0.9': {} - - '@types/node@22.19.20': - dependencies: - undici-types: 6.21.0 - - '@vitest/expect@4.1.8': - dependencies: - '@standard-schema/spec': 1.1.0 - '@types/chai': 5.2.3 - '@vitest/spy': 4.1.8 - '@vitest/utils': 4.1.8 - chai: 6.2.2 - tinyrainbow: 3.1.0 - - '@vitest/mocker@4.1.8(vite@8.0.16(@types/node@22.19.20))': - dependencies: - '@vitest/spy': 4.1.8 - estree-walker: 3.0.3 - magic-string: 0.30.21 - optionalDependencies: - vite: 8.0.16(@types/node@22.19.20) - - '@vitest/pretty-format@4.1.8': - dependencies: - tinyrainbow: 3.1.0 - - '@vitest/runner@4.1.8': - dependencies: - '@vitest/utils': 4.1.8 - pathe: 2.0.3 - - '@vitest/snapshot@4.1.8': - dependencies: - '@vitest/pretty-format': 4.1.8 - '@vitest/utils': 4.1.8 - magic-string: 0.30.21 - pathe: 2.0.3 - - '@vitest/spy@4.1.8': {} - - '@vitest/utils@4.1.8': - dependencies: - '@vitest/pretty-format': 4.1.8 - convert-source-map: 2.0.0 - tinyrainbow: 3.1.0 - - ansis@4.3.1: {} - - assertion-error@2.0.1: {} - - ast-kit@2.2.0: - dependencies: - '@babel/parser': 7.29.7 - pathe: 2.0.3 - - birpc@4.0.0: {} - - cac@6.7.14: {} - - chai@6.2.2: {} - - convert-source-map@2.0.0: {} - - defu@6.1.7: {} - - detect-libc@2.1.2: {} - - dts-resolver@2.1.3: {} - - empathic@2.0.1: {} - - es-module-lexer@2.1.0: {} - - estree-walker@3.0.3: - dependencies: - '@types/estree': 1.0.9 - - expect-type@1.3.0: {} - - fdir@6.5.0(picomatch@4.0.4): - optionalDependencies: - picomatch: 4.0.4 - - fsevents@2.3.3: - optional: true - - get-tsconfig@4.14.0: - dependencies: - resolve-pkg-maps: 1.0.0 - - hookable@6.1.1: {} - - import-without-cache@0.2.5: {} - - jsesc@3.1.0: {} - - lightningcss-android-arm64@1.32.0: - optional: true - - lightningcss-darwin-arm64@1.32.0: - optional: true - - lightningcss-darwin-x64@1.32.0: - optional: true - - lightningcss-freebsd-x64@1.32.0: - optional: true - - lightningcss-linux-arm-gnueabihf@1.32.0: - optional: true - - lightningcss-linux-arm64-gnu@1.32.0: - optional: true - - lightningcss-linux-arm64-musl@1.32.0: - optional: true - - lightningcss-linux-x64-gnu@1.32.0: - optional: true - - lightningcss-linux-x64-musl@1.32.0: - optional: true - - lightningcss-win32-arm64-msvc@1.32.0: - optional: true - - lightningcss-win32-x64-msvc@1.32.0: - optional: true - - lightningcss@1.32.0: - dependencies: - detect-libc: 2.1.2 - optionalDependencies: - lightningcss-android-arm64: 1.32.0 - lightningcss-darwin-arm64: 1.32.0 - lightningcss-darwin-x64: 1.32.0 - lightningcss-freebsd-x64: 1.32.0 - lightningcss-linux-arm-gnueabihf: 1.32.0 - lightningcss-linux-arm64-gnu: 1.32.0 - lightningcss-linux-arm64-musl: 1.32.0 - lightningcss-linux-x64-gnu: 1.32.0 - lightningcss-linux-x64-musl: 1.32.0 - lightningcss-win32-arm64-msvc: 1.32.0 - lightningcss-win32-x64-msvc: 1.32.0 - - long@5.3.2: {} - - magic-string@0.30.21: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 - - nanoid@3.3.12: {} - - obug@2.1.2: {} - - pathe@2.0.3: {} - - picocolors@1.1.1: {} - - picomatch@4.0.4: {} - - postcss@8.5.15: - dependencies: - nanoid: 3.3.12 - picocolors: 1.1.1 - source-map-js: 1.2.1 - - prettier@3.8.3: {} - - protobufjs@7.6.2: - dependencies: - '@protobufjs/aspromise': 1.1.2 - '@protobufjs/base64': 1.1.2 - '@protobufjs/codegen': 2.0.5 - '@protobufjs/eventemitter': 1.1.1 - '@protobufjs/fetch': 1.1.1 - '@protobufjs/float': 1.0.2 - '@protobufjs/inquire': 1.1.2 - '@protobufjs/path': 1.1.2 - '@protobufjs/pool': 1.1.0 - '@protobufjs/utf8': 1.1.1 - '@types/node': 22.19.20 - long: 5.3.2 - - quansync@1.0.0: {} - - resolve-pkg-maps@1.0.0: {} - - rolldown-plugin-dts@0.20.0(rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0))(typescript@5.9.3): - dependencies: - '@babel/generator': 7.29.7 - '@babel/parser': 7.29.7 - '@babel/types': 7.29.7 - ast-kit: 2.2.0 - birpc: 4.0.0 - dts-resolver: 2.1.3 - get-tsconfig: 4.14.0 - obug: 2.1.2 - rolldown: 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - optionalDependencies: - typescript: 5.9.3 - transitivePeerDependencies: - - oxc-resolver - - rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): - dependencies: - '@oxc-project/types': 0.103.0 - '@rolldown/pluginutils': 1.0.0-beta.57 - optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-beta.57 - '@rolldown/binding-darwin-arm64': 1.0.0-beta.57 - '@rolldown/binding-darwin-x64': 1.0.0-beta.57 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.57 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.57 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.57 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.57 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.57 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.57 - '@rolldown/binding-openharmony-arm64': 1.0.0-beta.57 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.57 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.57 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - rolldown@1.0.0-rc.17: - dependencies: - '@oxc-project/types': 0.127.0 - '@rolldown/pluginutils': 1.0.0-rc.17 - optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-rc.17 - '@rolldown/binding-darwin-arm64': 1.0.0-rc.17 - '@rolldown/binding-darwin-x64': 1.0.0-rc.17 - '@rolldown/binding-freebsd-x64': 1.0.0-rc.17 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.17 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.17 - '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.17 - '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.17 - '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.17 - '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.17 - '@rolldown/binding-linux-x64-musl': 1.0.0-rc.17 - '@rolldown/binding-openharmony-arm64': 1.0.0-rc.17 - '@rolldown/binding-wasm32-wasi': 1.0.0-rc.17 - '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.17 - '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.17 - - rolldown@1.0.3: - dependencies: - '@oxc-project/types': 0.133.0 - '@rolldown/pluginutils': 1.0.1 - optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.3 - '@rolldown/binding-darwin-arm64': 1.0.3 - '@rolldown/binding-darwin-x64': 1.0.3 - '@rolldown/binding-freebsd-x64': 1.0.3 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.3 - '@rolldown/binding-linux-arm64-gnu': 1.0.3 - '@rolldown/binding-linux-arm64-musl': 1.0.3 - '@rolldown/binding-linux-ppc64-gnu': 1.0.3 - '@rolldown/binding-linux-s390x-gnu': 1.0.3 - '@rolldown/binding-linux-x64-gnu': 1.0.3 - '@rolldown/binding-linux-x64-musl': 1.0.3 - '@rolldown/binding-openharmony-arm64': 1.0.3 - '@rolldown/binding-wasm32-wasi': 1.0.3 - '@rolldown/binding-win32-arm64-msvc': 1.0.3 - '@rolldown/binding-win32-x64-msvc': 1.0.3 - - semver@7.8.2: {} - - siginfo@2.0.0: {} - - source-map-js@1.2.1: {} - - stackback@0.0.2: {} - - std-env@4.1.0: {} - - tinybench@2.9.0: {} - - tinyexec@1.2.4: {} - - tinyglobby@0.2.17: - dependencies: - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 - - tinyrainbow@3.1.0: {} - - tree-kill@1.2.2: {} - - tsdown@0.18.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(typescript@5.9.3): - dependencies: - ansis: 4.3.1 - cac: 6.7.14 - defu: 6.1.7 - empathic: 2.0.1 - hookable: 6.1.1 - import-without-cache: 0.2.5 - obug: 2.1.2 - picomatch: 4.0.4 - rolldown: 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - rolldown-plugin-dts: 0.20.0(rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0))(typescript@5.9.3) - semver: 7.8.2 - tinyexec: 1.2.4 - tinyglobby: 0.2.17 - tree-kill: 1.2.2 - unconfig-core: 7.5.0 - unrun: 0.2.39 - optionalDependencies: - typescript: 5.9.3 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - '@ts-macro/tsc' - - '@typescript/native-preview' - - oxc-resolver - - synckit - - vue-tsc - - tslib@2.8.1: - optional: true - - typescript@5.9.3: {} - - unconfig-core@7.5.0: - dependencies: - '@quansync/fs': 1.0.0 - quansync: 1.0.0 - - undici-types@6.21.0: {} - - unrun@0.2.39: - dependencies: - rolldown: 1.0.0-rc.17 - - vite@8.0.16(@types/node@22.19.20): - dependencies: - lightningcss: 1.32.0 - picomatch: 4.0.4 - postcss: 8.5.15 - rolldown: 1.0.3 - tinyglobby: 0.2.17 - optionalDependencies: - '@types/node': 22.19.20 - fsevents: 2.3.3 - - vitest@4.1.8(@opentelemetry/api@1.9.1)(@types/node@22.19.20)(vite@8.0.16(@types/node@22.19.20)): - dependencies: - '@vitest/expect': 4.1.8 - '@vitest/mocker': 4.1.8(vite@8.0.16(@types/node@22.19.20)) - '@vitest/pretty-format': 4.1.8 - '@vitest/runner': 4.1.8 - '@vitest/snapshot': 4.1.8 - '@vitest/spy': 4.1.8 - '@vitest/utils': 4.1.8 - es-module-lexer: 2.1.0 - expect-type: 1.3.0 - magic-string: 0.30.21 - obug: 2.1.2 - pathe: 2.0.3 - picomatch: 4.0.4 - std-env: 4.1.0 - tinybench: 2.9.0 - tinyexec: 1.2.4 - tinyglobby: 0.2.17 - tinyrainbow: 3.1.0 - vite: 8.0.16(@types/node@22.19.20) - why-is-node-running: 2.3.0 - optionalDependencies: - '@opentelemetry/api': 1.9.1 - '@types/node': 22.19.20 - transitivePeerDependencies: - - msw - - why-is-node-running@2.3.0: - dependencies: - siginfo: 2.0.0 - stackback: 0.0.2 - - zod@4.4.3: {} diff --git a/src/instrumentation.ts b/src/instrumentation.ts index cf05b97..e2e3393 100644 --- a/src/instrumentation.ts +++ b/src/instrumentation.ts @@ -14,7 +14,9 @@ export type Instrumentation = { * We register a dedicated `NodeTracerProvider` (rather than the full auto- * instrumenting `NodeSDK`) so the bundle stays small and free of dynamic * instrumentation loading. Registering the provider also installs the - * AsyncLocalStorage context manager that `propagateAttributes` relies on. + * AsyncLocalStorage context manager that `propagateAttributes` relies on; + * Bun implements `node:async_hooks` AsyncLocalStorage, so context propagation + * works under the Bun runtime the hook ships on. * * We use `exportMode: "batched"` and flush once at the end: the whole * transcript is converted in-process, so batching every span into one (or a diff --git a/test/config.test.ts b/test/config.test.ts index cb7ed7a..73a2a28 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -2,7 +2,7 @@ import * as fs from "node:fs/promises"; import * as os from "node:os"; import * as path from "node:path"; -import { afterAll, beforeAll, describe, expect, it } from "vitest"; +import { afterAll, beforeAll, describe, expect, it } from "bun:test"; import { getConfig } from "../src/config.js"; diff --git a/test/parse.test.ts b/test/parse.test.ts index a6df6f0..ca4c580 100644 --- a/test/parse.test.ts +++ b/test/parse.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, it } from "vitest"; +import { describe, expect, it } from "bun:test"; import { buildTurns } from "../src/parse.js"; import type { TranscriptRow } from "../src/types.js"; diff --git a/test/subagents.test.ts b/test/subagents.test.ts index 166f2fe..2d600ed 100644 --- a/test/subagents.test.ts +++ b/test/subagents.test.ts @@ -2,7 +2,7 @@ import * as fs from "node:fs/promises"; import * as os from "node:os"; import * as path from "node:path"; -import { afterAll, beforeAll, describe, expect, it } from "vitest"; +import { afterAll, beforeAll, describe, expect, it } from "bun:test"; import { discoverSubagents } from "../src/subagents.js"; diff --git a/tsconfig.json b/tsconfig.json index 583c39f..e613ace 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "strict": true, "esModuleInterop": true, "skipLibCheck": true, - "types": ["node"], + "types": ["node", "bun"], "forceConsistentCasingInFileNames": true, "verbatimModuleSyntax": true, "noEmit": true diff --git a/tsdown.config.ts b/tsdown.config.ts deleted file mode 100644 index b492d3d..0000000 --- a/tsdown.config.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { defineConfig } from "tsdown"; - -// The plugin runs as a standalone Claude Code hook (`node dist/index.mjs`) -// without an install step, so the bundle must be fully self-contained. We -// bundle every runtime dependency (Langfuse SDK, OpenTelemetry, zod) and keep -// only Node.js built-ins external. -export default defineConfig({ - entry: ["src/index.ts"], - outDir: "dist", - format: ["esm"], - platform: "node", - target: "node20", - noExternal: [/^@langfuse\//, /^@opentelemetry\//, /^zod$/, /^zod\//], - dts: false, - clean: true, - minify: false, - // Emit a single self-contained file. OpenTelemetry's resource detection uses - // dynamic imports (platform-specific machine-id helpers); inlining them keeps - // the hook to one shippable `dist/index.mjs`. - outputOptions: { - inlineDynamicImports: true, - }, -}); From 3d068825ebc5ed96aba3cf6b20da89b8170fe4d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 10 Jun 2026 14:07:07 +0000 Subject: [PATCH 8/8] Port main's Python hook features to the TypeScript hook Brings the TS rewrite up to parity with the features merged to main after the rewrite branched: - LANGFUSE_USER_ID env/plugin option (CC_LANGFUSE_USER_ID still works) - Skip isMeta transcript rows (slash-command expansions, skill instructions) so they no longer create phantom turns - Tag traces skill: per invoked skill (CC_LANGFUSE_SKILL_TAGS, default on) - Optionally attach injected skill instructions to the Skill tool span (CC_LANGFUSE_CAPTURE_SKILL_CONTENT, default off) - Surface the turn's cwd and git branch as trace metadata - Run the hook on SessionEnd as well as Stop (done in the merge commit) Adds bun tests for all of the above (24 total) and documents the new options in the README. Verified end-to-end against a mock Langfuse OTLP endpoint: skill tag propagated to every span, injected instructions only on the Skill tool span, cwd/git_branch on the turn, and the isMeta row no longer splits the turn. https://claude.ai/code/session_015es18wH2qWjsuPtZrXQCjA --- README.md | 31 ++++++++++-------- dist/index.mjs | 79 ++++++++++++++++++++++++++++++++++++++++----- src/config.ts | 20 ++++++++++-- src/parse.ts | 30 ++++++++++++++++- src/trace.ts | 73 ++++++++++++++++++++++++++++++++++------- src/types.ts | 14 ++++++++ test/config.test.ts | 27 ++++++++++++++++ test/parse.test.ts | 68 ++++++++++++++++++++++++++++++++++++++ test/trace.test.ts | 40 +++++++++++++++++++++++ 9 files changed, 345 insertions(+), 37 deletions(-) create mode 100644 test/trace.test.ts diff --git a/README.md b/README.md index 49c56a8..f013456 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ After each turn, a `Stop` hook reads the new part of the session transcript and - **Tool calls** — `Bash`, `Read`, `Edit`, MCP tools, etc., each nested under the generation that issued it, with its input and output. - **Subagents** — when a turn spawns a subagent (the `Agent`/`Task` tool), the subagent's own transcript is expanded inline and nested under the spawning tool call: its generations, token usage, and tool calls all show up as children. - **Sessions** — all turns from one Claude Code session are grouped via the session id, so you can replay the whole session in Langfuse's [Sessions](https://langfuse.com/docs/observability/features/sessions) view. +- **Skills** — turns that invoke a skill are tagged `skill:` (disable with `CC_LANGFUSE_SKILL_TAGS=false`), and the injected skill instructions can optionally be captured on the Skill tool span (`CC_LANGFUSE_CAPTURE_SKILL_CONTENT=true`). Original timestamps are preserved on every span, so the Langfuse timeline reflects real wall-clock timing. @@ -34,7 +35,7 @@ claude plugin marketplace add langfuse/Claude-Observability-Plugin ### 2. Install the plugin ```bash -claude plugin install langfuse@langfuse-observability +claude plugin install langfuse-observability@langfuse-observability ``` Restart Claude Code after installing. @@ -67,18 +68,20 @@ Configuration is resolved as **defaults → `~/.claude/langfuse.json` → ` ### Environment variables -| Variable | Required | Default | Description | -| ---------------------------------------------------------- | -------- | ------------------------------- | --------------------------------------------------------- | -| `LANGFUSE_PUBLIC_KEY` / `CC_LANGFUSE_PUBLIC_KEY` | Yes | — | Langfuse public key (`pk-lf-...`) | -| `LANGFUSE_SECRET_KEY` / `CC_LANGFUSE_SECRET_KEY` | Yes | — | Langfuse secret key (`sk-lf-...`) | -| `LANGFUSE_BASE_URL` / `CC_LANGFUSE_BASE_URL` | No | `https://us.cloud.langfuse.com` | Langfuse host / data region | -| `LANGFUSE_TRACING_ENVIRONMENT` / `CC_LANGFUSE_ENVIRONMENT` | No | — | Environment label for the traces (e.g. `production`) | -| `CC_LANGFUSE_USER_ID` | No | Claude Code account email | Attach a user id to all traces | -| `CC_LANGFUSE_TAGS` | No | — | Extra tags for all traces (JSON array or comma-separated) | -| `CC_LANGFUSE_METADATA` | No | — | JSON object of metadata to attach to all traces | -| `CC_LANGFUSE_MAX_CHARS` | No | `20000` | Truncate inputs/outputs longer than this many characters | -| `CC_LANGFUSE_DEBUG` | No | `false` | Set to `"true"` for verbose logging to stderr | -| `CC_LANGFUSE_FAIL_ON_ERROR` | No | `false` | Set to `"true"` to make hook upload errors fail the hook | +| Variable | Required | Default | Description | +| ---------------------------------------------------------- | -------- | ------------------------------- | ---------------------------------------------------------- | +| `LANGFUSE_PUBLIC_KEY` / `CC_LANGFUSE_PUBLIC_KEY` | Yes | — | Langfuse public key (`pk-lf-...`) | +| `LANGFUSE_SECRET_KEY` / `CC_LANGFUSE_SECRET_KEY` | Yes | — | Langfuse secret key (`sk-lf-...`) | +| `LANGFUSE_BASE_URL` / `CC_LANGFUSE_BASE_URL` | No | `https://us.cloud.langfuse.com` | Langfuse host / data region | +| `LANGFUSE_TRACING_ENVIRONMENT` / `CC_LANGFUSE_ENVIRONMENT` | No | — | Environment label for the traces (e.g. `production`) | +| `LANGFUSE_USER_ID` / `CC_LANGFUSE_USER_ID` | No | Claude Code account email | Attach a user id to all traces | +| `CC_LANGFUSE_TAGS` | No | — | Extra tags for all traces (JSON array or comma-separated) | +| `CC_LANGFUSE_METADATA` | No | — | JSON object of metadata to attach to all traces | +| `CC_LANGFUSE_MAX_CHARS` | No | `20000` | Truncate inputs/outputs longer than this many characters | +| `CC_LANGFUSE_SKILL_TAGS` | No | `true` | Tag traces `skill:` for every skill invoked | +| `CC_LANGFUSE_CAPTURE_SKILL_CONTENT` | No | `false` | Capture injected skill instructions on the Skill tool span | +| `CC_LANGFUSE_DEBUG` | No | `false` | Set to `"true"` for verbose logging to stderr | +| `CC_LANGFUSE_FAIL_ON_ERROR` | No | `false` | Set to `"true"` to make hook upload errors fail the hook | ### JSON config file @@ -103,7 +106,7 @@ Instead of environment variables you can create `~/.claude/langfuse.json` (globa ## How it works -A `Stop` hook runs `bun "${CLAUDE_PLUGIN_ROOT}/dist/index.mjs"` after every turn. The hook reads the session transcript **incrementally**: a small sidecar file next to the transcript (`.jsonl.langfuse`) records the byte offset already processed and the number of turns emitted, so each turn is uploaded exactly once even though the hook fires repeatedly over the life of a session. +A `Stop` hook runs `bun "${CLAUDE_PLUGIN_ROOT}/dist/index.mjs"` after every turn (and again on `SessionEnd`, to catch anything the final `Stop` missed). The hook reads the session transcript **incrementally**: a small sidecar file next to the transcript (`.jsonl.langfuse`) records the byte offset already processed and the number of turns emitted, so each turn is uploaded exactly once even though the hook fires repeatedly over the life of a session. Spans are sent via the [Langfuse TypeScript SDK](https://langfuse.com/docs/sdk/typescript) on top of OpenTelemetry, batched, and flushed once at the end of the hook (capped by the hook's 30s timeout). The hook **fails open**: any error is swallowed (logged in debug mode) so a tracing problem never blocks your Claude Code session. diff --git a/dist/index.mjs b/dist/index.mjs index 3c9a260..b4664fd 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -41517,6 +41517,8 @@ var ConfigSchema = exports_external.object({ tags: exports_external.array(exports_external.string()).optional(), metadata: exports_external.record(exports_external.string(), exports_external.string()).optional(), max_chars: exports_external.number().int().positive(), + skill_tags: exports_external.boolean(), + capture_skill_content: exports_external.boolean(), debug: exports_external.boolean(), fail_on_error: exports_external.boolean() }); @@ -41524,6 +41526,8 @@ var PartialConfigSchema = ConfigSchema.partial(); var DEFAULTS = { base_url: "https://us.cloud.langfuse.com", max_chars: 20000, + skill_tags: true, + capture_skill_content: false, debug: false, fail_on_error: false }; @@ -41596,6 +41600,8 @@ async function readConfigFile(file2) { tags: raw.tags != null ? parseTags(raw.tags) : undefined, metadata: raw.metadata != null ? parseMetadata(raw.metadata) : undefined, max_chars: raw.max_chars != null ? parseInteger(raw.max_chars) : undefined, + skill_tags: raw.skill_tags != null ? parseBoolean(raw.skill_tags) : undefined, + capture_skill_content: raw.capture_skill_content != null ? parseBoolean(raw.capture_skill_content) : undefined, debug: raw.debug != null ? parseBoolean(raw.debug) : undefined, fail_on_error: raw.fail_on_error != null ? parseBoolean(raw.fail_on_error) : undefined })); @@ -41615,10 +41621,12 @@ function readEnvConfig(env) { secret_key: getVar("SECRET_KEY", env), base_url: getVar("BASE_URL", env), environment: opt("LANGFUSE_TRACING_ENVIRONMENT", env) ?? opt("CC_LANGFUSE_ENVIRONMENT", env), - user_id: opt("CC_LANGFUSE_USER_ID", env), + user_id: getVar("USER_ID", env), tags: parseTags(opt("CC_LANGFUSE_TAGS", env)), metadata: parseMetadata(opt("CC_LANGFUSE_METADATA", env)), max_chars: parseInteger(opt("CC_LANGFUSE_MAX_CHARS", env)), + skill_tags: parseBoolean(opt("CC_LANGFUSE_SKILL_TAGS", env)), + capture_skill_content: parseBoolean(opt("CC_LANGFUSE_CAPTURE_SKILL_CONTENT", env)), debug: parseBoolean(opt("CC_LANGFUSE_DEBUG", env)), fail_on_error: parseBoolean(opt("CC_LANGFUSE_FAIL_ON_ERROR", env)) })); @@ -51775,6 +51783,7 @@ function buildTurns(rows) { let assistantOrder = []; let assistantLatest = new Map; let toolResultsById = new Map; + let injectedByToolId = new Map; const flush = () => { if (currentUser === null || assistantLatest.size === 0) return; @@ -51813,9 +51822,26 @@ function buildTurns(rows) { candidateEnds.push(tr.timestamp); } const endTimestamp = candidateEnds.filter((t) => t !== undefined).reduce((max, t) => max === undefined || t > max ? t : max, undefined); - turns.push({ userText, userTimestamp, finalAssistantText, endTimestamp, steps }); + turns.push({ + userText, + userTimestamp, + finalAssistantText, + endTimestamp, + steps, + injectedByToolId: new Map(injectedByToolId), + cwd: typeof currentUser.cwd === "string" && currentUser.cwd ? currentUser.cwd : undefined, + gitBranch: typeof currentUser.gitBranch === "string" && currentUser.gitBranch ? currentUser.gitBranch : undefined + }); }; for (const row of rows) { + if (row.isMeta) { + if (row.sourceToolUseID) { + const text = extractText(getContent(row)); + if (text) + injectedByToolId.set(String(row.sourceToolUseID), text); + } + continue; + } if (isToolResultRow(row)) { const ts = parseTimestamp(row.timestamp); for (const tr of getToolResults(getContent(row))) { @@ -51832,6 +51858,7 @@ function buildTurns(rows) { assistantOrder = []; assistantLatest = new Map; toolResultsById = new Map; + injectedByToolId = new Map; continue; } if (role === "assistant") { @@ -51971,6 +51998,21 @@ async function discoverSubagents(transcriptPath) { function asDate(ts) { return ts !== undefined ? new Date(ts) : undefined; } +function collectSkillTags(turn) { + const tags = []; + for (const step of turn.steps) { + for (const tc of step.toolCalls) { + if (tc.name !== "Skill") + continue; + const input = tc.input; + const skill = input != null && typeof input === "object" ? input.skill : undefined; + if (typeof skill === "string" && skill && !tags.includes(`skill:${skill}`)) { + tags.push(`skill:${skill}`); + } + } + } + return tags; +} function buildGenerationOutput(step, clip) { const output = { role: "assistant" }; if (step.text) @@ -52022,9 +52064,12 @@ async function emitSteps(parent, steps, firstInput, startTs, ctx) { return prevTs; } async function emitToolCall(tc, parent, fallbackEnd, ctx) { + const result = tc.output != null ? ctx.clip(toText(tc.output)) : undefined; + const injected = ctx.captureSkillContent ? ctx.injected.get(tc.id) : undefined; + const output = injected ? { result, injected_instructions: ctx.clip(injected) } : result; const tool = startObservation(`Tool: ${tc.name}`, { input: ctx.clip(tc.input), - output: tc.output != null ? ctx.clip(toText(tc.output)) : undefined, + output, metadata: { "claude.tool_id": tc.id, "claude.tool_name": tc.name } }, { asType: "tool", @@ -52063,8 +52108,14 @@ async function emitSubagent(parentTool, subagent, tc, ctx) { startTime: asDate(turn.userTimestamp), parentSpanContext: parentTool.otelSpan.spanContext() }); - const lastTs = await emitSteps(agent, turn.steps, { role: "user", content: ctx.clip(turn.userText) }, turn.userTimestamp, ctx); - agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); + const outerInjected = ctx.injected; + ctx.injected = turn.injectedByToolId; + try { + const lastTs = await emitSteps(agent, turn.steps, { role: "user", content: ctx.clip(turn.userText) }, turn.userTimestamp, ctx); + agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); + } finally { + ctx.injected = outerInjected; + } } } async function emitTurn(turn, turnNum, transcriptPath, ctx) { @@ -52075,7 +52126,9 @@ async function emitTurn(turn, turnNum, transcriptPath, ctx) { "claude.source": "claude-code", "claude.turn_number": turnNum, "claude.transcript_path": transcriptPath, - "claude.assistant_message_count": turn.steps.length + "claude.assistant_message_count": turn.steps.length, + ...turn.cwd ? { "claude.cwd": turn.cwd } : {}, + ...turn.gitBranch ? { "claude.git_branch": turn.gitBranch } : {} } }, { asType: "agent", @@ -52098,12 +52151,22 @@ async function convertTranscript(transcriptPath, sessionId, config2) { let emitted = 0; for (const turn of turns) { const turnNum = state.turnCount + emitted + 1; - const ctx = { clip: makeClip(config2.max_chars), subagents, visited: new Set }; + const ctx = { + clip: makeClip(config2.max_chars), + subagents, + visited: new Set, + captureSkillContent: config2.capture_skill_content, + injected: turn.injectedByToolId + }; try { await propagateAttributes({ sessionId, traceName: "Claude Code Turn", - tags: ["claude-code", ...config2.tags ?? []], + tags: [ + "claude-code", + ...config2.skill_tags ? collectSkillTags(turn) : [], + ...config2.tags ?? [] + ], ...config2.user_id ? { userId: config2.user_id } : {}, ...config2.metadata ? { metadata: config2.metadata } : {} }, async () => { diff --git a/src/config.ts b/src/config.ts index 876a96a..45b1e43 100644 --- a/src/config.ts +++ b/src/config.ts @@ -25,7 +25,7 @@ export const ConfigSchema = z.object({ base_url: z.string(), // LANGFUSE_TRACING_ENVIRONMENT | CC_LANGFUSE_ENVIRONMENT environment: z.string().optional(), - // CC_LANGFUSE_USER_ID + // LANGFUSE_USER_ID | CC_LANGFUSE_USER_ID user_id: z.string().optional(), // CC_LANGFUSE_TAGS (JSON array or comma-separated list) tags: z.array(z.string()).optional(), @@ -33,6 +33,10 @@ export const ConfigSchema = z.object({ metadata: z.record(z.string(), z.string()).optional(), // CC_LANGFUSE_MAX_CHARS — truncate large inputs/outputs max_chars: z.number().int().positive(), + // CC_LANGFUSE_SKILL_TAGS — tag traces with skill: for invoked skills + skill_tags: z.boolean(), + // CC_LANGFUSE_CAPTURE_SKILL_CONTENT — attach injected skill instructions to tool spans + capture_skill_content: z.boolean(), // CC_LANGFUSE_DEBUG debug: z.boolean(), // CC_LANGFUSE_FAIL_ON_ERROR @@ -43,9 +47,14 @@ export type Config = z.infer; const PartialConfigSchema = ConfigSchema.partial(); -const DEFAULTS: Pick = { +const DEFAULTS: Pick< + Config, + "base_url" | "max_chars" | "skill_tags" | "capture_skill_content" | "debug" | "fail_on_error" +> = { base_url: "https://us.cloud.langfuse.com", max_chars: 20_000, + skill_tags: true, + capture_skill_content: false, debug: false, fail_on_error: false, }; @@ -128,6 +137,9 @@ async function readConfigFile(file: string): Promise | undefined tags: raw.tags != null ? parseTags(raw.tags) : undefined, metadata: raw.metadata != null ? parseMetadata(raw.metadata) : undefined, max_chars: raw.max_chars != null ? parseInteger(raw.max_chars) : undefined, + skill_tags: raw.skill_tags != null ? parseBoolean(raw.skill_tags) : undefined, + capture_skill_content: + raw.capture_skill_content != null ? parseBoolean(raw.capture_skill_content) : undefined, debug: raw.debug != null ? parseBoolean(raw.debug) : undefined, fail_on_error: raw.fail_on_error != null ? parseBoolean(raw.fail_on_error) : undefined, }), @@ -157,10 +169,12 @@ function readEnvConfig(env: Record): Partial secret_key: getVar("SECRET_KEY", env), base_url: getVar("BASE_URL", env), environment: opt("LANGFUSE_TRACING_ENVIRONMENT", env) ?? opt("CC_LANGFUSE_ENVIRONMENT", env), - user_id: opt("CC_LANGFUSE_USER_ID", env), + user_id: getVar("USER_ID", env), tags: parseTags(opt("CC_LANGFUSE_TAGS", env)), metadata: parseMetadata(opt("CC_LANGFUSE_METADATA", env)), max_chars: parseInteger(opt("CC_LANGFUSE_MAX_CHARS", env)), + skill_tags: parseBoolean(opt("CC_LANGFUSE_SKILL_TAGS", env)), + capture_skill_content: parseBoolean(opt("CC_LANGFUSE_CAPTURE_SKILL_CONTENT", env)), debug: parseBoolean(opt("CC_LANGFUSE_DEBUG", env)), fail_on_error: parseBoolean(opt("CC_LANGFUSE_FAIL_ON_ERROR", env)), }), diff --git a/src/parse.ts b/src/parse.ts index cc4e7e9..81b8c9f 100644 --- a/src/parse.ts +++ b/src/parse.ts @@ -99,6 +99,7 @@ export function buildTurns(rows: TranscriptRow[]): Turn[] { let assistantOrder: string[] = []; let assistantLatest = new Map(); let toolResultsById = new Map(); + let injectedByToolId = new Map(); const flush = () => { if (currentUser === null || assistantLatest.size === 0) return; @@ -147,10 +148,36 @@ export function buildTurns(rows: TranscriptRow[]): Turn[] { .filter((t): t is number => t !== undefined) .reduce((max, t) => (max === undefined || t > max ? t : max), undefined); - turns.push({ userText, userTimestamp, finalAssistantText, endTimestamp, steps }); + turns.push({ + userText, + userTimestamp, + finalAssistantText, + endTimestamp, + steps, + injectedByToolId: new Map(injectedByToolId), + cwd: typeof currentUser.cwd === "string" && currentUser.cwd ? currentUser.cwd : undefined, + gitBranch: + typeof currentUser.gitBranch === "string" && currentUser.gitBranch + ? currentUser.gitBranch + : undefined, + }); }; for (const row of rows) { + // Injected user rows (slash-command expansions, caveats, skill instructions) + // carry isMeta=true. They are not real prompts — treating them as turn starts + // creates phantom turns and prematurely flushes the real one. + if (row.isMeta) { + // Skill invocations link their injected instructions to the originating + // tool_use via sourceToolUseID; keep the text so emit can optionally + // attach it to that tool span. + if (row.sourceToolUseID) { + const text = extractText(getContent(row)); + if (text) injectedByToolId.set(String(row.sourceToolUseID), text); + } + continue; + } + if (isToolResultRow(row)) { const ts = parseTimestamp(row.timestamp); for (const tr of getToolResults(getContent(row))) { @@ -170,6 +197,7 @@ export function buildTurns(rows: TranscriptRow[]): Turn[] { assistantOrder = []; assistantLatest = new Map(); toolResultsById = new Map(); + injectedByToolId = new Map(); continue; } diff --git a/src/trace.ts b/src/trace.ts index 5eb5c0b..bdcb4c7 100644 --- a/src/trace.ts +++ b/src/trace.ts @@ -18,8 +18,31 @@ type EmitCtx = { subagents: SubagentIndex; /** Subagent transcript files already expanded — guards against cycles. */ visited: Set; + /** Attach injected skill instructions to the tool span they belong to. */ + captureSkillContent: boolean; + /** Injected context for the turn currently being emitted, by tool_use id. */ + injected: Map; }; +/** Return `skill:` tags for every Skill tool invocation in the turn. */ +export function collectSkillTags(turn: Turn): string[] { + const tags: string[] = []; + for (const step of turn.steps) { + for (const tc of step.toolCalls) { + if (tc.name !== "Skill") continue; + const input = tc.input; + const skill = + input != null && typeof input === "object" + ? (input as Record).skill + : undefined; + if (typeof skill === "string" && skill && !tags.includes(`skill:${skill}`)) { + tags.push(`skill:${skill}`); + } + } + } + return tags; +} + function buildGenerationOutput( step: AssistantStep, clip: Clip, @@ -113,11 +136,17 @@ async function emitToolCall( fallbackEnd: number | undefined, ctx: EmitCtx, ): Promise { + // Skill invocations inject their instructions as a separate transcript row; + // optionally surface them on the tool span they belong to. + const result = tc.output != null ? ctx.clip(toText(tc.output)) : undefined; + const injected = ctx.captureSkillContent ? ctx.injected.get(tc.id) : undefined; + const output = injected ? { result, injected_instructions: ctx.clip(injected) } : result; + const tool = startObservation( `Tool: ${tc.name}`, { input: ctx.clip(tc.input), - output: tc.output != null ? ctx.clip(toText(tc.output)) : undefined, + output, metadata: { "claude.tool_id": tc.id, "claude.tool_name": tc.name }, }, { @@ -178,15 +207,23 @@ async function emitSubagent( }, ); - const lastTs = await emitSteps( - agent, - turn.steps, - { role: "user", content: ctx.clip(turn.userText) }, - turn.userTimestamp, - ctx, - ); + // Tool spans inside the subagent resolve injected context against the + // subagent turn's own map; restore the outer turn's map afterwards. + const outerInjected = ctx.injected; + ctx.injected = turn.injectedByToolId; + try { + const lastTs = await emitSteps( + agent, + turn.steps, + { role: "user", content: ctx.clip(turn.userText) }, + turn.userTimestamp, + ctx, + ); - agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); + agent.end(asDate(turn.endTimestamp ?? lastTs ?? turn.userTimestamp)); + } finally { + ctx.injected = outerInjected; + } } } @@ -210,6 +247,10 @@ async function emitTurn( "claude.turn_number": turnNum, "claude.transcript_path": transcriptPath, "claude.assistant_message_count": turn.steps.length, + // Transcript rows carry the project dir and git branch — surface them + // so traces from different projects/worktrees are distinguishable. + ...(turn.cwd ? { "claude.cwd": turn.cwd } : {}), + ...(turn.gitBranch ? { "claude.git_branch": turn.gitBranch } : {}), }, }, { @@ -258,13 +299,23 @@ export async function convertTranscript( let emitted = 0; for (const turn of turns) { const turnNum = state.turnCount + emitted + 1; - const ctx: EmitCtx = { clip: makeClip(config.max_chars), subagents, visited: new Set() }; + const ctx: EmitCtx = { + clip: makeClip(config.max_chars), + subagents, + visited: new Set(), + captureSkillContent: config.capture_skill_content, + injected: turn.injectedByToolId, + }; try { await propagateAttributes( { sessionId, traceName: "Claude Code Turn", - tags: ["claude-code", ...(config.tags ?? [])], + tags: [ + "claude-code", + ...(config.skill_tags ? collectSkillTags(turn) : []), + ...(config.tags ?? []), + ], ...(config.user_id ? { userId: config.user_id } : {}), ...(config.metadata ? { metadata: config.metadata } : {}), }, diff --git a/src/types.ts b/src/types.ts index 44851a7..95b3937 100644 --- a/src/types.ts +++ b/src/types.ts @@ -42,6 +42,12 @@ export type TranscriptRow = { message?: TranscriptMessage; content?: string | ContentBlock[]; timestamp?: string; + /** True for injected rows (slash-command expansions, skill instructions). */ + isMeta?: boolean; + /** On isMeta rows: the tool_use id the injected content belongs to. */ + sourceToolUseID?: string; + cwd?: string; + gitBranch?: string; [key: string]: unknown; }; @@ -87,4 +93,12 @@ export type Turn = { finalAssistantText?: string; endTimestamp?: number; steps: AssistantStep[]; + /** + * Injected context (e.g. skill instructions) keyed by the tool_use id it + * belongs to, taken from isMeta rows carrying `sourceToolUseID`. + */ + injectedByToolId: Map; + /** Project dir and git branch the turn ran in, from the user row. */ + cwd?: string; + gitBranch?: string; }; diff --git a/test/config.test.ts b/test/config.test.ts index 73a2a28..c0876e5 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -89,3 +89,30 @@ describe("getConfig — Claude Code user email fallback", () => { expect(config.user_id).toBe("explicit-user"); }); }); + +describe("getConfig ported main options", () => { + it("reads LANGFUSE_USER_ID with CC_LANGFUSE_USER_ID as fallback", async () => { + const viaPlain = await getConfig(baseOpts({ LANGFUSE_USER_ID: "user-a" })); + expect(viaPlain.user_id).toBe("user-a"); + const viaCc = await getConfig(baseOpts({ CC_LANGFUSE_USER_ID: "user-b" })); + expect(viaCc.user_id).toBe("user-b"); + const both = await getConfig( + baseOpts({ LANGFUSE_USER_ID: "user-a", CC_LANGFUSE_USER_ID: "user-b" }), + ); + expect(both.user_id).toBe("user-a"); + }); + + it("defaults skill_tags on and capture_skill_content off", async () => { + const config = await getConfig(baseOpts({})); + expect(config.skill_tags).toBe(true); + expect(config.capture_skill_content).toBe(false); + }); + + it("reads the skill option environment variables", async () => { + const config = await getConfig( + baseOpts({ CC_LANGFUSE_SKILL_TAGS: "false", CC_LANGFUSE_CAPTURE_SKILL_CONTENT: "true" }), + ); + expect(config.skill_tags).toBe(false); + expect(config.capture_skill_content).toBe(true); + }); +}); diff --git a/test/parse.test.ts b/test/parse.test.ts index ca4c580..f0b0bd9 100644 --- a/test/parse.test.ts +++ b/test/parse.test.ts @@ -124,3 +124,71 @@ describe("buildTurns", () => { expect(buildTurns(orphan)).toHaveLength(0); }); }); + +describe("buildTurns isMeta handling", () => { + const skillRows: TranscriptRow[] = [ + { + type: "user", + timestamp: "2026-06-08T11:00:00.000Z", + message: { role: "user", content: "/my-skill do the thing" }, + cwd: "/home/dev/project", + gitBranch: "feature/x", + }, + { + type: "assistant", + timestamp: "2026-06-08T11:00:01.000Z", + message: { + id: "msg_s1", + role: "assistant", + content: [ + { type: "tool_use", id: "tu_skill", name: "Skill", input: { skill: "my-skill" } }, + ], + }, + }, + // Injected skill instructions: isMeta user row linked via sourceToolUseID. + { + type: "user", + isMeta: true, + sourceToolUseID: "tu_skill", + timestamp: "2026-06-08T11:00:02.000Z", + message: { role: "user", content: "You are running my-skill. Follow these steps..." }, + }, + { + type: "user", + timestamp: "2026-06-08T11:00:03.000Z", + message: { + role: "user", + content: [{ type: "tool_result", tool_use_id: "tu_skill", content: "Launched skill" }], + }, + }, + { + type: "assistant", + timestamp: "2026-06-08T11:00:04.000Z", + message: { + id: "msg_s2", + role: "assistant", + content: [{ type: "text", text: "Done." }], + }, + }, + ]; + + it("does not treat isMeta rows as turn boundaries", () => { + const turns = buildTurns(skillRows); + expect(turns).toHaveLength(1); + expect(turns[0].steps).toHaveLength(2); + expect(turns[0].finalAssistantText).toBe("Done."); + }); + + it("captures injected instructions keyed by sourceToolUseID", () => { + const [turn] = buildTurns(skillRows); + expect(turn.injectedByToolId.get("tu_skill")).toBe( + "You are running my-skill. Follow these steps...", + ); + }); + + it("captures cwd and git branch from the user row", () => { + const [turn] = buildTurns(skillRows); + expect(turn.cwd).toBe("/home/dev/project"); + expect(turn.gitBranch).toBe("feature/x"); + }); +}); diff --git a/test/trace.test.ts b/test/trace.test.ts new file mode 100644 index 0000000..64a2d7a --- /dev/null +++ b/test/trace.test.ts @@ -0,0 +1,40 @@ +import { describe, expect, it } from "bun:test"; + +import { buildTurns } from "../src/parse.js"; +import { collectSkillTags } from "../src/trace.js"; +import type { TranscriptRow } from "../src/types.js"; + +describe("collectSkillTags", () => { + it("returns a deduped skill: tag per invoked skill", () => { + const rows: TranscriptRow[] = [ + { type: "user", message: { role: "user", content: "run skills" } }, + { + type: "assistant", + message: { + id: "a1", + role: "assistant", + content: [ + { type: "tool_use", id: "t1", name: "Skill", input: { skill: "deep-research" } }, + { type: "tool_use", id: "t2", name: "Skill", input: { skill: "deep-research" } }, + { type: "tool_use", id: "t3", name: "Skill", input: { skill: "verify" } }, + { type: "tool_use", id: "t4", name: "Bash", input: { command: "ls" } }, + ], + }, + }, + ]; + const [turn] = buildTurns(rows); + expect(collectSkillTags(turn)).toEqual(["skill:deep-research", "skill:verify"]); + }); + + it("returns no tags when no Skill tool was used", () => { + const rows: TranscriptRow[] = [ + { type: "user", message: { role: "user", content: "hi" } }, + { + type: "assistant", + message: { id: "a1", role: "assistant", content: [{ type: "text", text: "hello" }] }, + }, + ]; + const [turn] = buildTurns(rows); + expect(collectSkillTags(turn)).toEqual([]); + }); +});