scorecard-ai 0.5.4 → 0.6.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 (350) hide show
  1. package/Client.d.ts +9 -3
  2. package/Client.js +8 -3
  3. package/api/resources/index.d.ts +3 -1
  4. package/api/resources/index.js +4 -2
  5. package/api/resources/prompt/client/Client.d.ts +27 -22
  6. package/api/resources/prompt/client/Client.js +110 -99
  7. package/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
  8. package/api/resources/prompt/client/requests/index.d.ts +1 -0
  9. package/api/resources/run/client/Client.d.ts +6 -3
  10. package/api/resources/run/client/Client.js +26 -23
  11. package/api/resources/runMetric/client/Client.d.ts +4 -1
  12. package/api/resources/runMetric/client/Client.js +8 -7
  13. package/api/resources/score/client/Client.d.ts +5 -2
  14. package/api/resources/score/client/Client.js +18 -16
  15. package/api/resources/scoringConfig/client/Client.d.ts +62 -0
  16. package/{dist/api/resources/traces → api/resources/scoringConfig}/client/Client.js +114 -16
  17. package/api/resources/scoringConfig/client/index.d.ts +1 -0
  18. package/api/resources/scoringConfig/client/index.js +17 -0
  19. package/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
  20. package/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  21. package/api/resources/testcase/client/Client.d.ts +55 -3
  22. package/api/resources/testcase/client/Client.js +308 -22
  23. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  24. package/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  25. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  26. package/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  27. package/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  28. package/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
  29. package/api/resources/testcase/client/requests/index.d.ts +3 -0
  30. package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
  31. package/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
  32. package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
  33. package/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
  34. package/api/resources/testcase/types/index.d.ts +2 -0
  35. package/api/resources/testcase/types/index.js +2 -0
  36. package/api/resources/testrecord/client/Client.d.ts +5 -2
  37. package/api/resources/testrecord/client/Client.js +17 -15
  38. package/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
  39. package/api/resources/testset/client/Client.d.ts +24 -5
  40. package/api/resources/testset/client/Client.js +135 -36
  41. package/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -0
  42. package/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  43. package/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  44. package/api/resources/testset/client/requests/index.d.ts +1 -0
  45. package/api/resources/tracing/client/Client.d.ts +72 -0
  46. package/api/resources/tracing/client/Client.js +327 -0
  47. package/api/types/IngestionMethod.d.ts +8 -0
  48. package/api/types/IngestionMethod.js +10 -0
  49. package/api/types/ScoringConfig.d.ts +16 -0
  50. package/api/types/ScoringConfig.js +5 -0
  51. package/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
  52. package/api/types/TestcaseBatchDeletionResponse.js +5 -0
  53. package/api/types/Testrecord.d.ts +2 -0
  54. package/api/types/Trace.d.ts +2 -0
  55. package/api/types/index.d.ts +6 -4
  56. package/api/types/index.js +6 -4
  57. package/core/fetcher/Fetcher.d.ts +4 -1
  58. package/core/fetcher/Fetcher.js +19 -176
  59. package/core/fetcher/createRequestUrl.d.ts +1 -0
  60. package/core/fetcher/createRequestUrl.js +13 -0
  61. package/core/fetcher/getFetchFn.d.ts +4 -0
  62. package/core/fetcher/getFetchFn.js +59 -0
  63. package/core/fetcher/getRequestBody.d.ts +7 -0
  64. package/core/fetcher/getRequestBody.js +23 -0
  65. package/core/fetcher/getResponseBody.d.ts +1 -0
  66. package/core/fetcher/getResponseBody.js +52 -0
  67. package/core/fetcher/makeRequest.d.ts +1 -0
  68. package/core/fetcher/makeRequest.js +42 -0
  69. package/core/fetcher/requestWithRetries.d.ts +1 -0
  70. package/core/fetcher/requestWithRetries.js +32 -0
  71. package/core/fetcher/signals.d.ts +12 -0
  72. package/core/fetcher/signals.js +37 -0
  73. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  74. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  75. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  76. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  77. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  78. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  79. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  80. package/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  81. package/core/runtime/runtime.d.ts +2 -1
  82. package/core/runtime/runtime.js +12 -1
  83. package/core/schemas/Schema.d.ts +7 -4
  84. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  85. package/core/schemas/builders/lazy/lazy.js +8 -19
  86. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  87. package/core/schemas/builders/list/list.js +31 -44
  88. package/core/schemas/builders/object/object.js +90 -111
  89. package/core/schemas/builders/object/types.d.ts +2 -2
  90. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  91. package/core/schemas/builders/record/record.js +49 -60
  92. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  93. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  94. package/core/schemas/builders/set/set.js +6 -15
  95. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  96. package/core/schemas/builders/union/union.js +51 -62
  97. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  98. package/dist/Client.d.ts +9 -3
  99. package/dist/Client.js +8 -3
  100. package/dist/api/resources/index.d.ts +3 -1
  101. package/dist/api/resources/index.js +4 -2
  102. package/dist/api/resources/prompt/client/Client.d.ts +27 -22
  103. package/dist/api/resources/prompt/client/Client.js +110 -99
  104. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.d.ts +15 -0
  105. package/dist/api/resources/prompt/client/requests/PromptGetByNameRequest.js +5 -0
  106. package/dist/api/resources/prompt/client/requests/index.d.ts +1 -0
  107. package/dist/api/resources/run/client/Client.d.ts +6 -3
  108. package/dist/api/resources/run/client/Client.js +26 -23
  109. package/dist/api/resources/runMetric/client/Client.d.ts +4 -1
  110. package/dist/api/resources/runMetric/client/Client.js +8 -7
  111. package/dist/api/resources/score/client/Client.d.ts +5 -2
  112. package/dist/api/resources/score/client/Client.js +18 -16
  113. package/dist/api/resources/scoringConfig/client/Client.d.ts +62 -0
  114. package/{api/resources/traces → dist/api/resources/scoringConfig}/client/Client.js +114 -16
  115. package/dist/api/resources/scoringConfig/client/index.d.ts +1 -0
  116. package/dist/api/resources/scoringConfig/client/index.js +17 -0
  117. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +16 -0
  118. package/dist/api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +5 -0
  119. package/dist/api/resources/scoringConfig/client/requests/index.d.ts +1 -0
  120. package/dist/api/resources/scoringConfig/client/requests/index.js +2 -0
  121. package/dist/api/resources/testcase/client/Client.d.ts +55 -3
  122. package/dist/api/resources/testcase/client/Client.js +308 -22
  123. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +11 -0
  124. package/dist/api/resources/testcase/client/requests/TestcaseBatchCopyParams.js +5 -0
  125. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +11 -0
  126. package/dist/api/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +5 -0
  127. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  128. package/dist/api/resources/testcase/client/requests/TestcaseUpdateParams.js +5 -0
  129. package/dist/api/resources/testcase/client/requests/index.d.ts +3 -0
  130. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +5 -0
  131. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +5 -0
  132. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +5 -0
  133. package/dist/api/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +5 -0
  134. package/dist/api/resources/testcase/types/index.d.ts +2 -0
  135. package/dist/api/resources/testcase/types/index.js +2 -0
  136. package/dist/api/resources/testrecord/client/Client.d.ts +5 -2
  137. package/dist/api/resources/testrecord/client/Client.js +17 -15
  138. package/dist/api/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +2 -0
  139. package/dist/api/resources/testset/client/Client.d.ts +24 -5
  140. package/dist/api/resources/testset/client/Client.js +135 -36
  141. package/dist/api/resources/testset/client/requests/TestsetCreateParams.d.ts +6 -0
  142. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  143. package/dist/api/resources/testset/client/requests/TestsetUpdateParams.js +5 -0
  144. package/dist/api/resources/testset/client/requests/index.d.ts +1 -0
  145. package/dist/api/resources/tracing/client/Client.d.ts +72 -0
  146. package/dist/api/resources/tracing/client/Client.js +327 -0
  147. package/dist/api/resources/tracing/client/index.js +2 -0
  148. package/dist/api/types/IngestionMethod.d.ts +8 -0
  149. package/dist/api/types/IngestionMethod.js +10 -0
  150. package/dist/api/types/ScoringConfig.d.ts +16 -0
  151. package/dist/api/types/ScoringConfig.js +5 -0
  152. package/dist/api/types/TestcaseBatchDeletionResponse.d.ts +9 -0
  153. package/dist/api/types/TestcaseBatchDeletionResponse.js +5 -0
  154. package/dist/api/types/Testrecord.d.ts +2 -0
  155. package/dist/api/types/Trace.d.ts +2 -0
  156. package/dist/api/types/index.d.ts +6 -4
  157. package/dist/api/types/index.js +6 -4
  158. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  159. package/dist/core/fetcher/Fetcher.js +19 -176
  160. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  161. package/dist/core/fetcher/createRequestUrl.js +13 -0
  162. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  163. package/dist/core/fetcher/getFetchFn.js +59 -0
  164. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  165. package/dist/core/fetcher/getRequestBody.js +23 -0
  166. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  167. package/dist/core/fetcher/getResponseBody.js +52 -0
  168. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  169. package/dist/core/fetcher/makeRequest.js +42 -0
  170. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  171. package/dist/core/fetcher/requestWithRetries.js +32 -0
  172. package/dist/core/fetcher/signals.d.ts +12 -0
  173. package/dist/core/fetcher/signals.js +37 -0
  174. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
  175. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
  176. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  177. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  178. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  179. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
  180. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  181. package/dist/{serialization/resources/traces/client/get.js → core/fetcher/stream-wrappers/chooseStreamWrapper.js} +16 -6
  182. package/dist/core/runtime/runtime.d.ts +2 -1
  183. package/dist/core/runtime/runtime.js +12 -1
  184. package/dist/core/schemas/Schema.d.ts +7 -4
  185. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  186. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  187. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  188. package/dist/core/schemas/builders/list/list.js +31 -44
  189. package/dist/core/schemas/builders/object/object.js +90 -111
  190. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  191. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  192. package/dist/core/schemas/builders/record/record.js +49 -60
  193. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  194. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  195. package/dist/core/schemas/builders/set/set.js +6 -15
  196. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  197. package/dist/core/schemas/builders/union/union.js +51 -62
  198. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  199. package/dist/serialization/resources/index.d.ts +3 -1
  200. package/dist/serialization/resources/index.js +4 -2
  201. package/dist/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  202. package/dist/serialization/resources/scoringConfig/client/index.js +17 -0
  203. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
  204. package/dist/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
  205. package/dist/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  206. package/dist/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  207. package/dist/serialization/resources/scoringConfig/index.d.ts +1 -0
  208. package/dist/serialization/resources/scoringConfig/index.js +17 -0
  209. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  210. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  211. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  212. package/dist/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  213. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  214. package/dist/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  215. package/dist/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  216. package/dist/serialization/resources/testcase/client/requests/index.js +7 -1
  217. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  218. package/dist/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  219. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  220. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  221. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  222. package/dist/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  223. package/dist/serialization/resources/testcase/types/index.d.ts +2 -0
  224. package/dist/serialization/resources/testcase/types/index.js +2 -0
  225. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  226. package/dist/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  227. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  228. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  229. package/dist/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  230. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
  231. package/dist/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
  232. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  233. package/dist/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  234. package/dist/serialization/resources/testset/client/requests/index.d.ts +1 -0
  235. package/dist/serialization/resources/testset/client/requests/index.js +3 -1
  236. package/dist/serialization/resources/tracing/client/index.d.ts +1 -0
  237. package/{serialization/resources/traces → dist/serialization/resources/tracing}/client/index.js +2 -2
  238. package/dist/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  239. package/dist/serialization/resources/tracing/client/traces.js +32 -0
  240. package/dist/serialization/resources/tracing/index.d.ts +1 -0
  241. package/dist/serialization/resources/tracing/index.js +17 -0
  242. package/dist/serialization/types/IngestionMethod.d.ts +10 -0
  243. package/dist/serialization/types/IngestionMethod.js +31 -0
  244. package/dist/serialization/types/JsonObject.js +2 -10
  245. package/dist/serialization/types/JsonObjectInputValue.js +3 -11
  246. package/dist/serialization/types/JsonObjectOutputValue.js +3 -11
  247. package/dist/serialization/types/ScoringConfig.d.ts +20 -0
  248. package/dist/serialization/types/ScoringConfig.js +41 -0
  249. package/dist/serialization/types/Span.js +2 -10
  250. package/dist/serialization/types/TestCaseCustomInputsValue.js +2 -10
  251. package/dist/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  252. package/dist/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  253. package/dist/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  254. package/dist/serialization/types/Testrecord.d.ts +1 -0
  255. package/dist/serialization/types/Testrecord.js +1 -0
  256. package/dist/serialization/types/TestrecordCustomInputsValue.js +2 -10
  257. package/dist/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  258. package/dist/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  259. package/dist/serialization/types/Trace.d.ts +1 -0
  260. package/dist/serialization/types/Trace.js +2 -0
  261. package/dist/serialization/types/index.d.ts +6 -4
  262. package/dist/serialization/types/index.js +6 -4
  263. package/package.json +8 -2
  264. package/reference.md +657 -569
  265. package/serialization/resources/index.d.ts +3 -1
  266. package/serialization/resources/index.js +4 -2
  267. package/serialization/resources/scoringConfig/client/index.d.ts +1 -0
  268. package/serialization/resources/scoringConfig/client/index.js +17 -0
  269. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.d.ts +14 -0
  270. package/serialization/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js +35 -0
  271. package/serialization/resources/scoringConfig/client/requests/index.d.ts +1 -0
  272. package/serialization/resources/scoringConfig/client/requests/index.js +5 -0
  273. package/serialization/resources/scoringConfig/index.d.ts +1 -0
  274. package/serialization/resources/scoringConfig/index.js +17 -0
  275. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.d.ts +12 -0
  276. package/serialization/resources/testcase/client/requests/TestcaseBatchCopyParams.js +33 -0
  277. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.d.ts +12 -0
  278. package/serialization/resources/testcase/client/requests/TestcaseBatchDeleteParams.js +33 -0
  279. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.d.ts +18 -0
  280. package/serialization/resources/testcase/client/requests/TestcaseUpdateParams.js +43 -0
  281. package/serialization/resources/testcase/client/requests/index.d.ts +3 -0
  282. package/serialization/resources/testcase/client/requests/index.js +7 -1
  283. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomInputsValue.js +2 -10
  284. package/serialization/resources/testcase/types/TestcaseCreateParamsCustomLabelsValue.js +2 -10
  285. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.d.ts +11 -0
  286. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomInputsValue.js +40 -0
  287. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.d.ts +11 -0
  288. package/serialization/resources/testcase/types/TestcaseUpdateParamsCustomLabelsValue.js +40 -0
  289. package/serialization/resources/testcase/types/index.d.ts +2 -0
  290. package/serialization/resources/testcase/types/index.js +2 -0
  291. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.d.ts +1 -0
  292. package/serialization/resources/testrecord/client/requests/TestrecordCreateParams.js +1 -0
  293. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomInputsValue.js +2 -10
  294. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomLabelsValue.js +2 -10
  295. package/serialization/resources/testrecord/types/TestrecordCreateParamsCustomOutputsValue.js +2 -10
  296. package/serialization/resources/testset/client/requests/TestsetCreateParams.d.ts +4 -0
  297. package/serialization/resources/testset/client/requests/TestsetCreateParams.js +4 -0
  298. package/serialization/resources/testset/client/requests/TestsetUpdateParams.d.ts +16 -0
  299. package/serialization/resources/testset/client/requests/TestsetUpdateParams.js +37 -0
  300. package/serialization/resources/testset/client/requests/index.d.ts +1 -0
  301. package/serialization/resources/testset/client/requests/index.js +3 -1
  302. package/serialization/resources/tracing/client/index.d.ts +1 -0
  303. package/{dist/serialization/resources/traces → serialization/resources/tracing}/client/index.js +2 -2
  304. package/serialization/resources/{traces/client/get.d.ts → tracing/client/traces.d.ts} +3 -2
  305. package/serialization/resources/tracing/client/traces.js +32 -0
  306. package/serialization/resources/tracing/index.d.ts +1 -0
  307. package/serialization/resources/tracing/index.js +17 -0
  308. package/serialization/types/IngestionMethod.d.ts +10 -0
  309. package/serialization/types/IngestionMethod.js +31 -0
  310. package/serialization/types/JsonObject.js +2 -10
  311. package/serialization/types/JsonObjectInputValue.js +3 -11
  312. package/serialization/types/JsonObjectOutputValue.js +3 -11
  313. package/serialization/types/ScoringConfig.d.ts +20 -0
  314. package/serialization/types/ScoringConfig.js +41 -0
  315. package/serialization/types/Span.js +2 -10
  316. package/serialization/types/TestCaseCustomInputsValue.js +2 -10
  317. package/serialization/types/TestCaseCustomLabelsValue.js +2 -10
  318. package/serialization/types/TestcaseBatchDeletionResponse.d.ts +13 -0
  319. package/serialization/types/{TestCaseCreate.js → TestcaseBatchDeletionResponse.js} +4 -7
  320. package/serialization/types/Testrecord.d.ts +1 -0
  321. package/serialization/types/Testrecord.js +1 -0
  322. package/serialization/types/TestrecordCustomInputsValue.js +2 -10
  323. package/serialization/types/TestrecordCustomLabelsValue.js +2 -10
  324. package/serialization/types/TestrecordCustomOutputsValue.js +2 -10
  325. package/serialization/types/Trace.d.ts +1 -0
  326. package/serialization/types/Trace.js +2 -0
  327. package/serialization/types/index.d.ts +6 -4
  328. package/serialization/types/index.js +6 -4
  329. package/api/resources/traces/client/Client.d.ts +0 -40
  330. package/api/types/TestCaseCreate.d.ts +0 -10
  331. package/dist/api/resources/traces/client/Client.d.ts +0 -40
  332. package/dist/api/types/TestCaseCreate.d.ts +0 -10
  333. package/dist/serialization/resources/traces/client/index.d.ts +0 -1
  334. package/dist/serialization/types/TestCaseCreate.d.ts +0 -16
  335. package/serialization/resources/traces/client/index.d.ts +0 -1
  336. package/serialization/types/TestCaseCreate.d.ts +0 -16
  337. /package/api/{types/TestCaseCreate.js → resources/prompt/client/requests/PromptGetByNameRequest.js} +0 -0
  338. /package/{dist/api/types/TestCaseCreate.js → api/resources/scoringConfig/client/requests/ScoringConfigCreateParams.js} +0 -0
  339. /package/api/resources/{traces/client → scoringConfig/client/requests}/index.js +0 -0
  340. /package/api/resources/{traces → scoringConfig}/index.d.ts +0 -0
  341. /package/api/resources/{traces → scoringConfig}/index.js +0 -0
  342. /package/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  343. /package/{dist/api/resources/traces → api/resources/tracing}/client/index.js +0 -0
  344. /package/{dist/api/resources/traces → api/resources/tracing}/index.d.ts +0 -0
  345. /package/{dist/api/resources/traces → api/resources/tracing}/index.js +0 -0
  346. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.d.ts +0 -0
  347. /package/dist/{serialization/resources/traces → api/resources/scoringConfig}/index.js +0 -0
  348. /package/dist/api/resources/{traces → tracing}/client/index.d.ts +0 -0
  349. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.d.ts +0 -0
  350. /package/{serialization/resources/traces → dist/api/resources/tracing}/index.js +0 -0
@@ -62,7 +62,7 @@ class Testcase {
62
62
  * @throws {@link Scorecard.UnprocessableEntityError}
63
63
  *
64
64
  * @example
65
- * await scorecard.testcase.create(1)
65
+ * await client.testcase.create(1)
66
66
  */
67
67
  create(testsetId, request = {}, requestOptions) {
68
68
  var _a, _b;
@@ -70,15 +70,16 @@ class Testcase {
70
70
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
71
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase`),
72
72
  method: "POST",
73
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
74
74
  contentType: "application/json",
75
- body: yield serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
75
+ requestType: "json",
76
+ body: serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
76
77
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
77
78
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
78
79
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
79
80
  });
80
81
  if (_response.ok) {
81
- return yield serializers.TestCase.parseOrThrow(_response.body, {
82
+ return serializers.TestCase.parseOrThrow(_response.body, {
82
83
  unrecognizedObjectKeys: "passthrough",
83
84
  allowUnrecognizedUnionMembers: true,
84
85
  allowUnrecognizedEnumValues: true,
@@ -89,7 +90,7 @@ class Testcase {
89
90
  if (_response.error.reason === "status-code") {
90
91
  switch (_response.error.statusCode) {
91
92
  case 401:
92
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
93
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
93
94
  unrecognizedObjectKeys: "passthrough",
94
95
  allowUnrecognizedUnionMembers: true,
95
96
  allowUnrecognizedEnumValues: true,
@@ -97,7 +98,7 @@ class Testcase {
97
98
  breadcrumbsPrefix: ["response"],
98
99
  }));
99
100
  case 403:
100
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
101
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
101
102
  unrecognizedObjectKeys: "passthrough",
102
103
  allowUnrecognizedUnionMembers: true,
103
104
  allowUnrecognizedEnumValues: true,
@@ -105,7 +106,7 @@ class Testcase {
105
106
  breadcrumbsPrefix: ["response"],
106
107
  }));
107
108
  case 404:
108
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
109
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
109
110
  unrecognizedObjectKeys: "passthrough",
110
111
  allowUnrecognizedUnionMembers: true,
111
112
  allowUnrecognizedEnumValues: true,
@@ -113,7 +114,7 @@ class Testcase {
113
114
  breadcrumbsPrefix: ["response"],
114
115
  }));
115
116
  case 422:
116
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
117
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
117
118
  unrecognizedObjectKeys: "passthrough",
118
119
  allowUnrecognizedUnionMembers: true,
119
120
  allowUnrecognizedEnumValues: true,
@@ -155,7 +156,7 @@ class Testcase {
155
156
  * @throws {@link Scorecard.UnprocessableEntityError}
156
157
  *
157
158
  * @example
158
- * await scorecard.testcase.get(1, 1)
159
+ * await client.testcase.get(1, 1)
159
160
  */
160
161
  get(testcaseId, testsetId, requestOptions) {
161
162
  var _a, _b;
@@ -163,14 +164,15 @@ class Testcase {
163
164
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
164
165
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
165
166
  method: "GET",
166
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
167
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
167
168
  contentType: "application/json",
169
+ requestType: "json",
168
170
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
169
171
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
170
172
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
171
173
  });
172
174
  if (_response.ok) {
173
- return yield serializers.TestCase.parseOrThrow(_response.body, {
175
+ return serializers.TestCase.parseOrThrow(_response.body, {
174
176
  unrecognizedObjectKeys: "passthrough",
175
177
  allowUnrecognizedUnionMembers: true,
176
178
  allowUnrecognizedEnumValues: true,
@@ -181,7 +183,7 @@ class Testcase {
181
183
  if (_response.error.reason === "status-code") {
182
184
  switch (_response.error.statusCode) {
183
185
  case 401:
184
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
186
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
185
187
  unrecognizedObjectKeys: "passthrough",
186
188
  allowUnrecognizedUnionMembers: true,
187
189
  allowUnrecognizedEnumValues: true,
@@ -189,7 +191,7 @@ class Testcase {
189
191
  breadcrumbsPrefix: ["response"],
190
192
  }));
191
193
  case 403:
192
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
194
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
193
195
  unrecognizedObjectKeys: "passthrough",
194
196
  allowUnrecognizedUnionMembers: true,
195
197
  allowUnrecognizedEnumValues: true,
@@ -197,7 +199,7 @@ class Testcase {
197
199
  breadcrumbsPrefix: ["response"],
198
200
  }));
199
201
  case 404:
200
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
202
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
201
203
  unrecognizedObjectKeys: "passthrough",
202
204
  allowUnrecognizedUnionMembers: true,
203
205
  allowUnrecognizedEnumValues: true,
@@ -205,7 +207,7 @@ class Testcase {
205
207
  breadcrumbsPrefix: ["response"],
206
208
  }));
207
209
  case 422:
208
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
210
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
209
211
  unrecognizedObjectKeys: "passthrough",
210
212
  allowUnrecognizedUnionMembers: true,
211
213
  allowUnrecognizedEnumValues: true,
@@ -247,7 +249,7 @@ class Testcase {
247
249
  * @throws {@link Scorecard.UnprocessableEntityError}
248
250
  *
249
251
  * @example
250
- * await scorecard.testcase.delete(1, 1)
252
+ * await client.testcase.delete(1, 1)
251
253
  */
252
254
  delete(testcaseId, testsetId, requestOptions) {
253
255
  var _a, _b;
@@ -255,14 +257,15 @@ class Testcase {
255
257
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
256
258
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
257
259
  method: "DELETE",
258
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
260
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
259
261
  contentType: "application/json",
262
+ requestType: "json",
260
263
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
261
264
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
262
265
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
263
266
  });
264
267
  if (_response.ok) {
265
- return yield serializers.TestcaseDeletionResponse.parseOrThrow(_response.body, {
268
+ return serializers.TestcaseDeletionResponse.parseOrThrow(_response.body, {
266
269
  unrecognizedObjectKeys: "passthrough",
267
270
  allowUnrecognizedUnionMembers: true,
268
271
  allowUnrecognizedEnumValues: true,
@@ -273,7 +276,7 @@ class Testcase {
273
276
  if (_response.error.reason === "status-code") {
274
277
  switch (_response.error.statusCode) {
275
278
  case 401:
276
- throw new Scorecard.UnauthorizedError(yield serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
279
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
277
280
  unrecognizedObjectKeys: "passthrough",
278
281
  allowUnrecognizedUnionMembers: true,
279
282
  allowUnrecognizedEnumValues: true,
@@ -281,7 +284,7 @@ class Testcase {
281
284
  breadcrumbsPrefix: ["response"],
282
285
  }));
283
286
  case 403:
284
- throw new Scorecard.ForbiddenError(yield serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
287
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
285
288
  unrecognizedObjectKeys: "passthrough",
286
289
  allowUnrecognizedUnionMembers: true,
287
290
  allowUnrecognizedEnumValues: true,
@@ -289,7 +292,7 @@ class Testcase {
289
292
  breadcrumbsPrefix: ["response"],
290
293
  }));
291
294
  case 404:
292
- throw new Scorecard.NotFoundError(yield serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
295
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
293
296
  unrecognizedObjectKeys: "passthrough",
294
297
  allowUnrecognizedUnionMembers: true,
295
298
  allowUnrecognizedEnumValues: true,
@@ -297,7 +300,290 @@ class Testcase {
297
300
  breadcrumbsPrefix: ["response"],
298
301
  }));
299
302
  case 422:
300
- throw new Scorecard.UnprocessableEntityError(yield serializers.HttpValidationError.parseOrThrow(_response.error.body, {
303
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
304
+ unrecognizedObjectKeys: "passthrough",
305
+ allowUnrecognizedUnionMembers: true,
306
+ allowUnrecognizedEnumValues: true,
307
+ skipValidation: true,
308
+ breadcrumbsPrefix: ["response"],
309
+ }));
310
+ default:
311
+ throw new errors.ScorecardError({
312
+ statusCode: _response.error.statusCode,
313
+ body: _response.error.body,
314
+ });
315
+ }
316
+ }
317
+ switch (_response.error.reason) {
318
+ case "non-json":
319
+ throw new errors.ScorecardError({
320
+ statusCode: _response.error.statusCode,
321
+ body: _response.error.rawBody,
322
+ });
323
+ case "timeout":
324
+ throw new errors.ScorecardTimeoutError();
325
+ case "unknown":
326
+ throw new errors.ScorecardError({
327
+ message: _response.error.errorMessage,
328
+ });
329
+ }
330
+ });
331
+ }
332
+ /**
333
+ * Update a Testcase.
334
+ *
335
+ * @param {number} testcaseId - The ID of the Testcase to update.
336
+ * @param {number} testsetId - The ID of the Testset to retrieve the Testcase from.
337
+ * @param {Scorecard.TestcaseUpdateParams} request
338
+ * @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
339
+ *
340
+ * @throws {@link Scorecard.UnauthorizedError}
341
+ * @throws {@link Scorecard.ForbiddenError}
342
+ * @throws {@link Scorecard.NotFoundError}
343
+ * @throws {@link Scorecard.UnprocessableEntityError}
344
+ *
345
+ * @example
346
+ * await client.testcase.update(1, 1)
347
+ */
348
+ update(testcaseId, testsetId, request = {}, requestOptions) {
349
+ var _a, _b;
350
+ return __awaiter(this, void 0, void 0, function* () {
351
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
352
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
353
+ method: "PATCH",
354
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
355
+ contentType: "application/json",
356
+ requestType: "json",
357
+ body: serializers.TestcaseUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
358
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
359
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
360
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
361
+ });
362
+ if (_response.ok) {
363
+ return serializers.TestCase.parseOrThrow(_response.body, {
364
+ unrecognizedObjectKeys: "passthrough",
365
+ allowUnrecognizedUnionMembers: true,
366
+ allowUnrecognizedEnumValues: true,
367
+ skipValidation: true,
368
+ breadcrumbsPrefix: ["response"],
369
+ });
370
+ }
371
+ if (_response.error.reason === "status-code") {
372
+ switch (_response.error.statusCode) {
373
+ case 401:
374
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
375
+ unrecognizedObjectKeys: "passthrough",
376
+ allowUnrecognizedUnionMembers: true,
377
+ allowUnrecognizedEnumValues: true,
378
+ skipValidation: true,
379
+ breadcrumbsPrefix: ["response"],
380
+ }));
381
+ case 403:
382
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
383
+ unrecognizedObjectKeys: "passthrough",
384
+ allowUnrecognizedUnionMembers: true,
385
+ allowUnrecognizedEnumValues: true,
386
+ skipValidation: true,
387
+ breadcrumbsPrefix: ["response"],
388
+ }));
389
+ case 404:
390
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
391
+ unrecognizedObjectKeys: "passthrough",
392
+ allowUnrecognizedUnionMembers: true,
393
+ allowUnrecognizedEnumValues: true,
394
+ skipValidation: true,
395
+ breadcrumbsPrefix: ["response"],
396
+ }));
397
+ case 422:
398
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
399
+ unrecognizedObjectKeys: "passthrough",
400
+ allowUnrecognizedUnionMembers: true,
401
+ allowUnrecognizedEnumValues: true,
402
+ skipValidation: true,
403
+ breadcrumbsPrefix: ["response"],
404
+ }));
405
+ default:
406
+ throw new errors.ScorecardError({
407
+ statusCode: _response.error.statusCode,
408
+ body: _response.error.body,
409
+ });
410
+ }
411
+ }
412
+ switch (_response.error.reason) {
413
+ case "non-json":
414
+ throw new errors.ScorecardError({
415
+ statusCode: _response.error.statusCode,
416
+ body: _response.error.rawBody,
417
+ });
418
+ case "timeout":
419
+ throw new errors.ScorecardTimeoutError();
420
+ case "unknown":
421
+ throw new errors.ScorecardError({
422
+ message: _response.error.errorMessage,
423
+ });
424
+ }
425
+ });
426
+ }
427
+ /**
428
+ * Batch copy Testcases
429
+ *
430
+ * @param {number} testsetId - The ID of the Testset to create the Testcase in.
431
+ * @param {Scorecard.TestcaseBatchCopyParams} request
432
+ * @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
433
+ *
434
+ * @throws {@link Scorecard.UnauthorizedError}
435
+ * @throws {@link Scorecard.ForbiddenError}
436
+ * @throws {@link Scorecard.NotFoundError}
437
+ * @throws {@link Scorecard.UnprocessableEntityError}
438
+ *
439
+ * @example
440
+ * await client.testcase.batchCopy(1)
441
+ */
442
+ batchCopy(testsetId, request = {}, requestOptions) {
443
+ var _a, _b;
444
+ return __awaiter(this, void 0, void 0, function* () {
445
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
446
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/batch_copy`),
447
+ method: "POST",
448
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
449
+ contentType: "application/json",
450
+ requestType: "json",
451
+ body: serializers.TestcaseBatchCopyParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
452
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
453
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
454
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
455
+ });
456
+ if (_response.ok) {
457
+ return serializers.TestCase.parseOrThrow(_response.body, {
458
+ unrecognizedObjectKeys: "passthrough",
459
+ allowUnrecognizedUnionMembers: true,
460
+ allowUnrecognizedEnumValues: true,
461
+ skipValidation: true,
462
+ breadcrumbsPrefix: ["response"],
463
+ });
464
+ }
465
+ if (_response.error.reason === "status-code") {
466
+ switch (_response.error.statusCode) {
467
+ case 401:
468
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
469
+ unrecognizedObjectKeys: "passthrough",
470
+ allowUnrecognizedUnionMembers: true,
471
+ allowUnrecognizedEnumValues: true,
472
+ skipValidation: true,
473
+ breadcrumbsPrefix: ["response"],
474
+ }));
475
+ case 403:
476
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
477
+ unrecognizedObjectKeys: "passthrough",
478
+ allowUnrecognizedUnionMembers: true,
479
+ allowUnrecognizedEnumValues: true,
480
+ skipValidation: true,
481
+ breadcrumbsPrefix: ["response"],
482
+ }));
483
+ case 404:
484
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
485
+ unrecognizedObjectKeys: "passthrough",
486
+ allowUnrecognizedUnionMembers: true,
487
+ allowUnrecognizedEnumValues: true,
488
+ skipValidation: true,
489
+ breadcrumbsPrefix: ["response"],
490
+ }));
491
+ case 422:
492
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
493
+ unrecognizedObjectKeys: "passthrough",
494
+ allowUnrecognizedUnionMembers: true,
495
+ allowUnrecognizedEnumValues: true,
496
+ skipValidation: true,
497
+ breadcrumbsPrefix: ["response"],
498
+ }));
499
+ default:
500
+ throw new errors.ScorecardError({
501
+ statusCode: _response.error.statusCode,
502
+ body: _response.error.body,
503
+ });
504
+ }
505
+ }
506
+ switch (_response.error.reason) {
507
+ case "non-json":
508
+ throw new errors.ScorecardError({
509
+ statusCode: _response.error.statusCode,
510
+ body: _response.error.rawBody,
511
+ });
512
+ case "timeout":
513
+ throw new errors.ScorecardTimeoutError();
514
+ case "unknown":
515
+ throw new errors.ScorecardError({
516
+ message: _response.error.errorMessage,
517
+ });
518
+ }
519
+ });
520
+ }
521
+ /**
522
+ * Batch delete Testcases
523
+ *
524
+ * @param {number} testsetId - The ID of the Testset from which the Testcases will be deleted.
525
+ * @param {Scorecard.TestcaseBatchDeleteParams} request
526
+ * @param {Testcase.RequestOptions} requestOptions - Request-specific configuration.
527
+ *
528
+ * @throws {@link Scorecard.UnauthorizedError}
529
+ * @throws {@link Scorecard.ForbiddenError}
530
+ * @throws {@link Scorecard.NotFoundError}
531
+ * @throws {@link Scorecard.UnprocessableEntityError}
532
+ *
533
+ * @example
534
+ * await client.testcase.batchDelete(1)
535
+ */
536
+ batchDelete(testsetId, request = {}, requestOptions) {
537
+ var _a, _b;
538
+ return __awaiter(this, void 0, void 0, function* () {
539
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
540
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/batch_delete`),
541
+ method: "PATCH",
542
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.6.0", "User-Agent": "scorecard-ai/0.6.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
543
+ contentType: "application/json",
544
+ requestType: "json",
545
+ body: serializers.TestcaseBatchDeleteParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
546
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
547
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
548
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
549
+ });
550
+ if (_response.ok) {
551
+ return serializers.TestcaseBatchDeletionResponse.parseOrThrow(_response.body, {
552
+ unrecognizedObjectKeys: "passthrough",
553
+ allowUnrecognizedUnionMembers: true,
554
+ allowUnrecognizedEnumValues: true,
555
+ skipValidation: true,
556
+ breadcrumbsPrefix: ["response"],
557
+ });
558
+ }
559
+ if (_response.error.reason === "status-code") {
560
+ switch (_response.error.statusCode) {
561
+ case 401:
562
+ throw new Scorecard.UnauthorizedError(serializers.UnauthenticatedError.parseOrThrow(_response.error.body, {
563
+ unrecognizedObjectKeys: "passthrough",
564
+ allowUnrecognizedUnionMembers: true,
565
+ allowUnrecognizedEnumValues: true,
566
+ skipValidation: true,
567
+ breadcrumbsPrefix: ["response"],
568
+ }));
569
+ case 403:
570
+ throw new Scorecard.ForbiddenError(serializers.UnauthorizedErrorBody.parseOrThrow(_response.error.body, {
571
+ unrecognizedObjectKeys: "passthrough",
572
+ allowUnrecognizedUnionMembers: true,
573
+ allowUnrecognizedEnumValues: true,
574
+ skipValidation: true,
575
+ breadcrumbsPrefix: ["response"],
576
+ }));
577
+ case 404:
578
+ throw new Scorecard.NotFoundError(serializers.NotFoundErrorBody.parseOrThrow(_response.error.body, {
579
+ unrecognizedObjectKeys: "passthrough",
580
+ allowUnrecognizedUnionMembers: true,
581
+ allowUnrecognizedEnumValues: true,
582
+ skipValidation: true,
583
+ breadcrumbsPrefix: ["response"],
584
+ }));
585
+ case 422:
586
+ throw new Scorecard.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
301
587
  unrecognizedObjectKeys: "passthrough",
302
588
  allowUnrecognizedUnionMembers: true,
303
589
  allowUnrecognizedEnumValues: true,
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface TestcaseBatchCopyParams {
9
+ /** List of Testcase IDs to copy. */
10
+ ids?: number[];
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface TestcaseBatchDeleteParams {
9
+ /** List of Testcase IDs to delete. */
10
+ ids?: number[];
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Scorecard from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface TestcaseUpdateParams {
10
+ /** The user query to be executed. */
11
+ userQuery?: string;
12
+ /** The context to be used while generating the testcase. */
13
+ context?: string;
14
+ /** The ideal response to the user query. */
15
+ ideal?: string;
16
+ customInputs?: Record<string, Scorecard.TestcaseUpdateParamsCustomInputsValue | undefined>;
17
+ customLabels?: Record<string, Scorecard.TestcaseUpdateParamsCustomLabelsValue | undefined>;
18
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,4 @@
1
1
  export { type TestcaseCreateParams } from "./TestcaseCreateParams";
2
+ export { type TestcaseUpdateParams } from "./TestcaseUpdateParams";
3
+ export { type TestcaseBatchCopyParams } from "./TestcaseBatchCopyParams";
4
+ export { type TestcaseBatchDeleteParams } from "./TestcaseBatchDeleteParams";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Scorecard from "../../../index";
5
+ export declare type TestcaseUpdateParamsCustomInputsValue = Scorecard.FileUrl | Scorecard.JsonObject | string | number | number | boolean;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Scorecard from "../../../index";
5
+ export declare type TestcaseUpdateParamsCustomLabelsValue = Scorecard.FileUrl | Scorecard.JsonObject | string | number | number | boolean;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,4 @@
1
1
  export * from "./TestcaseCreateParamsCustomInputsValue";
2
2
  export * from "./TestcaseCreateParamsCustomLabelsValue";
3
+ export * from "./TestcaseUpdateParamsCustomInputsValue";
4
+ export * from "./TestcaseUpdateParamsCustomLabelsValue";
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./TestcaseCreateParamsCustomInputsValue"), exports);
18
18
  __exportStar(require("./TestcaseCreateParamsCustomLabelsValue"), exports);
19
+ __exportStar(require("./TestcaseUpdateParamsCustomInputsValue"), exports);
20
+ __exportStar(require("./TestcaseUpdateParamsCustomLabelsValue"), exports);
@@ -11,8 +11,11 @@ export declare namespace Testrecord {
11
11
  fetcher?: core.FetchFunction;
12
12
  }
13
13
  interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
14
15
  timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
15
17
  maxRetries?: number;
18
+ /** A hook to abort the request. */
16
19
  abortSignal?: AbortSignal;
17
20
  }
18
21
  }
@@ -32,7 +35,7 @@ export declare class Testrecord {
32
35
  * @throws {@link Scorecard.UnprocessableEntityError}
33
36
  *
34
37
  * @example
35
- * await scorecard.testrecord.get(1, 1)
38
+ * await client.testrecord.get(1, 1)
36
39
  */
37
40
  get(testrecordId: number, runId: number, requestOptions?: Testrecord.RequestOptions): Promise<Scorecard.Testrecord>;
38
41
  /**
@@ -48,7 +51,7 @@ export declare class Testrecord {
48
51
  * @throws {@link Scorecard.UnprocessableEntityError}
49
52
  *
50
53
  * @example
51
- * await scorecard.testrecord.create(1)
54
+ * await client.testrecord.create(1)
52
55
  */
53
56
  create(runId: number, request?: Scorecard.TestrecordCreateParams, requestOptions?: Testrecord.RequestOptions): Promise<Scorecard.Testrecord>;
54
57
  protected _getCustomAuthorizationHeaders(): Promise<{