@posthog/agent 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/dist/_virtual/index.js +4 -0
  4. package/dist/_virtual/index.js.map +1 -0
  5. package/dist/node_modules/@ai-sdk/anthropic/dist/index.js +1154 -0
  6. package/dist/node_modules/@ai-sdk/anthropic/dist/index.js.map +1 -0
  7. package/dist/node_modules/@ai-sdk/provider/dist/index.js +296 -0
  8. package/dist/node_modules/@ai-sdk/provider/dist/index.js.map +1 -0
  9. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +576 -0
  10. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js.map +1 -0
  11. package/dist/node_modules/@ai-sdk/ui-utils/dist/index.js +741 -0
  12. package/dist/node_modules/@ai-sdk/ui-utils/dist/index.js.map +1 -0
  13. package/dist/node_modules/@opentelemetry/api/build/esm/api/context.js +112 -0
  14. package/dist/node_modules/@opentelemetry/api/build/esm/api/context.js.map +1 -0
  15. package/dist/node_modules/@opentelemetry/api/build/esm/api/diag.js +123 -0
  16. package/dist/node_modules/@opentelemetry/api/build/esm/api/diag.js.map +1 -0
  17. package/dist/node_modules/@opentelemetry/api/build/esm/api/metrics.js +62 -0
  18. package/dist/node_modules/@opentelemetry/api/build/esm/api/metrics.js.map +1 -0
  19. package/dist/node_modules/@opentelemetry/api/build/esm/api/propagation.js +91 -0
  20. package/dist/node_modules/@opentelemetry/api/build/esm/api/propagation.js.map +1 -0
  21. package/dist/node_modules/@opentelemetry/api/build/esm/api/trace.js +79 -0
  22. package/dist/node_modules/@opentelemetry/api/build/esm/api/trace.js.map +1 -0
  23. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js +59 -0
  24. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map +1 -0
  25. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js +99 -0
  26. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map +1 -0
  27. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/utils.js +31 -0
  28. package/dist/node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map +1 -0
  29. package/dist/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js +69 -0
  30. package/dist/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js.map +1 -0
  31. package/dist/node_modules/@opentelemetry/api/build/esm/context/context.js +54 -0
  32. package/dist/node_modules/@opentelemetry/api/build/esm/context/context.js.map +1 -0
  33. package/dist/node_modules/@opentelemetry/api/build/esm/context-api.js +22 -0
  34. package/dist/node_modules/@opentelemetry/api/build/esm/context-api.js.map +1 -0
  35. package/dist/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js +104 -0
  36. package/dist/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js.map +1 -0
  37. package/dist/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js +44 -0
  38. package/dist/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js.map +1 -0
  39. package/dist/node_modules/@opentelemetry/api/build/esm/diag/types.js +43 -0
  40. package/dist/node_modules/@opentelemetry/api/build/esm/diag/types.js.map +1 -0
  41. package/dist/node_modules/@opentelemetry/api/build/esm/diag-api.js +27 -0
  42. package/dist/node_modules/@opentelemetry/api/build/esm/diag-api.js.map +1 -0
  43. package/dist/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js +62 -0
  44. package/dist/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js.map +1 -0
  45. package/dist/node_modules/@opentelemetry/api/build/esm/internal/semver.js +121 -0
  46. package/dist/node_modules/@opentelemetry/api/build/esm/internal/semver.js.map +1 -0
  47. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js +167 -0
  48. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js.map +1 -0
  49. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js +33 -0
  50. package/dist/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js.map +1 -0
  51. package/dist/node_modules/@opentelemetry/api/build/esm/metrics-api.js +22 -0
  52. package/dist/node_modules/@opentelemetry/api/build/esm/metrics-api.js.map +1 -0
  53. package/dist/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js +21 -0
  54. package/dist/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js.map +1 -0
  55. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js +35 -0
  56. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js.map +1 -0
  57. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js +40 -0
  58. package/dist/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js.map +1 -0
  59. package/dist/node_modules/@opentelemetry/api/build/esm/propagation-api.js +22 -0
  60. package/dist/node_modules/@opentelemetry/api/build/esm/propagation-api.js.map +1 -0
  61. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js +70 -0
  62. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js.map +1 -0
  63. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js +78 -0
  64. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js.map +1 -0
  65. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js +34 -0
  66. package/dist/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js.map +1 -0
  67. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js +55 -0
  68. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js.map +1 -0
  69. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js +56 -0
  70. package/dist/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js.map +1 -0
  71. package/dist/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js +76 -0
  72. package/dist/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js.map +1 -0
  73. package/dist/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js +27 -0
  74. package/dist/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js.map +1 -0
  75. package/dist/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js +45 -0
  76. package/dist/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js.map +1 -0
  77. package/dist/node_modules/@opentelemetry/api/build/esm/trace/status.js +22 -0
  78. package/dist/node_modules/@opentelemetry/api/build/esm/trace/status.js.map +1 -0
  79. package/dist/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js +25 -0
  80. package/dist/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js.map +1 -0
  81. package/dist/node_modules/@opentelemetry/api/build/esm/trace-api.js +24 -0
  82. package/dist/node_modules/@opentelemetry/api/build/esm/trace-api.js.map +1 -0
  83. package/dist/node_modules/@opentelemetry/api/build/esm/version.js +20 -0
  84. package/dist/node_modules/@opentelemetry/api/build/esm/version.js.map +1 -0
  85. package/dist/node_modules/ai/dist/index.js +2870 -0
  86. package/dist/node_modules/ai/dist/index.js.map +1 -0
  87. package/dist/node_modules/nanoid/non-secure/index.js +13 -0
  88. package/dist/node_modules/nanoid/non-secure/index.js.map +1 -0
  89. package/dist/node_modules/secure-json-parse/index.js +133 -0
  90. package/dist/node_modules/secure-json-parse/index.js.map +1 -0
  91. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +37 -0
  92. package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
  93. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +26 -0
  94. package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
  95. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +17 -0
  96. package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
  97. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +11 -0
  98. package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
  99. package/dist/node_modules/zod-to-json-schema/dist/esm/index.js +8 -0
  100. package/dist/node_modules/zod-to-json-schema/dist/esm/index.js.map +1 -0
  101. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +66 -0
  102. package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
  103. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +21 -0
  104. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
  105. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +30 -0
  106. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
  107. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +53 -0
  108. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
  109. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +8 -0
  110. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
  111. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +8 -0
  112. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
  113. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +8 -0
  114. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
  115. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +50 -0
  116. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
  117. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +11 -0
  118. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
  119. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +11 -0
  120. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
  121. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +9 -0
  122. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
  123. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +56 -0
  124. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
  125. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +24 -0
  126. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
  127. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +30 -0
  128. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
  129. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +19 -0
  130. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
  131. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +15 -0
  132. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
  133. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +13 -0
  134. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
  135. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +37 -0
  136. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
  137. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +56 -0
  138. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
  139. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +76 -0
  140. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
  141. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +25 -0
  142. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
  143. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +24 -0
  144. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
  145. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +8 -0
  146. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
  147. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +8 -0
  148. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
  149. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +65 -0
  150. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
  151. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +24 -0
  152. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
  153. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +350 -0
  154. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
  155. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +36 -0
  156. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
  157. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +10 -0
  158. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
  159. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +84 -0
  160. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
  161. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +8 -0
  162. package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
  163. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +110 -0
  164. package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
  165. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +90 -0
  166. package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
  167. package/dist/src/agent.d.ts +3 -0
  168. package/dist/src/agent.d.ts.map +1 -1
  169. package/dist/src/agent.js +93 -291
  170. package/dist/src/agent.js.map +1 -1
  171. package/dist/src/agents/planning.d.ts +1 -1
  172. package/dist/src/agents/planning.d.ts.map +1 -1
  173. package/dist/src/agents/planning.js +1 -2
  174. package/dist/src/agents/planning.js.map +1 -1
  175. package/dist/src/agents/research.d.ts +1 -1
  176. package/dist/src/agents/research.d.ts.map +1 -1
  177. package/dist/src/agents/research.js +3 -6
  178. package/dist/src/agents/research.js.map +1 -1
  179. package/dist/src/prompt-builder.d.ts.map +1 -1
  180. package/dist/src/prompt-builder.js +0 -1
  181. package/dist/src/prompt-builder.js.map +1 -1
  182. package/dist/src/structured-extraction.d.ts +2 -2
  183. package/dist/src/structured-extraction.d.ts.map +1 -1
  184. package/dist/src/structured-extraction.js +51 -110
  185. package/dist/src/structured-extraction.js.map +1 -1
  186. package/dist/src/workflow/config.d.ts +3 -0
  187. package/dist/src/workflow/config.d.ts.map +1 -0
  188. package/dist/src/workflow/config.js +43 -0
  189. package/dist/src/workflow/config.js.map +1 -0
  190. package/dist/src/workflow/steps/build.d.ts +3 -0
  191. package/dist/src/workflow/steps/build.d.ts.map +1 -0
  192. package/dist/src/workflow/steps/build.js +64 -0
  193. package/dist/src/workflow/steps/build.js.map +1 -0
  194. package/dist/src/workflow/steps/plan.d.ts +3 -0
  195. package/dist/src/workflow/steps/plan.d.ts.map +1 -0
  196. package/dist/src/workflow/steps/plan.js +86 -0
  197. package/dist/src/workflow/steps/plan.js.map +1 -0
  198. package/dist/src/workflow/steps/research.d.ts +3 -0
  199. package/dist/src/workflow/steps/research.d.ts.map +1 -0
  200. package/dist/src/workflow/steps/research.js +124 -0
  201. package/dist/src/workflow/steps/research.js.map +1 -0
  202. package/dist/src/workflow/types.d.ts +48 -0
  203. package/dist/src/workflow/types.d.ts.map +1 -0
  204. package/dist/src/workflow/utils.d.ts +12 -0
  205. package/dist/src/workflow/utils.d.ts.map +1 -0
  206. package/dist/src/workflow/utils.js +38 -0
  207. package/dist/src/workflow/utils.js.map +1 -0
  208. package/package.json +5 -2
  209. package/src/agent.ts +112 -321
  210. package/src/agents/planning.ts +1 -2
  211. package/src/agents/research.ts +3 -6
  212. package/src/prompt-builder.ts +0 -2
  213. package/src/structured-extraction.ts +58 -115
  214. package/src/workflow/config.ts +42 -0
  215. package/src/workflow/steps/build.ts +87 -0
  216. package/src/workflow/steps/plan.ts +112 -0
  217. package/src/workflow/steps/research.ts +156 -0
  218. package/src/workflow/types.ts +53 -0
  219. package/src/workflow/utils.ts +50 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalThis.js","sources":["../../../../../../../../node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexport var _globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACU,IAAC,WAAW,GAAG,OAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * No-op implementations of {@link TextMapPropagator}.
18
+ */
19
+ var NoopTextMapPropagator = /** @class */ (function () {
20
+ function NoopTextMapPropagator() {
21
+ }
22
+ /** Noop inject function does nothing */
23
+ NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };
24
+ /** Noop extract function does nothing and returns the input context */
25
+ NoopTextMapPropagator.prototype.extract = function (context, _carrier) {
26
+ return context;
27
+ };
28
+ NoopTextMapPropagator.prototype.fields = function () {
29
+ return [];
30
+ };
31
+ return NoopTextMapPropagator;
32
+ }());
33
+
34
+ export { NoopTextMapPropagator };
35
+ //# sourceMappingURL=NoopTextMapPropagator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopTextMapPropagator.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nvar NoopTextMapPropagator = /** @class */ (function () {\n function NoopTextMapPropagator() {\n }\n /** Noop inject function does nothing */\n NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };\n /** Noop extract function does nothing and returns the input context */\n NoopTextMapPropagator.prototype.extract = function (context, _carrier) {\n return context;\n };\n NoopTextMapPropagator.prototype.fields = function () {\n return [];\n };\n return NoopTextMapPropagator;\n}());\nexport { NoopTextMapPropagator };\n//# sourceMappingURL=NoopTextMapPropagator.js.map"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG,IAAC,qBAAqB,kBAAkB,YAAY;AACvD,IAAI,SAAS,qBAAqB,GAAG;AACrC,IAAI;AACJ;AACA,IAAI,qBAAqB,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC;AAC9E;AACA,IAAI,qBAAqB,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,OAAO,EAAE,QAAQ,EAAE;AAC3E,QAAQ,OAAO,OAAO;AACtB,IAAI,CAAC;AACL,IAAI,qBAAqB,CAAC,SAAS,CAAC,MAAM,GAAG,YAAY;AACzD,QAAQ,OAAO,EAAE;AACjB,IAAI,CAAC;AACL,IAAI,OAAO,qBAAqB;AAChC,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ var defaultTextMapGetter = {
17
+ get: function (carrier, key) {
18
+ if (carrier == null) {
19
+ return undefined;
20
+ }
21
+ return carrier[key];
22
+ },
23
+ keys: function (carrier) {
24
+ if (carrier == null) {
25
+ return [];
26
+ }
27
+ return Object.keys(carrier);
28
+ },
29
+ };
30
+ var defaultTextMapSetter = {
31
+ set: function (carrier, key, value) {
32
+ if (carrier == null) {
33
+ return;
34
+ }
35
+ carrier[key] = value;
36
+ },
37
+ };
38
+
39
+ export { defaultTextMapGetter, defaultTextMapSetter };
40
+ //# sourceMappingURL=TextMapPropagator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextMapPropagator.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nexport var defaultTextMapGetter = {\n get: function (carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys: function (carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\nexport var defaultTextMapSetter = {\n set: function (carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACU,IAAC,oBAAoB,GAAG;AAClC,IAAI,GAAG,EAAE,UAAU,OAAO,EAAE,GAAG,EAAE;AACjC,QAAQ,IAAI,OAAO,IAAI,IAAI,EAAE;AAC7B,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC;AAC3B,IAAI,CAAC;AACL,IAAI,IAAI,EAAE,UAAU,OAAO,EAAE;AAC7B,QAAQ,IAAI,OAAO,IAAI,IAAI,EAAE;AAC7B,YAAY,OAAO,EAAE;AACrB,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AACnC,IAAI,CAAC;AACL;AACU,IAAC,oBAAoB,GAAG;AAClC,IAAI,GAAG,EAAE,UAAU,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE;AACxC,QAAQ,IAAI,OAAO,IAAI,IAAI,EAAE;AAC7B,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK;AAC5B,IAAI,CAAC;AACL;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,22 @@
1
+ import { PropagationAPI } from './api/propagation.js';
2
+
3
+ /*
4
+ * Copyright The OpenTelemetry Authors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ // Split module-level variable definition into separate files to allow
19
+ // tree-shaking on each api instance.
20
+ /** Entrypoint for propagation API */
21
+ PropagationAPI.getInstance();
22
+ //# sourceMappingURL=propagation-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propagation-api.js","sources":["../../../../../../node_modules/@opentelemetry/api/build/esm/propagation-api.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/** Entrypoint for propagation API */\nexport var propagation = PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACyB,cAAc,CAAC,WAAW","x_google_ignoreList":[0]}
@@ -0,0 +1,70 @@
1
+ import { INVALID_SPAN_CONTEXT } from './invalid-span-constants.js';
2
+
3
+ /*
4
+ * Copyright The OpenTelemetry Authors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ /**
19
+ * The NonRecordingSpan is the default {@link Span} that is used when no Span
20
+ * implementation is available. All operations are no-op including context
21
+ * propagation.
22
+ */
23
+ var NonRecordingSpan = /** @class */ (function () {
24
+ function NonRecordingSpan(_spanContext) {
25
+ if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; }
26
+ this._spanContext = _spanContext;
27
+ }
28
+ // Returns a SpanContext.
29
+ NonRecordingSpan.prototype.spanContext = function () {
30
+ return this._spanContext;
31
+ };
32
+ // By default does nothing
33
+ NonRecordingSpan.prototype.setAttribute = function (_key, _value) {
34
+ return this;
35
+ };
36
+ // By default does nothing
37
+ NonRecordingSpan.prototype.setAttributes = function (_attributes) {
38
+ return this;
39
+ };
40
+ // By default does nothing
41
+ NonRecordingSpan.prototype.addEvent = function (_name, _attributes) {
42
+ return this;
43
+ };
44
+ NonRecordingSpan.prototype.addLink = function (_link) {
45
+ return this;
46
+ };
47
+ NonRecordingSpan.prototype.addLinks = function (_links) {
48
+ return this;
49
+ };
50
+ // By default does nothing
51
+ NonRecordingSpan.prototype.setStatus = function (_status) {
52
+ return this;
53
+ };
54
+ // By default does nothing
55
+ NonRecordingSpan.prototype.updateName = function (_name) {
56
+ return this;
57
+ };
58
+ // By default does nothing
59
+ NonRecordingSpan.prototype.end = function (_endTime) { };
60
+ // isRecording always returns false for NonRecordingSpan.
61
+ NonRecordingSpan.prototype.isRecording = function () {
62
+ return false;
63
+ };
64
+ // By default does nothing
65
+ NonRecordingSpan.prototype.recordException = function (_exception, _time) { };
66
+ return NonRecordingSpan;
67
+ }());
68
+
69
+ export { NonRecordingSpan };
70
+ //# sourceMappingURL=NonRecordingSpan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NonRecordingSpan.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nvar NonRecordingSpan = /** @class */ (function () {\n function NonRecordingSpan(_spanContext) {\n if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; }\n this._spanContext = _spanContext;\n }\n // Returns a SpanContext.\n NonRecordingSpan.prototype.spanContext = function () {\n return this._spanContext;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttribute = function (_key, _value) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttributes = function (_attributes) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.addEvent = function (_name, _attributes) {\n return this;\n };\n NonRecordingSpan.prototype.addLink = function (_link) {\n return this;\n };\n NonRecordingSpan.prototype.addLinks = function (_links) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setStatus = function (_status) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.updateName = function (_name) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.end = function (_endTime) { };\n // isRecording always returns false for NonRecordingSpan.\n NonRecordingSpan.prototype.isRecording = function () {\n return false;\n };\n // By default does nothing\n NonRecordingSpan.prototype.recordException = function (_exception, _time) { };\n return NonRecordingSpan;\n}());\nexport { NonRecordingSpan };\n//# sourceMappingURL=NonRecordingSpan.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACG,IAAC,gBAAgB,kBAAkB,YAAY;AAClD,IAAI,SAAS,gBAAgB,CAAC,YAAY,EAAE;AAC5C,QAAQ,IAAI,YAAY,KAAK,MAAM,EAAE,EAAE,YAAY,GAAG,oBAAoB,CAAC,CAAC;AAC5E,QAAQ,IAAI,CAAC,YAAY,GAAG,YAAY;AACxC,IAAI;AACJ;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,WAAW,GAAG,YAAY;AACzD,QAAQ,OAAO,IAAI,CAAC,YAAY;AAChC,IAAI,CAAC;AACL;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,YAAY,GAAG,UAAU,IAAI,EAAE,MAAM,EAAE;AACtE,QAAQ,OAAO,IAAI;AACnB,IAAI,CAAC;AACL;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,aAAa,GAAG,UAAU,WAAW,EAAE;AACtE,QAAQ,OAAO,IAAI;AACnB,IAAI,CAAC;AACL;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAU,KAAK,EAAE,WAAW,EAAE;AACxE,QAAQ,OAAO,IAAI;AACnB,IAAI,CAAC;AACL,IAAI,gBAAgB,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,KAAK,EAAE;AAC1D,QAAQ,OAAO,IAAI;AACnB,IAAI,CAAC;AACL,IAAI,gBAAgB,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAU,MAAM,EAAE;AAC5D,QAAQ,OAAO,IAAI;AACnB,IAAI,CAAC;AACL;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,OAAO,EAAE;AAC9D,QAAQ,OAAO,IAAI;AACnB,IAAI,CAAC;AACL;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,UAAU,GAAG,UAAU,KAAK,EAAE;AAC7D,QAAQ,OAAO,IAAI;AACnB,IAAI,CAAC;AACL;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,GAAG,GAAG,UAAU,QAAQ,EAAE,EAAE,CAAC;AAC5D;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,WAAW,GAAG,YAAY;AACzD,QAAQ,OAAO,KAAK;AACpB,IAAI,CAAC;AACL;AACA,IAAI,gBAAgB,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC;AACjF,IAAI,OAAO,gBAAgB;AAC3B,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,78 @@
1
+ import { ContextAPI } from '../api/context.js';
2
+ import { getSpanContext, setSpan } from './context-utils.js';
3
+ import { NonRecordingSpan } from './NonRecordingSpan.js';
4
+ import { isSpanContextValid } from './spancontext-utils.js';
5
+
6
+ /*
7
+ * Copyright The OpenTelemetry Authors
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * https://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ var contextApi = ContextAPI.getInstance();
22
+ /**
23
+ * No-op implementations of {@link Tracer}.
24
+ */
25
+ var NoopTracer = /** @class */ (function () {
26
+ function NoopTracer() {
27
+ }
28
+ // startSpan starts a noop span.
29
+ NoopTracer.prototype.startSpan = function (name, options, context) {
30
+ if (context === void 0) { context = contextApi.active(); }
31
+ var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
32
+ if (root) {
33
+ return new NonRecordingSpan();
34
+ }
35
+ var parentFromContext = context && getSpanContext(context);
36
+ if (isSpanContext(parentFromContext) &&
37
+ isSpanContextValid(parentFromContext)) {
38
+ return new NonRecordingSpan(parentFromContext);
39
+ }
40
+ else {
41
+ return new NonRecordingSpan();
42
+ }
43
+ };
44
+ NoopTracer.prototype.startActiveSpan = function (name, arg2, arg3, arg4) {
45
+ var opts;
46
+ var ctx;
47
+ var fn;
48
+ if (arguments.length < 2) {
49
+ return;
50
+ }
51
+ else if (arguments.length === 2) {
52
+ fn = arg2;
53
+ }
54
+ else if (arguments.length === 3) {
55
+ opts = arg2;
56
+ fn = arg3;
57
+ }
58
+ else {
59
+ opts = arg2;
60
+ ctx = arg3;
61
+ fn = arg4;
62
+ }
63
+ var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
64
+ var span = this.startSpan(name, opts, parentContext);
65
+ var contextWithSpanSet = setSpan(parentContext, span);
66
+ return contextApi.with(contextWithSpanSet, fn, undefined, span);
67
+ };
68
+ return NoopTracer;
69
+ }());
70
+ function isSpanContext(spanContext) {
71
+ return (typeof spanContext === 'object' &&
72
+ typeof spanContext['spanId'] === 'string' &&
73
+ typeof spanContext['traceId'] === 'string' &&
74
+ typeof spanContext['traceFlags'] === 'number');
75
+ }
76
+
77
+ export { NoopTracer };
78
+ //# sourceMappingURL=NoopTracer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopTracer.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nimport { ContextAPI } from '../api/context';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { isSpanContextValid } from './spancontext-utils';\nvar contextApi = ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nvar NoopTracer = /** @class */ (function () {\n function NoopTracer() {\n }\n // startSpan starts a noop span.\n NoopTracer.prototype.startSpan = function (name, options, context) {\n if (context === void 0) { context = contextApi.active(); }\n var root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan();\n }\n var parentFromContext = context && getSpanContext(context);\n if (isSpanContext(parentFromContext) &&\n isSpanContextValid(parentFromContext)) {\n return new NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan();\n }\n };\n NoopTracer.prototype.startActiveSpan = function (name, arg2, arg3, arg4) {\n var opts;\n var ctx;\n var fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();\n var span = this.startSpan(name, opts, parentContext);\n var contextWithSpanSet = setSpan(parentContext, span);\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n };\n return NoopTracer;\n}());\nexport { NoopTracer };\nfunction isSpanContext(spanContext) {\n return (typeof spanContext === 'object' &&\n typeof spanContext['spanId'] === 'string' &&\n typeof spanContext['traceId'] === 'string' &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,IAAI,UAAU,GAAG,UAAU,CAAC,WAAW,EAAE;AACzC;AACA;AACA;AACG,IAAC,UAAU,kBAAkB,YAAY;AAC5C,IAAI,SAAS,UAAU,GAAG;AAC1B,IAAI;AACJ;AACA,IAAI,UAAU,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;AACvE,QAAQ,IAAI,OAAO,KAAK,MAAM,EAAE,EAAE,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;AACjE,QAAQ,IAAI,IAAI,GAAG,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;AAC1F,QAAQ,IAAI,IAAI,EAAE;AAClB,YAAY,OAAO,IAAI,gBAAgB,EAAE;AACzC,QAAQ;AACR,QAAQ,IAAI,iBAAiB,GAAG,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC;AAClE,QAAQ,IAAI,aAAa,CAAC,iBAAiB,CAAC;AAC5C,YAAY,kBAAkB,CAAC,iBAAiB,CAAC,EAAE;AACnD,YAAY,OAAO,IAAI,gBAAgB,CAAC,iBAAiB,CAAC;AAC1D,QAAQ;AACR,aAAa;AACb,YAAY,OAAO,IAAI,gBAAgB,EAAE;AACzC,QAAQ;AACR,IAAI,CAAC;AACL,IAAI,UAAU,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AAC7E,QAAQ,IAAI,IAAI;AAChB,QAAQ,IAAI,GAAG;AACf,QAAQ,IAAI,EAAE;AACd,QAAQ,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;AAClC,YAAY;AACZ,QAAQ;AACR,aAAa,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,YAAY,EAAE,GAAG,IAAI;AACrB,QAAQ;AACR,aAAa,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,YAAY,IAAI,GAAG,IAAI;AACvB,YAAY,EAAE,GAAG,IAAI;AACrB,QAAQ;AACR,aAAa;AACb,YAAY,IAAI,GAAG,IAAI;AACvB,YAAY,GAAG,GAAG,IAAI;AACtB,YAAY,EAAE,GAAG,IAAI;AACrB,QAAQ;AACR,QAAQ,IAAI,aAAa,GAAG,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE;AACtF,QAAQ,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC;AAC5D,QAAQ,IAAI,kBAAkB,GAAG,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC;AAC7D,QAAQ,OAAO,UAAU,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC;AACvE,IAAI,CAAC;AACL,IAAI,OAAO,UAAU;AACrB,CAAC,EAAE;AAEH,SAAS,aAAa,CAAC,WAAW,EAAE;AACpC,IAAI,QAAQ,OAAO,WAAW,KAAK,QAAQ;AAC3C,QAAQ,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,QAAQ;AACjD,QAAQ,OAAO,WAAW,CAAC,SAAS,CAAC,KAAK,QAAQ;AAClD,QAAQ,OAAO,WAAW,CAAC,YAAY,CAAC,KAAK,QAAQ;AACrD;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,34 @@
1
+ import { NoopTracer } from './NoopTracer.js';
2
+
3
+ /*
4
+ * Copyright The OpenTelemetry Authors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ /**
19
+ * An implementation of the {@link TracerProvider} which returns an impotent
20
+ * Tracer for all calls to `getTracer`.
21
+ *
22
+ * All operations are no-op.
23
+ */
24
+ var NoopTracerProvider = /** @class */ (function () {
25
+ function NoopTracerProvider() {
26
+ }
27
+ NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) {
28
+ return new NoopTracer();
29
+ };
30
+ return NoopTracerProvider;
31
+ }());
32
+
33
+ export { NoopTracerProvider };
34
+ //# sourceMappingURL=NoopTracerProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopTracerProvider.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nimport { NoopTracer } from './NoopTracer';\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nvar NoopTracerProvider = /** @class */ (function () {\n function NoopTracerProvider() {\n }\n NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) {\n return new NoopTracer();\n };\n return NoopTracerProvider;\n}());\nexport { NoopTracerProvider };\n//# sourceMappingURL=NoopTracerProvider.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACG,IAAC,kBAAkB,kBAAkB,YAAY;AACpD,IAAI,SAAS,kBAAkB,GAAG;AAClC,IAAI;AACJ,IAAI,kBAAkB,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE;AAClF,QAAQ,OAAO,IAAI,UAAU,EAAE;AAC/B,IAAI,CAAC;AACL,IAAI,OAAO,kBAAkB;AAC7B,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,55 @@
1
+ import { NoopTracer } from './NoopTracer.js';
2
+
3
+ /*
4
+ * Copyright The OpenTelemetry Authors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ var NOOP_TRACER = new NoopTracer();
19
+ /**
20
+ * Proxy tracer provided by the proxy tracer provider
21
+ */
22
+ var ProxyTracer = /** @class */ (function () {
23
+ function ProxyTracer(_provider, name, version, options) {
24
+ this._provider = _provider;
25
+ this.name = name;
26
+ this.version = version;
27
+ this.options = options;
28
+ }
29
+ ProxyTracer.prototype.startSpan = function (name, options, context) {
30
+ return this._getTracer().startSpan(name, options, context);
31
+ };
32
+ ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {
33
+ var tracer = this._getTracer();
34
+ return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
35
+ };
36
+ /**
37
+ * Try to get a tracer from the proxy tracer provider.
38
+ * If the proxy tracer provider has no delegate, return a noop tracer.
39
+ */
40
+ ProxyTracer.prototype._getTracer = function () {
41
+ if (this._delegate) {
42
+ return this._delegate;
43
+ }
44
+ var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
45
+ if (!tracer) {
46
+ return NOOP_TRACER;
47
+ }
48
+ this._delegate = tracer;
49
+ return this._delegate;
50
+ };
51
+ return ProxyTracer;
52
+ }());
53
+
54
+ export { ProxyTracer };
55
+ //# sourceMappingURL=ProxyTracer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProxyTracer.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nimport { NoopTracer } from './NoopTracer';\nvar NOOP_TRACER = new NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n */\nvar ProxyTracer = /** @class */ (function () {\n function ProxyTracer(_provider, name, version, options) {\n this._provider = _provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n ProxyTracer.prototype.startSpan = function (name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n };\n ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {\n var tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n };\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n ProxyTracer.prototype._getTracer = function () {\n if (this._delegate) {\n return this._delegate;\n }\n var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n };\n return ProxyTracer;\n}());\nexport { ProxyTracer };\n//# sourceMappingURL=ProxyTracer.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAI,WAAW,GAAG,IAAI,UAAU,EAAE;AAClC;AACA;AACA;AACG,IAAC,WAAW,kBAAkB,YAAY;AAC7C,IAAI,SAAS,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;AAC5D,QAAQ,IAAI,CAAC,SAAS,GAAG,SAAS;AAClC,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI;AACxB,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO;AAC9B,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO;AAC9B,IAAI;AACJ,IAAI,WAAW,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;AACxE,QAAQ,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;AAClE,IAAI,CAAC;AACL,IAAI,WAAW,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE;AACtF,QAAQ,IAAI,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE;AACtC,QAAQ,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,CAAC;AACvE,IAAI,CAAC;AACL;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,SAAS,CAAC,UAAU,GAAG,YAAY;AACnD,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE;AAC5B,YAAY,OAAO,IAAI,CAAC,SAAS;AACjC,QAAQ;AACR,QAAQ,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;AAC5F,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,YAAY,OAAO,WAAW;AAC9B,QAAQ;AACR,QAAQ,IAAI,CAAC,SAAS,GAAG,MAAM;AAC/B,QAAQ,OAAO,IAAI,CAAC,SAAS;AAC7B,IAAI,CAAC;AACL,IAAI,OAAO,WAAW;AACtB,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,56 @@
1
+ import { ProxyTracer } from './ProxyTracer.js';
2
+ import { NoopTracerProvider } from './NoopTracerProvider.js';
3
+
4
+ /*
5
+ * Copyright The OpenTelemetry Authors
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
20
+ /**
21
+ * Tracer provider which provides {@link ProxyTracer}s.
22
+ *
23
+ * Before a delegate is set, tracers provided are NoOp.
24
+ * When a delegate is set, traces are provided from the delegate.
25
+ * When a delegate is set after tracers have already been provided,
26
+ * all tracers already provided will use the provided delegate implementation.
27
+ */
28
+ var ProxyTracerProvider = /** @class */ (function () {
29
+ function ProxyTracerProvider() {
30
+ }
31
+ /**
32
+ * Get a {@link ProxyTracer}
33
+ */
34
+ ProxyTracerProvider.prototype.getTracer = function (name, version, options) {
35
+ var _a;
36
+ return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options));
37
+ };
38
+ ProxyTracerProvider.prototype.getDelegate = function () {
39
+ var _a;
40
+ return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
41
+ };
42
+ /**
43
+ * Set the delegate tracer provider
44
+ */
45
+ ProxyTracerProvider.prototype.setDelegate = function (delegate) {
46
+ this._delegate = delegate;
47
+ };
48
+ ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) {
49
+ var _a;
50
+ return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
51
+ };
52
+ return ProxyTracerProvider;
53
+ }());
54
+
55
+ export { ProxyTracerProvider };
56
+ //# sourceMappingURL=ProxyTracerProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProxyTracerProvider.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nimport { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nvar NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n */\nvar ProxyTracerProvider = /** @class */ (function () {\n function ProxyTracerProvider() {\n }\n /**\n * Get a {@link ProxyTracer}\n */\n ProxyTracerProvider.prototype.getTracer = function (name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options));\n };\n ProxyTracerProvider.prototype.getDelegate = function () {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n };\n /**\n * Set the delegate tracer provider\n */\n ProxyTracerProvider.prototype.setDelegate = function (delegate) {\n this._delegate = delegate;\n };\n ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n };\n return ProxyTracerProvider;\n}());\nexport { ProxyTracerProvider };\n//# sourceMappingURL=ProxyTracerProvider.js.map"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAI,oBAAoB,GAAG,IAAI,kBAAkB,EAAE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACG,IAAC,mBAAmB,kBAAkB,YAAY;AACrD,IAAI,SAAS,mBAAmB,GAAG;AACnC,IAAI;AACJ;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;AAChF,QAAQ,IAAI,EAAE;AACd,QAAQ,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;AACpJ,IAAI,CAAC;AACL,IAAI,mBAAmB,CAAC,SAAS,CAAC,WAAW,GAAG,YAAY;AAC5D,QAAQ,IAAI,EAAE;AACd,QAAQ,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,oBAAoB;AAC1F,IAAI,CAAC;AACL;AACA;AACA;AACA,IAAI,mBAAmB,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,QAAQ,EAAE;AACpE,QAAQ,IAAI,CAAC,SAAS,GAAG,QAAQ;AACjC,IAAI,CAAC;AACL,IAAI,mBAAmB,CAAC,SAAS,CAAC,iBAAiB,GAAG,UAAU,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE;AACxF,QAAQ,IAAI,EAAE;AACd,QAAQ,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;AAC9G,IAAI,CAAC;AACL,IAAI,OAAO,mBAAmB;AAC9B,CAAC,EAAE;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,76 @@
1
+ import { createContextKey } from '../context/context.js';
2
+ import { NonRecordingSpan } from './NonRecordingSpan.js';
3
+ import { ContextAPI } from '../api/context.js';
4
+
5
+ /*
6
+ * Copyright The OpenTelemetry Authors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * https://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+ /**
21
+ * span key
22
+ */
23
+ var SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');
24
+ /**
25
+ * Return the span if one exists
26
+ *
27
+ * @param context context to get span from
28
+ */
29
+ function getSpan(context) {
30
+ return context.getValue(SPAN_KEY) || undefined;
31
+ }
32
+ /**
33
+ * Gets the span from the current context, if one exists.
34
+ */
35
+ function getActiveSpan() {
36
+ return getSpan(ContextAPI.getInstance().active());
37
+ }
38
+ /**
39
+ * Set the span on a context
40
+ *
41
+ * @param context context to use as parent
42
+ * @param span span to set active
43
+ */
44
+ function setSpan(context, span) {
45
+ return context.setValue(SPAN_KEY, span);
46
+ }
47
+ /**
48
+ * Remove current span stored in the context
49
+ *
50
+ * @param context context to delete span from
51
+ */
52
+ function deleteSpan(context) {
53
+ return context.deleteValue(SPAN_KEY);
54
+ }
55
+ /**
56
+ * Wrap span context in a NoopSpan and set as span in a new
57
+ * context
58
+ *
59
+ * @param context context to set active span on
60
+ * @param spanContext span context to be wrapped
61
+ */
62
+ function setSpanContext(context, spanContext) {
63
+ return setSpan(context, new NonRecordingSpan(spanContext));
64
+ }
65
+ /**
66
+ * Get the span context of the span if it exists.
67
+ *
68
+ * @param context context to get values from
69
+ */
70
+ function getSpanContext(context) {
71
+ var _a;
72
+ return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();
73
+ }
74
+
75
+ export { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext };
76
+ //# sourceMappingURL=context-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-utils.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/trace/context-utils.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nimport { createContextKey } from '../context/context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { ContextAPI } from '../api/context';\n/**\n * span key\n */\nvar SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\n/**\n * Gets the span from the current context, if one exists.\n */\nexport function getActiveSpan() {\n return getSpan(ContextAPI.getInstance().active());\n}\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nexport function setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nexport function setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan(spanContext));\n}\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nexport function getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\n//# sourceMappingURL=context-utils.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA,IAAI,QAAQ,GAAG,gBAAgB,CAAC,gCAAgC,CAAC;AACjE;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,OAAO,EAAE;AACjC,IAAI,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,SAAS;AAClD;AACA;AACA;AACA;AACO,SAAS,aAAa,GAAG;AAChC,IAAI,OAAO,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE;AACvC,IAAI,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,OAAO,EAAE;AACpC,IAAI,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE;AACrD,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAE;AACxC,IAAI,IAAI,EAAE;AACV,IAAI,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,WAAW,EAAE;AACxF;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,27 @@
1
+ import { TraceFlags } from './trace_flags.js';
2
+
3
+ /*
4
+ * Copyright The OpenTelemetry Authors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ var INVALID_SPANID = '0000000000000000';
19
+ var INVALID_TRACEID = '00000000000000000000000000000000';
20
+ var INVALID_SPAN_CONTEXT = {
21
+ traceId: INVALID_TRACEID,
22
+ spanId: INVALID_SPANID,
23
+ traceFlags: TraceFlags.NONE,
24
+ };
25
+
26
+ export { INVALID_SPANID, INVALID_SPAN_CONTEXT, INVALID_TRACEID };
27
+ //# sourceMappingURL=invalid-span-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invalid-span-constants.js","sources":["../../../../../../../node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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 * https://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 */\nimport { TraceFlags } from './trace_flags';\nexport var INVALID_SPANID = '0000000000000000';\nexport var INVALID_TRACEID = '00000000000000000000000000000000';\nexport var INVALID_SPAN_CONTEXT = {\n traceId: INVALID_TRACEID,\n spanId: INVALID_SPANID,\n traceFlags: TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEU,IAAC,cAAc,GAAG;AAClB,IAAC,eAAe,GAAG;AACnB,IAAC,oBAAoB,GAAG;AAClC,IAAI,OAAO,EAAE,eAAe;AAC5B,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,UAAU,EAAE,UAAU,CAAC,IAAI;AAC/B;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,45 @@
1
+ import { INVALID_TRACEID, INVALID_SPANID } from './invalid-span-constants.js';
2
+ import { NonRecordingSpan } from './NonRecordingSpan.js';
3
+
4
+ /*
5
+ * Copyright The OpenTelemetry Authors
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
20
+ var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
21
+ function isValidTraceId(traceId) {
22
+ return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
23
+ }
24
+ function isValidSpanId(spanId) {
25
+ return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
26
+ }
27
+ /**
28
+ * Returns true if this {@link SpanContext} is valid.
29
+ * @return true if this {@link SpanContext} is valid.
30
+ */
31
+ function isSpanContextValid(spanContext) {
32
+ return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));
33
+ }
34
+ /**
35
+ * Wrap the given {@link SpanContext} in a new non-recording {@link Span}
36
+ *
37
+ * @param spanContext span context to be wrapped
38
+ * @returns a new non-recording {@link Span} with the provided context
39
+ */
40
+ function wrapSpanContext(spanContext) {
41
+ return new NonRecordingSpan(spanContext);
42
+ }
43
+
44
+ export { isSpanContextValid, isValidSpanId, isValidTraceId, wrapSpanContext };
45
+ //# sourceMappingURL=spancontext-utils.js.map