@airweave/sdk 0.1.38 → 0.1.45

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 (40) hide show
  1. package/Client.d.ts +1 -5
  2. package/README.md +1 -1
  3. package/api/resources/collections/client/Client.d.ts +4 -6
  4. package/api/resources/collections/client/Client.js +9 -20
  5. package/api/resources/sourceConnections/client/Client.d.ts +4 -6
  6. package/api/resources/sourceConnections/client/Client.js +10 -23
  7. package/api/resources/sources/client/Client.d.ts +4 -6
  8. package/api/resources/sources/client/Client.js +5 -8
  9. package/api/resources/whiteLabels/client/Client.d.ts +4 -6
  10. package/api/resources/whiteLabels/client/Client.js +9 -20
  11. package/core/index.d.ts +0 -1
  12. package/core/index.js +0 -1
  13. package/dist/Client.d.ts +1 -5
  14. package/dist/api/resources/collections/client/Client.d.ts +4 -6
  15. package/dist/api/resources/collections/client/Client.js +9 -20
  16. package/dist/api/resources/sourceConnections/client/Client.d.ts +4 -6
  17. package/dist/api/resources/sourceConnections/client/Client.js +10 -23
  18. package/dist/api/resources/sources/client/Client.d.ts +4 -6
  19. package/dist/api/resources/sources/client/Client.js +5 -8
  20. package/dist/api/resources/whiteLabels/client/Client.d.ts +4 -6
  21. package/dist/api/resources/whiteLabels/client/Client.js +9 -20
  22. package/dist/core/index.d.ts +0 -1
  23. package/dist/core/index.js +0 -1
  24. package/dist/version.d.ts +1 -1
  25. package/dist/version.js +1 -1
  26. package/package.json +2 -3
  27. package/version.d.ts +1 -1
  28. package/version.js +1 -1
  29. package/core/auth/BasicAuth.d.ts +0 -8
  30. package/core/auth/BasicAuth.js +0 -26
  31. package/core/auth/BearerToken.d.ts +0 -5
  32. package/core/auth/BearerToken.js +0 -15
  33. package/core/auth/index.d.ts +0 -2
  34. package/core/auth/index.js +0 -7
  35. package/dist/core/auth/BasicAuth.d.ts +0 -8
  36. package/dist/core/auth/BasicAuth.js +0 -26
  37. package/dist/core/auth/BearerToken.d.ts +0 -5
  38. package/dist/core/auth/BearerToken.js +0 -15
  39. package/dist/core/auth/index.d.ts +0 -2
  40. package/dist/core/auth/index.js +0 -7
package/Client.d.ts CHANGED
@@ -10,9 +10,7 @@ import { WhiteLabels } from "./api/resources/whiteLabels/client/Client";
10
10
  export declare namespace AirweaveSDKClient {
11
11
  interface Options {
12
12
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
13
- token: core.Supplier<core.BearerToken>;
14
- /** Override the x-api-key header */
15
- apiKey?: core.Supplier<string | undefined>;
13
+ apiKey: core.Supplier<string>;
16
14
  }
17
15
  interface RequestOptions {
18
16
  /** The maximum time to wait for a response in seconds. */
@@ -21,8 +19,6 @@ export declare namespace AirweaveSDKClient {
21
19
  maxRetries?: number;
22
20
  /** A hook to abort the request. */
23
21
  abortSignal?: AbortSignal;
24
- /** Override the x-api-key header */
25
- apiKey?: string | undefined;
26
22
  /** Additional headers to include in the request. */
27
23
  headers?: Record<string, string>;
28
24
  }
package/README.md CHANGED
@@ -22,7 +22,7 @@ Instantiate and use the client with the following:
22
22
  ```typescript
23
23
  import { AirweaveSDKClient } from "@airweave/sdk";
24
24
 
25
- const client = new AirweaveSDKClient({ token: "YOUR_TOKEN", apiKey: "YOUR_API_KEY" });
25
+ const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY" });
26
26
  await client.collections.createCollection({
27
27
  name: "name",
28
28
  });
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace Collections {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace Collections {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -133,5 +129,7 @@ export declare class Collections {
133
129
  * await client.collections.refreshAllSourceConnections("readable_id")
134
130
  */
135
131
  refreshAllSourceConnections(readableId: string, requestOptions?: Collections.RequestOptions): Promise<AirweaveSDK.SourceConnectionJob[]>;
136
- protected _getAuthorizationHeader(): Promise<string>;
132
+ protected _getCustomAuthorizationHeaders(): Promise<{
133
+ "x-api-key": string;
134
+ }>;
137
135
  }
@@ -84,9 +84,7 @@ class Collections {
84
84
  const _response = yield core.fetcher({
85
85
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "collections"),
86
86
  method: "GET",
87
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
88
- ? yield core.Supplier.get(this._options.apiKey)
89
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
88
  contentType: "application/json",
91
89
  queryParameters: _queryParams,
92
90
  requestType: "json",
@@ -152,9 +150,7 @@ class Collections {
152
150
  const _response = yield core.fetcher({
153
151
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "collections"),
154
152
  method: "POST",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
156
- ? yield core.Supplier.get(this._options.apiKey)
157
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
154
  contentType: "application/json",
159
155
  requestType: "json",
160
156
  body: serializers.CollectionCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -218,9 +214,7 @@ class Collections {
218
214
  const _response = yield core.fetcher({
219
215
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}`),
220
216
  method: "GET",
221
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
222
- ? yield core.Supplier.get(this._options.apiKey)
223
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
217
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
224
218
  contentType: "application/json",
225
219
  requestType: "json",
226
220
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -298,9 +292,7 @@ class Collections {
298
292
  const _response = yield core.fetcher({
299
293
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}`),
300
294
  method: "DELETE",
301
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
302
- ? yield core.Supplier.get(this._options.apiKey)
303
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
295
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
304
296
  contentType: "application/json",
305
297
  queryParameters: _queryParams,
306
298
  requestType: "json",
@@ -383,9 +375,7 @@ class Collections {
383
375
  const _response = yield core.fetcher({
384
376
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
385
377
  method: "GET",
386
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
387
- ? yield core.Supplier.get(this._options.apiKey)
388
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
378
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
389
379
  contentType: "application/json",
390
380
  queryParameters: _queryParams,
391
381
  requestType: "json",
@@ -458,9 +448,7 @@ class Collections {
458
448
  const _response = yield core.fetcher({
459
449
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/refresh_all`),
460
450
  method: "POST",
461
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
462
- ? yield core.Supplier.get(this._options.apiKey)
463
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
451
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
464
452
  contentType: "application/json",
465
453
  requestType: "json",
466
454
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -506,9 +494,10 @@ class Collections {
506
494
  }
507
495
  });
508
496
  }
509
- _getAuthorizationHeader() {
497
+ _getCustomAuthorizationHeaders() {
510
498
  return __awaiter(this, void 0, void 0, function* () {
511
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
499
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
500
+ return { "x-api-key": apiKeyValue };
512
501
  });
513
502
  }
514
503
  }
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace SourceConnections {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace SourceConnections {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -187,5 +183,7 @@ export declare class SourceConnections {
187
183
  * await client.sourceConnections.listSourceConnectionJobs("source_connection_id")
188
184
  */
189
185
  listSourceConnectionJobs(sourceConnectionId: string, requestOptions?: SourceConnections.RequestOptions): Promise<AirweaveSDK.SourceConnectionJob[]>;
190
- protected _getAuthorizationHeader(): Promise<string>;
186
+ protected _getCustomAuthorizationHeaders(): Promise<{
187
+ "x-api-key": string;
188
+ }>;
191
189
  }
@@ -97,9 +97,7 @@ class SourceConnections {
97
97
  const _response = yield core.fetcher({
98
98
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "source-connections"),
99
99
  method: "GET",
100
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
101
- ? yield core.Supplier.get(this._options.apiKey)
102
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
100
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
103
101
  contentType: "application/json",
104
102
  queryParameters: _queryParams,
105
103
  requestType: "json",
@@ -182,9 +180,7 @@ class SourceConnections {
182
180
  const _response = yield core.fetcher({
183
181
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "source-connections"),
184
182
  method: "POST",
185
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
186
- ? yield core.Supplier.get(this._options.apiKey)
187
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
183
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
188
184
  contentType: "application/json",
189
185
  requestType: "json",
190
186
  body: serializers.SourceConnectionCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -263,9 +259,7 @@ class SourceConnections {
263
259
  const _response = yield core.fetcher({
264
260
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
265
261
  method: "GET",
266
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
267
- ? yield core.Supplier.get(this._options.apiKey)
268
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
262
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
269
263
  contentType: "application/json",
270
264
  queryParameters: _queryParams,
271
265
  requestType: "json",
@@ -339,9 +333,7 @@ class SourceConnections {
339
333
  const _response = yield core.fetcher({
340
334
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
341
335
  method: "PUT",
342
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
343
- ? yield core.Supplier.get(this._options.apiKey)
344
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
336
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
345
337
  contentType: "application/json",
346
338
  requestType: "json",
347
339
  body: serializers.SourceConnectionUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -420,9 +412,7 @@ class SourceConnections {
420
412
  const _response = yield core.fetcher({
421
413
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
422
414
  method: "DELETE",
423
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
424
- ? yield core.Supplier.get(this._options.apiKey)
425
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
415
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
426
416
  contentType: "application/json",
427
417
  queryParameters: _queryParams,
428
418
  requestType: "json",
@@ -495,9 +485,7 @@ class SourceConnections {
495
485
  const _response = yield core.fetcher({
496
486
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}/run`),
497
487
  method: "POST",
498
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
499
- ? yield core.Supplier.get(this._options.apiKey)
500
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
488
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
501
489
  contentType: "application/json",
502
490
  requestType: "json",
503
491
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -568,9 +556,7 @@ class SourceConnections {
568
556
  const _response = yield core.fetcher({
569
557
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}/jobs`),
570
558
  method: "GET",
571
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
572
- ? yield core.Supplier.get(this._options.apiKey)
573
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
559
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
574
560
  contentType: "application/json",
575
561
  requestType: "json",
576
562
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -616,9 +602,10 @@ class SourceConnections {
616
602
  }
617
603
  });
618
604
  }
619
- _getAuthorizationHeader() {
605
+ _getCustomAuthorizationHeaders() {
620
606
  return __awaiter(this, void 0, void 0, function* () {
621
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
607
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
608
+ return { "x-api-key": apiKeyValue };
622
609
  });
623
610
  }
624
611
  }
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace Sources {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace Sources {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -69,5 +65,7 @@ export declare class Sources {
69
65
  * await client.sources.readSources()
70
66
  */
71
67
  readSources(requestOptions?: Sources.RequestOptions): Promise<AirweaveSDK.Source[]>;
72
- protected _getAuthorizationHeader(): Promise<string>;
68
+ protected _getCustomAuthorizationHeaders(): Promise<{
69
+ "x-api-key": string;
70
+ }>;
73
71
  }
@@ -86,9 +86,7 @@ class Sources {
86
86
  const _response = yield core.fetcher({
87
87
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `sources/detail/${encodeURIComponent(shortName)}`),
88
88
  method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
90
- ? yield core.Supplier.get(this._options.apiKey)
91
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
90
  contentType: "application/json",
93
91
  requestType: "json",
94
92
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -159,9 +157,7 @@ class Sources {
159
157
  const _response = yield core.fetcher({
160
158
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "sources/list"),
161
159
  method: "GET",
162
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
163
- ? yield core.Supplier.get(this._options.apiKey)
164
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
160
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
165
161
  contentType: "application/json",
166
162
  requestType: "json",
167
163
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -207,9 +203,10 @@ class Sources {
207
203
  }
208
204
  });
209
205
  }
210
- _getAuthorizationHeader() {
206
+ _getCustomAuthorizationHeaders() {
211
207
  return __awaiter(this, void 0, void 0, function* () {
212
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
208
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
209
+ return { "x-api-key": apiKeyValue };
213
210
  });
214
211
  }
215
212
  }
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace WhiteLabels {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace WhiteLabels {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -165,5 +161,7 @@ export declare class WhiteLabels {
165
161
  * await client.whiteLabels.listWhiteLabelSyncs("white_label_id")
166
162
  */
167
163
  listWhiteLabelSyncs(whiteLabelId: string, requestOptions?: WhiteLabels.RequestOptions): Promise<AirweaveSDK.Sync[]>;
168
- protected _getAuthorizationHeader(): Promise<string>;
164
+ protected _getCustomAuthorizationHeaders(): Promise<{
165
+ "x-api-key": string;
166
+ }>;
169
167
  }
@@ -84,9 +84,7 @@ class WhiteLabels {
84
84
  const _response = yield core.fetcher({
85
85
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "white_labels/list"),
86
86
  method: "GET",
87
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
88
- ? yield core.Supplier.get(this._options.apiKey)
89
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
88
  contentType: "application/json",
91
89
  requestType: "json",
92
90
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -165,9 +163,7 @@ class WhiteLabels {
165
163
  const _response = yield core.fetcher({
166
164
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "white_labels"),
167
165
  method: "POST",
168
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
169
- ? yield core.Supplier.get(this._options.apiKey)
170
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
166
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
171
167
  contentType: "application/json",
172
168
  requestType: "json",
173
169
  body: serializers.WhiteLabelCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -241,9 +237,7 @@ class WhiteLabels {
241
237
  const _response = yield core.fetcher({
242
238
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}`),
243
239
  method: "GET",
244
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
245
- ? yield core.Supplier.get(this._options.apiKey)
246
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
240
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
247
241
  contentType: "application/json",
248
242
  requestType: "json",
249
243
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -318,9 +312,7 @@ class WhiteLabels {
318
312
  const _response = yield core.fetcher({
319
313
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}`),
320
314
  method: "PUT",
321
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
322
- ? yield core.Supplier.get(this._options.apiKey)
323
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
315
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
324
316
  contentType: "application/json",
325
317
  requestType: "json",
326
318
  body: serializers.WhiteLabelUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -394,9 +386,7 @@ class WhiteLabels {
394
386
  const _response = yield core.fetcher({
395
387
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}`),
396
388
  method: "DELETE",
397
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
398
- ? yield core.Supplier.get(this._options.apiKey)
399
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
389
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
400
390
  contentType: "application/json",
401
391
  requestType: "json",
402
392
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -469,9 +459,7 @@ class WhiteLabels {
469
459
  const _response = yield core.fetcher({
470
460
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}/syncs`),
471
461
  method: "GET",
472
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
473
- ? yield core.Supplier.get(this._options.apiKey)
474
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
462
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
475
463
  contentType: "application/json",
476
464
  requestType: "json",
477
465
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -517,9 +505,10 @@ class WhiteLabels {
517
505
  }
518
506
  });
519
507
  }
520
- _getAuthorizationHeader() {
508
+ _getCustomAuthorizationHeaders() {
521
509
  return __awaiter(this, void 0, void 0, function* () {
522
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
510
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
511
+ return { "x-api-key": apiKeyValue };
523
512
  });
524
513
  }
525
514
  }
package/core/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from "./fetcher";
2
- export * from "./auth";
3
2
  export * from "./runtime";
4
3
  export * as serialization from "./schemas";
package/core/index.js CHANGED
@@ -38,6 +38,5 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.serialization = void 0;
40
40
  __exportStar(require("./fetcher"), exports);
41
- __exportStar(require("./auth"), exports);
42
41
  __exportStar(require("./runtime"), exports);
43
42
  exports.serialization = __importStar(require("./schemas"));
package/dist/Client.d.ts CHANGED
@@ -10,9 +10,7 @@ import { WhiteLabels } from "./api/resources/whiteLabels/client/Client";
10
10
  export declare namespace AirweaveSDKClient {
11
11
  interface Options {
12
12
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
13
- token: core.Supplier<core.BearerToken>;
14
- /** Override the x-api-key header */
15
- apiKey?: core.Supplier<string | undefined>;
13
+ apiKey: core.Supplier<string>;
16
14
  }
17
15
  interface RequestOptions {
18
16
  /** The maximum time to wait for a response in seconds. */
@@ -21,8 +19,6 @@ export declare namespace AirweaveSDKClient {
21
19
  maxRetries?: number;
22
20
  /** A hook to abort the request. */
23
21
  abortSignal?: AbortSignal;
24
- /** Override the x-api-key header */
25
- apiKey?: string | undefined;
26
22
  /** Additional headers to include in the request. */
27
23
  headers?: Record<string, string>;
28
24
  }
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace Collections {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace Collections {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -133,5 +129,7 @@ export declare class Collections {
133
129
  * await client.collections.refreshAllSourceConnections("readable_id")
134
130
  */
135
131
  refreshAllSourceConnections(readableId: string, requestOptions?: Collections.RequestOptions): Promise<AirweaveSDK.SourceConnectionJob[]>;
136
- protected _getAuthorizationHeader(): Promise<string>;
132
+ protected _getCustomAuthorizationHeaders(): Promise<{
133
+ "x-api-key": string;
134
+ }>;
137
135
  }
@@ -84,9 +84,7 @@ class Collections {
84
84
  const _response = yield core.fetcher({
85
85
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "collections"),
86
86
  method: "GET",
87
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
88
- ? yield core.Supplier.get(this._options.apiKey)
89
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
88
  contentType: "application/json",
91
89
  queryParameters: _queryParams,
92
90
  requestType: "json",
@@ -152,9 +150,7 @@ class Collections {
152
150
  const _response = yield core.fetcher({
153
151
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "collections"),
154
152
  method: "POST",
155
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
156
- ? yield core.Supplier.get(this._options.apiKey)
157
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
154
  contentType: "application/json",
159
155
  requestType: "json",
160
156
  body: serializers.CollectionCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -218,9 +214,7 @@ class Collections {
218
214
  const _response = yield core.fetcher({
219
215
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}`),
220
216
  method: "GET",
221
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
222
- ? yield core.Supplier.get(this._options.apiKey)
223
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
217
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
224
218
  contentType: "application/json",
225
219
  requestType: "json",
226
220
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -298,9 +292,7 @@ class Collections {
298
292
  const _response = yield core.fetcher({
299
293
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}`),
300
294
  method: "DELETE",
301
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
302
- ? yield core.Supplier.get(this._options.apiKey)
303
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
295
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
304
296
  contentType: "application/json",
305
297
  queryParameters: _queryParams,
306
298
  requestType: "json",
@@ -383,9 +375,7 @@ class Collections {
383
375
  const _response = yield core.fetcher({
384
376
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
385
377
  method: "GET",
386
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
387
- ? yield core.Supplier.get(this._options.apiKey)
388
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
378
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
389
379
  contentType: "application/json",
390
380
  queryParameters: _queryParams,
391
381
  requestType: "json",
@@ -458,9 +448,7 @@ class Collections {
458
448
  const _response = yield core.fetcher({
459
449
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/refresh_all`),
460
450
  method: "POST",
461
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
462
- ? yield core.Supplier.get(this._options.apiKey)
463
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
451
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
464
452
  contentType: "application/json",
465
453
  requestType: "json",
466
454
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -506,9 +494,10 @@ class Collections {
506
494
  }
507
495
  });
508
496
  }
509
- _getAuthorizationHeader() {
497
+ _getCustomAuthorizationHeaders() {
510
498
  return __awaiter(this, void 0, void 0, function* () {
511
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
499
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
500
+ return { "x-api-key": apiKeyValue };
512
501
  });
513
502
  }
514
503
  }
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace SourceConnections {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace SourceConnections {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -187,5 +183,7 @@ export declare class SourceConnections {
187
183
  * await client.sourceConnections.listSourceConnectionJobs("source_connection_id")
188
184
  */
189
185
  listSourceConnectionJobs(sourceConnectionId: string, requestOptions?: SourceConnections.RequestOptions): Promise<AirweaveSDK.SourceConnectionJob[]>;
190
- protected _getAuthorizationHeader(): Promise<string>;
186
+ protected _getCustomAuthorizationHeaders(): Promise<{
187
+ "x-api-key": string;
188
+ }>;
191
189
  }
@@ -97,9 +97,7 @@ class SourceConnections {
97
97
  const _response = yield core.fetcher({
98
98
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "source-connections"),
99
99
  method: "GET",
100
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
101
- ? yield core.Supplier.get(this._options.apiKey)
102
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
100
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
103
101
  contentType: "application/json",
104
102
  queryParameters: _queryParams,
105
103
  requestType: "json",
@@ -182,9 +180,7 @@ class SourceConnections {
182
180
  const _response = yield core.fetcher({
183
181
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "source-connections"),
184
182
  method: "POST",
185
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
186
- ? yield core.Supplier.get(this._options.apiKey)
187
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
183
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
188
184
  contentType: "application/json",
189
185
  requestType: "json",
190
186
  body: serializers.SourceConnectionCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -263,9 +259,7 @@ class SourceConnections {
263
259
  const _response = yield core.fetcher({
264
260
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
265
261
  method: "GET",
266
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
267
- ? yield core.Supplier.get(this._options.apiKey)
268
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
262
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
269
263
  contentType: "application/json",
270
264
  queryParameters: _queryParams,
271
265
  requestType: "json",
@@ -339,9 +333,7 @@ class SourceConnections {
339
333
  const _response = yield core.fetcher({
340
334
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
341
335
  method: "PUT",
342
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
343
- ? yield core.Supplier.get(this._options.apiKey)
344
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
336
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
345
337
  contentType: "application/json",
346
338
  requestType: "json",
347
339
  body: serializers.SourceConnectionUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -420,9 +412,7 @@ class SourceConnections {
420
412
  const _response = yield core.fetcher({
421
413
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
422
414
  method: "DELETE",
423
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
424
- ? yield core.Supplier.get(this._options.apiKey)
425
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
415
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
426
416
  contentType: "application/json",
427
417
  queryParameters: _queryParams,
428
418
  requestType: "json",
@@ -495,9 +485,7 @@ class SourceConnections {
495
485
  const _response = yield core.fetcher({
496
486
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}/run`),
497
487
  method: "POST",
498
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
499
- ? yield core.Supplier.get(this._options.apiKey)
500
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
488
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
501
489
  contentType: "application/json",
502
490
  requestType: "json",
503
491
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -568,9 +556,7 @@ class SourceConnections {
568
556
  const _response = yield core.fetcher({
569
557
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `source-connections/${encodeURIComponent(sourceConnectionId)}/jobs`),
570
558
  method: "GET",
571
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
572
- ? yield core.Supplier.get(this._options.apiKey)
573
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
559
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
574
560
  contentType: "application/json",
575
561
  requestType: "json",
576
562
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -616,9 +602,10 @@ class SourceConnections {
616
602
  }
617
603
  });
618
604
  }
619
- _getAuthorizationHeader() {
605
+ _getCustomAuthorizationHeaders() {
620
606
  return __awaiter(this, void 0, void 0, function* () {
621
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
607
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
608
+ return { "x-api-key": apiKeyValue };
622
609
  });
623
610
  }
624
611
  }
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace Sources {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace Sources {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -69,5 +65,7 @@ export declare class Sources {
69
65
  * await client.sources.readSources()
70
66
  */
71
67
  readSources(requestOptions?: Sources.RequestOptions): Promise<AirweaveSDK.Source[]>;
72
- protected _getAuthorizationHeader(): Promise<string>;
68
+ protected _getCustomAuthorizationHeaders(): Promise<{
69
+ "x-api-key": string;
70
+ }>;
73
71
  }
@@ -86,9 +86,7 @@ class Sources {
86
86
  const _response = yield core.fetcher({
87
87
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `sources/detail/${encodeURIComponent(shortName)}`),
88
88
  method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
90
- ? yield core.Supplier.get(this._options.apiKey)
91
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
90
  contentType: "application/json",
93
91
  requestType: "json",
94
92
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -159,9 +157,7 @@ class Sources {
159
157
  const _response = yield core.fetcher({
160
158
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "sources/list"),
161
159
  method: "GET",
162
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
163
- ? yield core.Supplier.get(this._options.apiKey)
164
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
160
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
165
161
  contentType: "application/json",
166
162
  requestType: "json",
167
163
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -207,9 +203,10 @@ class Sources {
207
203
  }
208
204
  });
209
205
  }
210
- _getAuthorizationHeader() {
206
+ _getCustomAuthorizationHeaders() {
211
207
  return __awaiter(this, void 0, void 0, function* () {
212
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
208
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
209
+ return { "x-api-key": apiKeyValue };
213
210
  });
214
211
  }
215
212
  }
@@ -7,9 +7,7 @@ import * as AirweaveSDK from "../../../index";
7
7
  export declare namespace WhiteLabels {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
10
+ apiKey: core.Supplier<string>;
13
11
  }
14
12
  interface RequestOptions {
15
13
  /** The maximum time to wait for a response in seconds. */
@@ -18,8 +16,6 @@ export declare namespace WhiteLabels {
18
16
  maxRetries?: number;
19
17
  /** A hook to abort the request. */
20
18
  abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
19
  /** Additional headers to include in the request. */
24
20
  headers?: Record<string, string>;
25
21
  }
@@ -165,5 +161,7 @@ export declare class WhiteLabels {
165
161
  * await client.whiteLabels.listWhiteLabelSyncs("white_label_id")
166
162
  */
167
163
  listWhiteLabelSyncs(whiteLabelId: string, requestOptions?: WhiteLabels.RequestOptions): Promise<AirweaveSDK.Sync[]>;
168
- protected _getAuthorizationHeader(): Promise<string>;
164
+ protected _getCustomAuthorizationHeaders(): Promise<{
165
+ "x-api-key": string;
166
+ }>;
169
167
  }
@@ -84,9 +84,7 @@ class WhiteLabels {
84
84
  const _response = yield core.fetcher({
85
85
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "white_labels/list"),
86
86
  method: "GET",
87
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
88
- ? yield core.Supplier.get(this._options.apiKey)
89
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
88
  contentType: "application/json",
91
89
  requestType: "json",
92
90
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -165,9 +163,7 @@ class WhiteLabels {
165
163
  const _response = yield core.fetcher({
166
164
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "white_labels"),
167
165
  method: "POST",
168
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
169
- ? yield core.Supplier.get(this._options.apiKey)
170
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
166
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
171
167
  contentType: "application/json",
172
168
  requestType: "json",
173
169
  body: serializers.WhiteLabelCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -241,9 +237,7 @@ class WhiteLabels {
241
237
  const _response = yield core.fetcher({
242
238
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}`),
243
239
  method: "GET",
244
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
245
- ? yield core.Supplier.get(this._options.apiKey)
246
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
240
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
247
241
  contentType: "application/json",
248
242
  requestType: "json",
249
243
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -318,9 +312,7 @@ class WhiteLabels {
318
312
  const _response = yield core.fetcher({
319
313
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}`),
320
314
  method: "PUT",
321
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
322
- ? yield core.Supplier.get(this._options.apiKey)
323
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
315
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
324
316
  contentType: "application/json",
325
317
  requestType: "json",
326
318
  body: serializers.WhiteLabelUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -394,9 +386,7 @@ class WhiteLabels {
394
386
  const _response = yield core.fetcher({
395
387
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}`),
396
388
  method: "DELETE",
397
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
398
- ? yield core.Supplier.get(this._options.apiKey)
399
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
389
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
400
390
  contentType: "application/json",
401
391
  requestType: "json",
402
392
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -469,9 +459,7 @@ class WhiteLabels {
469
459
  const _response = yield core.fetcher({
470
460
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `white_labels/${encodeURIComponent(whiteLabelId)}/syncs`),
471
461
  method: "GET",
472
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
473
- ? yield core.Supplier.get(this._options.apiKey)
474
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.38", "User-Agent": "@airweave/sdk/v0.1.38", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
462
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.45", "User-Agent": "@airweave/sdk/v0.1.45", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
475
463
  contentType: "application/json",
476
464
  requestType: "json",
477
465
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -517,9 +505,10 @@ class WhiteLabels {
517
505
  }
518
506
  });
519
507
  }
520
- _getAuthorizationHeader() {
508
+ _getCustomAuthorizationHeaders() {
521
509
  return __awaiter(this, void 0, void 0, function* () {
522
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
510
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
511
+ return { "x-api-key": apiKeyValue };
523
512
  });
524
513
  }
525
514
  }
@@ -1,4 +1,3 @@
1
1
  export * from "./fetcher";
2
- export * from "./auth";
3
2
  export * from "./runtime";
4
3
  export * as serialization from "./schemas";
@@ -38,6 +38,5 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.serialization = void 0;
40
40
  __exportStar(require("./fetcher"), exports);
41
- __exportStar(require("./auth"), exports);
42
41
  __exportStar(require("./runtime"), exports);
43
42
  exports.serialization = __importStar(require("./schemas"));
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "v0.1.38";
1
+ export declare const SDK_VERSION = "v0.1.45";
package/dist/version.js CHANGED
@@ -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 = "v0.1.38";
4
+ exports.SDK_VERSION = "v0.1.45";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airweave/sdk",
3
- "version": "v0.1.38",
3
+ "version": "v0.1.45",
4
4
  "private": false,
5
5
  "repository": "https://github.com/airweave-ai/typescript-sdk",
6
6
  "main": "./index.js",
@@ -17,8 +17,7 @@
17
17
  "formdata-node": "^6.0.3",
18
18
  "node-fetch": "^2.7.0",
19
19
  "qs": "^6.13.1",
20
- "readable-stream": "^4.5.2",
21
- "js-base64": "3.7.7"
20
+ "readable-stream": "^4.5.2"
22
21
  },
23
22
  "devDependencies": {
24
23
  "@types/url-join": "4.0.1",
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "v0.1.38";
1
+ export declare const SDK_VERSION = "v0.1.45";
package/version.js CHANGED
@@ -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 = "v0.1.38";
4
+ exports.SDK_VERSION = "v0.1.45";
@@ -1,8 +0,0 @@
1
- export interface BasicAuth {
2
- username: string;
3
- password: string;
4
- }
5
- export declare const BasicAuth: {
6
- toAuthorizationHeader: (basicAuth: BasicAuth | undefined) => string | undefined;
7
- fromAuthorizationHeader: (header: string) => BasicAuth;
8
- };
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BasicAuth = void 0;
4
- const js_base64_1 = require("js-base64");
5
- const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
6
- exports.BasicAuth = {
7
- toAuthorizationHeader: (basicAuth) => {
8
- if (basicAuth == null) {
9
- return undefined;
10
- }
11
- const token = js_base64_1.Base64.encode(`${basicAuth.username}:${basicAuth.password}`);
12
- return `Basic ${token}`;
13
- },
14
- fromAuthorizationHeader: (header) => {
15
- const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
16
- const decoded = js_base64_1.Base64.decode(credentials);
17
- const [username, password] = decoded.split(":", 2);
18
- if (username == null || password == null) {
19
- throw new Error("Invalid basic auth");
20
- }
21
- return {
22
- username,
23
- password,
24
- };
25
- },
26
- };
@@ -1,5 +0,0 @@
1
- export type BearerToken = string;
2
- export declare const BearerToken: {
3
- toAuthorizationHeader: (token: BearerToken | undefined) => string | undefined;
4
- fromAuthorizationHeader: (header: string) => BearerToken;
5
- };
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BearerToken = void 0;
4
- const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i;
5
- exports.BearerToken = {
6
- toAuthorizationHeader: (token) => {
7
- if (token == null) {
8
- return undefined;
9
- }
10
- return `Bearer ${token}`;
11
- },
12
- fromAuthorizationHeader: (header) => {
13
- return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim();
14
- },
15
- };
@@ -1,2 +0,0 @@
1
- export { BasicAuth } from "./BasicAuth";
2
- export { BearerToken } from "./BearerToken";
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BearerToken = exports.BasicAuth = void 0;
4
- var BasicAuth_1 = require("./BasicAuth");
5
- Object.defineProperty(exports, "BasicAuth", { enumerable: true, get: function () { return BasicAuth_1.BasicAuth; } });
6
- var BearerToken_1 = require("./BearerToken");
7
- Object.defineProperty(exports, "BearerToken", { enumerable: true, get: function () { return BearerToken_1.BearerToken; } });
@@ -1,8 +0,0 @@
1
- export interface BasicAuth {
2
- username: string;
3
- password: string;
4
- }
5
- export declare const BasicAuth: {
6
- toAuthorizationHeader: (basicAuth: BasicAuth | undefined) => string | undefined;
7
- fromAuthorizationHeader: (header: string) => BasicAuth;
8
- };
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BasicAuth = void 0;
4
- const js_base64_1 = require("js-base64");
5
- const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
6
- exports.BasicAuth = {
7
- toAuthorizationHeader: (basicAuth) => {
8
- if (basicAuth == null) {
9
- return undefined;
10
- }
11
- const token = js_base64_1.Base64.encode(`${basicAuth.username}:${basicAuth.password}`);
12
- return `Basic ${token}`;
13
- },
14
- fromAuthorizationHeader: (header) => {
15
- const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
16
- const decoded = js_base64_1.Base64.decode(credentials);
17
- const [username, password] = decoded.split(":", 2);
18
- if (username == null || password == null) {
19
- throw new Error("Invalid basic auth");
20
- }
21
- return {
22
- username,
23
- password,
24
- };
25
- },
26
- };
@@ -1,5 +0,0 @@
1
- export type BearerToken = string;
2
- export declare const BearerToken: {
3
- toAuthorizationHeader: (token: BearerToken | undefined) => string | undefined;
4
- fromAuthorizationHeader: (header: string) => BearerToken;
5
- };
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BearerToken = void 0;
4
- const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i;
5
- exports.BearerToken = {
6
- toAuthorizationHeader: (token) => {
7
- if (token == null) {
8
- return undefined;
9
- }
10
- return `Bearer ${token}`;
11
- },
12
- fromAuthorizationHeader: (header) => {
13
- return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim();
14
- },
15
- };
@@ -1,2 +0,0 @@
1
- export { BasicAuth } from "./BasicAuth";
2
- export { BearerToken } from "./BearerToken";
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BearerToken = exports.BasicAuth = void 0;
4
- var BasicAuth_1 = require("./BasicAuth");
5
- Object.defineProperty(exports, "BasicAuth", { enumerable: true, get: function () { return BasicAuth_1.BasicAuth; } });
6
- var BearerToken_1 = require("./BearerToken");
7
- Object.defineProperty(exports, "BearerToken", { enumerable: true, get: function () { return BearerToken_1.BearerToken; } });