@airweave/sdk 0.1.11 → 0.1.12

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 (58) hide show
  1. package/Client.d.ts +3 -2
  2. package/Client.js +1 -1
  3. package/README.md +1 -1
  4. package/api/resources/apiKeys/client/Client.d.ts +3 -2
  5. package/api/resources/apiKeys/client/Client.js +14 -9
  6. package/api/resources/chat/client/Client.d.ts +3 -2
  7. package/api/resources/chat/client/Client.js +26 -17
  8. package/api/resources/connections/client/Client.d.ts +3 -2
  9. package/api/resources/connections/client/Client.js +38 -25
  10. package/api/resources/destinations/client/Client.d.ts +3 -2
  11. package/api/resources/destinations/client/Client.js +8 -5
  12. package/api/resources/embeddingModels/client/Client.d.ts +3 -2
  13. package/api/resources/embeddingModels/client/Client.js +8 -5
  14. package/api/resources/health/client/Client.d.ts +3 -2
  15. package/api/resources/health/client/Client.js +5 -3
  16. package/api/resources/sources/client/Client.d.ts +3 -2
  17. package/api/resources/sources/client/Client.js +8 -5
  18. package/api/resources/sync/client/Client.d.ts +3 -2
  19. package/api/resources/sync/client/Client.js +26 -17
  20. package/api/resources/users/client/Client.d.ts +3 -2
  21. package/api/resources/users/client/Client.js +5 -3
  22. package/api/resources/whiteLabels/client/Client.d.ts +3 -2
  23. package/api/resources/whiteLabels/client/Client.js +26 -17
  24. package/dist/Client.d.ts +3 -2
  25. package/dist/Client.js +1 -1
  26. package/dist/api/resources/apiKeys/client/Client.d.ts +3 -2
  27. package/dist/api/resources/apiKeys/client/Client.js +14 -9
  28. package/dist/api/resources/chat/client/Client.d.ts +3 -2
  29. package/dist/api/resources/chat/client/Client.js +26 -17
  30. package/dist/api/resources/connections/client/Client.d.ts +3 -2
  31. package/dist/api/resources/connections/client/Client.js +38 -25
  32. package/dist/api/resources/destinations/client/Client.d.ts +3 -2
  33. package/dist/api/resources/destinations/client/Client.js +8 -5
  34. package/dist/api/resources/embeddingModels/client/Client.d.ts +3 -2
  35. package/dist/api/resources/embeddingModels/client/Client.js +8 -5
  36. package/dist/api/resources/health/client/Client.d.ts +3 -2
  37. package/dist/api/resources/health/client/Client.js +5 -3
  38. package/dist/api/resources/sources/client/Client.d.ts +3 -2
  39. package/dist/api/resources/sources/client/Client.js +8 -5
  40. package/dist/api/resources/sync/client/Client.d.ts +3 -2
  41. package/dist/api/resources/sync/client/Client.js +26 -17
  42. package/dist/api/resources/users/client/Client.d.ts +3 -2
  43. package/dist/api/resources/users/client/Client.js +5 -3
  44. package/dist/api/resources/whiteLabels/client/Client.d.ts +3 -2
  45. package/dist/api/resources/whiteLabels/client/Client.js +26 -17
  46. package/dist/environments.d.ts +8 -0
  47. package/dist/environments.js +10 -0
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.js +3 -1
  50. package/dist/version.d.ts +1 -1
  51. package/dist/version.js +1 -1
  52. package/environments.d.ts +8 -0
  53. package/environments.js +10 -0
  54. package/index.d.ts +1 -0
  55. package/index.js +3 -1
  56. package/package.json +1 -1
  57. package/version.d.ts +1 -1
  58. package/version.js +1 -1
package/Client.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as environments from "./environments";
4
5
  import * as core from "./core";
5
6
  import { Health } from "./api/resources/health/client/Client";
6
7
  import { ApiKeys } from "./api/resources/apiKeys/client/Client";
@@ -14,7 +15,7 @@ import { WhiteLabels } from "./api/resources/whiteLabels/client/Client";
14
15
  import { Chat } from "./api/resources/chat/client/Client";
15
16
  export declare namespace AirweaveSDKClient {
16
17
  interface Options {
17
- environment: core.Supplier<string>;
18
+ environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
18
19
  /** Override the x-api-key header */
19
20
  apiKey?: core.Supplier<string | undefined>;
20
21
  }
@@ -43,7 +44,7 @@ export declare class AirweaveSDKClient {
43
44
  protected _sync: Sync | undefined;
44
45
  protected _whiteLabels: WhiteLabels | undefined;
45
46
  protected _chat: Chat | undefined;
46
- constructor(_options: AirweaveSDKClient.Options);
47
+ constructor(_options?: AirweaveSDKClient.Options);
47
48
  get health(): Health;
48
49
  get apiKeys(): ApiKeys;
49
50
  get users(): Users;
package/Client.js CHANGED
@@ -15,7 +15,7 @@ const Client_8 = require("./api/resources/sync/client/Client");
15
15
  const Client_9 = require("./api/resources/whiteLabels/client/Client");
16
16
  const Client_10 = require("./api/resources/chat/client/Client");
17
17
  class AirweaveSDKClient {
18
- constructor(_options) {
18
+ constructor(_options = {}) {
19
19
  this._options = _options;
20
20
  }
21
21
  get health() {
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({ environment: "YOUR_BASE_URL", apiKey: "YOUR_API_KEY" });
25
+ const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY" });
26
26
  await client.apiKeys.createApiKey();
27
27
  ```
28
28
 
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as environments from "../../../../environments";
4
5
  import * as core from "../../../../core";
5
6
  import * as AirweaveSDK from "../../../index";
6
7
  export declare namespace ApiKeys {
7
8
  interface Options {
8
- environment: core.Supplier<string>;
9
+ environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
9
10
  /** Override the x-api-key header */
10
11
  apiKey?: core.Supplier<string | undefined>;
11
12
  }
@@ -24,7 +25,7 @@ export declare namespace ApiKeys {
24
25
  }
25
26
  export declare class ApiKeys {
26
27
  protected readonly _options: ApiKeys.Options;
27
- constructor(_options: ApiKeys.Options);
28
+ constructor(_options?: ApiKeys.Options);
28
29
  /**
29
30
  * Retrieve all API keys for the current user.
30
31
  *
@@ -49,13 +49,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
49
49
  };
50
50
  Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.ApiKeys = void 0;
52
+ const environments = __importStar(require("../../../../environments"));
52
53
  const core = __importStar(require("../../../../core"));
53
54
  const AirweaveSDK = __importStar(require("../../../index"));
54
55
  const url_join_1 = __importDefault(require("url-join"));
55
56
  const serializers = __importStar(require("../../../../serialization/index"));
56
57
  const errors = __importStar(require("../../../../errors/index"));
57
58
  class ApiKeys {
58
- constructor(_options) {
59
+ constructor(_options = {}) {
59
60
  this._options = _options;
60
61
  }
61
62
  /**
@@ -82,6 +83,7 @@ class ApiKeys {
82
83
  */
83
84
  readApiKeys() {
84
85
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
86
+ var _a;
85
87
  const { skip, limit } = request;
86
88
  const _queryParams = {};
87
89
  if (skip != null) {
@@ -91,11 +93,11 @@ class ApiKeys {
91
93
  _queryParams["limit"] = limit.toString();
92
94
  }
93
95
  const _response = yield core.fetcher({
94
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "api_keys/"),
96
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "api_keys/"),
95
97
  method: "GET",
96
98
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
97
99
  ? yield core.Supplier.get(this._options.apiKey)
98
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
100
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
101
  contentType: "application/json",
100
102
  queryParameters: _queryParams,
101
103
  requestType: "json",
@@ -168,12 +170,13 @@ class ApiKeys {
168
170
  */
169
171
  createApiKey() {
170
172
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
173
+ var _a;
171
174
  const _response = yield core.fetcher({
172
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "api_keys/"),
175
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "api_keys/"),
173
176
  method: "POST",
174
177
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
175
178
  ? yield core.Supplier.get(this._options.apiKey)
176
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
179
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
177
180
  contentType: "application/json",
178
181
  requestType: "json",
179
182
  body: serializers.ApiKeyCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -249,15 +252,16 @@ class ApiKeys {
249
252
  */
250
253
  deleteApiKey(request, requestOptions) {
251
254
  return __awaiter(this, void 0, void 0, function* () {
255
+ var _a;
252
256
  const { id } = request;
253
257
  const _queryParams = {};
254
258
  _queryParams["id"] = id;
255
259
  const _response = yield core.fetcher({
256
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "api_keys/"),
260
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "api_keys/"),
257
261
  method: "DELETE",
258
262
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
259
263
  ? yield core.Supplier.get(this._options.apiKey)
260
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
264
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
261
265
  contentType: "application/json",
262
266
  queryParameters: _queryParams,
263
267
  requestType: "json",
@@ -331,12 +335,13 @@ class ApiKeys {
331
335
  */
332
336
  readApiKey(id, requestOptions) {
333
337
  return __awaiter(this, void 0, void 0, function* () {
338
+ var _a;
334
339
  const _response = yield core.fetcher({
335
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `api_keys/${encodeURIComponent(id)}`),
340
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `api_keys/${encodeURIComponent(id)}`),
336
341
  method: "GET",
337
342
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
338
343
  ? yield core.Supplier.get(this._options.apiKey)
339
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
344
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
340
345
  contentType: "application/json",
341
346
  requestType: "json",
342
347
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as environments from "../../../../environments";
4
5
  import * as core from "../../../../core";
5
6
  import * as AirweaveSDK from "../../../index";
6
7
  export declare namespace Chat {
7
8
  interface Options {
8
- environment: core.Supplier<string>;
9
+ environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
9
10
  /** Override the x-api-key header */
10
11
  apiKey?: core.Supplier<string | undefined>;
11
12
  }
@@ -24,7 +25,7 @@ export declare namespace Chat {
24
25
  }
25
26
  export declare class Chat {
26
27
  protected readonly _options: Chat.Options;
27
- constructor(_options: Chat.Options);
28
+ constructor(_options?: Chat.Options);
28
29
  /**
29
30
  * Check if the OpenAI API key is set for the current user.
30
31
  *
@@ -49,13 +49,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
49
49
  };
50
50
  Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.Chat = void 0;
52
+ const environments = __importStar(require("../../../../environments"));
52
53
  const core = __importStar(require("../../../../core"));
53
54
  const AirweaveSDK = __importStar(require("../../../index"));
54
55
  const url_join_1 = __importDefault(require("url-join"));
55
56
  const serializers = __importStar(require("../../../../serialization/index"));
56
57
  const errors = __importStar(require("../../../../errors/index"));
57
58
  class Chat {
58
- constructor(_options) {
59
+ constructor(_options = {}) {
59
60
  this._options = _options;
60
61
  }
61
62
  /**
@@ -73,12 +74,13 @@ class Chat {
73
74
  */
74
75
  openaiKeySet(requestOptions) {
75
76
  return __awaiter(this, void 0, void 0, function* () {
77
+ var _a;
76
78
  const _response = yield core.fetcher({
77
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "chat/openai_key_set"),
79
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "chat/openai_key_set"),
78
80
  method: "GET",
79
81
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
80
82
  ? yield core.Supplier.get(this._options.apiKey)
81
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
84
  contentType: "application/json",
83
85
  requestType: "json",
84
86
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -137,6 +139,7 @@ class Chat {
137
139
  */
138
140
  listChats() {
139
141
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
142
+ var _a;
140
143
  const { skip, limit } = request;
141
144
  const _queryParams = {};
142
145
  if (skip != null) {
@@ -146,11 +149,11 @@ class Chat {
146
149
  _queryParams["limit"] = limit.toString();
147
150
  }
148
151
  const _response = yield core.fetcher({
149
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "chat/"),
152
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "chat/"),
150
153
  method: "GET",
151
154
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
152
155
  ? yield core.Supplier.get(this._options.apiKey)
153
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
154
157
  contentType: "application/json",
155
158
  queryParameters: _queryParams,
156
159
  requestType: "json",
@@ -213,12 +216,13 @@ class Chat {
213
216
  */
214
217
  createChat(request, requestOptions) {
215
218
  return __awaiter(this, void 0, void 0, function* () {
219
+ var _a;
216
220
  const _response = yield core.fetcher({
217
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "chat/"),
221
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "chat/"),
218
222
  method: "POST",
219
223
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
220
224
  ? yield core.Supplier.get(this._options.apiKey)
221
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
225
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
222
226
  contentType: "application/json",
223
227
  requestType: "json",
224
228
  body: serializers.ChatCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -278,12 +282,13 @@ class Chat {
278
282
  */
279
283
  getChat(chatId, requestOptions) {
280
284
  return __awaiter(this, void 0, void 0, function* () {
285
+ var _a;
281
286
  const _response = yield core.fetcher({
282
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `chat/${encodeURIComponent(chatId)}`),
287
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `chat/${encodeURIComponent(chatId)}`),
283
288
  method: "GET",
284
289
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
285
290
  ? yield core.Supplier.get(this._options.apiKey)
286
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
291
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
287
292
  contentType: "application/json",
288
293
  requestType: "json",
289
294
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -343,12 +348,13 @@ class Chat {
343
348
  */
344
349
  updateChat(chatId_1) {
345
350
  return __awaiter(this, arguments, void 0, function* (chatId, request = {}, requestOptions) {
351
+ var _a;
346
352
  const _response = yield core.fetcher({
347
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `chat/${encodeURIComponent(chatId)}`),
353
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `chat/${encodeURIComponent(chatId)}`),
348
354
  method: "PUT",
349
355
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
350
356
  ? yield core.Supplier.get(this._options.apiKey)
351
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
357
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
352
358
  contentType: "application/json",
353
359
  requestType: "json",
354
360
  body: serializers.ChatUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -408,12 +414,13 @@ class Chat {
408
414
  */
409
415
  deleteChat(chatId, requestOptions) {
410
416
  return __awaiter(this, void 0, void 0, function* () {
417
+ var _a;
411
418
  const _response = yield core.fetcher({
412
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `chat/${encodeURIComponent(chatId)}`),
419
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `chat/${encodeURIComponent(chatId)}`),
413
420
  method: "DELETE",
414
421
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
415
422
  ? yield core.Supplier.get(this._options.apiKey)
416
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
423
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
417
424
  contentType: "application/json",
418
425
  requestType: "json",
419
426
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -470,12 +477,13 @@ class Chat {
470
477
  */
471
478
  sendMessage(chatId, request, requestOptions) {
472
479
  return __awaiter(this, void 0, void 0, function* () {
480
+ var _a;
473
481
  const _response = yield core.fetcher({
474
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `chat/${encodeURIComponent(chatId)}/message`),
482
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `chat/${encodeURIComponent(chatId)}/message`),
475
483
  method: "POST",
476
484
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
477
485
  ? yield core.Supplier.get(this._options.apiKey)
478
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
486
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
479
487
  contentType: "application/json",
480
488
  requestType: "json",
481
489
  body: serializers.ChatMessageCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -535,12 +543,13 @@ class Chat {
535
543
  */
536
544
  streamChatResponse(chatId, requestOptions) {
537
545
  return __awaiter(this, void 0, void 0, function* () {
546
+ var _a;
538
547
  const _response = yield core.fetcher({
539
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `chat/${encodeURIComponent(chatId)}/stream`),
548
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `chat/${encodeURIComponent(chatId)}/stream`),
540
549
  method: "GET",
541
550
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
542
551
  ? yield core.Supplier.get(this._options.apiKey)
543
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
552
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
544
553
  contentType: "application/json",
545
554
  requestType: "json",
546
555
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as environments from "../../../../environments";
4
5
  import * as core from "../../../../core";
5
6
  import * as AirweaveSDK from "../../../index";
6
7
  export declare namespace Connections {
7
8
  interface Options {
8
- environment: core.Supplier<string>;
9
+ environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
9
10
  /** Override the x-api-key header */
10
11
  apiKey?: core.Supplier<string | undefined>;
11
12
  }
@@ -24,7 +25,7 @@ export declare namespace Connections {
24
25
  }
25
26
  export declare class Connections {
26
27
  protected readonly _options: Connections.Options;
27
- constructor(_options: Connections.Options);
28
+ constructor(_options?: Connections.Options);
28
29
  /**
29
30
  * Get a specific connection.
30
31
  *
@@ -49,13 +49,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
49
49
  };
50
50
  Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.Connections = void 0;
52
+ const environments = __importStar(require("../../../../environments"));
52
53
  const core = __importStar(require("../../../../core"));
53
54
  const AirweaveSDK = __importStar(require("../../../index"));
54
55
  const url_join_1 = __importDefault(require("url-join"));
55
56
  const serializers = __importStar(require("../../../../serialization/index"));
56
57
  const errors = __importStar(require("../../../../errors/index"));
57
58
  class Connections {
58
- constructor(_options) {
59
+ constructor(_options = {}) {
59
60
  this._options = _options;
60
61
  }
61
62
  /**
@@ -71,12 +72,13 @@ class Connections {
71
72
  */
72
73
  getConnection(connectionId, requestOptions) {
73
74
  return __awaiter(this, void 0, void 0, function* () {
75
+ var _a;
74
76
  const _response = yield core.fetcher({
75
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/detail/${encodeURIComponent(connectionId)}`),
77
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/detail/${encodeURIComponent(connectionId)}`),
76
78
  method: "GET",
77
79
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
78
80
  ? yield core.Supplier.get(this._options.apiKey)
79
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
81
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
80
82
  contentType: "application/json",
81
83
  requestType: "json",
82
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -134,12 +136,13 @@ class Connections {
134
136
  */
135
137
  listAllConnectedIntegrations(requestOptions) {
136
138
  return __awaiter(this, void 0, void 0, function* () {
139
+ var _a;
137
140
  const _response = yield core.fetcher({
138
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "connections/list"),
141
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "connections/list"),
139
142
  method: "GET",
140
143
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
141
144
  ? yield core.Supplier.get(this._options.apiKey)
142
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
145
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
143
146
  contentType: "application/json",
144
147
  requestType: "json",
145
148
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -206,12 +209,13 @@ class Connections {
206
209
  */
207
210
  listConnectedIntegrations(integrationType, requestOptions) {
208
211
  return __awaiter(this, void 0, void 0, function* () {
212
+ var _a;
209
213
  const _response = yield core.fetcher({
210
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/list/${encodeURIComponent(serializers.IntegrationType.jsonOrThrow(integrationType))}`),
214
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/list/${encodeURIComponent(serializers.IntegrationType.jsonOrThrow(integrationType))}`),
211
215
  method: "GET",
212
216
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
213
217
  ? yield core.Supplier.get(this._options.apiKey)
214
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
218
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
215
219
  contentType: "application/json",
216
220
  requestType: "json",
217
221
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -284,12 +288,13 @@ class Connections {
284
288
  */
285
289
  connectIntegration(integrationType, shortName, request, requestOptions) {
286
290
  return __awaiter(this, void 0, void 0, function* () {
291
+ var _a;
287
292
  const _response = yield core.fetcher({
288
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/connect/${encodeURIComponent(serializers.IntegrationType.jsonOrThrow(integrationType))}/${encodeURIComponent(shortName)}`),
293
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/connect/${encodeURIComponent(serializers.IntegrationType.jsonOrThrow(integrationType))}/${encodeURIComponent(shortName)}`),
289
294
  method: "POST",
290
295
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
291
296
  ? yield core.Supplier.get(this._options.apiKey)
292
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
297
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
293
298
  contentType: "application/json",
294
299
  requestType: "json",
295
300
  body: serializers.BodyConnectIntegrationConnectionsConnectIntegrationTypeShortNamePost.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -357,12 +362,13 @@ class Connections {
357
362
  */
358
363
  getConnectionCredentials(connectionId, requestOptions) {
359
364
  return __awaiter(this, void 0, void 0, function* () {
365
+ var _a;
360
366
  const _response = yield core.fetcher({
361
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/credentials/${encodeURIComponent(connectionId)}`),
367
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/credentials/${encodeURIComponent(connectionId)}`),
362
368
  method: "GET",
363
369
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
364
370
  ? yield core.Supplier.get(this._options.apiKey)
365
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
371
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
366
372
  contentType: "application/json",
367
373
  requestType: "json",
368
374
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -432,12 +438,13 @@ class Connections {
432
438
  */
433
439
  deleteConnection(connectionId, requestOptions) {
434
440
  return __awaiter(this, void 0, void 0, function* () {
441
+ var _a;
435
442
  const _response = yield core.fetcher({
436
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/delete/source/${encodeURIComponent(connectionId)}`),
443
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/delete/source/${encodeURIComponent(connectionId)}`),
437
444
  method: "DELETE",
438
445
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
439
446
  ? yield core.Supplier.get(this._options.apiKey)
440
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
447
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
441
448
  contentType: "application/json",
442
449
  requestType: "json",
443
450
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -503,12 +510,13 @@ class Connections {
503
510
  */
504
511
  disconnectSourceConnection(connectionId, requestOptions) {
505
512
  return __awaiter(this, void 0, void 0, function* () {
513
+ var _a;
506
514
  const _response = yield core.fetcher({
507
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/disconnect/source/${encodeURIComponent(connectionId)}`),
515
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/disconnect/source/${encodeURIComponent(connectionId)}`),
508
516
  method: "PUT",
509
517
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
510
518
  ? yield core.Supplier.get(this._options.apiKey)
511
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
519
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
512
520
  contentType: "application/json",
513
521
  requestType: "json",
514
522
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -575,12 +583,13 @@ class Connections {
575
583
  */
576
584
  disconnectDestinationConnection(connectionId, requestOptions) {
577
585
  return __awaiter(this, void 0, void 0, function* () {
586
+ var _a;
578
587
  const _response = yield core.fetcher({
579
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/disconnect/destination/${encodeURIComponent(connectionId)}`),
588
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/disconnect/destination/${encodeURIComponent(connectionId)}`),
580
589
  method: "PUT",
581
590
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
582
591
  ? yield core.Supplier.get(this._options.apiKey)
583
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
592
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
584
593
  contentType: "application/json",
585
594
  requestType: "json",
586
595
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -641,15 +650,16 @@ class Connections {
641
650
  */
642
651
  getOauth2AuthUrl(request, requestOptions) {
643
652
  return __awaiter(this, void 0, void 0, function* () {
653
+ var _a;
644
654
  const { shortName } = request;
645
655
  const _queryParams = {};
646
656
  _queryParams["short_name"] = shortName;
647
657
  const _response = yield core.fetcher({
648
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "connections/oauth2/source/auth_url"),
658
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "connections/oauth2/source/auth_url"),
649
659
  method: "GET",
650
660
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
651
661
  ? yield core.Supplier.get(this._options.apiKey)
652
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
662
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
653
663
  contentType: "application/json",
654
664
  queryParameters: _queryParams,
655
665
  requestType: "json",
@@ -717,12 +727,13 @@ class Connections {
717
727
  */
718
728
  sendOauth2Code(request, requestOptions) {
719
729
  return __awaiter(this, void 0, void 0, function* () {
730
+ var _a;
720
731
  const _response = yield core.fetcher({
721
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), "connections/oauth2/source/code"),
732
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "connections/oauth2/source/code"),
722
733
  method: "POST",
723
734
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
724
735
  ? yield core.Supplier.get(this._options.apiKey)
725
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
736
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
726
737
  contentType: "application/json",
727
738
  requestType: "json",
728
739
  body: serializers.BodySendOauth2CodeConnectionsOauth2SourceCodePost.jsonOrThrow(request, {
@@ -785,12 +796,13 @@ class Connections {
785
796
  */
786
797
  sendOauth2WhiteLabelCode(whiteLabelId, request, requestOptions) {
787
798
  return __awaiter(this, void 0, void 0, function* () {
799
+ var _a;
788
800
  const _response = yield core.fetcher({
789
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/oauth2/white-label/${encodeURIComponent(whiteLabelId)}/code`),
801
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/oauth2/white-label/${encodeURIComponent(whiteLabelId)}/code`),
790
802
  method: "POST",
791
803
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
792
804
  ? yield core.Supplier.get(this._options.apiKey)
793
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
805
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
794
806
  contentType: "application/json",
795
807
  requestType: "json",
796
808
  body: serializers.connections.sendOauth2WhiteLabelCode.Request.jsonOrThrow(request, {
@@ -852,12 +864,13 @@ class Connections {
852
864
  */
853
865
  getOauth2WhiteLabelAuthUrl(whiteLabelId, requestOptions) {
854
866
  return __awaiter(this, void 0, void 0, function* () {
867
+ var _a;
855
868
  const _response = yield core.fetcher({
856
- url: (0, url_join_1.default)(yield core.Supplier.get(this._options.environment), `connections/oauth2/white-label/${encodeURIComponent(whiteLabelId)}/auth_url`),
869
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/oauth2/white-label/${encodeURIComponent(whiteLabelId)}/auth_url`),
857
870
  method: "GET",
858
871
  headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
859
872
  ? yield core.Supplier.get(this._options.apiKey)
860
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.11", "User-Agent": "@airweave/sdk/0.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
873
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "0.1.12", "User-Agent": "@airweave/sdk/0.1.12", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
861
874
  contentType: "application/json",
862
875
  requestType: "json",
863
876
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as environments from "../../../../environments";
4
5
  import * as core from "../../../../core";
5
6
  import * as AirweaveSDK from "../../../index";
6
7
  export declare namespace Destinations {
7
8
  interface Options {
8
- environment: core.Supplier<string>;
9
+ environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
9
10
  /** Override the x-api-key header */
10
11
  apiKey?: core.Supplier<string | undefined>;
11
12
  }
@@ -24,7 +25,7 @@ export declare namespace Destinations {
24
25
  }
25
26
  export declare class Destinations {
26
27
  protected readonly _options: Destinations.Options;
27
- constructor(_options: Destinations.Options);
28
+ constructor(_options?: Destinations.Options);
28
29
  /**
29
30
  * Get all available destinations.
30
31
  *