decocms 2.366.3 → 2.366.4

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 (441) hide show
  1. package/dist/client/assets/{AlertCircle-K18hQ6kh.js → AlertCircle-C6cau0Z8.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-BHG6VtYx.js → ArrowNarrowLeft-Cekkt9PP.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-BwnvDybP.js → ArrowUpRight-ZZMagTgz.js} +1 -1
  4. package/dist/client/assets/{Check-B9DLiiXK.js → Check-CF6cT-vn.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-EgJIl7Jq.js → CheckCircle-DYcWyNLY.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CYSM6Fo7.js → ChevronDown-CaogQsSj.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CnHMC9j_.js → ChevronRight-CFQY6flT.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-nYk1B1_g.js → ChevronUp-DEs085g3.js} +1 -1
  9. package/dist/client/assets/{Container-b9mjD0TM.js → Container-CSg33ShG.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-Dtz1r1oP.js → DotsVertical-BpSrvoX4.js} +1 -1
  11. package/dist/client/assets/{FilterLines-BKJvI7Is.js → FilterLines-DTLtSlSq.js} +1 -1
  12. package/dist/client/assets/{HardDrive-CiQGwbk6.js → HardDrive-g8HLn6-f.js} +1 -1
  13. package/dist/client/assets/{Key01-DwdEB7q3.js → Key01-CSEVr4fz.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-RV1yOjgR.js → LayoutLeft-BU19SAHw.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BqKrNdKE.js → LinkExternal01-1JZnVKte.js} +1 -1
  16. package/dist/client/assets/{Lock01-CmgC9dnY.js → Lock01-C7Tt4W8w.js} +1 -1
  17. package/dist/client/assets/{Monitor01-Cvm6D4L-.js → Monitor01-BcTHwM_i.js} +1 -1
  18. package/dist/client/assets/{Palette-BGsKalZp.js → Palette-CbS54vUp.js} +1 -1
  19. package/dist/client/assets/{Play-BnYrM15l.js → Play-DSs7HXSZ.js} +1 -1
  20. package/dist/client/assets/{Plus-dGHh9fRd.js → Plus-BVQmPLI7.js} +1 -1
  21. package/dist/client/assets/{RefreshCcw01-BSt0ADGE.js → RefreshCcw01-Dc1R9NRA.js} +1 -1
  22. package/dist/client/assets/{SearchMd-CfsQ0oub.js → SearchMd-CVPiaY_p.js} +1 -1
  23. package/dist/client/assets/{Settings02-yZXaZurd.js → Settings02-CwLaPF-0.js} +1 -1
  24. package/dist/client/assets/{Shield01-CmPuY_el.js → Shield01-PWuaAGg9.js} +1 -1
  25. package/dist/client/assets/{Star01-CTWmgTYQ.js → Star01-i2nx_POl.js} +1 -1
  26. package/dist/client/assets/{Stars02-B9_FZUis.js → Stars02-DsDzl3Oc.js} +1 -1
  27. package/dist/client/assets/{Sun-61PjPFad.js → Sun-C3ba0R0w.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-Onf8viR5.js → SwitchHorizontal01-Bjrshyqa.js} +1 -1
  29. package/dist/client/assets/{Tool01-CRNgXP6A.js → Tool01-DIB70GZ7.js} +1 -1
  30. package/dist/client/assets/{Trash01-CrFomFzC.js → Trash01-BsBJzBGk.js} +1 -1
  31. package/dist/client/assets/{Upload01-CiQUmK5L.js → Upload01-CYDJ3k8B.js} +1 -1
  32. package/dist/client/assets/{User01-EBgfoxm1.js → User01-CwUo40nW.js} +1 -1
  33. package/dist/client/assets/{Users01-BjvY9sLn.js → Users01-BvoHip1P.js} +1 -1
  34. package/dist/client/assets/{Users03-cFry-Rto.js → Users03-D-ej3qHB.js} +1 -1
  35. package/dist/client/assets/{X-BxdhEfJ_.js → X-BPXqNLsl.js} +1 -1
  36. package/dist/client/assets/{XCircle-D2dRUl3X.js → XCircle-zIDM8GwS.js} +1 -1
  37. package/dist/client/assets/{XClose-JIALRJcF.js → XClose-DD1U63b5.js} +1 -1
  38. package/dist/client/assets/{Zap-BBMFZYEP.js → Zap-MoK1HORt.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-KiMDOCHX.js → ZapSquare-l-_QWgxW.js} +1 -1
  40. package/dist/client/assets/{accordion-h2F4EqpO.js → accordion-DcoI0e89.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-CD9lEu0h.js → add-connection-dialog-691NMS8M.js} +1 -1
  42. package/dist/client/assets/{agent-icon-BD_rPqqb.js → agent-icon-B8MUzwj9.js} +1 -1
  43. package/dist/client/assets/{agent-icons-Z7s7DXbl.js → agent-icons-D8K6PGji.js} +1 -1
  44. package/dist/client/assets/{agents-list-BmhEmsa6.js → agents-list-B3sWxmhq.js} +1 -1
  45. package/dist/client/assets/{ai-providers-JX4LLR4S.js → ai-providers-BLQRmDEg.js} +1 -1
  46. package/dist/client/assets/{alert-dialog-DgwmE6f3.js → alert-dialog-BfFuIIAi.js} +1 -1
  47. package/dist/client/assets/{alert-u_bZaxHx.js → alert-imFouKvd.js} +1 -1
  48. package/dist/client/assets/{auth-catchall-Drjj4RCT.js → auth-catchall-EN4ZUYKI.js} +1 -1
  49. package/dist/client/assets/{auth-split-layout-rcdl_zMB.js → auth-split-layout-CLNl-Liu.js} +1 -1
  50. package/dist/client/assets/{automation-list-row-DqwcsD_7.js → automation-list-row-Du7yiRWx.js} +1 -1
  51. package/dist/client/assets/{automations-DEWBneTw.js → automations-BWT6Igqy.js} +1 -1
  52. package/dist/client/assets/{avatar-DDOxYtYL.js → avatar-B6KH1Gf_.js} +1 -1
  53. package/dist/client/assets/{badge-BXjK8wbY.js → badge-B9vWlyPt.js} +1 -1
  54. package/dist/client/assets/{brand-context-VeDeSTFo.js → brand-context-FCCIqEzi.js} +1 -1
  55. package/dist/client/assets/{card-DoyuDgsn.js → card-BLis0vqP.js} +1 -1
  56. package/dist/client/assets/{chat-context-RtHQhIE9.js → chat-context-BpnrANuQ.js} +1 -1
  57. package/dist/client/assets/{checkbox-D0Yc0mN-.js → checkbox-CYayg7ka.js} +1 -1
  58. package/dist/client/assets/{cli-auth-success-m0RL44gP.js → cli-auth-success-C0vEgSfg.js} +1 -1
  59. package/dist/client/assets/{collection-detail-DbRTvVee.js → collection-detail-nCLm3UeD.js} +1 -1
  60. package/dist/client/assets/{collection-display-button-RxtopRZN.js → collection-display-button-4swnjq5r.js} +1 -1
  61. package/dist/client/assets/{collection-search-9hGW5RZJ.js → collection-search-D05VQNPV.js} +1 -1
  62. package/dist/client/assets/{collection-search-CnmAVtDL.js → collection-search-D1Q9ymRZ.js} +1 -1
  63. package/dist/client/assets/{collection-table-wrapper-Dp2sd_0o.js → collection-table-wrapper-DRImmQWF.js} +1 -1
  64. package/dist/client/assets/{collection-tabs-CdyiDLUE.js → collection-tabs-BQMwIOyb.js} +1 -1
  65. package/dist/client/assets/{collections-Cr9-k5Dp.js → collections-Bxf7d2CZ.js} +1 -1
  66. package/dist/client/assets/{command-BOhfxy80.js → command-DSe0Tiwa.js} +1 -1
  67. package/dist/client/assets/{connect-desktop-dialog-HmPW1Qn6.js → connect-desktop-dialog-BrqoBGeb.js} +1 -1
  68. package/dist/client/assets/{connection-card-DWESZBbJ.js → connection-card-lXrZV4t4.js} +1 -1
  69. package/dist/client/assets/{connection-detail-CAWdGksF.js → connection-detail-IR4-CC_N.js} +1 -1
  70. package/dist/client/assets/{connection-form-helpers-CYGjPtOE.js → connection-form-helpers-7IxnhZqQ.js} +1 -1
  71. package/dist/client/assets/{connections-Ui7d_qa2.js → connections-DkBR3JcU.js} +1 -1
  72. package/dist/client/assets/{constants-wlikBzl5.js → constants-gk_IP4Zc.js} +2 -2
  73. package/dist/client/assets/{decopilot-sse-pool-CzmyvklN.js → decopilot-sse-pool-BhDKUi8c.js} +1 -1
  74. package/dist/client/assets/{dialog-BUuYbzZb.js → dialog-C_ienXNW.js} +1 -1
  75. package/dist/client/assets/{domain-settings-Djh1RrEA.js → domain-settings-61QbJzTR.js} +1 -1
  76. package/dist/client/assets/{drawer-DhizNMYf.js → drawer-DaOexVbe.js} +1 -1
  77. package/dist/client/assets/{dropdown-menu-B8jYuYV-.js → dropdown-menu-CMqoOV9T.js} +1 -1
  78. package/dist/client/assets/{dynamic-plugin-layout-DDdk-i9L.js → dynamic-plugin-layout-BoeGFzSl.js} +1 -1
  79. package/dist/client/assets/{empty-state-SFIgelF3.js → empty-state-BA09Bcpv.js} +1 -1
  80. package/dist/client/assets/{empty-state-BbU9ZFwC.js → empty-state-BZL2NvaE.js} +1 -1
  81. package/dist/client/assets/{extract-connection-data-6hSkq68z.js → extract-connection-data-CP_hqmSV.js} +1 -1
  82. package/dist/client/assets/{features-B_3jXZO2.js → features-CIUn836F.js} +1 -1
  83. package/dist/client/assets/{file-explorer-BgbG5Heb.js → file-explorer-CQeuI4xK.js} +1 -1
  84. package/dist/client/assets/{files-BPz9nAjJ.js → files-BsgFc-RY.js} +1 -1
  85. package/dist/client/assets/{form-CIlRGCfL.js → form-CjoMj5wU.js} +1 -1
  86. package/dist/client/assets/{general-8eQggZYD.js → general-CSnG-719.js} +1 -1
  87. package/dist/client/assets/{generate-id-C3QoXSqo.js → generate-id-CsyB9bN_.js} +1 -1
  88. package/dist/client/assets/{github-repo-picker-sKyqTDT8.js → github-repo-picker--49O8V7y.js} +1 -1
  89. package/dist/client/assets/{hooks-9SOOqVR8.js → hooks-BRJojuLC.js} +1 -1
  90. package/dist/client/assets/{hover-card-XelaxJWw.js → hover-card-DUjbTNUy.js} +1 -1
  91. package/dist/client/assets/{import-from-deco-dialog-0HqqXpyK.js → import-from-deco-dialog-D-yCDmpo.js} +1 -1
  92. package/dist/client/assets/{index-6k58PiwU.js → index-3Xr-YP7L.js} +1 -1
  93. package/dist/client/assets/{index-COUAU6R2.js → index-5fHHh2jn.js} +1 -1
  94. package/dist/client/assets/{index-TGA5bhjE.js → index-B_LUGvge.js} +4 -4
  95. package/dist/client/assets/{index-CXBH4ITS.js → index-BnTQ8eNv.js} +1 -1
  96. package/dist/client/assets/{index-hYvqFXmU.js → index-CGnB_5xY.js} +1 -1
  97. package/dist/client/assets/{index-X620QjzP.js → index-CUGH2xCP.js} +1 -1
  98. package/dist/client/assets/index-CW_5pAsg.js +3 -0
  99. package/dist/client/assets/{index-BhIYEmDJ.js → index-Cj8-zQu2.js} +1 -1
  100. package/dist/client/assets/{index-Nz1-QZbz.js → index-CkdV7Jdj.js} +1 -1
  101. package/dist/client/assets/{index-DdXs1209.js → index-CqQCgXZz.js} +1 -1
  102. package/dist/client/assets/{index-mwiMEID5.js → index-DAlg104T.js} +1 -1
  103. package/dist/client/assets/{index-Dr1K0q-i.js → index-DEVleS27.js} +1 -1
  104. package/dist/client/assets/{index-DUYU5_a3.js → index-DKwzo9_P.js} +1 -1
  105. package/dist/client/assets/{index-xTsEtfpg.js → index-DwuuljEt.js} +2 -2
  106. package/dist/client/assets/{index-vyEFrfC1.js → index-OAEI9OjK.js} +1 -1
  107. package/dist/client/assets/{index-BQZrdtha.js → index-v8STBELI.js} +1 -1
  108. package/dist/client/assets/{infiniteQueryObserver-CaiIqjtX.js → infiniteQueryObserver-9AonwSNz.js} +1 -1
  109. package/dist/client/assets/{input-DkeyHbuG.js → input-DZpKo824.js} +1 -1
  110. package/dist/client/assets/{integration-icon-DPwh9Mg5.js → integration-icon-DsvUPe8D.js} +1 -1
  111. package/dist/client/assets/{label-CjHvdO00.js → label-C7wkK6L0.js} +1 -1
  112. package/dist/client/assets/{layout-D6bcRuMt.js → layout-CtmyeSJk.js} +1 -1
  113. package/dist/client/assets/{login-5B_zJAJ0.js → login-BvyiZZN1.js} +1 -1
  114. package/dist/client/assets/{members-CYqiSVqs.js → members-HhwRS5QP.js} +1 -1
  115. package/dist/client/assets/{monaco-editor-nd_tO0rB.js → monaco-editor-CuQaBG94.js} +1 -1
  116. package/dist/client/assets/{monitoring-stats-row-DwHfPynF.js → monitoring-stats-row-CHJUB9Mc.js} +1 -1
  117. package/dist/client/assets/{oauth-callback-Yq18eV5L.js → oauth-callback-BFRuXIzs.js} +1 -1
  118. package/dist/client/assets/{oauth-callback-ai-provider-CteoZxfZ.js → oauth-callback-ai-provider-B5wKjn23.js} +1 -1
  119. package/dist/client/assets/{onboarding-DPOGFsER.js → onboarding-B-FHrp0v.js} +1 -1
  120. package/dist/client/assets/{org-layout-tE-QUmN6.js → org-layout-D2_wAXUn.js} +1 -1
  121. package/dist/client/assets/{org-plugin-layout-Ba2bMLZC.js → org-plugin-layout-nh6Xw_Ah.js} +1 -1
  122. package/dist/client/assets/{pair-CqRdJmjs.js → pair-DOnTaGrk.js} +37 -37
  123. package/dist/client/assets/{plugin-empty-state-C4HxFtK3.js → plugin-empty-state-CYe_e4dU.js} +1 -1
  124. package/dist/client/assets/{plugin-header-B15yYTP4.js → plugin-header-CZtVpBDn.js} +1 -1
  125. package/dist/client/assets/{plugin-layout-CRAuWVBJ.js → plugin-layout-C6ZublgJ.js} +1 -1
  126. package/dist/client/assets/{popover-97K8LVnU.js → popover-BtfZOknF.js} +1 -1
  127. package/dist/client/assets/{profile-BsxYHSPL.js → profile-C82P0tKQ.js} +1 -1
  128. package/dist/client/assets/{project-app-view-B0nyBoME.js → project-app-view-C-e07U9-.js} +1 -1
  129. package/dist/client/assets/registry-CMRj3FZM.js +2 -0
  130. package/dist/client/assets/{registry-layout-CZnLlfiV.js → registry-layout-D3l95YU2.js} +1 -1
  131. package/dist/client/assets/{required-auth-layout-C8mgBWNS.js → required-auth-layout-CJyQW0YT.js} +1 -1
  132. package/dist/client/assets/{reset-password-DkqgcluV.js → reset-password-Xo19Byf8.js} +1 -1
  133. package/dist/client/assets/{roles-CUEBOHc6.js → roles-B70h-wZN.js} +1 -1
  134. package/dist/client/assets/{search-input-KAnyn9Ce.js → search-input-DLTOTTz9.js} +1 -1
  135. package/dist/client/assets/{secrets-769db080.js → secrets-B7yPO5kI.js} +1 -1
  136. package/dist/client/assets/{sections-editor-Bt3uwcPI.js → sections-editor-C2P-j6nQ.js} +1 -1
  137. package/dist/client/assets/{select-SCbL4gku.js → select-CvUEwjOa.js} +1 -1
  138. package/dist/client/assets/{settings-layout-BshCgGUt.js → settings-layout-Cz8b5Lt3.js} +1 -1
  139. package/dist/client/assets/{settings-section-Cw0xQ_2H.js → settings-section-D_h13tJM.js} +1 -1
  140. package/dist/client/assets/{shell-controls-CGIP_uLo.js → shell-controls-DxesHoiQ.js} +1 -1
  141. package/dist/client/assets/{shell-layout-BLHIVG5Z.js → shell-layout-BetUYMXy.js} +1 -1
  142. package/dist/client/assets/{sidebar-BwKIfhlQ.js → sidebar-BMXh3EqA.js} +1 -1
  143. package/dist/client/assets/{skeleton-XDlr2hZV.js → skeleton-BuRaBDS1.js} +1 -1
  144. package/dist/client/assets/{sortable.esm-D5aIF3Zw.js → sortable.esm-5Pd6_HBn.js} +1 -1
  145. package/dist/client/assets/{spinner-B0XfX9TU.js → spinner-CtUyvJSV.js} +1 -1
  146. package/dist/client/assets/{sso-DH5RfLHg.js → sso-DtKDlHL0.js} +1 -1
  147. package/dist/client/assets/{store-CKhrQP_w.js → store-CbaXOCNL.js} +1 -1
  148. package/dist/client/assets/store-registry-DTb6OWPI.js +2 -0
  149. package/dist/client/assets/{switch-BQJohnI0.js → switch-d7tEagSK.js} +1 -1
  150. package/dist/client/assets/{table-DB3uKj-r.js → table-lcYjT119.js} +1 -1
  151. package/dist/client/assets/{tabs-jNjpN-gk.js → tabs-CSXDa2Ir.js} +1 -1
  152. package/dist/client/assets/{task-status-Dg5YM4Hc.js → task-status-DNmv8phZ.js} +1 -1
  153. package/dist/client/assets/{textarea-Dd1cGQh8.js → textarea-Ccx7YT75.js} +1 -1
  154. package/dist/client/assets/{toggle-group-kM4bYsLp.js → toggle-group-DSTBaZXh.js} +1 -1
  155. package/dist/client/assets/{toolbar-CvaxE6qF.js → toolbar-C83LdlA1.js} +1 -1
  156. package/dist/client/assets/{tools-list-BH7hZPhi.js → tools-list-rNOW66IG.js} +1 -1
  157. package/dist/client/assets/{tooltip-DBVO58Zp.js → tooltip-BN3IZOUM.js} +1 -1
  158. package/dist/client/assets/{types-D2TlIP4U.js → types-BnZvZp4Q.js} +1 -1
  159. package/dist/client/assets/{use-ai-providers-MXu298dg.js → use-ai-providers-d6kXM9vW.js} +1 -1
  160. package/dist/client/assets/{use-collections-DdcwH7lg.js → use-collections-DxzUt-h0.js} +1 -1
  161. package/dist/client/assets/{use-connection-Cm5lxSmT.js → use-connection-A90ocYZ3.js} +1 -1
  162. package/dist/client/assets/{use-copy-yDzCLUIu.js → use-copy-hH-GxgcQ.js} +1 -1
  163. package/dist/client/assets/{use-create-virtual-mcp-BGAVRvOL.js → use-create-virtual-mcp-DxmAhbh-.js} +1 -1
  164. package/dist/client/assets/{use-debounced-autosave-BQDH8UbJ.js → use-debounced-autosave-C5Pi-I_L.js} +1 -1
  165. package/dist/client/assets/{use-delete-connection-DJL8w2QN.js → use-delete-connection-GCkys6Oo.js} +1 -1
  166. package/dist/client/assets/{use-file-configs-CD9Yp4ac.js → use-file-configs-DqjN38PI.js} +1 -1
  167. package/dist/client/assets/{use-infinite-scroll-LY_NYoXx.js → use-infinite-scroll-CqbWH69Y.js} +1 -1
  168. package/dist/client/assets/{use-list-state-ihX8HW7M.js → use-list-state-BD70dFhh.js} +1 -1
  169. package/dist/client/assets/{use-mcp-prompts-BhuHCP_V.js → use-mcp-prompts-BhbjYccm.js} +1 -1
  170. package/dist/client/assets/{use-mcp-tools-CJa2fE9h.js → use-mcp-tools-B4qJIn_m.js} +1 -1
  171. package/dist/client/assets/{use-members-CXsnuh5x.js → use-members-DDXTUyfW.js} +1 -1
  172. package/dist/client/assets/{use-navigate-to-agent-X31tY0SN.js → use-navigate-to-agent-CmeIQKZz.js} +1 -1
  173. package/dist/client/assets/{use-org-auth-client-OoTGSTfv.js → use-org-auth-client-CBdNHYrJ.js} +1 -1
  174. package/dist/client/assets/{use-org-sso-UZ289aQt.js → use-org-sso-sVoU3o4y.js} +1 -1
  175. package/dist/client/assets/{use-organization-roles-B6qmwiF_.js → use-organization-roles-CiqnqqgF.js} +1 -1
  176. package/dist/client/assets/{use-organization-settings-Cg7cZnTH.js → use-organization-settings-Co3t-zpJ.js} +1 -1
  177. package/dist/client/assets/{use-registry-connections-zPaNsQlY.js → use-registry-connections-B8ZxDRct.js} +1 -1
  178. package/dist/client/assets/{use-secrets-DJHp-WGT.js → use-secrets-BBXTSfnh.js} +1 -1
  179. package/dist/client/assets/{use-status-sounds-4UFUcqZ3.js → use-status-sounds-Cwpee3KI.js} +1 -1
  180. package/dist/client/assets/{use-view-mode-CFr3nIeP.js → use-view-mode-JXpYJVE9.js} +1 -1
  181. package/dist/client/assets/{use-virtual-mcp-BQTYd8NA.js → use-virtual-mcp-DO1sI5xT.js} +1 -1
  182. package/dist/client/assets/useInfiniteQuery-CU-G2y2S.js +1 -0
  183. package/dist/client/assets/{useRouterState-C7U0A7oQ.js → useRouterState-CGeSfCq2.js} +1 -1
  184. package/dist/client/assets/useSuspenseInfiniteQuery-BDUa0AyA.js +1 -0
  185. package/dist/client/assets/{user-jMIXm7Xf.js → user-CANp-kXL.js} +1 -1
  186. package/dist/client/assets/{view-mode-toggle-Bbwkp2j8.js → view-mode-toggle-CWn9sP9X.js} +1 -1
  187. package/dist/client/assets/{workflow-CUWnTahx.js → workflow-Dsd6hzjI.js} +1 -1
  188. package/dist/client/assets/workflow-detail-Bb6d775m.js +1 -0
  189. package/dist/client/index.html +1 -1
  190. package/dist/server/cli.js +6 -2
  191. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js +36 -6
  192. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js.map +1 -1
  193. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js +15 -0
  194. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js.map +1 -1
  195. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js +36 -6
  196. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js.map +1 -1
  197. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js +15 -0
  198. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js.map +1 -1
  199. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +36 -6
  200. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js.map +1 -1
  201. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +15 -0
  202. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js.map +1 -1
  203. package/dist/server/node_modules/@opentelemetry/otlp-transformer/package.json +12 -14
  204. package/dist/server/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js +1 -1
  205. package/dist/server/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js.map +1 -1
  206. package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.d.ts +9 -0
  207. package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.js +38 -0
  208. package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.js.map +1 -0
  209. package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.d.ts +1 -1
  210. package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.js +1 -1
  211. package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.js.map +1 -1
  212. package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.d.ts +0 -1
  213. package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.js +0 -3
  214. package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.js.map +1 -1
  215. package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.d.ts +1 -1
  216. package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.js +1 -1
  217. package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.js.map +1 -1
  218. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/ResourceImpl.js +1 -1
  219. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/ResourceImpl.js.map +1 -1
  220. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.d.ts +9 -0
  221. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.js +38 -0
  222. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.js.map +1 -0
  223. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.d.ts +1 -1
  224. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.js +1 -1
  225. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.js.map +1 -1
  226. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.d.ts +0 -1
  227. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.js +0 -3
  228. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.js.map +1 -1
  229. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.d.ts +1 -1
  230. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.js +1 -1
  231. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.js.map +1 -1
  232. package/dist/server/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +2 -2
  233. package/dist/server/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js.map +1 -1
  234. package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.d.ts +9 -0
  235. package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.js +43 -0
  236. package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.js.map +1 -0
  237. package/dist/server/node_modules/@opentelemetry/resources/build/src/index.d.ts +1 -1
  238. package/dist/server/node_modules/@opentelemetry/resources/build/src/index.js +2 -2
  239. package/dist/server/node_modules/@opentelemetry/resources/build/src/index.js.map +1 -1
  240. package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.d.ts +0 -1
  241. package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.js +1 -5
  242. package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.js.map +1 -1
  243. package/dist/server/node_modules/@opentelemetry/resources/build/src/version.d.ts +1 -1
  244. package/dist/server/node_modules/@opentelemetry/resources/build/src/version.js +1 -1
  245. package/dist/server/node_modules/@opentelemetry/resources/build/src/version.js.map +1 -1
  246. package/dist/server/node_modules/@opentelemetry/resources/package.json +5 -9
  247. package/dist/server/node_modules/{is-what → pg}/LICENSE +1 -1
  248. package/dist/server/node_modules/pg/README.md +89 -0
  249. package/dist/server/node_modules/pg/lib/client.js +631 -0
  250. package/dist/server/node_modules/pg/lib/connection-parameters.js +167 -0
  251. package/dist/server/node_modules/pg/lib/connection.js +223 -0
  252. package/dist/server/node_modules/pg/lib/crypto/sasl.js +186 -0
  253. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +37 -0
  254. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +83 -0
  255. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  256. package/dist/server/node_modules/pg/lib/defaults.js +84 -0
  257. package/dist/server/node_modules/pg/lib/index.js +58 -0
  258. package/dist/server/node_modules/pg/lib/native/client.js +307 -0
  259. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  260. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  261. package/dist/server/node_modules/pg/lib/query.js +241 -0
  262. package/dist/server/node_modules/pg/lib/result.js +107 -0
  263. package/dist/server/node_modules/pg/lib/stream.js +28 -0
  264. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  265. package/dist/server/node_modules/pg/lib/utils.js +204 -0
  266. package/dist/server/node_modules/pg/package.json +64 -0
  267. package/dist/server/server.js +1 -1
  268. package/package.json +1 -1
  269. package/dist/client/assets/index-DZOICIVA.js +0 -3
  270. package/dist/client/assets/registry-DCNSwAFB.js +0 -2
  271. package/dist/client/assets/store-registry-a04PRl5d.js +0 -2
  272. package/dist/client/assets/useInfiniteQuery-reF0B5YX.js +0 -1
  273. package/dist/client/assets/useSuspenseInfiniteQuery-DnuupN6w.js +0 -1
  274. package/dist/client/assets/workflow-detail-BOKGoGz4.js +0 -1
  275. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.d.ts +0 -2
  276. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js +0 -19
  277. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js.map +0 -1
  278. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.d.ts +0 -2
  279. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js +0 -17
  280. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js.map +0 -1
  281. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.d.ts +0 -2
  282. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.js +0 -17
  283. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.js.map +0 -1
  284. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.d.ts +0 -2
  285. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js +0 -19
  286. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js.map +0 -1
  287. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/index.d.ts +0 -2
  288. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/index.js +0 -17
  289. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/index.js.map +0 -1
  290. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.d.ts +0 -2
  291. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.js +0 -19
  292. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.js.map +0 -1
  293. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.d.ts +0 -2
  294. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.js +0 -17
  295. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.js.map +0 -1
  296. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.d.ts +0 -2
  297. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.js +0 -17
  298. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.js.map +0 -1
  299. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.d.ts +0 -2
  300. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.js +0 -19
  301. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.js.map +0 -1
  302. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.d.ts +0 -2
  303. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.js +0 -17
  304. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.js.map +0 -1
  305. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.d.ts +0 -2
  306. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.js +0 -23
  307. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.js.map +0 -1
  308. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.d.ts +0 -2
  309. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.js +0 -21
  310. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.js.map +0 -1
  311. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.d.ts +0 -2
  312. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.js +0 -21
  313. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.js.map +0 -1
  314. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.d.ts +0 -2
  315. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js +0 -23
  316. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js.map +0 -1
  317. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.d.ts +0 -2
  318. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.js +0 -21
  319. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.js.map +0 -1
  320. package/dist/server/node_modules/@protobufjs/base64/LICENSE +0 -26
  321. package/dist/server/node_modules/@protobufjs/base64/README.md +0 -19
  322. package/dist/server/node_modules/@protobufjs/base64/index.d.ts +0 -32
  323. package/dist/server/node_modules/@protobufjs/base64/index.js +0 -139
  324. package/dist/server/node_modules/@protobufjs/base64/package.json +0 -21
  325. package/dist/server/node_modules/@protobufjs/base64/tests/index.js +0 -46
  326. package/dist/server/node_modules/is-what/README.md +0 -294
  327. package/dist/server/node_modules/is-what/dist/cjs/index.cjs +0 -209
  328. package/dist/server/node_modules/is-what/dist/cjs/index.d.cts +0 -380
  329. package/dist/server/node_modules/is-what/dist/index.d.ts +0 -380
  330. package/dist/server/node_modules/is-what/dist/index.js +0 -171
  331. package/dist/server/node_modules/is-what/package.json +0 -128
  332. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  333. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  334. package/dist/server/node_modules/mimic-fn/license +0 -9
  335. package/dist/server/node_modules/mimic-fn/package.json +0 -42
  336. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
  337. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  338. package/dist/server/node_modules/pg-int8/README.md +0 -16
  339. package/dist/server/node_modules/pg-int8/index.js +0 -100
  340. package/dist/server/node_modules/pg-int8/package.json +0 -24
  341. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  342. package/dist/server/node_modules/postgres-array/index.js +0 -97
  343. package/dist/server/node_modules/postgres-array/license +0 -21
  344. package/dist/server/node_modules/postgres-array/package.json +0 -35
  345. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  346. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  347. package/dist/server/node_modules/postgres-bytea/license +0 -21
  348. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  349. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  350. package/dist/server/node_modules/postgres-date/index.js +0 -116
  351. package/dist/server/node_modules/postgres-date/license +0 -21
  352. package/dist/server/node_modules/postgres-date/package.json +0 -33
  353. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  354. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  355. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  356. package/dist/server/node_modules/postgres-interval/license +0 -21
  357. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  358. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  359. package/dist/server/node_modules/protobufjs/LICENSE +0 -39
  360. package/dist/server/node_modules/protobufjs/README.md +0 -727
  361. package/dist/server/node_modules/protobufjs/dist/light/protobuf.js +0 -7839
  362. package/dist/server/node_modules/protobufjs/dist/light/protobuf.js.map +0 -1
  363. package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js +0 -8
  364. package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +0 -1
  365. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js +0 -2736
  366. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js.map +0 -1
  367. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +0 -8
  368. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +0 -1
  369. package/dist/server/node_modules/protobufjs/dist/protobuf.js +0 -9643
  370. package/dist/server/node_modules/protobufjs/dist/protobuf.js.map +0 -1
  371. package/dist/server/node_modules/protobufjs/dist/protobuf.min.js +0 -8
  372. package/dist/server/node_modules/protobufjs/dist/protobuf.min.js.map +0 -1
  373. package/dist/server/node_modules/protobufjs/ext/debug/README.md +0 -4
  374. package/dist/server/node_modules/protobufjs/ext/debug/index.js +0 -71
  375. package/dist/server/node_modules/protobufjs/ext/descriptor/README.md +0 -72
  376. package/dist/server/node_modules/protobufjs/ext/descriptor/index.d.ts +0 -191
  377. package/dist/server/node_modules/protobufjs/ext/descriptor/index.js +0 -1162
  378. package/dist/server/node_modules/protobufjs/ext/descriptor/test.js +0 -54
  379. package/dist/server/node_modules/protobufjs/google/LICENSE +0 -27
  380. package/dist/server/node_modules/protobufjs/google/README.md +0 -1
  381. package/dist/server/node_modules/protobufjs/google/api/annotations.json +0 -83
  382. package/dist/server/node_modules/protobufjs/google/api/annotations.proto +0 -11
  383. package/dist/server/node_modules/protobufjs/google/api/http.json +0 -86
  384. package/dist/server/node_modules/protobufjs/google/api/http.proto +0 -31
  385. package/dist/server/node_modules/protobufjs/google/protobuf/api.json +0 -118
  386. package/dist/server/node_modules/protobufjs/google/protobuf/api.proto +0 -34
  387. package/dist/server/node_modules/protobufjs/google/protobuf/descriptor.json +0 -1382
  388. package/dist/server/node_modules/protobufjs/google/protobuf/descriptor.proto +0 -535
  389. package/dist/server/node_modules/protobufjs/google/protobuf/source_context.json +0 -20
  390. package/dist/server/node_modules/protobufjs/google/protobuf/source_context.proto +0 -7
  391. package/dist/server/node_modules/protobufjs/google/protobuf/type.json +0 -202
  392. package/dist/server/node_modules/protobufjs/google/protobuf/type.proto +0 -89
  393. package/dist/server/node_modules/protobufjs/index.d.ts +0 -2799
  394. package/dist/server/node_modules/protobufjs/index.js +0 -4
  395. package/dist/server/node_modules/protobufjs/light.d.ts +0 -2
  396. package/dist/server/node_modules/protobufjs/light.js +0 -4
  397. package/dist/server/node_modules/protobufjs/minimal.d.ts +0 -2
  398. package/dist/server/node_modules/protobufjs/minimal.js +0 -4
  399. package/dist/server/node_modules/protobufjs/package.json +0 -114
  400. package/dist/server/node_modules/protobufjs/scripts/postinstall.js +0 -32
  401. package/dist/server/node_modules/protobufjs/src/common.js +0 -399
  402. package/dist/server/node_modules/protobufjs/src/converter.js +0 -301
  403. package/dist/server/node_modules/protobufjs/src/decoder.js +0 -127
  404. package/dist/server/node_modules/protobufjs/src/encoder.js +0 -100
  405. package/dist/server/node_modules/protobufjs/src/enum.js +0 -223
  406. package/dist/server/node_modules/protobufjs/src/field.js +0 -453
  407. package/dist/server/node_modules/protobufjs/src/index-light.js +0 -104
  408. package/dist/server/node_modules/protobufjs/src/index-minimal.js +0 -36
  409. package/dist/server/node_modules/protobufjs/src/index.js +0 -12
  410. package/dist/server/node_modules/protobufjs/src/mapfield.js +0 -126
  411. package/dist/server/node_modules/protobufjs/src/message.js +0 -143
  412. package/dist/server/node_modules/protobufjs/src/method.js +0 -160
  413. package/dist/server/node_modules/protobufjs/src/namespace.js +0 -546
  414. package/dist/server/node_modules/protobufjs/src/object.js +0 -378
  415. package/dist/server/node_modules/protobufjs/src/oneof.js +0 -222
  416. package/dist/server/node_modules/protobufjs/src/parse.js +0 -969
  417. package/dist/server/node_modules/protobufjs/src/reader.js +0 -416
  418. package/dist/server/node_modules/protobufjs/src/reader_buffer.js +0 -51
  419. package/dist/server/node_modules/protobufjs/src/root.js +0 -404
  420. package/dist/server/node_modules/protobufjs/src/roots.js +0 -18
  421. package/dist/server/node_modules/protobufjs/src/rpc/service.js +0 -142
  422. package/dist/server/node_modules/protobufjs/src/rpc.js +0 -36
  423. package/dist/server/node_modules/protobufjs/src/service.js +0 -189
  424. package/dist/server/node_modules/protobufjs/src/tokenize.js +0 -416
  425. package/dist/server/node_modules/protobufjs/src/type.js +0 -615
  426. package/dist/server/node_modules/protobufjs/src/types.js +0 -196
  427. package/dist/server/node_modules/protobufjs/src/typescript.jsdoc +0 -15
  428. package/dist/server/node_modules/protobufjs/src/util/longbits.js +0 -200
  429. package/dist/server/node_modules/protobufjs/src/util/minimal.js +0 -438
  430. package/dist/server/node_modules/protobufjs/src/util.js +0 -215
  431. package/dist/server/node_modules/protobufjs/src/verifier.js +0 -177
  432. package/dist/server/node_modules/protobufjs/src/wrappers.js +0 -102
  433. package/dist/server/node_modules/protobufjs/src/writer.js +0 -465
  434. package/dist/server/node_modules/protobufjs/src/writer_buffer.js +0 -85
  435. package/dist/server/node_modules/protobufjs/tsconfig.json +0 -8
  436. package/dist/server/node_modules/split2/LICENSE +0 -13
  437. package/dist/server/node_modules/split2/README.md +0 -85
  438. package/dist/server/node_modules/split2/bench.js +0 -27
  439. package/dist/server/node_modules/split2/index.js +0 -141
  440. package/dist/server/node_modules/split2/package.json +0 -39
  441. package/dist/server/node_modules/split2/test.js +0 -409
@@ -71,6 +71,21 @@ function toOtlpSpanEvent(timedEvent, encoder) {
71
71
  };
72
72
  }
73
73
  exports.toOtlpSpanEvent = toOtlpSpanEvent;
74
+ /*
75
+ * Copyright The OpenTelemetry Authors
76
+ *
77
+ * Licensed under the Apache License, Version 2.0 (the "License");
78
+ * you may not use this file except in compliance with the License.
79
+ * You may obtain a copy of the License at
80
+ *
81
+ * https://www.apache.org/licenses/LICENSE-2.0
82
+ *
83
+ * Unless required by applicable law or agreed to in writing, software
84
+ * distributed under the License is distributed on an "AS IS" BASIS,
85
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
+ * See the License for the specific language governing permissions and
87
+ * limitations under the License.
88
+ */
74
89
  function createExportTraceServiceRequest(spans, options) {
75
90
  const encoder = (0, utils_1.getOtlpEncoder)(options);
76
91
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/trace/internal.ts"],"names":[],"mappings":";;;AAmBA,iDAI4B;AAW5B,2CAAiD;AAEjD,uDAAuD;AACvD,MAAM,qCAAqC,GAAG,KAAK,CAAC;AACpD,MAAM,iCAAiC,GAAG,KAAK,CAAC;AAEhD;;;GAGG;AACH,SAAS,kBAAkB,CAAC,UAAkB,EAAE,QAAkB;IAChE,gDAAgD;IAChD,IAAI,KAAK,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,qCAAqC,CAAC;IACxE,IAAI,QAAQ,EAAE;QACZ,KAAK,IAAI,iCAAiC,CAAC;KAC5C;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,iBAAiB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GAAG,CAAC;AACb,CAAC","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 type { Link } from '@opentelemetry/api';\nimport { Resource } from '@opentelemetry/resources';\nimport type { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport type { Encoder } from '../common/utils';\nimport {\n createInstrumentationScope,\n createResource,\n toAttributes,\n} from '../common/internal';\nimport {\n EStatusCode,\n IEvent,\n IExportTraceServiceRequest,\n ILink,\n IResourceSpans,\n IScopeSpans,\n ISpan,\n} from './internal-types';\nimport { OtlpEncodingOptions } from '../common/internal-types';\nimport { getOtlpEncoder } from '../common/utils';\n\n// Span flags constants matching the OTLP specification\nconst SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 0x100;\nconst SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x200;\n\n/**\n * Builds the 32-bit span flags value combining the low 8-bit W3C TraceFlags\n * with the HAS_IS_REMOTE and IS_REMOTE bits according to the OTLP spec.\n */\nfunction buildSpanFlagsFrom(traceFlags: number, isRemote?: boolean): number {\n // low 8 bits are W3C TraceFlags (e.g., sampled)\n let flags = (traceFlags & 0xff) | SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK;\n if (isRemote) {\n flags |= SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK;\n }\n return flags;\n}\n\nexport function sdkSpanToOtlpSpan(span: ReadableSpan, encoder: Encoder): ISpan {\n const ctx = span.spanContext();\n const status = span.status;\n const parentSpanId = span.parentSpanContext?.spanId\n ? encoder.encodeSpanContext(span.parentSpanContext?.spanId)\n : undefined;\n return {\n traceId: encoder.encodeSpanContext(ctx.traceId),\n spanId: encoder.encodeSpanContext(ctx.spanId),\n parentSpanId: parentSpanId,\n traceState: ctx.traceState?.serialize(),\n name: span.name,\n // Span kind is offset by 1 because the API does not define a value for unset\n kind: span.kind == null ? 0 : span.kind + 1,\n startTimeUnixNano: encoder.encodeHrTime(span.startTime),\n endTimeUnixNano: encoder.encodeHrTime(span.endTime),\n attributes: toAttributes(span.attributes),\n droppedAttributesCount: span.droppedAttributesCount,\n events: span.events.map(event => toOtlpSpanEvent(event, encoder)),\n droppedEventsCount: span.droppedEventsCount,\n status: {\n // API and proto enums share the same values\n code: status.code as unknown as EStatusCode,\n message: status.message,\n },\n links: span.links.map(link => toOtlpLink(link, encoder)),\n droppedLinksCount: span.droppedLinksCount,\n flags: buildSpanFlagsFrom(ctx.traceFlags, span.parentSpanContext?.isRemote),\n };\n}\n\nexport function toOtlpLink(link: Link, encoder: Encoder): ILink {\n return {\n attributes: link.attributes ? toAttributes(link.attributes) : [],\n spanId: encoder.encodeSpanContext(link.context.spanId),\n traceId: encoder.encodeSpanContext(link.context.traceId),\n traceState: link.context.traceState?.serialize(),\n droppedAttributesCount: link.droppedAttributesCount || 0,\n flags: buildSpanFlagsFrom(link.context.traceFlags, link.context.isRemote),\n };\n}\n\nexport function toOtlpSpanEvent(\n timedEvent: TimedEvent,\n encoder: Encoder\n): IEvent {\n return {\n attributes: timedEvent.attributes\n ? toAttributes(timedEvent.attributes)\n : [],\n name: timedEvent.name,\n timeUnixNano: encoder.encodeHrTime(timedEvent.time),\n droppedAttributesCount: timedEvent.droppedAttributesCount || 0,\n };\n}\n\nexport function createExportTraceServiceRequest(\n spans: ReadableSpan[],\n options?: OtlpEncodingOptions\n): IExportTraceServiceRequest {\n const encoder = getOtlpEncoder(options);\n return {\n resourceSpans: spanRecordsToResourceSpans(spans, encoder),\n };\n}\n\nfunction createResourceMap(readableSpans: ReadableSpan[]) {\n const resourceMap: Map<Resource, Map<string, ReadableSpan[]>> = new Map();\n for (const record of readableSpans) {\n let ilsMap = resourceMap.get(record.resource);\n\n if (!ilsMap) {\n ilsMap = new Map();\n resourceMap.set(record.resource, ilsMap);\n }\n\n // TODO this is duplicated in basic tracer. Consolidate on a common helper in core\n const instrumentationScopeKey = `${record.instrumentationScope.name}@${\n record.instrumentationScope.version || ''\n }:${record.instrumentationScope.schemaUrl || ''}`;\n let records = ilsMap.get(instrumentationScopeKey);\n\n if (!records) {\n records = [];\n ilsMap.set(instrumentationScopeKey, records);\n }\n\n records.push(record);\n }\n\n return resourceMap;\n}\n\nfunction spanRecordsToResourceSpans(\n readableSpans: ReadableSpan[],\n encoder: Encoder\n): IResourceSpans[] {\n const resourceMap = createResourceMap(readableSpans);\n const out: IResourceSpans[] = [];\n\n const entryIterator = resourceMap.entries();\n let entry = entryIterator.next();\n while (!entry.done) {\n const [resource, ilmMap] = entry.value;\n const scopeResourceSpans: IScopeSpans[] = [];\n const ilmIterator = ilmMap.values();\n let ilmEntry = ilmIterator.next();\n while (!ilmEntry.done) {\n const scopeSpans = ilmEntry.value;\n if (scopeSpans.length > 0) {\n const spans = scopeSpans.map(readableSpan =>\n sdkSpanToOtlpSpan(readableSpan, encoder)\n );\n\n scopeResourceSpans.push({\n scope: createInstrumentationScope(scopeSpans[0].instrumentationScope),\n spans: spans,\n schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl,\n });\n }\n ilmEntry = ilmIterator.next();\n }\n const processedResource = createResource(resource);\n const transformedSpans: IResourceSpans = {\n resource: processedResource,\n scopeSpans: scopeResourceSpans,\n schemaUrl: processedResource.schemaUrl,\n };\n\n out.push(transformedSpans);\n entry = entryIterator.next();\n }\n\n return out;\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/trace/internal.ts"],"names":[],"mappings":";;;AAmBA,iDAI4B;AAW5B,2CAAiD;AAEjD,uDAAuD;AACvD,MAAM,qCAAqC,GAAG,KAAK,CAAC;AACpD,MAAM,iCAA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;QACD,MAAM,iBAAiB,GAAG,IAAA,yBAAc,EAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,gBAAgB,GAAmB;YACvC,QAAQ,EAAE,iBAAiB;YAC3B,UAAU,EAAE,kBAAkB;YAC9B,SAAS,EAAE,iBAAiB,CAAC,SAAS;SACvC,CAAC;QAEF,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC3B,KAAK,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC;KAC9B;IAED,OAAO,GAAG,CAAC;AACb,CAAC","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 type { Link } from '@opentelemetry/api';\nimport { Resource } from '@opentelemetry/resources';\nimport type { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport type { Encoder } from '../common/utils';\nimport {\n createInstrumentationScope,\n createResource,\n toAttributes,\n} from '../common/internal';\nimport {\n EStatusCode,\n IEvent,\n IExportTraceServiceRequest,\n ILink,\n IResourceSpans,\n IScopeSpans,\n ISpan,\n} from './internal-types';\nimport { OtlpEncodingOptions } from '../common/internal-types';\nimport { getOtlpEncoder } from '../common/utils';\n\n// Span flags constants matching the OTLP specification\nconst SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 0x100;\nconst SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x200;\n\n/**\n * Builds the 32-bit span flags value combining the low 8-bit W3C TraceFlags\n * with the HAS_IS_REMOTE and IS_REMOTE bits according to the OTLP spec.\n */\nfunction buildSpanFlagsFrom(traceFlags: number, isRemote?: boolean): number {\n // low 8 bits are W3C TraceFlags (e.g., sampled)\n let flags = (traceFlags & 0xff) | SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK;\n if (isRemote) {\n flags |= SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK;\n }\n return flags;\n}\n\nexport function sdkSpanToOtlpSpan(span: ReadableSpan, encoder: Encoder): ISpan {\n const ctx = span.spanContext();\n const status = span.status;\n const parentSpanId = span.parentSpanContext?.spanId\n ? encoder.encodeSpanContext(span.parentSpanContext?.spanId)\n : undefined;\n return {\n traceId: encoder.encodeSpanContext(ctx.traceId),\n spanId: encoder.encodeSpanContext(ctx.spanId),\n parentSpanId: parentSpanId,\n traceState: ctx.traceState?.serialize(),\n name: span.name,\n // Span kind is offset by 1 because the API does not define a value for unset\n kind: span.kind == null ? 0 : span.kind + 1,\n startTimeUnixNano: encoder.encodeHrTime(span.startTime),\n endTimeUnixNano: encoder.encodeHrTime(span.endTime),\n attributes: toAttributes(span.attributes),\n droppedAttributesCount: span.droppedAttributesCount,\n events: span.events.map(event => toOtlpSpanEvent(event, encoder)),\n droppedEventsCount: span.droppedEventsCount,\n status: {\n // API and proto enums share the same values\n code: status.code as unknown as EStatusCode,\n message: status.message,\n },\n links: span.links.map(link => toOtlpLink(link, encoder)),\n droppedLinksCount: span.droppedLinksCount,\n flags: buildSpanFlagsFrom(ctx.traceFlags, span.parentSpanContext?.isRemote),\n };\n}\n\nexport function toOtlpLink(link: Link, encoder: Encoder): ILink {\n return {\n attributes: link.attributes ? toAttributes(link.attributes) : [],\n spanId: encoder.encodeSpanContext(link.context.spanId),\n traceId: encoder.encodeSpanContext(link.context.traceId),\n traceState: link.context.traceState?.serialize(),\n droppedAttributesCount: link.droppedAttributesCount || 0,\n flags: buildSpanFlagsFrom(link.context.traceFlags, link.context.isRemote),\n };\n}\n\nexport function toOtlpSpanEvent(\n timedEvent: TimedEvent,\n encoder: Encoder\n): IEvent {\n return {\n attributes: timedEvent.attributes\n ? toAttributes(timedEvent.attributes)\n : [],\n name: timedEvent.name,\n timeUnixNano: encoder.encodeHrTime(timedEvent.time),\n droppedAttributesCount: timedEvent.droppedAttributesCount || 0,\n };\n}\n\n/*\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\nexport function createExportTraceServiceRequest(\n spans: ReadableSpan[],\n options?: OtlpEncodingOptions\n): IExportTraceServiceRequest {\n const encoder = getOtlpEncoder(options);\n return {\n resourceSpans: spanRecordsToResourceSpans(spans, encoder),\n };\n}\n\nfunction createResourceMap(readableSpans: ReadableSpan[]) {\n const resourceMap: Map<Resource, Map<string, ReadableSpan[]>> = new Map();\n for (const record of readableSpans) {\n let ilsMap = resourceMap.get(record.resource);\n\n if (!ilsMap) {\n ilsMap = new Map();\n resourceMap.set(record.resource, ilsMap);\n }\n\n // TODO this is duplicated in basic tracer. Consolidate on a common helper in core\n const instrumentationScopeKey = `${record.instrumentationScope.name}@${\n record.instrumentationScope.version || ''\n }:${record.instrumentationScope.schemaUrl || ''}`;\n let records = ilsMap.get(instrumentationScopeKey);\n\n if (!records) {\n records = [];\n ilsMap.set(instrumentationScopeKey, records);\n }\n\n records.push(record);\n }\n\n return resourceMap;\n}\n\nfunction spanRecordsToResourceSpans(\n readableSpans: ReadableSpan[],\n encoder: Encoder\n): IResourceSpans[] {\n const resourceMap = createResourceMap(readableSpans);\n const out: IResourceSpans[] = [];\n\n const entryIterator = resourceMap.entries();\n let entry = entryIterator.next();\n while (!entry.done) {\n const [resource, ilmMap] = entry.value;\n const scopeResourceSpans: IScopeSpans[] = [];\n const ilmIterator = ilmMap.values();\n let ilmEntry = ilmIterator.next();\n while (!ilmEntry.done) {\n const scopeSpans = ilmEntry.value;\n if (scopeSpans.length > 0) {\n const spans = scopeSpans.map(readableSpan =>\n sdkSpanToOtlpSpan(readableSpan, encoder)\n );\n\n scopeResourceSpans.push({\n scope: createInstrumentationScope(scopeSpans[0].instrumentationScope),\n spans: spans,\n schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl,\n });\n }\n ilmEntry = ilmIterator.next();\n }\n const processedResource = createResource(resource);\n const transformedSpans: IResourceSpans = {\n resource: processedResource,\n scopeSpans: scopeResourceSpans,\n schemaUrl: processedResource.schemaUrl,\n };\n\n out.push(transformedSpans);\n entry = entryIterator.next();\n }\n\n return out;\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.211.0",
7
+ "version": "0.207.0",
8
8
  "description": "Transform OpenTelemetry SDK data into OTLP",
9
9
  "module": "build/esm/index.js",
10
10
  "esnext": "build/esnext/index.js",
@@ -17,9 +17,7 @@
17
17
  "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
18
18
  "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
19
19
  "protos": "npm run submodule && npm run protos:generate",
20
- "protos:generate:js": "pbjs -t static-module -p ./protos -w commonjs --null-defaults -o ./src/generated/root.js ./protos/opentelemetry/proto/common/v1/common.proto ./protos/opentelemetry/proto/resource/v1/resource.proto ./protos/opentelemetry/proto/trace/v1/trace.proto ./protos/opentelemetry/proto/collector/trace/v1/trace_service.proto ./protos/opentelemetry/proto/metrics/v1/metrics.proto ./protos/opentelemetry/proto/collector/metrics/v1/metrics_service.proto ./protos/opentelemetry/proto/logs/v1/logs.proto ./protos/opentelemetry/proto/collector/logs/v1/logs_service.proto",
21
- "protos:generate:ts": "pbts -o ./src/generated/root.d.ts ./src/generated/root.js",
22
- "protos:generate": "npm run protos:generate:js && npm run protos:generate:ts",
20
+ "protos:generate": "node ../../../scripts/generate-protos.js",
23
21
  "lint": "eslint . --ext .ts",
24
22
  "lint:fix": "eslint . --ext .ts --fix",
25
23
  "tdd": "npm run test -- --watch-extensions ts --watch",
@@ -73,23 +71,23 @@
73
71
  "karma-mocha": "2.0.1",
74
72
  "karma-spec-reporter": "0.0.36",
75
73
  "karma-webpack": "5.0.1",
76
- "mocha": "11.7.5",
74
+ "mocha": "11.7.4",
77
75
  "nyc": "17.1.0",
78
- "protobufjs-cli": "2.0.0",
76
+ "protobufjs-cli": "1.1.3",
79
77
  "ts-loader": "9.5.4",
80
78
  "typescript": "5.0.4",
81
79
  "webpack": "5.101.3"
82
80
  },
83
81
  "dependencies": {
84
- "@opentelemetry/api-logs": "0.211.0",
85
- "@opentelemetry/core": "2.5.0",
86
- "@opentelemetry/resources": "2.5.0",
87
- "@opentelemetry/sdk-logs": "0.211.0",
88
- "@opentelemetry/sdk-metrics": "2.5.0",
89
- "@opentelemetry/sdk-trace-base": "2.5.0",
90
- "protobufjs": "8.0.0"
82
+ "@opentelemetry/api-logs": "0.207.0",
83
+ "@opentelemetry/core": "2.2.0",
84
+ "@opentelemetry/resources": "2.2.0",
85
+ "@opentelemetry/sdk-logs": "0.207.0",
86
+ "@opentelemetry/sdk-metrics": "2.2.0",
87
+ "@opentelemetry/sdk-trace-base": "2.2.0",
88
+ "protobufjs": "^7.3.0"
91
89
  },
92
90
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-transformer",
93
91
  "sideEffects": false,
94
- "gitHead": "38924cbff2a6e924ce8a2a227d3a72de52fbcd35"
92
+ "gitHead": "fb6476d8243ac8dcaaea74130b9c50c43938275c"
95
93
  }
@@ -16,7 +16,7 @@
16
16
  import { diag } from '@opentelemetry/api';
17
17
  import { SDK_INFO } from '@opentelemetry/core';
18
18
  import { ATTR_SERVICE_NAME, ATTR_TELEMETRY_SDK_LANGUAGE, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions';
19
- import { defaultServiceName } from './platform';
19
+ import { defaultServiceName } from './default-service-name';
20
20
  import { isPromiseLike } from './utils';
21
21
  class ResourceImpl {
22
22
  _rawAttributes;
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAQhD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1C,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACtD,GAAG,CAAC,uBAAuB;YACzB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,OAAO,GAAG,CAAC;IACb,CAAC;IAED;IACE;;;;OAIG;IACH,QAA0B,EAC1B,OAAyB;QAEzB,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;QAC7C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GA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G,QAAQ,EAAE,SAAS,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","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\nimport { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './platform';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1C,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACtD,GAAG,CAAC,uBAAuB;YACzB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,G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,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,CAAC,IAAI,CACP,6EAA6E,EAC7E,SAAS,CACV,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CACrB,GAAa,EACb,QAAyB;IAEzB,MAAM,YAAY,GAAG,GAAG,EAAE,SAAS,CAAC;IACpC,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","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\nimport { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns the default service name for OpenTelemetry resources.
3
+ * In Node.js environments, returns "unknown_service:<process.argv0>".
4
+ * In browser/edge environments, returns "unknown_service".
5
+ */
6
+ export declare function defaultServiceName(): string;
7
+ /** @internal For testing purposes only */
8
+ export declare function _clearDefaultServiceNameCache(): void;
9
+ //# sourceMappingURL=default-service-name.d.ts.map
@@ -0,0 +1,38 @@
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
+ let serviceName;
17
+ /**
18
+ * Returns the default service name for OpenTelemetry resources.
19
+ * In Node.js environments, returns "unknown_service:<process.argv0>".
20
+ * In browser/edge environments, returns "unknown_service".
21
+ */
22
+ export function defaultServiceName() {
23
+ if (serviceName === undefined) {
24
+ try {
25
+ const argv0 = globalThis.process.argv0;
26
+ serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';
27
+ }
28
+ catch {
29
+ serviceName = 'unknown_service';
30
+ }
31
+ }
32
+ return serviceName;
33
+ }
34
+ /** @internal For testing purposes only */
35
+ export function _clearDefaultServiceNameCache() {
36
+ serviceName = undefined;
37
+ }
38
+ //# sourceMappingURL=default-service-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC","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\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]}
@@ -3,6 +3,6 @@ export { detectResources } from './detect-resources';
3
3
  export { envDetector, hostDetector, osDetector, processDetector, serviceInstanceIdDetector, } from './detectors';
4
4
  export type { Resource } from './Resource';
5
5
  export { resourceFromAttributes, defaultResource, emptyResource, } from './ResourceImpl';
6
- export { defaultServiceName } from './platform';
6
+ export { defaultServiceName } from './default-service-name';
7
7
  export type { ResourceDetector, DetectedResource, DetectedResourceAttributes, RawResourceAttribute, MaybePromise, } from './types';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -16,5 +16,5 @@
16
16
  export { detectResources } from './detect-resources';
17
17
  export { envDetector, hostDetector, osDetector, processDetector, serviceInstanceIdDetector, } from './detectors';
18
18
  export { resourceFromAttributes, defaultResource, emptyResource, } from './ResourceImpl';
19
- export { defaultServiceName } from './platform';
19
+ export { defaultServiceName } from './default-service-name';
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC","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\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './platform';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC","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\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]}
@@ -1,3 +1,2 @@
1
1
  export declare const isPromiseLike: <R>(val: unknown) => val is PromiseLike<R>;
2
- export declare function identity<T>(_: T): T;
3
2
  //# sourceMappingURL=utils.d.ts.map
@@ -18,7 +18,4 @@ export const isPromiseLike = (val) => {
18
18
  typeof val === 'object' &&
19
19
  typeof val.then === 'function');
20
20
  };
21
- export function identity(_) {
22
- return _;
23
- }
24
21
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAI,CAAI;IAC9B,OAAO,CAAC,CAAC;AACX,CAAC","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\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n\nexport function identity<T>(_: T): T {\n return _;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC","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\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.2.0";
1
+ export declare const VERSION = "2.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // this is autogenerated file, see scripts/version-update.js
17
- export const VERSION = '2.2.0';
17
+ export const VERSION = '2.5.0';
18
18
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.2.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.5.0';\n"]}
@@ -16,7 +16,7 @@
16
16
  import { diag } from '@opentelemetry/api';
17
17
  import { SDK_INFO } from '@opentelemetry/core';
18
18
  import { ATTR_SERVICE_NAME, ATTR_TELEMETRY_SDK_LANGUAGE, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions';
19
- import { defaultServiceName } from './platform';
19
+ import { defaultServiceName } from './default-service-name';
20
20
  import { isPromiseLike } from './utils';
21
21
  class ResourceImpl {
22
22
  _rawAttributes;
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAQhD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1C,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACtD,GAAG,CAAC,uBAAuB;YACzB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,OAAO,GAAG,CAAC;IACb,CAAC;IAED;IACE;;;;OAIG;IACH,QAA0B,EAC1B,OAAyB;QAEzB,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;QAC7C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC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,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","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\nimport { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './platform';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"ResourceImpl.js","sourceRoot":"","sources":["../../src/ResourceImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,YAAY;IACR,cAAc,CAAyB;IACvC,uBAAuB,GAAG,KAAK,CAAC;IAChC,UAAU,CAAU;IAEpB,mBAAmB,CAAc;IAEzC,MAAM,CAAC,iBAAiB,CACtB,UAAgE,EAChE,OAAyB;QAEzB,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1C,GAAG,CAAC,cAAc,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACtD,GAAG,CAAC,uBAAuB;YACzB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACj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AClB;IAED,IAAI,CAAC,IAAI,CACP,6EAA6E,EAC7E,SAAS,CACV,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc,CACrB,GAAa,EACb,QAAyB;IAEzB,MAAM,YAAY,GAAG,GAAG,EAAE,SAAS,CAAC;IACpC,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS,CAAC;IAE9C,MAAM,UAAU,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,EAAE,CAAC;IACrE,MAAM,eAAe,GACnB,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,EAAE,CAAC;IAE9D,IAAI,UAAU,EAAE;QACd,OAAO,iBAAiB,CAAC;KAC1B;IAED,IAAI,eAAe,EAAE;QACnB,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,YAAY,KAAK,iBAAiB,EAAE;QACtC,OAAO,YAAY,CAAC;KACrB;IAED,IAAI,CAAC,IAAI,CACP,kIAAkI,EAClI,YAAY,EACZ,iBAAiB,CAClB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","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\nimport { Attributes, AttributeValue, diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_TELEMETRY_SDK_LANGUAGE,\n ATTR_TELEMETRY_SDK_NAME,\n ATTR_TELEMETRY_SDK_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { Resource } from './Resource';\nimport { defaultServiceName } from './default-service-name';\nimport {\n DetectedResource,\n DetectedResourceAttributes,\n MaybePromise,\n RawResourceAttribute,\n ResourceOptions,\n} from './types';\nimport { isPromiseLike } from './utils';\n\nclass ResourceImpl implements Resource {\n private _rawAttributes: RawResourceAttribute[];\n private _asyncAttributesPending = false;\n private _schemaUrl?: string;\n\n private _memoizedAttributes?: Attributes;\n\n static FromAttributeList(\n attributes: [string, MaybePromise<AttributeValue | undefined>][],\n options?: ResourceOptions\n ): Resource {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource: DetectedResource,\n options?: ResourceOptions\n ) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n\n return [k, v];\n });\n\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n\n public get asyncAttributesPending(): boolean {\n return this._asyncAttributesPending;\n }\n\n public async waitForAsyncAttributes(): Promise<void> {\n if (!this.asyncAttributesPending) {\n return;\n }\n\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n\n this._asyncAttributesPending = false;\n }\n\n public get attributes(): Attributes {\n if (this.asyncAttributesPending) {\n diag.error(\n 'Accessing resource attributes before async attributes settled'\n );\n }\n\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n\n const attrs: Attributes = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n\n return attrs;\n }\n\n public getRawAttributes(): RawResourceAttribute[] {\n return this._rawAttributes;\n }\n\n public get schemaUrl(): string | undefined {\n return this._schemaUrl;\n }\n\n public merge(resource: Resource | null): Resource {\n if (resource == null) return this;\n\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions: ResourceOptions | undefined = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n\n return ResourceImpl.FromAttributeList(\n [...resource.getRawAttributes(), ...this.getRawAttributes()],\n mergedOptions\n );\n }\n}\n\nexport function resourceFromAttributes(\n attributes: DetectedResourceAttributes,\n options?: ResourceOptions\n): Resource {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\n\nexport function resourceFromDetectedResource(\n detectedResource: DetectedResource,\n options?: ResourceOptions\n): Resource {\n return new ResourceImpl(detectedResource, options);\n}\n\nexport function emptyResource(): Resource {\n return resourceFromAttributes({});\n}\n\nexport function defaultResource(): Resource {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\n\nfunction guardedRawAttributes(\n attributes: RawResourceAttribute[]\n): RawResourceAttribute[] {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug(\n 'promise rejection for resource attribute: %s - %s',\n k,\n err\n );\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\n\nfunction validateSchemaUrl(schemaUrl?: string): string | undefined {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n\n diag.warn(\n 'Schema URL must be string or undefined, got %s. Schema URL will be ignored.',\n schemaUrl\n );\n\n return undefined;\n}\n\nfunction mergeSchemaUrl(\n old: Resource,\n updating: Resource | null\n): string | undefined {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty =\n updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n\n diag.warn(\n 'Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.',\n oldSchemaUrl,\n updatingSchemaUrl\n );\n\n return undefined;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns the default service name for OpenTelemetry resources.
3
+ * In Node.js environments, returns "unknown_service:<process.argv0>".
4
+ * In browser/edge environments, returns "unknown_service".
5
+ */
6
+ export declare function defaultServiceName(): string;
7
+ /** @internal For testing purposes only */
8
+ export declare function _clearDefaultServiceNameCache(): void;
9
+ //# sourceMappingURL=default-service-name.d.ts.map
@@ -0,0 +1,38 @@
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
+ let serviceName;
17
+ /**
18
+ * Returns the default service name for OpenTelemetry resources.
19
+ * In Node.js environments, returns "unknown_service:<process.argv0>".
20
+ * In browser/edge environments, returns "unknown_service".
21
+ */
22
+ export function defaultServiceName() {
23
+ if (serviceName === undefined) {
24
+ try {
25
+ const argv0 = globalThis.process.argv0;
26
+ serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';
27
+ }
28
+ catch {
29
+ serviceName = 'unknown_service';
30
+ }
31
+ }
32
+ return serviceName;
33
+ }
34
+ /** @internal For testing purposes only */
35
+ export function _clearDefaultServiceNameCache() {
36
+ serviceName = undefined;
37
+ }
38
+ //# sourceMappingURL=default-service-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-service-name.js","sourceRoot":"","sources":["../../src/default-service-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,IAAI,WAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,IAAI;YACF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACvC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;SACtE;QAAC,MAAM;YACN,WAAW,GAAG,iBAAiB,CAAC;SACjC;KACF;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,6BAA6B;IAC3C,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC","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\nlet serviceName: string | undefined;\n\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName(): string {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n } catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache(): void {\n serviceName = undefined;\n}\n"]}
@@ -3,6 +3,6 @@ export { detectResources } from './detect-resources';
3
3
  export { envDetector, hostDetector, osDetector, processDetector, serviceInstanceIdDetector, } from './detectors';
4
4
  export type { Resource } from './Resource';
5
5
  export { resourceFromAttributes, defaultResource, emptyResource, } from './ResourceImpl';
6
- export { defaultServiceName } from './platform';
6
+ export { defaultServiceName } from './default-service-name';
7
7
  export type { ResourceDetector, DetectedResource, DetectedResourceAttributes, RawResourceAttribute, MaybePromise, } from './types';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -16,5 +16,5 @@
16
16
  export { detectResources } from './detect-resources';
17
17
  export { envDetector, hostDetector, osDetector, processDetector, serviceInstanceIdDetector, } from './detectors';
18
18
  export { resourceFromAttributes, defaultResource, emptyResource, } from './ResourceImpl';
19
- export { defaultServiceName } from './platform';
19
+ export { defaultServiceName } from './default-service-name';
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC","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\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './platform';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC","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\nexport type { ResourceDetectionConfig } from './config';\nexport { detectResources } from './detect-resources';\nexport {\n envDetector,\n hostDetector,\n osDetector,\n processDetector,\n serviceInstanceIdDetector,\n} from './detectors';\nexport type { Resource } from './Resource';\nexport {\n resourceFromAttributes,\n defaultResource,\n emptyResource,\n} from './ResourceImpl';\nexport { defaultServiceName } from './default-service-name';\nexport type {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n RawResourceAttribute,\n MaybePromise,\n} from './types';\n"]}
@@ -1,3 +1,2 @@
1
1
  export declare const isPromiseLike: <R>(val: unknown) => val is PromiseLike<R>;
2
- export declare function identity<T>(_: T): T;
3
2
  //# sourceMappingURL=utils.d.ts.map
@@ -18,7 +18,4 @@ export const isPromiseLike = (val) => {
18
18
  typeof val === 'object' &&
19
19
  typeof val.then === 'function');
20
20
  };
21
- export function identity(_) {
22
- return _;
23
- }
24
21
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAI,CAAI;IAC9B,OAAO,CAAC,CAAC;AACX,CAAC","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\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n\nexport function identity<T>(_: T): T {\n return _;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,GAAY,EAAyB,EAAE;IACtE,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;QACvB,OAAQ,GAA+B,CAAC,IAAI,KAAK,UAAU,CAC5D,CAAC;AACJ,CAAC,CAAC","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\nexport const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {\n return (\n val !== null &&\n typeof val === 'object' &&\n typeof (val as Partial<PromiseLike<R>>).then === 'function'\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.2.0";
1
+ export declare const VERSION = "2.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // this is autogenerated file, see scripts/version-update.js
17
- export const VERSION = '2.2.0';
17
+ export const VERSION = '2.5.0';
18
18
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.2.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","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// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.5.0';\n"]}
@@ -19,7 +19,7 @@ exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedRe
19
19
  const api_1 = require("@opentelemetry/api");
20
20
  const core_1 = require("@opentelemetry/core");
21
21
  const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
22
- const platform_1 = require("./platform");
22
+ const default_service_name_1 = require("./default-service-name");
23
23
  const utils_1 = require("./utils");
24
24
  class ResourceImpl {
25
25
  _rawAttributes;
@@ -119,7 +119,7 @@ function emptyResource() {
119
119
  exports.emptyResource = emptyResource;
120
120
  function defaultResource() {
121
121
  return resourceFromAttributes({
122
- [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, platform_1.defaultServiceName)(),
122
+ [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, default_service_name_1.defaultServiceName)(),
123
123
  [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE],
124
124
  [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME],
125
125
  [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION],