@paid-ai/paid-node 0.5.0-alpha3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/README.md +118 -36
  2. package/dist/cjs/Client.d.ts +35 -3
  3. package/dist/cjs/Client.js +57 -19
  4. package/dist/cjs/api/errors/InternalServerError.d.ts +9 -0
  5. package/dist/cjs/api/errors/InternalServerError.js +52 -0
  6. package/dist/cjs/api/errors/index.d.ts +1 -0
  7. package/dist/cjs/api/errors/index.js +1 -0
  8. package/dist/cjs/api/index.d.ts +1 -1
  9. package/dist/cjs/api/index.js +1 -1
  10. package/dist/cjs/api/resources/agents/client/Client.d.ts +16 -0
  11. package/dist/cjs/api/resources/agents/client/Client.js +16 -0
  12. package/dist/cjs/api/resources/customers/client/Client.d.ts +38 -0
  13. package/dist/cjs/api/resources/customers/client/Client.js +164 -0
  14. package/dist/cjs/api/resources/customers/client/requests/CustomerCreate.d.ts +2 -0
  15. package/dist/cjs/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.d.ts +30 -0
  16. package/dist/cjs/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.d.ts +30 -0
  17. package/dist/cjs/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.js +5 -0
  18. package/dist/cjs/api/resources/customers/client/requests/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/index.d.ts +8 -1
  20. package/dist/cjs/api/resources/index.js +9 -2
  21. package/dist/cjs/api/resources/orders/client/requests/OrderCreate.d.ts +2 -0
  22. package/dist/cjs/api/resources/orders/resources/lines/client/Client.d.ts +0 -2
  23. package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +0 -2
  24. package/dist/cjs/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.ts +0 -2
  25. package/dist/cjs/api/resources/plans/client/Client.d.ts +75 -0
  26. package/dist/cjs/api/resources/plans/client/Client.js +272 -0
  27. package/dist/cjs/api/resources/plans/client/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/plans/client/index.js +17 -0
  29. package/dist/cjs/api/resources/plans/client/requests/PlansGetUsageRequest.d.ts +35 -0
  30. package/dist/cjs/api/resources/plans/client/requests/PlansGetUsageRequest.js +5 -0
  31. package/dist/cjs/api/resources/plans/client/requests/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/plans/client/requests/index.js +2 -0
  33. package/dist/cjs/api/resources/plans/index.d.ts +1 -0
  34. package/dist/cjs/api/resources/plans/index.js +17 -0
  35. package/dist/cjs/api/resources/products/client/Client.d.ts +109 -0
  36. package/dist/cjs/api/resources/products/client/Client.js +470 -0
  37. package/dist/cjs/api/resources/products/client/index.d.ts +1 -0
  38. package/dist/cjs/api/resources/products/client/index.js +17 -0
  39. package/dist/cjs/api/resources/products/client/requests/ProductCreate.d.ts +29 -0
  40. package/dist/cjs/api/resources/products/client/requests/ProductCreate.js +14 -0
  41. package/dist/cjs/api/resources/products/client/requests/index.d.ts +1 -0
  42. package/dist/cjs/api/resources/products/client/requests/index.js +2 -0
  43. package/dist/cjs/api/resources/products/index.d.ts +1 -0
  44. package/dist/cjs/api/resources/products/index.js +17 -0
  45. package/dist/cjs/api/resources/traces/client/Client.d.ts +52 -0
  46. package/dist/cjs/api/resources/traces/client/Client.js +166 -0
  47. package/dist/cjs/api/resources/traces/client/index.d.ts +1 -0
  48. package/dist/cjs/api/resources/traces/client/index.js +17 -0
  49. package/dist/cjs/api/resources/traces/client/requests/GetTracesRequest.d.ts +50 -0
  50. package/dist/cjs/api/resources/traces/client/requests/GetTracesRequest.js +5 -0
  51. package/dist/cjs/api/resources/traces/client/requests/index.d.ts +1 -0
  52. package/dist/cjs/api/resources/traces/client/requests/index.js +2 -0
  53. package/dist/cjs/api/resources/traces/index.d.ts +1 -0
  54. package/dist/cjs/api/resources/traces/index.js +17 -0
  55. package/dist/cjs/api/resources/usage/client/Client.d.ts +47 -0
  56. package/dist/cjs/api/resources/usage/client/Client.js +146 -0
  57. package/dist/cjs/api/resources/usage/client/requests/UsageCheckUsageRequest.d.ts +28 -0
  58. package/dist/cjs/api/resources/usage/client/requests/UsageCheckUsageRequest.js +5 -0
  59. package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.ts +29 -0
  60. package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkV2Request.js +5 -0
  61. package/dist/cjs/api/resources/usage/client/requests/index.d.ts +2 -0
  62. package/dist/cjs/api/resources/usage/index.d.ts +1 -0
  63. package/dist/cjs/api/resources/usage/index.js +1 -0
  64. package/dist/cjs/api/resources/usage/types/UsageCheckUsageResponse.d.ts +17 -0
  65. package/dist/cjs/api/resources/usage/types/UsageCheckUsageResponse.js +5 -0
  66. package/dist/cjs/api/resources/usage/types/index.d.ts +1 -0
  67. package/dist/cjs/api/resources/usage/types/index.js +17 -0
  68. package/dist/cjs/api/types/CostAmount.d.ts +12 -0
  69. package/dist/cjs/api/types/CostAmount.js +5 -0
  70. package/dist/cjs/api/types/CostTrace.d.ts +22 -0
  71. package/dist/cjs/api/types/CostTrace.js +5 -0
  72. package/dist/cjs/api/types/CostTracesResponse.d.ts +11 -0
  73. package/dist/cjs/api/types/CostTracesResponse.js +5 -0
  74. package/dist/cjs/api/types/Customer.d.ts +2 -0
  75. package/dist/cjs/api/types/CustomerUpdate.d.ts +2 -0
  76. package/dist/cjs/api/types/OrderLineAttributeCreateOne.d.ts +4 -0
  77. package/dist/cjs/api/types/OrderLineAttributeCreateOne.js +5 -0
  78. package/dist/cjs/api/types/OrderLineCreate.d.ts +10 -4
  79. package/dist/cjs/api/types/PaginationMeta.d.ts +28 -0
  80. package/dist/cjs/api/types/PaginationMeta.js +5 -0
  81. package/dist/cjs/api/types/Plan.d.ts +58 -0
  82. package/dist/cjs/api/types/Plan.js +5 -0
  83. package/dist/cjs/api/types/PlanGroup.d.ts +23 -0
  84. package/dist/cjs/api/types/PlanGroup.js +5 -0
  85. package/dist/cjs/api/types/Product.d.ts +36 -0
  86. package/dist/cjs/api/types/Product.js +14 -0
  87. package/dist/cjs/api/types/ProductUpdate.d.ts +23 -0
  88. package/dist/cjs/api/types/ProductUpdate.js +14 -0
  89. package/dist/cjs/api/types/Signal.d.ts +7 -2
  90. package/dist/cjs/api/types/SignalV2.d.ts +22 -0
  91. package/dist/cjs/api/types/SignalV2.js +5 -0
  92. package/dist/cjs/api/types/Trace.d.ts +26 -0
  93. package/dist/cjs/api/types/Trace.js +5 -0
  94. package/dist/cjs/api/types/TracesResponse.d.ts +11 -0
  95. package/dist/cjs/api/types/TracesResponse.js +5 -0
  96. package/dist/cjs/api/types/UsagePaginationMeta.d.ts +16 -0
  97. package/dist/cjs/api/types/UsagePaginationMeta.js +5 -0
  98. package/dist/cjs/api/types/UsageSummariesResponse.d.ts +11 -0
  99. package/dist/cjs/api/types/UsageSummariesResponse.js +5 -0
  100. package/dist/cjs/api/types/UsageSummary.d.ts +58 -0
  101. package/dist/cjs/api/types/UsageSummary.js +5 -0
  102. package/dist/cjs/api/types/index.d.ts +15 -1
  103. package/dist/cjs/api/types/index.js +15 -1
  104. package/dist/cjs/index.d.ts +1 -0
  105. package/dist/cjs/index.js +4 -0
  106. package/dist/cjs/tracing/autoInstrumentation.d.ts +10 -0
  107. package/dist/cjs/tracing/autoInstrumentation.js +57 -0
  108. package/dist/cjs/tracing/index.d.ts +4 -0
  109. package/dist/cjs/tracing/index.js +12 -0
  110. package/dist/cjs/tracing/signal.d.ts +18 -1
  111. package/dist/cjs/tracing/signal.js +29 -13
  112. package/dist/cjs/tracing/spanProcessor.d.ts +10 -0
  113. package/dist/cjs/tracing/spanProcessor.js +82 -0
  114. package/dist/cjs/tracing/tracing.d.ts +12 -6
  115. package/dist/cjs/tracing/tracing.js +65 -58
  116. package/dist/cjs/tracing/tracingContext.d.ts +8 -0
  117. package/dist/cjs/tracing/tracingContext.js +28 -0
  118. package/dist/cjs/tracing/wrappers/anthropicWrapper.js +11 -7
  119. package/dist/cjs/tracing/wrappers/langchainCallback.js +11 -7
  120. package/dist/cjs/tracing/wrappers/mistralWrapper.js +11 -7
  121. package/dist/cjs/tracing/wrappers/openAiWrapper.js +24 -23
  122. package/dist/cjs/tracing/wrappers/vercelAIWrapper.js +68 -43
  123. package/dist/cjs/version.d.ts +1 -1
  124. package/dist/cjs/version.js +1 -1
  125. package/dist/esm/Client.d.mts +35 -3
  126. package/dist/esm/Client.mjs +54 -16
  127. package/dist/esm/api/errors/InternalServerError.d.mts +9 -0
  128. package/dist/esm/api/errors/InternalServerError.mjs +15 -0
  129. package/dist/esm/api/errors/index.d.mts +1 -0
  130. package/dist/esm/api/errors/index.mjs +1 -0
  131. package/dist/esm/api/index.d.mts +1 -1
  132. package/dist/esm/api/index.mjs +1 -1
  133. package/dist/esm/api/resources/agents/client/Client.d.mts +16 -0
  134. package/dist/esm/api/resources/agents/client/Client.mjs +16 -0
  135. package/dist/esm/api/resources/customers/client/Client.d.mts +38 -0
  136. package/dist/esm/api/resources/customers/client/Client.mjs +164 -0
  137. package/dist/esm/api/resources/customers/client/requests/CustomerCreate.d.mts +2 -0
  138. package/dist/esm/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.d.mts +30 -0
  139. package/dist/esm/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.d.mts +30 -0
  140. package/dist/esm/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.mjs +4 -0
  141. package/dist/esm/api/resources/customers/client/requests/index.d.mts +2 -0
  142. package/dist/esm/api/resources/index.d.mts +8 -1
  143. package/dist/esm/api/resources/index.mjs +8 -1
  144. package/dist/esm/api/resources/orders/client/requests/OrderCreate.d.mts +2 -0
  145. package/dist/esm/api/resources/orders/resources/lines/client/Client.d.mts +0 -2
  146. package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +0 -2
  147. package/dist/esm/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.mts +0 -2
  148. package/dist/esm/api/resources/plans/client/Client.d.mts +75 -0
  149. package/dist/esm/api/resources/plans/client/Client.mjs +232 -0
  150. package/dist/esm/api/resources/plans/client/index.d.mts +1 -0
  151. package/dist/esm/api/resources/plans/client/index.mjs +1 -0
  152. package/dist/esm/api/resources/plans/client/requests/PlansGetUsageRequest.d.mts +35 -0
  153. package/dist/esm/api/resources/plans/client/requests/PlansGetUsageRequest.mjs +4 -0
  154. package/dist/esm/api/resources/plans/client/requests/index.d.mts +1 -0
  155. package/dist/esm/api/resources/plans/client/requests/index.mjs +1 -0
  156. package/dist/esm/api/resources/plans/index.d.mts +1 -0
  157. package/dist/esm/api/resources/plans/index.mjs +1 -0
  158. package/dist/esm/api/resources/products/client/Client.d.mts +109 -0
  159. package/dist/esm/api/resources/products/client/Client.mjs +430 -0
  160. package/dist/esm/api/resources/products/client/index.d.mts +1 -0
  161. package/dist/esm/api/resources/products/client/index.mjs +1 -0
  162. package/dist/esm/api/resources/products/client/requests/ProductCreate.d.mts +29 -0
  163. package/dist/esm/api/resources/products/client/requests/ProductCreate.mjs +11 -0
  164. package/dist/esm/api/resources/products/client/requests/index.d.mts +1 -0
  165. package/dist/esm/api/resources/products/client/requests/index.mjs +1 -0
  166. package/dist/esm/api/resources/products/index.d.mts +1 -0
  167. package/dist/esm/api/resources/products/index.mjs +1 -0
  168. package/dist/esm/api/resources/traces/client/Client.d.mts +52 -0
  169. package/dist/esm/api/resources/traces/client/Client.mjs +126 -0
  170. package/dist/esm/api/resources/traces/client/index.d.mts +1 -0
  171. package/dist/esm/api/resources/traces/client/index.mjs +1 -0
  172. package/dist/esm/api/resources/traces/client/requests/GetTracesRequest.d.mts +50 -0
  173. package/dist/esm/api/resources/traces/client/requests/GetTracesRequest.mjs +4 -0
  174. package/dist/esm/api/resources/traces/client/requests/index.d.mts +1 -0
  175. package/dist/esm/api/resources/traces/client/requests/index.mjs +1 -0
  176. package/dist/esm/api/resources/traces/index.d.mts +1 -0
  177. package/dist/esm/api/resources/traces/index.mjs +1 -0
  178. package/dist/esm/api/resources/usage/client/Client.d.mts +47 -0
  179. package/dist/esm/api/resources/usage/client/Client.mjs +146 -0
  180. package/dist/esm/api/resources/usage/client/requests/UsageCheckUsageRequest.d.mts +28 -0
  181. package/dist/esm/api/resources/usage/client/requests/UsageCheckUsageRequest.mjs +4 -0
  182. package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.mts +29 -0
  183. package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkV2Request.mjs +4 -0
  184. package/dist/esm/api/resources/usage/client/requests/index.d.mts +2 -0
  185. package/dist/esm/api/resources/usage/index.d.mts +1 -0
  186. package/dist/esm/api/resources/usage/index.mjs +1 -0
  187. package/dist/esm/api/resources/usage/types/UsageCheckUsageResponse.d.mts +17 -0
  188. package/dist/esm/api/resources/usage/types/UsageCheckUsageResponse.mjs +4 -0
  189. package/dist/esm/api/resources/usage/types/index.d.mts +1 -0
  190. package/dist/esm/api/resources/usage/types/index.mjs +1 -0
  191. package/dist/esm/api/types/CostAmount.d.mts +12 -0
  192. package/dist/esm/api/types/CostAmount.mjs +4 -0
  193. package/dist/esm/api/types/CostTrace.d.mts +22 -0
  194. package/dist/esm/api/types/CostTrace.mjs +4 -0
  195. package/dist/esm/api/types/CostTracesResponse.d.mts +11 -0
  196. package/dist/esm/api/types/CostTracesResponse.mjs +4 -0
  197. package/dist/esm/api/types/Customer.d.mts +2 -0
  198. package/dist/esm/api/types/CustomerUpdate.d.mts +2 -0
  199. package/dist/esm/api/types/OrderLineAttributeCreateOne.d.mts +4 -0
  200. package/dist/esm/api/types/OrderLineAttributeCreateOne.mjs +4 -0
  201. package/dist/esm/api/types/OrderLineCreate.d.mts +10 -4
  202. package/dist/esm/api/types/PaginationMeta.d.mts +28 -0
  203. package/dist/esm/api/types/PaginationMeta.mjs +4 -0
  204. package/dist/esm/api/types/Plan.d.mts +58 -0
  205. package/dist/esm/api/types/Plan.mjs +4 -0
  206. package/dist/esm/api/types/PlanGroup.d.mts +23 -0
  207. package/dist/esm/api/types/PlanGroup.mjs +4 -0
  208. package/dist/esm/api/types/Product.d.mts +36 -0
  209. package/dist/esm/api/types/Product.mjs +11 -0
  210. package/dist/esm/api/types/ProductUpdate.d.mts +23 -0
  211. package/dist/esm/api/types/ProductUpdate.mjs +11 -0
  212. package/dist/esm/api/types/Signal.d.mts +7 -2
  213. package/dist/esm/api/types/SignalV2.d.mts +22 -0
  214. package/dist/esm/api/types/SignalV2.mjs +4 -0
  215. package/dist/esm/api/types/Trace.d.mts +26 -0
  216. package/dist/esm/api/types/Trace.mjs +4 -0
  217. package/dist/esm/api/types/TracesResponse.d.mts +11 -0
  218. package/dist/esm/api/types/TracesResponse.mjs +4 -0
  219. package/dist/esm/api/types/UsagePaginationMeta.d.mts +16 -0
  220. package/dist/esm/api/types/UsagePaginationMeta.mjs +4 -0
  221. package/dist/esm/api/types/UsageSummariesResponse.d.mts +11 -0
  222. package/dist/esm/api/types/UsageSummariesResponse.mjs +4 -0
  223. package/dist/esm/api/types/UsageSummary.d.mts +58 -0
  224. package/dist/esm/api/types/UsageSummary.mjs +4 -0
  225. package/dist/esm/api/types/index.d.mts +15 -1
  226. package/dist/esm/api/types/index.mjs +15 -1
  227. package/dist/esm/index.d.mts +1 -0
  228. package/dist/esm/index.mjs +1 -0
  229. package/dist/esm/tracing/autoInstrumentation.d.mts +10 -0
  230. package/dist/esm/tracing/autoInstrumentation.mjs +54 -0
  231. package/dist/esm/tracing/index.d.mts +4 -0
  232. package/dist/esm/tracing/index.mjs +4 -0
  233. package/dist/esm/tracing/signal.d.mts +18 -1
  234. package/dist/esm/tracing/signal.mjs +28 -12
  235. package/dist/esm/tracing/spanProcessor.d.mts +10 -0
  236. package/dist/esm/tracing/spanProcessor.mjs +78 -0
  237. package/dist/esm/tracing/tracing.d.mts +12 -6
  238. package/dist/esm/tracing/tracing.mjs +59 -52
  239. package/dist/esm/tracing/tracingContext.d.mts +8 -0
  240. package/dist/esm/tracing/tracingContext.mjs +23 -0
  241. package/dist/esm/tracing/wrappers/anthropicWrapper.mjs +11 -7
  242. package/dist/esm/tracing/wrappers/langchainCallback.mjs +11 -7
  243. package/dist/esm/tracing/wrappers/mistralWrapper.mjs +11 -7
  244. package/dist/esm/tracing/wrappers/openAiWrapper.mjs +24 -23
  245. package/dist/esm/tracing/wrappers/vercelAIWrapper.mjs +68 -43
  246. package/dist/esm/version.d.mts +1 -1
  247. package/dist/esm/version.mjs +1 -1
  248. package/package.json +18 -10
  249. package/reference.md +1147 -153
  250. package/dist/cjs/api/types/OrderLineAttributeCreate.d.ts +0 -12
  251. package/dist/esm/api/types/OrderLineAttributeCreate.d.mts +0 -12
  252. /package/dist/cjs/api/{types/OrderLineAttributeCreate.js → resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.js} +0 -0
  253. /package/dist/esm/api/{types/OrderLineAttributeCreate.mjs → resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.mjs} +0 -0
@@ -11,11 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PaidOpenAI = void 0;
13
13
  const api_1 = require("@opentelemetry/api");
14
- const tracing_js_1 = require("../tracing.js");
14
+ const tracing_js_1 = require("tracing/tracing.js");
15
+ const tracingContext_js_1 = require("tracing/tracingContext.js");
15
16
  class PaidOpenAI {
16
17
  constructor(openaiClient) {
17
18
  this.openai = openaiClient;
18
- this.tracer = tracing_js_1.paidTracer;
19
+ const tracer = (0, tracing_js_1.getPaidTracer)();
20
+ if (!tracer) {
21
+ throw new Error("Paid tracer is not initialized, Make sure to call 'initializeTracing()' first");
22
+ }
23
+ this.tracer = tracer;
19
24
  }
20
25
  get chat() {
21
26
  return new ChatWrapper(this.openai, this.tracer);
@@ -47,9 +52,8 @@ class ChatCompletionsWrapper {
47
52
  }
48
53
  create(params) {
49
54
  return __awaiter(this, void 0, void 0, function* () {
50
- const externalCustomerId = (0, tracing_js_1.getCustomerIdStorage)();
51
- const externalAgentId = (0, tracing_js_1.getAgentIdStorage)();
52
- const token = (0, tracing_js_1.getTokenStorage)();
55
+ const token = (0, tracing_js_1.getToken)();
56
+ const { externalProductId, externalCustomerId } = (0, tracingContext_js_1.getTracingContext)();
53
57
  if (!token || !externalCustomerId) {
54
58
  throw new Error("No token or externalCustomerId: This wrapper should be used inside a callback to paid.trace().");
55
59
  }
@@ -60,8 +64,8 @@ class ChatCompletionsWrapper {
60
64
  };
61
65
  attributes["external_customer_id"] = externalCustomerId;
62
66
  attributes["token"] = token;
63
- if (externalAgentId) {
64
- attributes["external_agent_id"] = externalAgentId;
67
+ if (externalProductId) {
68
+ attributes["external_agent_id"] = externalProductId;
65
69
  }
66
70
  span.setAttributes(attributes);
67
71
  try {
@@ -95,9 +99,8 @@ class ResponsesWrapper {
95
99
  }
96
100
  create(params) {
97
101
  return __awaiter(this, void 0, void 0, function* () {
98
- const externalCustomerId = (0, tracing_js_1.getCustomerIdStorage)();
99
- const externalAgentId = (0, tracing_js_1.getAgentIdStorage)();
100
- const token = (0, tracing_js_1.getTokenStorage)();
102
+ const { externalCustomerId, externalProductId } = (0, tracingContext_js_1.getTracingContext)();
103
+ const token = (0, tracing_js_1.getToken)();
101
104
  if (!token || !externalCustomerId) {
102
105
  throw new Error("No token or externalCustomerId: This wrapper should be used inside a callback to paid.trace().");
103
106
  }
@@ -109,8 +112,8 @@ class ResponsesWrapper {
109
112
  };
110
113
  attributes["external_customer_id"] = externalCustomerId;
111
114
  attributes["token"] = token;
112
- if (externalAgentId) {
113
- attributes["external_agent_id"] = externalAgentId;
115
+ if (externalProductId) {
116
+ attributes["external_agent_id"] = externalProductId;
114
117
  }
115
118
  span.setAttributes(attributes);
116
119
  try {
@@ -150,9 +153,8 @@ class EmbeddingsWrapper {
150
153
  }
151
154
  create(params) {
152
155
  return __awaiter(this, void 0, void 0, function* () {
153
- const externalCustomerId = (0, tracing_js_1.getCustomerIdStorage)();
154
- const externalAgentId = (0, tracing_js_1.getAgentIdStorage)();
155
- const token = (0, tracing_js_1.getTokenStorage)();
156
+ const { externalCustomerId, externalProductId } = (0, tracingContext_js_1.getTracingContext)();
157
+ const token = (0, tracing_js_1.getToken)();
156
158
  if (!token || !externalCustomerId) {
157
159
  throw new Error("No token or externalCustomerId: This wrapper should be used inside a callback to paid.trace().");
158
160
  }
@@ -163,8 +165,8 @@ class EmbeddingsWrapper {
163
165
  };
164
166
  attributes["external_customer_id"] = externalCustomerId;
165
167
  attributes["token"] = token;
166
- if (externalAgentId) {
167
- attributes["external_agent_id"] = externalAgentId;
168
+ if (externalProductId) {
169
+ attributes["external_agent_id"] = externalProductId;
168
170
  }
169
171
  span.setAttributes(attributes);
170
172
  try {
@@ -197,9 +199,8 @@ class ImagesWrapper {
197
199
  }
198
200
  generate(params) {
199
201
  return __awaiter(this, void 0, void 0, function* () {
200
- const externalCustomerId = (0, tracing_js_1.getCustomerIdStorage)();
201
- const externalAgentId = (0, tracing_js_1.getAgentIdStorage)();
202
- const token = (0, tracing_js_1.getTokenStorage)();
202
+ const { externalCustomerId, externalProductId } = (0, tracingContext_js_1.getTracingContext)();
203
+ const token = (0, tracing_js_1.getToken)();
203
204
  const model = params.model || "";
204
205
  if (!token || !externalCustomerId) {
205
206
  throw new Error("No token or externalCustomerId: This wrapper should be used inside a callback to paid.trace().");
@@ -213,12 +214,12 @@ class ImagesWrapper {
213
214
  };
214
215
  attributes["external_customer_id"] = externalCustomerId;
215
216
  attributes["token"] = token;
216
- if (externalAgentId) {
217
- attributes["external_agent_id"] = externalAgentId;
217
+ if (externalProductId) {
218
+ attributes["external_agent_id"] = externalProductId;
218
219
  }
219
220
  span.setAttributes(attributes);
220
221
  try {
221
- const response = yield this.openai.images.generate(params);
222
+ const response = (yield this.openai.images.generate(params));
222
223
  span.setAttributes({
223
224
  "gen_ai.image.count": (_a = params.n) !== null && _a !== void 0 ? _a : 1,
224
225
  "gen_ai.image.size": params.size || "",
@@ -16,28 +16,29 @@ exports.streamObject = streamObject;
16
16
  exports.embed = embed;
17
17
  exports.embedMany = embedMany;
18
18
  const api_1 = require("@opentelemetry/api");
19
- const tracing_js_1 = require("../tracing.js");
20
19
  const ai_1 = require("ai");
20
+ const tracing_js_1 = require("tracing/tracing.js");
21
+ const tracingContext_js_1 = require("tracing/tracingContext.js");
21
22
  function getModelInfo(model) {
22
23
  if (model === null || model === void 0 ? void 0 : model.modelId) {
23
24
  const modelId = model.modelId;
24
- if (modelId.startsWith('gpt-') || modelId.startsWith('text-embedding-') || modelId.startsWith('dall-e-')) {
25
- return { system: 'openai', modelName: modelId };
25
+ if (modelId.startsWith("gpt-") || modelId.startsWith("text-embedding-") || modelId.startsWith("dall-e-")) {
26
+ return { system: "openai", modelName: modelId };
26
27
  }
27
- if (modelId.startsWith('claude-')) {
28
- return { system: 'anthropic', modelName: modelId };
28
+ if (modelId.startsWith("claude-")) {
29
+ return { system: "anthropic", modelName: modelId };
29
30
  }
30
- if (modelId.startsWith('mistral-') || modelId.startsWith('codestral-')) {
31
- return { system: 'mistral', modelName: modelId };
31
+ if (modelId.startsWith("mistral-") || modelId.startsWith("codestral-")) {
32
+ return { system: "mistral", modelName: modelId };
32
33
  }
33
- if (modelId.includes('gemini')) {
34
- return { system: 'google', modelName: modelId };
34
+ if (modelId.includes("gemini")) {
35
+ return { system: "google", modelName: modelId };
35
36
  }
36
37
  }
37
38
  if (model === null || model === void 0 ? void 0 : model.provider) {
38
39
  return { system: model.provider, modelName: model.modelId };
39
40
  }
40
- return { system: 'unknown' };
41
+ return { system: "unknown" };
41
42
  }
42
43
  function extractUsageMetrics(usage) {
43
44
  const usageAttrs = {};
@@ -59,14 +60,14 @@ function extractUsageMetrics(usage) {
59
60
  return usageAttrs;
60
61
  }
61
62
  function validateContext() {
62
- const externalCustomerId = (0, tracing_js_1.getCustomerIdStorage)();
63
- const token = (0, tracing_js_1.getTokenStorage)();
63
+ const token = (0, tracing_js_1.getToken)();
64
+ const { externalCustomerId, externalProductId } = (0, tracingContext_js_1.getTracingContext)();
64
65
  if (!token || !externalCustomerId) {
65
66
  throw new Error("No token or externalCustomerId: This wrapper should be used inside a callback to paid.trace().");
66
67
  }
67
68
  return {
68
69
  externalCustomerId,
69
- externalAgentId: (0, tracing_js_1.getAgentIdStorage)(),
70
+ externalProductId,
70
71
  token,
71
72
  };
72
73
  }
@@ -74,16 +75,20 @@ function generateText(params) {
74
75
  return __awaiter(this, void 0, void 0, function* () {
75
76
  const context = validateContext();
76
77
  const { system: aiSystem, modelName } = getModelInfo(params.model);
77
- return tracing_js_1.paidTracer.startActiveSpan("trace.ai-sdk.generateText", (span) => __awaiter(this, void 0, void 0, function* () {
78
+ const tracer = (0, tracing_js_1.getPaidTracer)();
79
+ if (!tracer) {
80
+ throw new Error("Paid tracer is not initialized, Make sure to call 'initializeTracing()' first");
81
+ }
82
+ return tracer.startActiveSpan("trace.ai-sdk.generateText", (span) => __awaiter(this, void 0, void 0, function* () {
78
83
  var _a;
79
84
  const attributes = {
80
85
  "gen_ai.system": aiSystem,
81
86
  "gen_ai.operation.name": "chat",
82
- "external_customer_id": context.externalCustomerId,
83
- "token": context.token,
87
+ external_customer_id: context.externalCustomerId,
88
+ token: context.token,
84
89
  };
85
- if (context.externalAgentId) {
86
- attributes["external_agent_id"] = context.externalAgentId;
90
+ if (context.externalProductId) {
91
+ attributes["external_agent_id"] = context.externalProductId;
87
92
  }
88
93
  if (modelName) {
89
94
  attributes["gen_ai.request.model"] = modelName;
@@ -116,15 +121,19 @@ function streamText(params) {
116
121
  return __awaiter(this, void 0, void 0, function* () {
117
122
  const context = validateContext();
118
123
  const { system: aiSystem, modelName } = getModelInfo(params.model);
119
- return tracing_js_1.paidTracer.startActiveSpan("trace.ai-sdk.streamText", (span) => __awaiter(this, void 0, void 0, function* () {
124
+ const tracer = (0, tracing_js_1.getPaidTracer)();
125
+ if (!tracer) {
126
+ throw new Error("Paid tracer is not initialized, Make sure to call 'initializeTracing()' first");
127
+ }
128
+ return tracer.startActiveSpan("trace.ai-sdk.streamText", (span) => __awaiter(this, void 0, void 0, function* () {
120
129
  const attributes = {
121
130
  "gen_ai.system": aiSystem,
122
131
  "gen_ai.operation.name": "chat",
123
- "external_customer_id": context.externalCustomerId,
124
- "token": context.token,
132
+ external_customer_id: context.externalCustomerId,
133
+ token: context.token,
125
134
  };
126
- if (context.externalAgentId) {
127
- attributes["external_agent_id"] = context.externalAgentId;
135
+ if (context.externalProductId) {
136
+ attributes["external_agent_id"] = context.externalProductId;
128
137
  }
129
138
  if (modelName) {
130
139
  attributes["gen_ai.request.model"] = modelName;
@@ -161,16 +170,20 @@ function generateObject(params) {
161
170
  return __awaiter(this, void 0, void 0, function* () {
162
171
  const context = validateContext();
163
172
  const { system: aiSystem, modelName } = getModelInfo(params.model);
164
- return tracing_js_1.paidTracer.startActiveSpan("trace.ai-sdk.generateObject", (span) => __awaiter(this, void 0, void 0, function* () {
173
+ const tracer = (0, tracing_js_1.getPaidTracer)();
174
+ if (!tracer) {
175
+ throw new Error("Paid tracer is not initialized, Make sure to call 'initializeTracing()' first");
176
+ }
177
+ return tracer.startActiveSpan("trace.ai-sdk.generateObject", (span) => __awaiter(this, void 0, void 0, function* () {
165
178
  var _a;
166
179
  const attributes = {
167
180
  "gen_ai.system": aiSystem,
168
181
  "gen_ai.operation.name": "chat",
169
- "external_customer_id": context.externalCustomerId,
170
- "token": context.token,
182
+ external_customer_id: context.externalCustomerId,
183
+ token: context.token,
171
184
  };
172
- if (context.externalAgentId) {
173
- attributes["external_agent_id"] = context.externalAgentId;
185
+ if (context.externalProductId) {
186
+ attributes["external_agent_id"] = context.externalProductId;
174
187
  }
175
188
  if (modelName) {
176
189
  attributes["gen_ai.request.model"] = modelName;
@@ -203,15 +216,19 @@ function streamObject(params) {
203
216
  return __awaiter(this, void 0, void 0, function* () {
204
217
  const context = validateContext();
205
218
  const { system: aiSystem, modelName } = getModelInfo(params.model);
206
- return tracing_js_1.paidTracer.startActiveSpan("trace.ai-sdk.streamObject", (span) => __awaiter(this, void 0, void 0, function* () {
219
+ const tracer = (0, tracing_js_1.getPaidTracer)();
220
+ if (!tracer) {
221
+ throw new Error("Paid tracer is not initialized, Make sure to call 'initializeTracing()' first");
222
+ }
223
+ return tracer.startActiveSpan("trace.ai-sdk.streamObject", (span) => __awaiter(this, void 0, void 0, function* () {
207
224
  const attributes = {
208
225
  "gen_ai.system": aiSystem,
209
226
  "gen_ai.operation.name": "chat",
210
- "external_customer_id": context.externalCustomerId,
211
- "token": context.token,
227
+ external_customer_id: context.externalCustomerId,
228
+ token: context.token,
212
229
  };
213
- if (context.externalAgentId) {
214
- attributes["external_agent_id"] = context.externalAgentId;
230
+ if (context.externalProductId) {
231
+ attributes["external_agent_id"] = context.externalProductId;
215
232
  }
216
233
  if (modelName) {
217
234
  attributes["gen_ai.request.model"] = modelName;
@@ -245,15 +262,19 @@ function embed(params) {
245
262
  return __awaiter(this, void 0, void 0, function* () {
246
263
  const context = validateContext();
247
264
  const { system: aiSystem, modelName } = getModelInfo(params.model);
248
- return tracing_js_1.paidTracer.startActiveSpan("trace.ai-sdk.embed", (span) => __awaiter(this, void 0, void 0, function* () {
265
+ const tracer = (0, tracing_js_1.getPaidTracer)();
266
+ if (!tracer) {
267
+ throw new Error("Paid tracer is not initialized, Make sure to call 'initializeTracing()' first");
268
+ }
269
+ return tracer.startActiveSpan("trace.ai-sdk.embed", (span) => __awaiter(this, void 0, void 0, function* () {
249
270
  const attributes = {
250
271
  "gen_ai.system": aiSystem,
251
272
  "gen_ai.operation.name": "embeddings",
252
- "external_customer_id": context.externalCustomerId,
253
- "token": context.token,
273
+ external_customer_id: context.externalCustomerId,
274
+ token: context.token,
254
275
  };
255
- if (context.externalAgentId) {
256
- attributes["external_agent_id"] = context.externalAgentId;
276
+ if (context.externalProductId) {
277
+ attributes["external_agent_id"] = context.externalProductId;
257
278
  }
258
279
  if (modelName) {
259
280
  attributes["gen_ai.request.model"] = modelName;
@@ -283,15 +304,19 @@ function embedMany(params) {
283
304
  return __awaiter(this, void 0, void 0, function* () {
284
305
  const context = validateContext();
285
306
  const { system: aiSystem, modelName } = getModelInfo(params.model);
286
- return tracing_js_1.paidTracer.startActiveSpan("trace.ai-sdk.embedMany", (span) => __awaiter(this, void 0, void 0, function* () {
307
+ const tracer = (0, tracing_js_1.getPaidTracer)();
308
+ if (!tracer) {
309
+ throw new Error("Paid tracer is not initialized, Make sure to call 'initializeTracing()' first");
310
+ }
311
+ return tracer.startActiveSpan("trace.ai-sdk.embedMany", (span) => __awaiter(this, void 0, void 0, function* () {
287
312
  const attributes = {
288
313
  "gen_ai.system": aiSystem,
289
314
  "gen_ai.operation.name": "embeddings",
290
- "external_customer_id": context.externalCustomerId,
291
- "token": context.token,
315
+ external_customer_id: context.externalCustomerId,
316
+ token: context.token,
292
317
  };
293
- if (context.externalAgentId) {
294
- attributes["external_agent_id"] = context.externalAgentId;
318
+ if (context.externalProductId) {
319
+ attributes["external_agent_id"] = context.externalProductId;
295
320
  }
296
321
  if (modelName) {
297
322
  attributes["gen_ai.request.model"] = modelName;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.5.0-alpha3";
1
+ export declare const SDK_VERSION = "0.9.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.5.0-alpha3";
4
+ exports.SDK_VERSION = "0.9.0";
@@ -5,15 +5,19 @@ import * as environments from "./environments.mjs";
5
5
  import * as core from "./core/index.mjs";
6
6
  import { Customers } from "./api/resources/customers/client/Client.mjs";
7
7
  import { Agents } from "./api/resources/agents/client/Client.mjs";
8
+ import { Products } from "./api/resources/products/client/Client.mjs";
8
9
  import { Contacts } from "./api/resources/contacts/client/Client.mjs";
9
10
  import { Orders } from "./api/resources/orders/client/Client.mjs";
11
+ import { Plans } from "./api/resources/plans/client/Client.mjs";
10
12
  import { Usage } from "./wrapper/BatchUsage.mjs";
13
+ import { Traces } from "./api/resources/traces/client/Client.mjs";
14
+ import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
11
15
  export declare namespace PaidClient {
12
16
  interface Options {
13
17
  environment?: core.Supplier<environments.PaidEnvironment | string>;
14
18
  /** Specify a custom URL to connect the client to. */
15
19
  baseUrl?: core.Supplier<string>;
16
- token: core.Supplier<core.BearerToken>;
20
+ token?: core.Supplier<core.BearerToken | undefined>;
17
21
  /** Additional headers to include in requests. */
18
22
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
19
23
  }
@@ -32,18 +36,41 @@ export declare class PaidClient {
32
36
  protected readonly _options: PaidClient.Options;
33
37
  protected _customers: Customers | undefined;
34
38
  protected _agents: Agents | undefined;
39
+ protected _products: Products | undefined;
35
40
  protected _contacts: Contacts | undefined;
36
41
  protected _orders: Orders | undefined;
42
+ protected _plans: Plans | undefined;
37
43
  protected _usage: Usage | undefined;
38
- constructor(_options: PaidClient.Options);
44
+ protected _traces: Traces | undefined;
45
+ constructor(_options?: PaidClient.Options);
39
46
  get customers(): Customers;
40
47
  get agents(): Agents;
48
+ get products(): Products;
41
49
  get contacts(): Contacts;
42
50
  get orders(): Orders;
51
+ get plans(): Plans;
43
52
  get usage(): Usage;
53
+ get traces(): Traces;
54
+ /**
55
+ * @deprecated use the standalone 'initializeTracing' instead
56
+ */
44
57
  initializeTracing(collectorEndpoint?: string): Promise<void>;
45
- trace<T extends (...args: any[]) => any>(externalCustomerId: string, fn: T, externalAgentId?: string, ...args: Parameters<T>): Promise<ReturnType<T>>;
46
58
  /**
59
+ * @deprecated use the standalone 'trace()' instead
60
+ * Use this method to track actions like LLM costs and sending signals.
61
+ * The callback to this function is the work that you want to trace.
62
+ *
63
+ * @param externalCustomerId - The external customer ID
64
+ * @param fn - The callback function containing the work to be traced
65
+ * @param externalAgentId - @deprecated Use externalProductId instead
66
+ * @param externalProductId - The external product ID
67
+ * @param storePrompt - Whether to store the prompt (defaults to false)
68
+ * @param args - Arguments to pass to the callback function
69
+ * @returns The return value of the callback function
70
+ */
71
+ trace<T extends (...args: any[]) => any>(externalCustomerId: string, fn: T, externalAgentId?: string, externalProductId?: string, storePrompt?: boolean, ...args: Parameters<T>): Promise<ReturnType<T>>;
72
+ /**
73
+ * @deprecated use the standalone 'signal()' instead
47
74
  * Sends Paid signal. Needs to be called as part of callback to Paid.trace().
48
75
  * When enableCostTracing flag is on, signal is associated
49
76
  * with cost traces from the same Paid.trace() context.
@@ -63,4 +90,9 @@ export declare class PaidClient {
63
90
  signal(eventName: string): void;
64
91
  signal(eventName: string, data: Record<string, any>): void;
65
92
  signal(eventName: string, enableCostTracing: boolean, data?: Record<string, any>): void;
93
+ /**
94
+ * @deprecated use the standalone 'getPaidTracerProvider()' instead
95
+ * Export the tracer provider which user can use for his own tracing.
96
+ */
97
+ get tracerProvider(): NodeTracerProvider | undefined;
66
98
  }
@@ -14,18 +14,20 @@ import * as core from "./core/index.mjs";
14
14
  import { mergeHeaders } from "./core/headers.mjs";
15
15
  import { Customers } from "./api/resources/customers/client/Client.mjs";
16
16
  import { Agents } from "./api/resources/agents/client/Client.mjs";
17
+ import { Products } from "./api/resources/products/client/Client.mjs";
17
18
  import { Contacts } from "./api/resources/contacts/client/Client.mjs";
18
19
  import { Orders } from "./api/resources/orders/client/Client.mjs";
20
+ import { Plans } from "./api/resources/plans/client/Client.mjs";
19
21
  import { Usage } from "./wrapper/BatchUsage.mjs";
20
- import { _trace, _initializeTracing } from "./tracing/tracing.mjs";
21
- import { _signal } from "./tracing/signal.mjs";
22
+ import { Traces } from "./api/resources/traces/client/Client.mjs";
23
+ import { signal } from "./tracing/signal.mjs";
24
+ import { getPaidTracerProvider, initializeTracing, trace } from "./tracing/tracing.mjs";
22
25
  export class PaidClient {
23
- constructor(_options) {
26
+ constructor(_options = {}) {
24
27
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
25
28
  "X-Fern-Language": "JavaScript",
26
- "X-Fern-SDK-Name": "@paid-ai/paid-node",
27
- "X-Fern-SDK-Version": "0.5.0-alpha3",
28
- "User-Agent": "@paid-ai/paid-node/0.5.0-alpha3",
29
+ "X-Fern-SDK-Name": "",
30
+ "X-Fern-SDK-Version": "0.8.0",
29
31
  "X-Fern-Runtime": core.RUNTIME.type,
30
32
  "X-Fern-Runtime-Version": core.RUNTIME.version,
31
33
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -38,6 +40,10 @@ export class PaidClient {
38
40
  var _a;
39
41
  return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Agents(this._options)));
40
42
  }
43
+ get products() {
44
+ var _a;
45
+ return ((_a = this._products) !== null && _a !== void 0 ? _a : (this._products = new Products(this._options)));
46
+ }
41
47
  get contacts() {
42
48
  var _a;
43
49
  return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Contacts(this._options)));
@@ -46,40 +52,72 @@ export class PaidClient {
46
52
  var _a;
47
53
  return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Orders(this._options)));
48
54
  }
55
+ get plans() {
56
+ var _a;
57
+ return ((_a = this._plans) !== null && _a !== void 0 ? _a : (this._plans = new Plans(this._options)));
58
+ }
49
59
  get usage() {
50
60
  var _a;
51
61
  return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Usage(this._options)));
52
62
  }
53
- // Need to call this method before using tracing or creating wrappers.
63
+ get traces() {
64
+ var _a;
65
+ return ((_a = this._traces) !== null && _a !== void 0 ? _a : (this._traces = new Traces(this._options)));
66
+ }
67
+ /**
68
+ * @deprecated use the standalone 'initializeTracing' instead
69
+ */
54
70
  initializeTracing(collectorEndpoint) {
55
71
  return __awaiter(this, void 0, void 0, function* () {
56
72
  const tokenSupplier = this._options.token;
57
73
  const token = typeof tokenSupplier === "function" ? yield tokenSupplier() : tokenSupplier;
58
74
  const resolvedToken = yield Promise.resolve(token);
59
- _initializeTracing(resolvedToken, collectorEndpoint);
75
+ initializeTracing(resolvedToken, collectorEndpoint);
60
76
  });
61
77
  }
62
- // Use this method to track actions like LLM costs and sending signals.
63
- // The callback to this function is the work that you want to trace.
64
- trace(externalCustomerId, fn, externalAgentId, ...args) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- return yield _trace(externalCustomerId, fn, externalAgentId, ...args);
78
+ /**
79
+ * @deprecated use the standalone 'trace()' instead
80
+ * Use this method to track actions like LLM costs and sending signals.
81
+ * The callback to this function is the work that you want to trace.
82
+ *
83
+ * @param externalCustomerId - The external customer ID
84
+ * @param fn - The callback function containing the work to be traced
85
+ * @param externalAgentId - @deprecated Use externalProductId instead
86
+ * @param externalProductId - The external product ID
87
+ * @param storePrompt - Whether to store the prompt (defaults to false)
88
+ * @param args - Arguments to pass to the callback function
89
+ * @returns The return value of the callback function
90
+ */
91
+ trace(externalCustomerId_1, fn_1, externalAgentId_1, externalProductId_1) {
92
+ return __awaiter(this, arguments, void 0, function* (externalCustomerId, fn, externalAgentId, externalProductId, storePrompt = false, ...args) {
93
+ // TODO: remove this after deprecation and replace externalAgentId with externalProductId everywhere
94
+ if (externalProductId) {
95
+ externalAgentId = externalProductId;
96
+ }
97
+ return yield trace({ externalCustomerId, externalProductId: externalAgentId, storePrompt }, fn, ...args);
67
98
  });
68
99
  }
69
100
  signal(eventName, enableCostTracingOrData, data) {
70
101
  let enableCostTracing = false;
71
102
  let finalData;
72
- if (typeof enableCostTracingOrData === 'boolean') {
103
+ if (typeof enableCostTracingOrData === "boolean") {
73
104
  // Case: signal(eventName, boolean, data?)
74
105
  enableCostTracing = enableCostTracingOrData;
75
106
  finalData = data;
76
107
  }
77
- else if (typeof enableCostTracingOrData === 'object') {
108
+ else if (typeof enableCostTracingOrData === "object") {
78
109
  // Case: signal(eventName, data)
79
110
  enableCostTracing = false;
80
111
  finalData = enableCostTracingOrData;
81
112
  }
82
113
  // Case: signal(eventName) - both remain default/undefined
83
- return _signal(eventName, enableCostTracing, finalData);
114
+ return signal(eventName, enableCostTracing, finalData);
115
+ }
116
+ /**
117
+ * @deprecated use the standalone 'getPaidTracerProvider()' instead
118
+ * Export the tracer provider which user can use for his own tracing.
119
+ */
120
+ get tracerProvider() {
121
+ return getPaidTracerProvider();
84
122
  }
85
123
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../errors/index.mjs";
5
+ import * as Paid from "../index.mjs";
6
+ import * as core from "../../core/index.mjs";
7
+ export declare class InternalServerError extends errors.PaidError {
8
+ constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
9
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../errors/index.mjs";
5
+ export class InternalServerError extends errors.PaidError {
6
+ constructor(body, rawResponse) {
7
+ super({
8
+ message: "InternalServerError",
9
+ statusCode: 500,
10
+ body: body,
11
+ rawResponse: rawResponse,
12
+ });
13
+ Object.setPrototypeOf(this, InternalServerError.prototype);
14
+ }
15
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./ForbiddenError.mjs";
2
2
  export * from "./BadRequestError.mjs";
3
3
  export * from "./NotFoundError.mjs";
4
+ export * from "./InternalServerError.mjs";
@@ -1,3 +1,4 @@
1
1
  export * from "./ForbiddenError.mjs";
2
2
  export * from "./BadRequestError.mjs";
3
3
  export * from "./NotFoundError.mjs";
4
+ export * from "./InternalServerError.mjs";
@@ -1,3 +1,3 @@
1
+ export * from "./resources/index.mjs";
1
2
  export * from "./types/index.mjs";
2
3
  export * from "./errors/index.mjs";
3
- export * from "./resources/index.mjs";
@@ -1,3 +1,3 @@
1
+ export * from "./resources/index.mjs";
1
2
  export * from "./types/index.mjs";
2
3
  export * from "./errors/index.mjs";
3
- export * from "./resources/index.mjs";