scorecard-ai 0.4.0 → 0.5.3

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 (47) hide show
  1. package/Client.d.ts +2 -0
  2. package/api/resources/prompt/client/Client.d.ts +2 -0
  3. package/api/resources/prompt/client/Client.js +25 -20
  4. package/api/resources/run/client/Client.d.ts +2 -0
  5. package/api/resources/run/client/Client.js +15 -12
  6. package/api/resources/runMetric/client/Client.d.ts +2 -0
  7. package/api/resources/runMetric/client/Client.js +5 -4
  8. package/api/resources/score/client/Client.d.ts +2 -0
  9. package/api/resources/score/client/Client.js +10 -8
  10. package/api/resources/testcase/client/Client.d.ts +2 -0
  11. package/api/resources/testcase/client/Client.js +15 -12
  12. package/api/resources/testrecord/client/Client.d.ts +2 -0
  13. package/api/resources/testrecord/client/Client.js +10 -8
  14. package/api/resources/testset/client/Client.d.ts +2 -0
  15. package/api/resources/testset/client/Client.js +25 -20
  16. package/api/resources/traces/client/Client.d.ts +2 -0
  17. package/api/resources/traces/client/Client.js +5 -4
  18. package/core/fetcher/Fetcher.d.ts +1 -0
  19. package/core/fetcher/Fetcher.js +58 -7
  20. package/dist/Client.d.ts +2 -0
  21. package/dist/api/resources/prompt/client/Client.d.ts +2 -0
  22. package/dist/api/resources/prompt/client/Client.js +25 -20
  23. package/dist/api/resources/run/client/Client.d.ts +2 -0
  24. package/dist/api/resources/run/client/Client.js +15 -12
  25. package/dist/api/resources/runMetric/client/Client.d.ts +2 -0
  26. package/dist/api/resources/runMetric/client/Client.js +5 -4
  27. package/dist/api/resources/score/client/Client.d.ts +2 -0
  28. package/dist/api/resources/score/client/Client.js +10 -8
  29. package/dist/api/resources/testcase/client/Client.d.ts +2 -0
  30. package/dist/api/resources/testcase/client/Client.js +15 -12
  31. package/dist/api/resources/testrecord/client/Client.d.ts +2 -0
  32. package/dist/api/resources/testrecord/client/Client.js +10 -8
  33. package/dist/api/resources/testset/client/Client.d.ts +2 -0
  34. package/dist/api/resources/testset/client/Client.js +25 -20
  35. package/dist/api/resources/traces/client/Client.d.ts +2 -0
  36. package/dist/api/resources/traces/client/Client.js +5 -4
  37. package/dist/core/fetcher/Fetcher.d.ts +1 -0
  38. package/dist/core/fetcher/Fetcher.js +58 -7
  39. package/dist/telemetry.d.ts +6 -0
  40. package/dist/telemetry.js +65 -0
  41. package/dist/wrapper/ScorecardClient.d.ts +1 -8
  42. package/dist/wrapper/ScorecardClient.js +0 -12
  43. package/package.json +56 -2
  44. package/telemetry.d.ts +6 -0
  45. package/telemetry.js +65 -0
  46. package/wrapper/ScorecardClient.d.ts +1 -8
  47. package/wrapper/ScorecardClient.js +0 -12
@@ -64,15 +64,16 @@ class Traces {
64
64
  * await scorecard.traces.get("trace_id")
65
65
  */
66
66
  get(traceId, requestOptions) {
67
- var _a;
67
+ var _a, _b;
68
68
  return __awaiter(this, void 0, void 0, function* () {
69
- const _response = yield core.fetcher({
70
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}/spans`),
69
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/traces/${encodeURIComponent(traceId)}/spans`),
71
71
  method: "GET",
72
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
72
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
73
  contentType: "application/json",
74
74
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
75
75
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
76
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
76
77
  });
77
78
  if (_response.ok) {
78
79
  return yield serializers.traces.get.Response.parseOrThrow(_response.body, {
@@ -11,6 +11,7 @@ export declare namespace Fetcher {
11
11
  timeoutMs?: number;
12
12
  maxRetries?: number;
13
13
  withCredentials?: boolean;
14
+ abortSignal?: AbortSignal;
14
15
  responseType?: "json" | "blob" | "streaming" | "text";
15
16
  }
16
17
  type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
@@ -63,6 +63,9 @@ function fetcherImpl(args) {
63
63
  if (body instanceof Uint8Array) {
64
64
  return body;
65
65
  }
66
+ else if (args.contentType === "application/x-www-form-urlencoded" && typeof args.body === "string") {
67
+ return args.body;
68
+ }
66
69
  else {
67
70
  return JSON.stringify(body);
68
71
  }
@@ -96,20 +99,27 @@ function fetcherImpl(args) {
96
99
  ? fetch
97
100
  : (yield Promise.resolve().then(() => __importStar(require("node-fetch")))).default;
98
101
  const makeRequest = () => __awaiter(this, void 0, void 0, function* () {
99
- const controller = new AbortController();
100
- let abortId = undefined;
102
+ const signals = [];
103
+ // Add timeout signal
104
+ let timeoutAbortId = undefined;
101
105
  if (args.timeoutMs != null) {
102
- abortId = setTimeout(() => controller.abort(), args.timeoutMs);
106
+ const { signal, abortId } = getTimeoutSignal(args.timeoutMs);
107
+ timeoutAbortId = abortId;
108
+ signals.push(signal);
109
+ }
110
+ // Add arbitrary signal
111
+ if (args.abortSignal != null) {
112
+ signals.push(args.abortSignal);
103
113
  }
104
114
  const response = yield fetchFn(url, {
105
115
  method: args.method,
106
116
  headers,
107
117
  body,
108
- signal: controller.signal,
118
+ signal: anySignal(signals),
109
119
  credentials: args.withCredentials ? "include" : undefined,
110
120
  });
111
- if (abortId != null) {
112
- clearTimeout(abortId);
121
+ if (timeoutAbortId != null) {
122
+ clearTimeout(timeoutAbortId);
113
123
  }
114
124
  return response;
115
125
  });
@@ -175,7 +185,16 @@ function fetcherImpl(args) {
175
185
  }
176
186
  }
177
187
  catch (error) {
178
- if (error instanceof Error && error.name === "AbortError") {
188
+ if (args.abortSignal != null && args.abortSignal.aborted) {
189
+ return {
190
+ ok: false,
191
+ error: {
192
+ reason: "unknown",
193
+ errorMessage: "The user aborted a request",
194
+ },
195
+ };
196
+ }
197
+ else if (error instanceof Error && error.name === "AbortError") {
179
198
  return {
180
199
  ok: false,
181
200
  error: {
@@ -202,4 +221,36 @@ function fetcherImpl(args) {
202
221
  }
203
222
  });
204
223
  }
224
+ const TIMEOUT = "timeout";
225
+ function getTimeoutSignal(timeoutMs) {
226
+ const controller = new AbortController();
227
+ const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs);
228
+ return { signal: controller.signal, abortId };
229
+ }
230
+ /**
231
+ * Returns an abort signal that is getting aborted when
232
+ * at least one of the specified abort signals is aborted.
233
+ *
234
+ * Requires at least node.js 18.
235
+ */
236
+ function anySignal(...args) {
237
+ // Allowing signals to be passed either as array
238
+ // of signals or as multiple arguments.
239
+ const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args);
240
+ const controller = new AbortController();
241
+ for (const signal of signals) {
242
+ if (signal.aborted) {
243
+ // Exiting early if one of the signals
244
+ // is already aborted.
245
+ controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
246
+ break;
247
+ }
248
+ // Listening for signals and removing the listeners
249
+ // when at least one symbol is aborted.
250
+ signal.addEventListener("abort", () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
251
+ signal: controller.signal,
252
+ });
253
+ }
254
+ return controller.signal;
255
+ }
205
256
  exports.fetcher = fetcherImpl;
package/dist/Client.d.ts CHANGED
@@ -15,10 +15,12 @@ export declare namespace ScorecardClient {
15
15
  interface Options {
16
16
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
17
17
  apiKey: core.Supplier<string>;
18
+ fetcher?: core.FetchFunction;
18
19
  }
19
20
  interface RequestOptions {
20
21
  timeoutInSeconds?: number;
21
22
  maxRetries?: number;
23
+ abortSignal?: AbortSignal;
22
24
  }
23
25
  }
24
26
  export declare class ScorecardClient {
@@ -8,10 +8,12 @@ export declare namespace Prompt {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
10
  apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
11
12
  }
12
13
  interface RequestOptions {
13
14
  timeoutInSeconds?: number;
14
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
15
17
  }
16
18
  }
17
19
  export declare class Prompt {
@@ -92,16 +92,17 @@ class Prompt {
92
92
  * })
93
93
  */
94
94
  create(request, requestOptions) {
95
- var _a;
95
+ var _a, _b;
96
96
  return __awaiter(this, void 0, void 0, function* () {
97
- const _response = yield core.fetcher({
98
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/prompt"),
97
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
98
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/prompt"),
99
99
  method: "POST",
100
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
100
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
101
101
  contentType: "application/json",
102
102
  body: yield serializers.PromptCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
103
103
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
104
104
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
105
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
105
106
  });
106
107
  if (_response.ok) {
107
108
  return yield serializers.Prompt.parseOrThrow(_response.body, {
@@ -183,15 +184,16 @@ class Prompt {
183
184
  * await scorecard.prompt.get("id")
184
185
  */
185
186
  get(id, requestOptions) {
186
- var _a;
187
+ var _a, _b;
187
188
  return __awaiter(this, void 0, void 0, function* () {
188
- const _response = yield core.fetcher({
189
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
189
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
190
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
190
191
  method: "GET",
191
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
192
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
192
193
  contentType: "application/json",
193
194
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
194
195
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
196
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
195
197
  });
196
198
  if (_response.ok) {
197
199
  return yield serializers.Prompt.parseOrThrow(_response.body, {
@@ -273,15 +275,16 @@ class Prompt {
273
275
  * await scorecard.prompt.delete("id")
274
276
  */
275
277
  delete(id, requestOptions) {
276
- var _a;
278
+ var _a, _b;
277
279
  return __awaiter(this, void 0, void 0, function* () {
278
- const _response = yield core.fetcher({
279
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
280
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
281
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
280
282
  method: "DELETE",
281
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
283
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
282
284
  contentType: "application/json",
283
285
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
284
286
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
287
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
285
288
  });
286
289
  if (_response.ok) {
287
290
  return _response.body;
@@ -362,16 +365,17 @@ class Prompt {
362
365
  * })
363
366
  */
364
367
  update(id, request = {}, requestOptions) {
365
- var _a;
368
+ var _a, _b;
366
369
  return __awaiter(this, void 0, void 0, function* () {
367
- const _response = yield core.fetcher({
368
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
370
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
371
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/${encodeURIComponent(id)}`),
369
372
  method: "PATCH",
370
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
373
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
371
374
  contentType: "application/json",
372
375
  body: yield serializers.PromptUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
373
376
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
374
377
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
378
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
375
379
  });
376
380
  if (_response.ok) {
377
381
  return yield serializers.Prompt.parseOrThrow(_response.body, {
@@ -453,15 +457,16 @@ class Prompt {
453
457
  * await scorecard.prompt.getByName("name")
454
458
  */
455
459
  getByName(name, requestOptions) {
456
- var _a;
460
+ var _a, _b;
457
461
  return __awaiter(this, void 0, void 0, function* () {
458
- const _response = yield core.fetcher({
459
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/prompt/name/${encodeURIComponent(name)}`),
462
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
463
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/prompt/name/${encodeURIComponent(name)}`),
460
464
  method: "GET",
461
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
465
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
462
466
  contentType: "application/json",
463
467
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
464
468
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
469
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
465
470
  });
466
471
  if (_response.ok) {
467
472
  return yield serializers.Prompt.parseOrThrow(_response.body, {
@@ -8,10 +8,12 @@ export declare namespace Run {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
10
  apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
11
12
  }
12
13
  interface RequestOptions {
13
14
  timeoutInSeconds?: number;
14
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
15
17
  }
16
18
  }
17
19
  export declare class Run {
@@ -64,16 +64,17 @@ class Run {
64
64
  * await scorecard.run.create()
65
65
  */
66
66
  create(request = {}, requestOptions) {
67
- var _a;
67
+ var _a, _b;
68
68
  return __awaiter(this, void 0, void 0, function* () {
69
- const _response = yield core.fetcher({
70
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, "v1/run"),
69
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, "v1/run"),
71
71
  method: "POST",
72
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
72
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
73
  contentType: "application/json",
74
74
  body: yield serializers.RunCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
75
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
76
76
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
77
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
77
78
  });
78
79
  if (_response.ok) {
79
80
  return yield serializers.Run.parseOrThrow(_response.body, {
@@ -155,15 +156,16 @@ class Run {
155
156
  * await scorecard.run.get(1)
156
157
  */
157
158
  get(runId, requestOptions) {
158
- var _a;
159
+ var _a, _b;
159
160
  return __awaiter(this, void 0, void 0, function* () {
160
- const _response = yield core.fetcher({
161
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}`),
161
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
162
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}`),
162
163
  method: "GET",
163
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
164
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
164
165
  contentType: "application/json",
165
166
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
166
167
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
168
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
167
169
  });
168
170
  if (_response.ok) {
169
171
  return yield serializers.Run.parseOrThrow(_response.body, {
@@ -246,16 +248,17 @@ class Run {
246
248
  * await scorecard.run.updateStatus(1)
247
249
  */
248
250
  updateStatus(runId, request = {}, requestOptions) {
249
- var _a;
251
+ var _a, _b;
250
252
  return __awaiter(this, void 0, void 0, function* () {
251
- const _response = yield core.fetcher({
252
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/status`),
253
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
254
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/status`),
253
255
  method: "PATCH",
254
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
256
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
255
257
  contentType: "application/json",
256
258
  body: yield serializers.UpdateStatusParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
257
259
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
258
260
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
261
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
259
262
  });
260
263
  if (_response.ok) {
261
264
  return yield serializers.Run.parseOrThrow(_response.body, {
@@ -8,10 +8,12 @@ export declare namespace RunMetric {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
10
  apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
11
12
  }
12
13
  interface RequestOptions {
13
14
  timeoutInSeconds?: number;
14
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
15
17
  }
16
18
  }
17
19
  export declare class RunMetric {
@@ -64,15 +64,16 @@ class RunMetric {
64
64
  * await scorecard.runMetric.get(1)
65
65
  */
66
66
  get(runId, requestOptions) {
67
- var _a;
67
+ var _a, _b;
68
68
  return __awaiter(this, void 0, void 0, function* () {
69
- const _response = yield core.fetcher({
70
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run_metric/${encodeURIComponent(runId)}`),
69
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run_metric/${encodeURIComponent(runId)}`),
71
71
  method: "GET",
72
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
72
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
73
  contentType: "application/json",
74
74
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
75
75
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
76
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
76
77
  });
77
78
  if (_response.ok) {
78
79
  return yield serializers.runMetric.get.Response.parseOrThrow(_response.body, {
@@ -8,10 +8,12 @@ export declare namespace Score {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
10
  apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
11
12
  }
12
13
  interface RequestOptions {
13
14
  timeoutInSeconds?: number;
14
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
15
17
  }
16
18
  }
17
19
  export declare class Score {
@@ -68,16 +68,17 @@ class Score {
68
68
  * })
69
69
  */
70
70
  create(runId, testrecordId, request, requestOptions) {
71
- var _a;
71
+ var _a, _b;
72
72
  return __awaiter(this, void 0, void 0, function* () {
73
- const _response = yield core.fetcher({
74
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score`),
73
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
74
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score`),
75
75
  method: "POST",
76
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
76
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
77
77
  contentType: "application/json",
78
78
  body: yield serializers.ScoreCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
79
79
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
80
80
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
81
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
81
82
  });
82
83
  if (_response.ok) {
83
84
  return yield serializers.Grade.parseOrThrow(_response.body, {
@@ -162,16 +163,17 @@ class Score {
162
163
  * await scorecard.score.update(1, 1, 1)
163
164
  */
164
165
  update(runId, testrecordId, scoreId, request = {}, requestOptions) {
165
- var _a;
166
+ var _a, _b;
166
167
  return __awaiter(this, void 0, void 0, function* () {
167
- const _response = yield core.fetcher({
168
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score/${encodeURIComponent(scoreId)}`),
168
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
169
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}/score/${encodeURIComponent(scoreId)}`),
169
170
  method: "PATCH",
170
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
171
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
171
172
  contentType: "application/json",
172
173
  body: yield serializers.ScoreUpdateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
173
174
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
174
175
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
176
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
175
177
  });
176
178
  if (_response.ok) {
177
179
  return yield serializers.Grade.parseOrThrow(_response.body, {
@@ -8,10 +8,12 @@ export declare namespace Testcase {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
10
  apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
11
12
  }
12
13
  interface RequestOptions {
13
14
  timeoutInSeconds?: number;
14
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
15
17
  }
16
18
  }
17
19
  export declare class Testcase {
@@ -65,16 +65,17 @@ class Testcase {
65
65
  * await scorecard.testcase.create(1)
66
66
  */
67
67
  create(testsetId, request = {}, requestOptions) {
68
- var _a;
68
+ var _a, _b;
69
69
  return __awaiter(this, void 0, void 0, function* () {
70
- const _response = yield core.fetcher({
71
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase`),
70
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
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.4.0", "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.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
74
74
  contentType: "application/json",
75
75
  body: yield serializers.TestcaseCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
76
76
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
77
77
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
78
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
78
79
  });
79
80
  if (_response.ok) {
80
81
  return yield serializers.TestCase.parseOrThrow(_response.body, {
@@ -157,15 +158,16 @@ class Testcase {
157
158
  * await scorecard.testcase.get(1, 1)
158
159
  */
159
160
  get(testcaseId, testsetId, requestOptions) {
160
- var _a;
161
+ var _a, _b;
161
162
  return __awaiter(this, void 0, void 0, function* () {
162
- const _response = yield core.fetcher({
163
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
163
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
164
+ 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)}`),
164
165
  method: "GET",
165
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
166
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
166
167
  contentType: "application/json",
167
168
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
168
169
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
170
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
171
  });
170
172
  if (_response.ok) {
171
173
  return yield serializers.TestCase.parseOrThrow(_response.body, {
@@ -248,15 +250,16 @@ class Testcase {
248
250
  * await scorecard.testcase.delete(1, 1)
249
251
  */
250
252
  delete(testcaseId, testsetId, requestOptions) {
251
- var _a;
253
+ var _a, _b;
252
254
  return __awaiter(this, void 0, void 0, function* () {
253
- const _response = yield core.fetcher({
254
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/testset/${encodeURIComponent(testsetId)}/testcase/${encodeURIComponent(testcaseId)}`),
255
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
256
+ 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)}`),
255
257
  method: "DELETE",
256
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
258
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
257
259
  contentType: "application/json",
258
260
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
259
261
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
262
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
260
263
  });
261
264
  if (_response.ok) {
262
265
  return yield serializers.TestcaseDeletionResponse.parseOrThrow(_response.body, {
@@ -8,10 +8,12 @@ export declare namespace Testrecord {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
10
  apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
11
12
  }
12
13
  interface RequestOptions {
13
14
  timeoutInSeconds?: number;
14
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
15
17
  }
16
18
  }
17
19
  export declare class Testrecord {
@@ -65,15 +65,16 @@ class Testrecord {
65
65
  * await scorecard.testrecord.get(1, 1)
66
66
  */
67
67
  get(testrecordId, runId, requestOptions) {
68
- var _a;
68
+ var _a, _b;
69
69
  return __awaiter(this, void 0, void 0, function* () {
70
- const _response = yield core.fetcher({
71
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}`),
70
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord/${encodeURIComponent(testrecordId)}`),
72
72
  method: "GET",
73
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "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.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
74
74
  contentType: "application/json",
75
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
76
76
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
77
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
77
78
  });
78
79
  if (_response.ok) {
79
80
  return yield serializers.Testrecord.parseOrThrow(_response.body, {
@@ -156,16 +157,17 @@ class Testrecord {
156
157
  * await scorecard.testrecord.create(1)
157
158
  */
158
159
  create(runId, request = {}, requestOptions) {
159
- var _a;
160
+ var _a, _b;
160
161
  return __awaiter(this, void 0, void 0, function* () {
161
- const _response = yield core.fetcher({
162
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord`),
162
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
163
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ScorecardEnvironment.Default, `v1/run/${encodeURIComponent(runId)}/testrecord`),
163
164
  method: "POST",
164
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.4.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
165
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "scorecard-ai", "X-Fern-SDK-Version": "0.5.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
165
166
  contentType: "application/json",
166
167
  body: yield serializers.TestrecordCreateParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
167
168
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
168
169
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
170
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
171
  });
170
172
  if (_response.ok) {
171
173
  return yield serializers.Testrecord.parseOrThrow(_response.body, {
@@ -8,10 +8,12 @@ export declare namespace Testset {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.ScorecardEnvironment | string>;
10
10
  apiKey: core.Supplier<string>;
11
+ fetcher?: core.FetchFunction;
11
12
  }
12
13
  interface RequestOptions {
13
14
  timeoutInSeconds?: number;
14
15
  maxRetries?: number;
16
+ abortSignal?: AbortSignal;
15
17
  }
16
18
  }
17
19
  export declare class Testset {