{"version":3,"sources":["../../../src/instrumentation/helpers/trace-serializer.ts"],"names":["DEFAULT_IGNORE_KEYS","traceSerializer","ignored_keys","mergedIgnoreKeys","Set","body","JSON","stringify","key","value","has","startsWith"],"mappings":";;;;AAgBA,MAAMA,mBAAsB,GAAA;AAAC,EAAA,SAAA;AAAW,EAAA,QAAA;AAAU,EAAA,QAAA;AAAU,EAAA,WAAA;AAAa,EAAA;;AAElE,SAASC,eAAgB,CAAA,EAAEC,YAAe,GAAA,IAAiC,EAAA;AAChF,EAAMC,MAAAA,gBAAAA,uBAAuBC,GAAI,CAAA;AAAIJ,IAAAA,GAAAA,mBAAAA;AAAwBE,IAAAA,GAAAA;AAAa,GAAA,CAAA;AAE1E,EAAA,OAAO,CAACG,IAAAA,KACNC,IAAKC,CAAAA,SAAAA,CACHF,sBACC,CAAA,MAAA;AACC,IAAO,OAAA,CAACG,KAAKC,KAAAA,KAAAA;AAEX,MAAA,IAAIN,iBAAiBO,GAAIF,CAAAA,GAAAA,KAAQA,GAAIG,CAAAA,UAAAA,CAAW,GAAA,CAAM,EAAA;AACpD,QAAA;AACF;AAEA,MAAOF,OAAAA,KAAAA;AACT,KAAA;AACF,GAAA,GAAA,CAAA;AAEN;AAjBgBR,MAAAA,CAAAA,eAAAA,EAAAA,iBAAAA,CAAAA","file":"trace-serializer.cjs","sourcesContent":["/**\n * Copyright 2025 IBM Corp.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst DEFAULT_IGNORE_KEYS = [\"emitter\", \"logger\", \"tokens\", \"createdBy\", \"client\"];\n\nexport function traceSerializer({ ignored_keys = [] }: { ignored_keys?: string[] }) {\n  const mergedIgnoreKeys = new Set([...DEFAULT_IGNORE_KEYS, ...ignored_keys]);\n\n  return (body: object) =>\n    JSON.stringify(\n      body,\n      (() => {\n        return (key, value) => {\n          // Ignore specific keys, all owned entities and keys starting with underscore\n          if (mergedIgnoreKeys.has(key) || key.startsWith(\"_\")) {\n            return;\n          }\n\n          return value;\n        };\n      })(),\n    );\n}\n"]}