@credal/sdk 0.1.14 → 0.1.16

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 (65) hide show
  1. package/dist/cjs/BaseClient.d.ts +7 -7
  2. package/dist/cjs/BaseClient.js +7 -3
  3. package/dist/cjs/Client.d.ts +1 -2
  4. package/dist/cjs/api/resources/copilots/client/Client.d.ts +1 -2
  5. package/dist/cjs/api/resources/copilots/client/Client.js +11 -150
  6. package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +1 -2
  7. package/dist/cjs/api/resources/documentCatalog/client/Client.js +5 -60
  8. package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +1 -2
  9. package/dist/cjs/api/resources/documentCollections/client/Client.js +8 -105
  10. package/dist/cjs/api/resources/search/client/Client.d.ts +1 -2
  11. package/dist/cjs/api/resources/search/client/Client.js +2 -15
  12. package/dist/cjs/api/resources/users/client/Client.d.ts +1 -2
  13. package/dist/cjs/api/resources/users/client/Client.js +2 -15
  14. package/dist/cjs/auth/BearerAuthProvider.d.ts +4 -2
  15. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  16. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  17. package/dist/cjs/core/auth/index.d.ts +1 -0
  18. package/dist/cjs/core/auth/index.js +3 -1
  19. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  20. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
  21. package/dist/cjs/core/fetcher/Fetcher.js +2 -1
  22. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  23. package/dist/cjs/core/fetcher/signals.d.ts +1 -1
  24. package/dist/cjs/core/runtime/runtime.js +11 -10
  25. package/dist/cjs/errors/CredalError.js +5 -1
  26. package/dist/cjs/errors/CredalTimeoutError.js +5 -1
  27. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  28. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/esm/BaseClient.d.mts +7 -7
  32. package/dist/esm/BaseClient.mjs +7 -3
  33. package/dist/esm/Client.d.mts +1 -2
  34. package/dist/esm/api/resources/copilots/client/Client.d.mts +1 -2
  35. package/dist/esm/api/resources/copilots/client/Client.mjs +11 -150
  36. package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +1 -2
  37. package/dist/esm/api/resources/documentCatalog/client/Client.mjs +5 -60
  38. package/dist/esm/api/resources/documentCollections/client/Client.d.mts +1 -2
  39. package/dist/esm/api/resources/documentCollections/client/Client.mjs +8 -105
  40. package/dist/esm/api/resources/search/client/Client.d.mts +1 -2
  41. package/dist/esm/api/resources/search/client/Client.mjs +2 -15
  42. package/dist/esm/api/resources/users/client/Client.d.mts +1 -2
  43. package/dist/esm/api/resources/users/client/Client.mjs +2 -15
  44. package/dist/esm/auth/BearerAuthProvider.d.mts +4 -2
  45. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  46. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  47. package/dist/esm/core/auth/index.d.mts +1 -0
  48. package/dist/esm/core/auth/index.mjs +1 -0
  49. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  50. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
  51. package/dist/esm/core/fetcher/Fetcher.mjs +2 -1
  52. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  53. package/dist/esm/core/fetcher/signals.d.mts +1 -1
  54. package/dist/esm/core/runtime/runtime.mjs +11 -10
  55. package/dist/esm/errors/CredalError.mjs +5 -1
  56. package/dist/esm/errors/CredalTimeoutError.mjs +5 -1
  57. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  58. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  59. package/dist/esm/version.d.mts +1 -1
  60. package/dist/esm/version.mjs +1 -1
  61. package/package.json +5 -2
  62. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  63. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  64. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  65. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"
3
3
  import * as core from "../../../../core/index.js";
4
4
  import type * as Credal from "../../../index.js";
5
5
  export declare namespace UsersClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }
@@ -48,6 +48,7 @@ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
48
  const headers_js_1 = require("../../../../core/headers.js");
49
49
  const core = __importStar(require("../../../../core/index.js"));
50
50
  const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
51
52
  const errors = __importStar(require("../../../../errors/index.js"));
52
53
  class UsersClient {
53
54
  constructor(options = {}) {
@@ -106,21 +107,7 @@ class UsersClient {
106
107
  rawResponse: _response.rawResponse,
107
108
  });
108
109
  }
109
- switch (_response.error.reason) {
110
- case "non-json":
111
- throw new errors.CredalError({
112
- statusCode: _response.error.statusCode,
113
- body: _response.error.rawBody,
114
- rawResponse: _response.rawResponse,
115
- });
116
- case "timeout":
117
- throw new errors.CredalTimeoutError("Timeout exceeded when calling PATCH /v0/users/metadata.");
118
- case "unknown":
119
- throw new errors.CredalError({
120
- message: _response.error.errorMessage,
121
- rawResponse: _response.rawResponse,
122
- });
123
- }
110
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v0/users/metadata");
124
111
  });
125
112
  }
126
113
  }
@@ -1,7 +1,9 @@
1
1
  import * as core from "../core/index.js";
2
2
  export declare namespace BearerAuthProvider {
3
- interface Options {
4
- apiKey?: core.Supplier<core.BearerToken | undefined>;
3
+ interface AuthOptions {
4
+ apiKey?: core.Supplier<core.BearerToken> | undefined;
5
+ }
6
+ interface Options extends AuthOptions {
5
7
  }
6
8
  }
7
9
  export declare class BearerAuthProvider implements core.AuthProvider {
@@ -0,0 +1,5 @@
1
+ import type { AuthProvider } from "./AuthProvider.js";
2
+ import type { AuthRequest } from "./AuthRequest.js";
3
+ export declare class NoOpAuthProvider implements AuthProvider {
4
+ getAuthRequest(): Promise<AuthRequest>;
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NoOpAuthProvider = void 0;
4
+ class NoOpAuthProvider {
5
+ getAuthRequest() {
6
+ return Promise.resolve({ headers: {} });
7
+ }
8
+ }
9
+ exports.NoOpAuthProvider = NoOpAuthProvider;
@@ -2,3 +2,4 @@ export type { AuthProvider } from "./AuthProvider.js";
2
2
  export type { AuthRequest } from "./AuthRequest.js";
3
3
  export { BasicAuth } from "./BasicAuth.js";
4
4
  export { BearerToken } from "./BearerToken.js";
5
+ export { NoOpAuthProvider } from "./NoOpAuthProvider.js";
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BearerToken = exports.BasicAuth = void 0;
3
+ exports.NoOpAuthProvider = exports.BearerToken = exports.BasicAuth = void 0;
4
4
  var BasicAuth_js_1 = require("./BasicAuth.js");
5
5
  Object.defineProperty(exports, "BasicAuth", { enumerable: true, get: function () { return BasicAuth_js_1.BasicAuth; } });
6
6
  var BearerToken_js_1 = require("./BearerToken.js");
7
7
  Object.defineProperty(exports, "BearerToken", { enumerable: true, get: function () { return BearerToken_js_1.BearerToken; } });
8
+ var NoOpAuthProvider_js_1 = require("./NoOpAuthProvider.js");
9
+ Object.defineProperty(exports, "NoOpAuthProvider", { enumerable: true, get: function () { return NoOpAuthProvider_js_1.NoOpAuthProvider; } });
@@ -1,20 +1,19 @@
1
- import type { ResponseWithBody } from "./ResponseWithBody.js";
2
1
  export type BinaryResponse = {
3
2
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
4
- bodyUsed: boolean;
3
+ bodyUsed: Response["bodyUsed"];
5
4
  /**
6
5
  * Returns a ReadableStream of the response body.
7
6
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body)
8
7
  */
9
- stream: () => ReadableStream<Uint8Array>;
8
+ stream: () => Response["body"];
10
9
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */
11
- arrayBuffer: () => Promise<ArrayBuffer>;
10
+ arrayBuffer: () => ReturnType<Response["arrayBuffer"]>;
12
11
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */
13
- blob: () => Promise<Blob>;
12
+ blob: () => ReturnType<Response["blob"]>;
14
13
  /**
15
14
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes)
16
15
  * Some versions of the Fetch API may not support this method.
17
16
  */
18
- bytes?(): Promise<Uint8Array>;
17
+ bytes?(): ReturnType<Response["bytes"]>;
19
18
  };
20
- export declare function getBinaryResponse(response: ResponseWithBody): BinaryResponse;
19
+ export declare function getBinaryResponse(response: Response): BinaryResponse;
@@ -22,7 +22,7 @@ export declare namespace Fetcher {
22
22
  fetchFn?: typeof fetch;
23
23
  logging?: LogConfig | Logger;
24
24
  }
25
- type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
25
+ type Error = FailedStatusCodeError | NonJsonError | BodyIsNullError | TimeoutError | UnknownError;
26
26
  interface FailedStatusCodeError {
27
27
  reason: "status-code";
28
28
  statusCode: number;
@@ -33,6 +33,10 @@ export declare namespace Fetcher {
33
33
  statusCode: number;
34
34
  rawBody: string;
35
35
  }
36
+ interface BodyIsNullError {
37
+ reason: "body-is-null";
38
+ statusCode: number;
39
+ }
36
40
  interface TimeoutError {
37
41
  reason: "timeout";
38
42
  }
@@ -212,9 +212,10 @@ function fetcherImpl(args) {
212
212
  };
213
213
  logger.debug("HTTP request succeeded", metadata);
214
214
  }
215
+ const body = yield (0, getResponseBody_js_1.getResponseBody)(response, args.responseType);
215
216
  return {
216
217
  ok: true,
217
- body: (yield (0, getResponseBody_js_1.getResponseBody)(response, args.responseType)),
218
+ body: body,
218
219
  headers: response.headers,
219
220
  rawResponse: (0, RawResponse_js_1.toRawResponse)(response),
220
221
  };
@@ -12,12 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getResponseBody = getResponseBody;
13
13
  const json_js_1 = require("../json.js");
14
14
  const BinaryResponse_js_1 = require("./BinaryResponse.js");
15
- const ResponseWithBody_js_1 = require("./ResponseWithBody.js");
16
15
  function getResponseBody(response, responseType) {
17
16
  return __awaiter(this, void 0, void 0, function* () {
18
- if (!(0, ResponseWithBody_js_1.isResponseWithBody)(response)) {
19
- return undefined;
20
- }
21
17
  switch (responseType) {
22
18
  case "binary-response":
23
19
  return (0, BinaryResponse_js_1.getBinaryResponse)(response);
@@ -26,8 +22,26 @@ function getResponseBody(response, responseType) {
26
22
  case "arrayBuffer":
27
23
  return yield response.arrayBuffer();
28
24
  case "sse":
25
+ if (response.body == null) {
26
+ return {
27
+ ok: false,
28
+ error: {
29
+ reason: "body-is-null",
30
+ statusCode: response.status,
31
+ },
32
+ };
33
+ }
29
34
  return response.body;
30
35
  case "streaming":
36
+ if (response.body == null) {
37
+ return {
38
+ ok: false,
39
+ error: {
40
+ reason: "body-is-null",
41
+ statusCode: response.status,
42
+ },
43
+ };
44
+ }
31
45
  return response.body;
32
46
  case "text":
33
47
  return yield response.text();
@@ -1,5 +1,5 @@
1
1
  export declare function getTimeoutSignal(timeoutMs: number): {
2
2
  signal: AbortSignal;
3
- abortId: NodeJS.Timeout;
3
+ abortId: ReturnType<typeof setTimeout>;
4
4
  };
5
5
  export declare function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal;
@@ -71,6 +71,17 @@ function evaluateRuntime() {
71
71
  version: Bun.version,
72
72
  };
73
73
  }
74
+ /**
75
+ * A constant that indicates whether the environment the code is running is in React-Native.
76
+ * This check should come before Node.js detection since React Native may have a process polyfill.
77
+ * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
78
+ */
79
+ const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
80
+ if (isReactNative) {
81
+ return {
82
+ type: "react-native",
83
+ };
84
+ }
74
85
  /**
75
86
  * A constant that indicates whether the environment the code is running is Node.JS.
76
87
  */
@@ -86,16 +97,6 @@ function evaluateRuntime() {
86
97
  parsedVersion: Number(process.versions.node.split(".")[0]),
87
98
  };
88
99
  }
89
- /**
90
- * A constant that indicates whether the environment the code is running is in React-Native.
91
- * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
92
- */
93
- const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
94
- if (isReactNative) {
95
- return {
96
- type: "react-native",
97
- };
98
- }
99
100
  return {
100
101
  type: "unknown",
101
102
  };
@@ -6,7 +6,11 @@ const json_js_1 = require("../core/json.js");
6
6
  class CredalError extends Error {
7
7
  constructor({ message, statusCode, body, rawResponse, }) {
8
8
  super(buildMessage({ message, statusCode, body }));
9
- Object.setPrototypeOf(this, CredalError.prototype);
9
+ Object.setPrototypeOf(this, new.target.prototype);
10
+ if (Error.captureStackTrace) {
11
+ Error.captureStackTrace(this, this.constructor);
12
+ }
13
+ this.name = this.constructor.name;
10
14
  this.statusCode = statusCode;
11
15
  this.body = body;
12
16
  this.rawResponse = rawResponse;
@@ -5,7 +5,11 @@ exports.CredalTimeoutError = void 0;
5
5
  class CredalTimeoutError extends Error {
6
6
  constructor(message) {
7
7
  super(message);
8
- Object.setPrototypeOf(this, CredalTimeoutError.prototype);
8
+ Object.setPrototypeOf(this, new.target.prototype);
9
+ if (Error.captureStackTrace) {
10
+ Error.captureStackTrace(this, this.constructor);
11
+ }
12
+ this.name = this.constructor.name;
9
13
  }
10
14
  }
11
15
  exports.CredalTimeoutError = CredalTimeoutError;
@@ -0,0 +1,2 @@
1
+ import type * as core from "../core/index.js";
2
+ export declare function handleNonStatusCodeError(error: core.Fetcher.Error, rawResponse: core.RawResponse, method: string, path: string): never;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.handleNonStatusCodeError = handleNonStatusCodeError;
38
+ const errors = __importStar(require("./index.js"));
39
+ function handleNonStatusCodeError(error, rawResponse, method, path) {
40
+ switch (error.reason) {
41
+ case "non-json":
42
+ throw new errors.CredalError({
43
+ statusCode: error.statusCode,
44
+ body: error.rawBody,
45
+ rawResponse: rawResponse,
46
+ });
47
+ case "body-is-null":
48
+ throw new errors.CredalError({
49
+ statusCode: error.statusCode,
50
+ rawResponse: rawResponse,
51
+ });
52
+ case "timeout":
53
+ throw new errors.CredalTimeoutError(`Timeout exceeded when calling ${method} ${path}.`);
54
+ case "unknown":
55
+ throw new errors.CredalError({
56
+ message: error.errorMessage,
57
+ rawResponse: rawResponse,
58
+ });
59
+ default:
60
+ throw new errors.CredalError({
61
+ message: "Unknown error",
62
+ rawResponse: rawResponse,
63
+ });
64
+ }
65
+ }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.14";
1
+ export declare const SDK_VERSION = "0.1.16";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.1.14";
4
+ exports.SDK_VERSION = "0.1.16";
@@ -1,10 +1,10 @@
1
+ import { BearerAuthProvider } from "./auth/BearerAuthProvider.mjs";
1
2
  import * as core from "./core/index.mjs";
2
3
  import type * as environments from "./environments.mjs";
3
- export interface BaseClientOptions {
4
+ export type BaseClientOptions = {
4
5
  environment?: core.Supplier<environments.CredalEnvironment | string>;
5
6
  /** Specify a custom URL to connect the client to. */
6
7
  baseUrl?: core.Supplier<string>;
7
- apiKey?: core.Supplier<core.BearerToken | undefined>;
8
8
  /** Additional headers to include in requests. */
9
9
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
10
10
  /** The default maximum time to wait for a response in seconds. */
@@ -16,7 +16,7 @@ export interface BaseClientOptions {
16
16
  fetcher?: core.FetchFunction;
17
17
  /** Configure logging for the client. */
18
18
  logging?: core.logging.LogConfig | core.logging.Logger;
19
- }
19
+ } & BearerAuthProvider.AuthOptions;
20
20
  export interface BaseRequestOptions {
21
21
  /** The maximum time to wait for a response in seconds. */
22
22
  timeoutInSeconds?: number;
@@ -29,12 +29,12 @@ export interface BaseRequestOptions {
29
29
  /** Additional headers to include in the request. */
30
30
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
31
31
  }
32
- export type NormalizedClientOptions<T extends BaseClientOptions> = T & {
32
+ export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
33
33
  logging: core.logging.Logger;
34
34
  authProvider?: core.AuthProvider;
35
35
  };
36
- export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions> = NormalizedClientOptions<T> & {
36
+ export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> = NormalizedClientOptions<T> & {
37
37
  authProvider: core.AuthProvider;
38
38
  };
39
- export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): NormalizedClientOptions<T>;
40
- export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
39
+ export declare function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptions<T>;
40
+ export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@credal/sdk",
9
- "X-Fern-SDK-Version": "0.1.14",
10
- "User-Agent": "@credal/sdk/0.1.14",
9
+ "X-Fern-SDK-Version": "0.1.16",
10
+ "User-Agent": "@credal/sdk/0.1.16",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -16,6 +16,10 @@ export function normalizeClientOptions(options) {
16
16
  export function normalizeClientOptionsWithAuth(options) {
17
17
  var _a;
18
18
  const normalized = normalizeClientOptions(options);
19
- (_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new BearerAuthProvider(options));
19
+ const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
20
+ (_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new BearerAuthProvider(normalizedWithNoOpAuthProvider));
20
21
  return normalized;
21
22
  }
23
+ function withNoOpAuthProvider(options) {
24
+ return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
25
+ }
@@ -6,8 +6,7 @@ import { UsersClient } from "./api/resources/users/client/Client.mjs";
6
6
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
7
7
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
8
8
  export declare namespace CredalClient {
9
- interface Options extends BaseClientOptions {
10
- }
9
+ type Options = BaseClientOptions;
11
10
  interface RequestOptions extends BaseRequestOptions {
12
11
  }
13
12
  }
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs
3
3
  import * as core from "../../../../core/index.mjs";
4
4
  import type * as Credal from "../../../index.mjs";
5
5
  export declare namespace CopilotsClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }