@airweave/sdk 0.1.36 → 0.1.37

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 (56) hide show
  1. package/Client.d.ts +0 -3
  2. package/Client.js +4 -9
  3. package/api/resources/collections/client/Client.d.ts +25 -0
  4. package/api/resources/collections/client/Client.js +90 -5
  5. package/api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.d.ts +20 -0
  6. package/{dist/api/resources/connections/client/index.js → api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.js} +3 -0
  7. package/api/resources/collections/client/requests/index.d.ts +1 -0
  8. package/api/resources/index.d.ts +0 -1
  9. package/api/resources/index.js +1 -2
  10. package/api/resources/sourceConnections/client/Client.js +7 -7
  11. package/api/resources/sources/client/Client.js +2 -2
  12. package/api/resources/whiteLabels/client/Client.js +6 -6
  13. package/dist/Client.d.ts +0 -3
  14. package/dist/Client.js +4 -9
  15. package/dist/api/resources/collections/client/Client.d.ts +25 -0
  16. package/dist/api/resources/collections/client/Client.js +90 -5
  17. package/dist/api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.d.ts +20 -0
  18. package/{api/resources/connections/client/index.js → dist/api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.js} +3 -0
  19. package/dist/api/resources/collections/client/requests/index.d.ts +1 -0
  20. package/dist/api/resources/index.d.ts +0 -1
  21. package/dist/api/resources/index.js +1 -2
  22. package/dist/api/resources/sourceConnections/client/Client.js +7 -7
  23. package/dist/api/resources/sources/client/Client.js +2 -2
  24. package/dist/api/resources/whiteLabels/client/Client.js +6 -6
  25. package/dist/serialization/resources/index.d.ts +0 -1
  26. package/dist/serialization/resources/index.js +1 -2
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/package.json +1 -1
  30. package/reference.md +29 -85
  31. package/serialization/resources/index.d.ts +0 -1
  32. package/serialization/resources/index.js +1 -2
  33. package/version.d.ts +1 -1
  34. package/version.js +1 -1
  35. package/api/resources/connections/client/Client.d.ts +0 -73
  36. package/api/resources/connections/client/Client.js +0 -216
  37. package/api/resources/connections/client/index.d.ts +0 -1
  38. package/api/resources/connections/index.d.ts +0 -1
  39. package/api/resources/connections/index.js +0 -17
  40. package/dist/api/resources/connections/client/Client.d.ts +0 -73
  41. package/dist/api/resources/connections/client/Client.js +0 -216
  42. package/dist/api/resources/connections/client/index.d.ts +0 -1
  43. package/dist/api/resources/connections/index.d.ts +0 -1
  44. package/dist/api/resources/connections/index.js +0 -17
  45. package/dist/serialization/resources/connections/client/index.d.ts +0 -1
  46. package/dist/serialization/resources/connections/client/index.js +0 -37
  47. package/dist/serialization/resources/connections/client/listAllConnectedIntegrations.d.ts +0 -11
  48. package/dist/serialization/resources/connections/client/listAllConnectedIntegrations.js +0 -42
  49. package/dist/serialization/resources/connections/index.d.ts +0 -1
  50. package/dist/serialization/resources/connections/index.js +0 -17
  51. package/serialization/resources/connections/client/index.d.ts +0 -1
  52. package/serialization/resources/connections/client/index.js +0 -37
  53. package/serialization/resources/connections/client/listAllConnectedIntegrations.d.ts +0 -11
  54. package/serialization/resources/connections/client/listAllConnectedIntegrations.js +0 -42
  55. package/serialization/resources/connections/index.d.ts +0 -1
  56. package/serialization/resources/connections/index.js +0 -17
package/Client.d.ts CHANGED
@@ -5,7 +5,6 @@ import * as environments from "./environments";
5
5
  import * as core from "./core";
6
6
  import { Sources } from "./api/resources/sources/client/Client";
7
7
  import { Collections } from "./api/resources/collections/client/Client";
8
- import { Connections } from "./api/resources/connections/client/Client";
9
8
  import { SourceConnections } from "./api/resources/sourceConnections/client/Client";
10
9
  import { WhiteLabels } from "./api/resources/whiteLabels/client/Client";
11
10
  export declare namespace AirweaveSDKClient {
@@ -32,13 +31,11 @@ export declare class AirweaveSDKClient {
32
31
  protected readonly _options: AirweaveSDKClient.Options;
33
32
  protected _sources: Sources | undefined;
34
33
  protected _collections: Collections | undefined;
35
- protected _connections: Connections | undefined;
36
34
  protected _sourceConnections: SourceConnections | undefined;
37
35
  protected _whiteLabels: WhiteLabels | undefined;
38
36
  constructor(_options: AirweaveSDKClient.Options);
39
37
  get sources(): Sources;
40
38
  get collections(): Collections;
41
- get connections(): Connections;
42
39
  get sourceConnections(): SourceConnections;
43
40
  get whiteLabels(): WhiteLabels;
44
41
  }
package/Client.js CHANGED
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AirweaveSDKClient = void 0;
7
7
  const Client_1 = require("./api/resources/sources/client/Client");
8
8
  const Client_2 = require("./api/resources/collections/client/Client");
9
- const Client_3 = require("./api/resources/connections/client/Client");
10
- const Client_4 = require("./api/resources/sourceConnections/client/Client");
11
- const Client_5 = require("./api/resources/whiteLabels/client/Client");
9
+ const Client_3 = require("./api/resources/sourceConnections/client/Client");
10
+ const Client_4 = require("./api/resources/whiteLabels/client/Client");
12
11
  class AirweaveSDKClient {
13
12
  constructor(_options) {
14
13
  this._options = _options;
@@ -21,17 +20,13 @@ class AirweaveSDKClient {
21
20
  var _a;
22
21
  return ((_a = this._collections) !== null && _a !== void 0 ? _a : (this._collections = new Client_2.Collections(this._options)));
23
22
  }
24
- get connections() {
25
- var _a;
26
- return ((_a = this._connections) !== null && _a !== void 0 ? _a : (this._connections = new Client_3.Connections(this._options)));
27
- }
28
23
  get sourceConnections() {
29
24
  var _a;
30
- return ((_a = this._sourceConnections) !== null && _a !== void 0 ? _a : (this._sourceConnections = new Client_4.SourceConnections(this._options)));
25
+ return ((_a = this._sourceConnections) !== null && _a !== void 0 ? _a : (this._sourceConnections = new Client_3.SourceConnections(this._options)));
31
26
  }
32
27
  get whiteLabels() {
33
28
  var _a;
34
- return ((_a = this._whiteLabels) !== null && _a !== void 0 ? _a : (this._whiteLabels = new Client_5.WhiteLabels(this._options)));
29
+ return ((_a = this._whiteLabels) !== null && _a !== void 0 ? _a : (this._whiteLabels = new Client_4.WhiteLabels(this._options)));
35
30
  }
36
31
  }
37
32
  exports.AirweaveSDKClient = AirweaveSDKClient;
@@ -87,6 +87,31 @@ export declare class Collections {
87
87
  * await client.collections.deleteCollection("readable_id")
88
88
  */
89
89
  deleteCollection(readableId: string, request?: AirweaveSDK.DeleteCollectionCollectionsReadableIdDeleteRequest, requestOptions?: Collections.RequestOptions): Promise<AirweaveSDK.Collection>;
90
+ /**
91
+ * Search within a collection identified by readable ID.
92
+ *
93
+ * Args:
94
+ * readable_id: The readable ID of the collection to search
95
+ * query: The search query
96
+ * response_type: Type of response (raw results or AI completion)
97
+ * db: The database session
98
+ * current_user: The current user
99
+ *
100
+ * Returns:
101
+ * dict: Search results or AI completion response
102
+ *
103
+ * @param {string} readableId
104
+ * @param {AirweaveSDK.SearchCollectionCollectionsReadableIdSearchGetRequest} request
105
+ * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
106
+ *
107
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
108
+ *
109
+ * @example
110
+ * await client.collections.searchCollection("readable_id", {
111
+ * query: "query"
112
+ * })
113
+ */
114
+ searchCollection(readableId: string, request: AirweaveSDK.SearchCollectionCollectionsReadableIdSearchGetRequest, requestOptions?: Collections.RequestOptions): Promise<AirweaveSDK.SearchResponse>;
90
115
  /**
91
116
  * Start sync jobs for all source connections in the collection.
92
117
  *
@@ -86,7 +86,7 @@ class Collections {
86
86
  method: "GET",
87
87
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
88
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
90
  contentType: "application/json",
91
91
  queryParameters: _queryParams,
92
92
  requestType: "json",
@@ -154,7 +154,7 @@ class Collections {
154
154
  method: "POST",
155
155
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
156
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
157
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
158
  contentType: "application/json",
159
159
  requestType: "json",
160
160
  body: serializers.CollectionCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -220,7 +220,7 @@ class Collections {
220
220
  method: "GET",
221
221
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
222
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
223
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
224
224
  contentType: "application/json",
225
225
  requestType: "json",
226
226
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -300,7 +300,7 @@ class Collections {
300
300
  method: "DELETE",
301
301
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
302
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
303
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
304
304
  contentType: "application/json",
305
305
  queryParameters: _queryParams,
306
306
  requestType: "json",
@@ -347,6 +347,91 @@ class Collections {
347
347
  }
348
348
  });
349
349
  }
350
+ /**
351
+ * Search within a collection identified by readable ID.
352
+ *
353
+ * Args:
354
+ * readable_id: The readable ID of the collection to search
355
+ * query: The search query
356
+ * response_type: Type of response (raw results or AI completion)
357
+ * db: The database session
358
+ * current_user: The current user
359
+ *
360
+ * Returns:
361
+ * dict: Search results or AI completion response
362
+ *
363
+ * @param {string} readableId
364
+ * @param {AirweaveSDK.SearchCollectionCollectionsReadableIdSearchGetRequest} request
365
+ * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
366
+ *
367
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
368
+ *
369
+ * @example
370
+ * await client.collections.searchCollection("readable_id", {
371
+ * query: "query"
372
+ * })
373
+ */
374
+ searchCollection(readableId, request, requestOptions) {
375
+ return __awaiter(this, void 0, void 0, function* () {
376
+ var _a;
377
+ const { query, responseType } = request;
378
+ const _queryParams = {};
379
+ _queryParams["query"] = query;
380
+ if (responseType != null) {
381
+ _queryParams["response_type"] = responseType;
382
+ }
383
+ const _response = yield core.fetcher({
384
+ 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
+ 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.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
389
+ contentType: "application/json",
390
+ queryParameters: _queryParams,
391
+ requestType: "json",
392
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
393
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
394
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
395
+ });
396
+ if (_response.ok) {
397
+ return serializers.SearchResponse.parseOrThrow(_response.body, {
398
+ unrecognizedObjectKeys: "passthrough",
399
+ allowUnrecognizedUnionMembers: true,
400
+ allowUnrecognizedEnumValues: true,
401
+ breadcrumbsPrefix: ["response"],
402
+ });
403
+ }
404
+ if (_response.error.reason === "status-code") {
405
+ switch (_response.error.statusCode) {
406
+ case 422:
407
+ throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
408
+ unrecognizedObjectKeys: "passthrough",
409
+ allowUnrecognizedUnionMembers: true,
410
+ allowUnrecognizedEnumValues: true,
411
+ breadcrumbsPrefix: ["response"],
412
+ }));
413
+ default:
414
+ throw new errors.AirweaveSDKError({
415
+ statusCode: _response.error.statusCode,
416
+ body: _response.error.body,
417
+ });
418
+ }
419
+ }
420
+ switch (_response.error.reason) {
421
+ case "non-json":
422
+ throw new errors.AirweaveSDKError({
423
+ statusCode: _response.error.statusCode,
424
+ body: _response.error.rawBody,
425
+ });
426
+ case "timeout":
427
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /collections/{readable_id}/search.");
428
+ case "unknown":
429
+ throw new errors.AirweaveSDKError({
430
+ message: _response.error.errorMessage,
431
+ });
432
+ }
433
+ });
434
+ }
350
435
  /**
351
436
  * Start sync jobs for all source connections in the collection.
352
437
  *
@@ -375,7 +460,7 @@ class Collections {
375
460
  method: "POST",
376
461
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
377
462
  ? yield core.Supplier.get(this._options.apiKey)
378
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
463
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
379
464
  contentType: "application/json",
380
465
  requestType: "json",
381
466
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AirweaveSDK from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * query: "query"
9
+ * }
10
+ */
11
+ export interface SearchCollectionCollectionsReadableIdSearchGetRequest {
12
+ /**
13
+ * Search query
14
+ */
15
+ query: string;
16
+ /**
17
+ * Type of response: raw search results or AI completion
18
+ */
19
+ responseType?: AirweaveSDK.ResponseType;
20
+ }
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
1
  export { type ListCollectionsCollectionsGetRequest } from "./ListCollectionsCollectionsGetRequest";
2
2
  export { type CollectionCreate } from "./CollectionCreate";
3
3
  export { type DeleteCollectionCollectionsReadableIdDeleteRequest } from "./DeleteCollectionCollectionsReadableIdDeleteRequest";
4
+ export { type SearchCollectionCollectionsReadableIdSearchGetRequest } from "./SearchCollectionCollectionsReadableIdSearchGetRequest";
@@ -1,6 +1,5 @@
1
1
  export * as sources from "./sources";
2
2
  export * as collections from "./collections";
3
- export * as connections from "./connections";
4
3
  export * as sourceConnections from "./sourceConnections";
5
4
  export * as whiteLabels from "./whiteLabels";
6
5
  export * from "./collections/client/requests";
@@ -36,10 +36,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.whiteLabels = exports.sourceConnections = exports.connections = exports.collections = exports.sources = void 0;
39
+ exports.whiteLabels = exports.sourceConnections = exports.collections = exports.sources = void 0;
40
40
  exports.sources = __importStar(require("./sources"));
41
41
  exports.collections = __importStar(require("./collections"));
42
- exports.connections = __importStar(require("./connections"));
43
42
  exports.sourceConnections = __importStar(require("./sourceConnections"));
44
43
  exports.whiteLabels = __importStar(require("./whiteLabels"));
45
44
  __exportStar(require("./collections/client/requests"), exports);
@@ -99,7 +99,7 @@ class SourceConnections {
99
99
  method: "GET",
100
100
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
101
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
102
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
103
103
  contentType: "application/json",
104
104
  queryParameters: _queryParams,
105
105
  requestType: "json",
@@ -184,7 +184,7 @@ class SourceConnections {
184
184
  method: "POST",
185
185
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
186
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
187
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
188
188
  contentType: "application/json",
189
189
  requestType: "json",
190
190
  body: serializers.SourceConnectionCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -265,7 +265,7 @@ class SourceConnections {
265
265
  method: "GET",
266
266
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
267
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
268
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
269
269
  contentType: "application/json",
270
270
  queryParameters: _queryParams,
271
271
  requestType: "json",
@@ -341,7 +341,7 @@ class SourceConnections {
341
341
  method: "PUT",
342
342
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
343
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "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": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
345
345
  contentType: "application/json",
346
346
  requestType: "json",
347
347
  body: serializers.SourceConnectionUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -422,7 +422,7 @@ class SourceConnections {
422
422
  method: "DELETE",
423
423
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
424
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
425
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
426
426
  contentType: "application/json",
427
427
  queryParameters: _queryParams,
428
428
  requestType: "json",
@@ -497,7 +497,7 @@ class SourceConnections {
497
497
  method: "POST",
498
498
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
499
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
500
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
501
501
  contentType: "application/json",
502
502
  requestType: "json",
503
503
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -570,7 +570,7 @@ class SourceConnections {
570
570
  method: "GET",
571
571
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
572
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
573
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
574
574
  contentType: "application/json",
575
575
  requestType: "json",
576
576
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -88,7 +88,7 @@ class Sources {
88
88
  method: "GET",
89
89
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
90
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
92
  contentType: "application/json",
93
93
  requestType: "json",
94
94
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -161,7 +161,7 @@ class Sources {
161
161
  method: "GET",
162
162
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
163
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
164
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
165
165
  contentType: "application/json",
166
166
  requestType: "json",
167
167
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -86,7 +86,7 @@ class WhiteLabels {
86
86
  method: "GET",
87
87
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
88
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
90
90
  contentType: "application/json",
91
91
  requestType: "json",
92
92
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -167,7 +167,7 @@ class WhiteLabels {
167
167
  method: "POST",
168
168
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
169
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
170
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
171
171
  contentType: "application/json",
172
172
  requestType: "json",
173
173
  body: serializers.WhiteLabelCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -243,7 +243,7 @@ class WhiteLabels {
243
243
  method: "GET",
244
244
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
245
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
246
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
247
247
  contentType: "application/json",
248
248
  requestType: "json",
249
249
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -320,7 +320,7 @@ class WhiteLabels {
320
320
  method: "PUT",
321
321
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
322
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
323
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
324
324
  contentType: "application/json",
325
325
  requestType: "json",
326
326
  body: serializers.WhiteLabelUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -396,7 +396,7 @@ class WhiteLabels {
396
396
  method: "DELETE",
397
397
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
398
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
399
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
400
400
  contentType: "application/json",
401
401
  requestType: "json",
402
402
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -471,7 +471,7 @@ class WhiteLabels {
471
471
  method: "GET",
472
472
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
473
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.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
474
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.37", "User-Agent": "@airweave/sdk/v0.1.37", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
475
475
  contentType: "application/json",
476
476
  requestType: "json",
477
477
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
package/dist/Client.d.ts CHANGED
@@ -5,7 +5,6 @@ import * as environments from "./environments";
5
5
  import * as core from "./core";
6
6
  import { Sources } from "./api/resources/sources/client/Client";
7
7
  import { Collections } from "./api/resources/collections/client/Client";
8
- import { Connections } from "./api/resources/connections/client/Client";
9
8
  import { SourceConnections } from "./api/resources/sourceConnections/client/Client";
10
9
  import { WhiteLabels } from "./api/resources/whiteLabels/client/Client";
11
10
  export declare namespace AirweaveSDKClient {
@@ -32,13 +31,11 @@ export declare class AirweaveSDKClient {
32
31
  protected readonly _options: AirweaveSDKClient.Options;
33
32
  protected _sources: Sources | undefined;
34
33
  protected _collections: Collections | undefined;
35
- protected _connections: Connections | undefined;
36
34
  protected _sourceConnections: SourceConnections | undefined;
37
35
  protected _whiteLabels: WhiteLabels | undefined;
38
36
  constructor(_options: AirweaveSDKClient.Options);
39
37
  get sources(): Sources;
40
38
  get collections(): Collections;
41
- get connections(): Connections;
42
39
  get sourceConnections(): SourceConnections;
43
40
  get whiteLabels(): WhiteLabels;
44
41
  }
package/dist/Client.js CHANGED
@@ -6,9 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AirweaveSDKClient = void 0;
7
7
  const Client_1 = require("./api/resources/sources/client/Client");
8
8
  const Client_2 = require("./api/resources/collections/client/Client");
9
- const Client_3 = require("./api/resources/connections/client/Client");
10
- const Client_4 = require("./api/resources/sourceConnections/client/Client");
11
- const Client_5 = require("./api/resources/whiteLabels/client/Client");
9
+ const Client_3 = require("./api/resources/sourceConnections/client/Client");
10
+ const Client_4 = require("./api/resources/whiteLabels/client/Client");
12
11
  class AirweaveSDKClient {
13
12
  constructor(_options) {
14
13
  this._options = _options;
@@ -21,17 +20,13 @@ class AirweaveSDKClient {
21
20
  var _a;
22
21
  return ((_a = this._collections) !== null && _a !== void 0 ? _a : (this._collections = new Client_2.Collections(this._options)));
23
22
  }
24
- get connections() {
25
- var _a;
26
- return ((_a = this._connections) !== null && _a !== void 0 ? _a : (this._connections = new Client_3.Connections(this._options)));
27
- }
28
23
  get sourceConnections() {
29
24
  var _a;
30
- return ((_a = this._sourceConnections) !== null && _a !== void 0 ? _a : (this._sourceConnections = new Client_4.SourceConnections(this._options)));
25
+ return ((_a = this._sourceConnections) !== null && _a !== void 0 ? _a : (this._sourceConnections = new Client_3.SourceConnections(this._options)));
31
26
  }
32
27
  get whiteLabels() {
33
28
  var _a;
34
- return ((_a = this._whiteLabels) !== null && _a !== void 0 ? _a : (this._whiteLabels = new Client_5.WhiteLabels(this._options)));
29
+ return ((_a = this._whiteLabels) !== null && _a !== void 0 ? _a : (this._whiteLabels = new Client_4.WhiteLabels(this._options)));
35
30
  }
36
31
  }
37
32
  exports.AirweaveSDKClient = AirweaveSDKClient;
@@ -87,6 +87,31 @@ export declare class Collections {
87
87
  * await client.collections.deleteCollection("readable_id")
88
88
  */
89
89
  deleteCollection(readableId: string, request?: AirweaveSDK.DeleteCollectionCollectionsReadableIdDeleteRequest, requestOptions?: Collections.RequestOptions): Promise<AirweaveSDK.Collection>;
90
+ /**
91
+ * Search within a collection identified by readable ID.
92
+ *
93
+ * Args:
94
+ * readable_id: The readable ID of the collection to search
95
+ * query: The search query
96
+ * response_type: Type of response (raw results or AI completion)
97
+ * db: The database session
98
+ * current_user: The current user
99
+ *
100
+ * Returns:
101
+ * dict: Search results or AI completion response
102
+ *
103
+ * @param {string} readableId
104
+ * @param {AirweaveSDK.SearchCollectionCollectionsReadableIdSearchGetRequest} request
105
+ * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
106
+ *
107
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
108
+ *
109
+ * @example
110
+ * await client.collections.searchCollection("readable_id", {
111
+ * query: "query"
112
+ * })
113
+ */
114
+ searchCollection(readableId: string, request: AirweaveSDK.SearchCollectionCollectionsReadableIdSearchGetRequest, requestOptions?: Collections.RequestOptions): Promise<AirweaveSDK.SearchResponse>;
90
115
  /**
91
116
  * Start sync jobs for all source connections in the collection.
92
117
  *