@airweave/sdk 0.1.48 → 0.1.50

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 (32) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/collections/client/Client.d.ts +48 -0
  3. package/dist/cjs/api/resources/collections/client/Client.js +95 -0
  4. package/dist/cjs/api/{types → resources/collections/client/requests}/SearchRequest.d.ts +14 -7
  5. package/dist/cjs/api/resources/collections/client/requests/index.d.ts +1 -0
  6. package/dist/cjs/api/resources/whiteLabels/client/Client.d.ts +4 -4
  7. package/dist/cjs/api/resources/whiteLabels/client/Client.js +5 -5
  8. package/dist/cjs/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.ts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.ts} +1 -1
  9. package/dist/cjs/api/resources/whiteLabels/client/requests/index.d.ts +1 -1
  10. package/dist/cjs/api/types/index.d.ts +0 -1
  11. package/dist/cjs/api/types/index.js +0 -1
  12. package/dist/cjs/version.d.ts +1 -1
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/esm/Client.mjs +2 -2
  15. package/dist/esm/api/resources/collections/client/Client.d.mts +48 -0
  16. package/dist/esm/api/resources/collections/client/Client.mjs +95 -0
  17. package/dist/esm/api/{types → resources/collections/client/requests}/SearchRequest.d.mts +14 -7
  18. package/dist/esm/api/resources/collections/client/requests/index.d.mts +1 -0
  19. package/dist/esm/api/resources/whiteLabels/client/Client.d.mts +4 -4
  20. package/dist/esm/api/resources/whiteLabels/client/Client.mjs +5 -5
  21. package/dist/esm/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.mts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.mts} +1 -1
  22. package/dist/esm/api/resources/whiteLabels/client/requests/index.d.mts +1 -1
  23. package/dist/esm/api/types/index.d.mts +0 -1
  24. package/dist/esm/api/types/index.mjs +0 -1
  25. package/dist/esm/version.d.mts +1 -1
  26. package/dist/esm/version.mjs +1 -1
  27. package/package.json +1 -1
  28. package/reference.md +110 -3
  29. /package/dist/cjs/api/{types → resources/collections/client/requests}/SearchRequest.js +0 -0
  30. /package/dist/cjs/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.js} +0 -0
  31. /package/dist/esm/api/{types → resources/collections/client/requests}/SearchRequest.mjs +0 -0
  32. /package/dist/esm/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.mjs} +0 -0
@@ -48,8 +48,8 @@ class AirweaveSDKClient {
48
48
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
49
49
  "X-Fern-Language": "JavaScript",
50
50
  "X-Fern-SDK-Name": "@airweave/sdk",
51
- "X-Fern-SDK-Version": "v0.1.48",
52
- "User-Agent": "@airweave/sdk/v0.1.48",
51
+ "X-Fern-SDK-Version": "v0.1.50",
52
+ "User-Agent": "@airweave/sdk/v0.1.50",
53
53
  "X-Fern-Runtime": core.RUNTIME.type,
54
54
  "X-Fern-Runtime-Version": core.RUNTIME.version,
55
55
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -136,6 +136,54 @@ export declare class Collections {
136
136
  */
137
137
  searchCollection(readableId: string, request: AirweaveSDK.SearchCollectionCollectionsReadableIdSearchGetRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchResponse>;
138
138
  private __searchCollection;
139
+ /**
140
+ * Advanced search with comprehensive filtering and options.
141
+ *
142
+ * This endpoint supports:
143
+ * - Metadata filtering using Qdrant's native filter syntax
144
+ * - Pagination with offset and limit
145
+ * - Score threshold filtering
146
+ * - Query expansion strategies
147
+ * - Result summarization
148
+ * - Control over included metadata and vectors
149
+ *
150
+ * Example request body:
151
+ * ```json
152
+ * {
153
+ * "query": "customer payment issues",
154
+ * "filter": {
155
+ * "must": [
156
+ * {"key": "source", "match": {"value": "stripe"}},
157
+ * {"key": "created_at", "range": {"gte": "2024-01-01T00:00:00Z"}}
158
+ * ]
159
+ * },
160
+ * "limit": 50,
161
+ * "score_threshold": 0.7,
162
+ * "response_type": "completion"
163
+ * }
164
+ * ```
165
+ *
166
+ * @param {string} readableId - The unique readable identifier of the collection to search
167
+ * @param {AirweaveSDK.SearchRequest} request
168
+ * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
169
+ *
170
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
171
+ *
172
+ * @example
173
+ * await client.collections.searchCollectionAdvanced("readable_id", {
174
+ * query: "customer payment issues",
175
+ * filter: {
176
+ * must: {
177
+ * key: "key"
178
+ * }
179
+ * },
180
+ * limit: 50,
181
+ * score_threshold: 0.7,
182
+ * response_type: "completion"
183
+ * })
184
+ */
185
+ searchCollectionAdvanced(readableId: string, request: AirweaveSDK.SearchRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchResponse>;
186
+ private __searchCollectionAdvanced;
139
187
  /**
140
188
  * Trigger data synchronization for all source connections in the collection.
141
189
  *
@@ -468,6 +468,101 @@ class Collections {
468
468
  }
469
469
  });
470
470
  }
471
+ /**
472
+ * Advanced search with comprehensive filtering and options.
473
+ *
474
+ * This endpoint supports:
475
+ * - Metadata filtering using Qdrant's native filter syntax
476
+ * - Pagination with offset and limit
477
+ * - Score threshold filtering
478
+ * - Query expansion strategies
479
+ * - Result summarization
480
+ * - Control over included metadata and vectors
481
+ *
482
+ * Example request body:
483
+ * ```json
484
+ * {
485
+ * "query": "customer payment issues",
486
+ * "filter": {
487
+ * "must": [
488
+ * {"key": "source", "match": {"value": "stripe"}},
489
+ * {"key": "created_at", "range": {"gte": "2024-01-01T00:00:00Z"}}
490
+ * ]
491
+ * },
492
+ * "limit": 50,
493
+ * "score_threshold": 0.7,
494
+ * "response_type": "completion"
495
+ * }
496
+ * ```
497
+ *
498
+ * @param {string} readableId - The unique readable identifier of the collection to search
499
+ * @param {AirweaveSDK.SearchRequest} request
500
+ * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
501
+ *
502
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
503
+ *
504
+ * @example
505
+ * await client.collections.searchCollectionAdvanced("readable_id", {
506
+ * query: "customer payment issues",
507
+ * filter: {
508
+ * must: {
509
+ * key: "key"
510
+ * }
511
+ * },
512
+ * limit: 50,
513
+ * score_threshold: 0.7,
514
+ * response_type: "completion"
515
+ * })
516
+ */
517
+ searchCollectionAdvanced(readableId, request, requestOptions) {
518
+ return core.HttpResponsePromise.fromPromise(this.__searchCollectionAdvanced(readableId, request, requestOptions));
519
+ }
520
+ __searchCollectionAdvanced(readableId, request, requestOptions) {
521
+ return __awaiter(this, void 0, void 0, function* () {
522
+ var _a, _b, _c;
523
+ const _response = yield core.fetcher({
524
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
525
+ method: "POST",
526
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
527
+ contentType: "application/json",
528
+ requestType: "json",
529
+ body: request,
530
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
531
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
532
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
533
+ });
534
+ if (_response.ok) {
535
+ return { data: _response.body, rawResponse: _response.rawResponse };
536
+ }
537
+ if (_response.error.reason === "status-code") {
538
+ switch (_response.error.statusCode) {
539
+ case 422:
540
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
541
+ default:
542
+ throw new errors.AirweaveSDKError({
543
+ statusCode: _response.error.statusCode,
544
+ body: _response.error.body,
545
+ rawResponse: _response.rawResponse,
546
+ });
547
+ }
548
+ }
549
+ switch (_response.error.reason) {
550
+ case "non-json":
551
+ throw new errors.AirweaveSDKError({
552
+ statusCode: _response.error.statusCode,
553
+ body: _response.error.rawBody,
554
+ rawResponse: _response.rawResponse,
555
+ });
556
+ case "timeout":
557
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/search.");
558
+ case "unknown":
559
+ throw new errors.AirweaveSDKError({
560
+ message: _response.error.errorMessage,
561
+ rawResponse: _response.rawResponse,
562
+ });
563
+ }
564
+ });
565
+ }
471
566
  /**
472
567
  * Trigger data synchronization for all source connections in the collection.
473
568
  *
@@ -1,9 +1,20 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as AirweaveSDK from "../index.js";
4
+ import * as AirweaveSDK from "../../../../index.js";
5
5
  /**
6
- * Comprehensive search request encapsulating all search parameters.
6
+ * @example
7
+ * {
8
+ * query: "customer payment issues",
9
+ * filter: {
10
+ * must: {
11
+ * key: "key"
12
+ * }
13
+ * },
14
+ * limit: 50,
15
+ * score_threshold: 0.7,
16
+ * response_type: "completion"
17
+ * }
7
18
  */
8
19
  export interface SearchRequest {
9
20
  /** The search query text */
@@ -20,10 +31,6 @@ export interface SearchRequest {
20
31
  summarize?: boolean;
21
32
  /** Type of response (raw or completion) */
22
33
  response_type?: AirweaveSDK.ResponseType;
23
- /** Query expansion strategy */
34
+ /** Query expansion strategy. Enhances recall by expanding the query with synonyms, related terms, and other variations, but increases latency. */
24
35
  expansion_strategy?: AirweaveSDK.QueryExpansionStrategy;
25
- /** Whether to include metadata in results */
26
- include_metadata?: boolean;
27
- /** Whether to include vectors in response */
28
- with_vectors?: boolean;
29
36
  }
@@ -3,3 +3,4 @@ export { type CollectionCreate } from "./CollectionCreate.js";
3
3
  export { type CollectionUpdate } from "./CollectionUpdate.js";
4
4
  export { type DeleteCollectionCollectionsReadableIdDeleteRequest } from "./DeleteCollectionCollectionsReadableIdDeleteRequest.js";
5
5
  export { type SearchCollectionCollectionsReadableIdSearchGetRequest } from "./SearchCollectionCollectionsReadableIdSearchGetRequest.js";
6
+ export { type SearchRequest } from "./SearchRequest.js";
@@ -171,18 +171,18 @@ export declare class WhiteLabels {
171
171
  * tracking and branding purposes.
172
172
  *
173
173
  * @param {string} whiteLabelId - The unique identifier of the white label integration
174
- * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions} request
174
+ * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
175
175
  * @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
176
176
  *
177
177
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
178
178
  *
179
179
  * @example
180
- * await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
180
+ * await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
181
181
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
182
182
  * })
183
183
  */
184
- exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId: string, request: AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
185
- private __exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions;
184
+ exchangeWhiteLabelOauth2Code(whiteLabelId: string, request: AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
185
+ private __exchangeWhiteLabelOauth2Code;
186
186
  protected _getCustomAuthorizationHeaders(): Promise<{
187
187
  "x-api-key": string;
188
188
  }>;
@@ -516,20 +516,20 @@ class WhiteLabels {
516
516
  * tracking and branding purposes.
517
517
  *
518
518
  * @param {string} whiteLabelId - The unique identifier of the white label integration
519
- * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions} request
519
+ * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
520
520
  * @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
521
521
  *
522
522
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
523
523
  *
524
524
  * @example
525
- * await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
525
+ * await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
526
526
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
527
527
  * })
528
528
  */
529
- exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
530
- return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions));
529
+ exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
530
+ return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions));
531
531
  }
532
- __exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
532
+ __exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
533
533
  return __awaiter(this, void 0, void 0, function* () {
534
534
  var _a, _b, _c;
535
535
  const _response = yield core.fetcher({
@@ -8,7 +8,7 @@ import * as AirweaveSDK from "../../../../index.js";
8
8
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
9
9
  * }
10
10
  */
11
- export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions {
11
+ export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost {
12
12
  /** The OAuth2 authorization code received from the OAuth callback after customer authentication */
13
13
  code: string;
14
14
  /** Optional configuration for the source connection. If not provided, a source connection will be created automatically with default settings. The white label integration is automatically linked to the source connection. */
@@ -1,3 +1,3 @@
1
1
  export { type WhiteLabelCreate } from "./WhiteLabelCreate.js";
2
2
  export { type WhiteLabelUpdate } from "./WhiteLabelUpdate.js";
3
- export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js";
3
+ export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.js";
@@ -58,7 +58,6 @@ export * from "./OrganizationWithRole.js";
58
58
  export * from "./PayloadField.js";
59
59
  export * from "./QueryExpansionStrategy.js";
60
60
  export * from "./ResponseType.js";
61
- export * from "./SearchRequest.js";
62
61
  export * from "./SearchResponse.js";
63
62
  export * from "./SearchStatus.js";
64
63
  export * from "./Source.js";
@@ -74,7 +74,6 @@ __exportStar(require("./OrganizationWithRole.js"), exports);
74
74
  __exportStar(require("./PayloadField.js"), exports);
75
75
  __exportStar(require("./QueryExpansionStrategy.js"), exports);
76
76
  __exportStar(require("./ResponseType.js"), exports);
77
- __exportStar(require("./SearchRequest.js"), exports);
78
77
  __exportStar(require("./SearchResponse.js"), exports);
79
78
  __exportStar(require("./SearchStatus.js"), exports);
80
79
  __exportStar(require("./Source.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "v0.1.48";
1
+ export declare const SDK_VERSION = "v0.1.50";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "v0.1.48";
4
+ exports.SDK_VERSION = "v0.1.50";
@@ -12,8 +12,8 @@ export class AirweaveSDKClient {
12
12
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
13
13
  "X-Fern-Language": "JavaScript",
14
14
  "X-Fern-SDK-Name": "@airweave/sdk",
15
- "X-Fern-SDK-Version": "v0.1.48",
16
- "User-Agent": "@airweave/sdk/v0.1.48",
15
+ "X-Fern-SDK-Version": "v0.1.50",
16
+ "User-Agent": "@airweave/sdk/v0.1.50",
17
17
  "X-Fern-Runtime": core.RUNTIME.type,
18
18
  "X-Fern-Runtime-Version": core.RUNTIME.version,
19
19
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -136,6 +136,54 @@ export declare class Collections {
136
136
  */
137
137
  searchCollection(readableId: string, request: AirweaveSDK.SearchCollectionCollectionsReadableIdSearchGetRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchResponse>;
138
138
  private __searchCollection;
139
+ /**
140
+ * Advanced search with comprehensive filtering and options.
141
+ *
142
+ * This endpoint supports:
143
+ * - Metadata filtering using Qdrant's native filter syntax
144
+ * - Pagination with offset and limit
145
+ * - Score threshold filtering
146
+ * - Query expansion strategies
147
+ * - Result summarization
148
+ * - Control over included metadata and vectors
149
+ *
150
+ * Example request body:
151
+ * ```json
152
+ * {
153
+ * "query": "customer payment issues",
154
+ * "filter": {
155
+ * "must": [
156
+ * {"key": "source", "match": {"value": "stripe"}},
157
+ * {"key": "created_at", "range": {"gte": "2024-01-01T00:00:00Z"}}
158
+ * ]
159
+ * },
160
+ * "limit": 50,
161
+ * "score_threshold": 0.7,
162
+ * "response_type": "completion"
163
+ * }
164
+ * ```
165
+ *
166
+ * @param {string} readableId - The unique readable identifier of the collection to search
167
+ * @param {AirweaveSDK.SearchRequest} request
168
+ * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
169
+ *
170
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
171
+ *
172
+ * @example
173
+ * await client.collections.searchCollectionAdvanced("readable_id", {
174
+ * query: "customer payment issues",
175
+ * filter: {
176
+ * must: {
177
+ * key: "key"
178
+ * }
179
+ * },
180
+ * limit: 50,
181
+ * score_threshold: 0.7,
182
+ * response_type: "completion"
183
+ * })
184
+ */
185
+ searchCollectionAdvanced(readableId: string, request: AirweaveSDK.SearchRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchResponse>;
186
+ private __searchCollectionAdvanced;
139
187
  /**
140
188
  * Trigger data synchronization for all source connections in the collection.
141
189
  *
@@ -432,6 +432,101 @@ export class Collections {
432
432
  }
433
433
  });
434
434
  }
435
+ /**
436
+ * Advanced search with comprehensive filtering and options.
437
+ *
438
+ * This endpoint supports:
439
+ * - Metadata filtering using Qdrant's native filter syntax
440
+ * - Pagination with offset and limit
441
+ * - Score threshold filtering
442
+ * - Query expansion strategies
443
+ * - Result summarization
444
+ * - Control over included metadata and vectors
445
+ *
446
+ * Example request body:
447
+ * ```json
448
+ * {
449
+ * "query": "customer payment issues",
450
+ * "filter": {
451
+ * "must": [
452
+ * {"key": "source", "match": {"value": "stripe"}},
453
+ * {"key": "created_at", "range": {"gte": "2024-01-01T00:00:00Z"}}
454
+ * ]
455
+ * },
456
+ * "limit": 50,
457
+ * "score_threshold": 0.7,
458
+ * "response_type": "completion"
459
+ * }
460
+ * ```
461
+ *
462
+ * @param {string} readableId - The unique readable identifier of the collection to search
463
+ * @param {AirweaveSDK.SearchRequest} request
464
+ * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
465
+ *
466
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
467
+ *
468
+ * @example
469
+ * await client.collections.searchCollectionAdvanced("readable_id", {
470
+ * query: "customer payment issues",
471
+ * filter: {
472
+ * must: {
473
+ * key: "key"
474
+ * }
475
+ * },
476
+ * limit: 50,
477
+ * score_threshold: 0.7,
478
+ * response_type: "completion"
479
+ * })
480
+ */
481
+ searchCollectionAdvanced(readableId, request, requestOptions) {
482
+ return core.HttpResponsePromise.fromPromise(this.__searchCollectionAdvanced(readableId, request, requestOptions));
483
+ }
484
+ __searchCollectionAdvanced(readableId, request, requestOptions) {
485
+ return __awaiter(this, void 0, void 0, function* () {
486
+ var _a, _b, _c;
487
+ const _response = yield core.fetcher({
488
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
489
+ method: "POST",
490
+ headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
491
+ contentType: "application/json",
492
+ requestType: "json",
493
+ body: request,
494
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
495
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
496
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
497
+ });
498
+ if (_response.ok) {
499
+ return { data: _response.body, rawResponse: _response.rawResponse };
500
+ }
501
+ if (_response.error.reason === "status-code") {
502
+ switch (_response.error.statusCode) {
503
+ case 422:
504
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
505
+ default:
506
+ throw new errors.AirweaveSDKError({
507
+ statusCode: _response.error.statusCode,
508
+ body: _response.error.body,
509
+ rawResponse: _response.rawResponse,
510
+ });
511
+ }
512
+ }
513
+ switch (_response.error.reason) {
514
+ case "non-json":
515
+ throw new errors.AirweaveSDKError({
516
+ statusCode: _response.error.statusCode,
517
+ body: _response.error.rawBody,
518
+ rawResponse: _response.rawResponse,
519
+ });
520
+ case "timeout":
521
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/search.");
522
+ case "unknown":
523
+ throw new errors.AirweaveSDKError({
524
+ message: _response.error.errorMessage,
525
+ rawResponse: _response.rawResponse,
526
+ });
527
+ }
528
+ });
529
+ }
435
530
  /**
436
531
  * Trigger data synchronization for all source connections in the collection.
437
532
  *
@@ -1,9 +1,20 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as AirweaveSDK from "../index.mjs";
4
+ import * as AirweaveSDK from "../../../../index.mjs";
5
5
  /**
6
- * Comprehensive search request encapsulating all search parameters.
6
+ * @example
7
+ * {
8
+ * query: "customer payment issues",
9
+ * filter: {
10
+ * must: {
11
+ * key: "key"
12
+ * }
13
+ * },
14
+ * limit: 50,
15
+ * score_threshold: 0.7,
16
+ * response_type: "completion"
17
+ * }
7
18
  */
8
19
  export interface SearchRequest {
9
20
  /** The search query text */
@@ -20,10 +31,6 @@ export interface SearchRequest {
20
31
  summarize?: boolean;
21
32
  /** Type of response (raw or completion) */
22
33
  response_type?: AirweaveSDK.ResponseType;
23
- /** Query expansion strategy */
34
+ /** Query expansion strategy. Enhances recall by expanding the query with synonyms, related terms, and other variations, but increases latency. */
24
35
  expansion_strategy?: AirweaveSDK.QueryExpansionStrategy;
25
- /** Whether to include metadata in results */
26
- include_metadata?: boolean;
27
- /** Whether to include vectors in response */
28
- with_vectors?: boolean;
29
36
  }
@@ -3,3 +3,4 @@ export { type CollectionCreate } from "./CollectionCreate.mjs";
3
3
  export { type CollectionUpdate } from "./CollectionUpdate.mjs";
4
4
  export { type DeleteCollectionCollectionsReadableIdDeleteRequest } from "./DeleteCollectionCollectionsReadableIdDeleteRequest.mjs";
5
5
  export { type SearchCollectionCollectionsReadableIdSearchGetRequest } from "./SearchCollectionCollectionsReadableIdSearchGetRequest.mjs";
6
+ export { type SearchRequest } from "./SearchRequest.mjs";
@@ -171,18 +171,18 @@ export declare class WhiteLabels {
171
171
  * tracking and branding purposes.
172
172
  *
173
173
  * @param {string} whiteLabelId - The unique identifier of the white label integration
174
- * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions} request
174
+ * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
175
175
  * @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
176
176
  *
177
177
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
178
178
  *
179
179
  * @example
180
- * await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
180
+ * await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
181
181
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
182
182
  * })
183
183
  */
184
- exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId: string, request: AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
185
- private __exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions;
184
+ exchangeWhiteLabelOauth2Code(whiteLabelId: string, request: AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
185
+ private __exchangeWhiteLabelOauth2Code;
186
186
  protected _getCustomAuthorizationHeaders(): Promise<{
187
187
  "x-api-key": string;
188
188
  }>;
@@ -480,20 +480,20 @@ export class WhiteLabels {
480
480
  * tracking and branding purposes.
481
481
  *
482
482
  * @param {string} whiteLabelId - The unique identifier of the white label integration
483
- * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions} request
483
+ * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
484
484
  * @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
485
485
  *
486
486
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
487
487
  *
488
488
  * @example
489
- * await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
489
+ * await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
490
490
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
491
491
  * })
492
492
  */
493
- exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
494
- return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions));
493
+ exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
494
+ return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions));
495
495
  }
496
- __exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
496
+ __exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
497
497
  return __awaiter(this, void 0, void 0, function* () {
498
498
  var _a, _b, _c;
499
499
  const _response = yield core.fetcher({
@@ -8,7 +8,7 @@ import * as AirweaveSDK from "../../../../index.mjs";
8
8
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
9
9
  * }
10
10
  */
11
- export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions {
11
+ export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost {
12
12
  /** The OAuth2 authorization code received from the OAuth callback after customer authentication */
13
13
  code: string;
14
14
  /** Optional configuration for the source connection. If not provided, a source connection will be created automatically with default settings. The white label integration is automatically linked to the source connection. */
@@ -1,3 +1,3 @@
1
1
  export { type WhiteLabelCreate } from "./WhiteLabelCreate.mjs";
2
2
  export { type WhiteLabelUpdate } from "./WhiteLabelUpdate.mjs";
3
- export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs";
3
+ export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.mjs";
@@ -58,7 +58,6 @@ export * from "./OrganizationWithRole.mjs";
58
58
  export * from "./PayloadField.mjs";
59
59
  export * from "./QueryExpansionStrategy.mjs";
60
60
  export * from "./ResponseType.mjs";
61
- export * from "./SearchRequest.mjs";
62
61
  export * from "./SearchResponse.mjs";
63
62
  export * from "./SearchStatus.mjs";
64
63
  export * from "./Source.mjs";
@@ -58,7 +58,6 @@ export * from "./OrganizationWithRole.mjs";
58
58
  export * from "./PayloadField.mjs";
59
59
  export * from "./QueryExpansionStrategy.mjs";
60
60
  export * from "./ResponseType.mjs";
61
- export * from "./SearchRequest.mjs";
62
61
  export * from "./SearchResponse.mjs";
63
62
  export * from "./SearchStatus.mjs";
64
63
  export * from "./Source.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "v0.1.48";
1
+ export declare const SDK_VERSION = "v0.1.50";
@@ -1 +1 @@
1
- export const SDK_VERSION = "v0.1.48";
1
+ export const SDK_VERSION = "v0.1.50";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airweave/sdk",
3
- "version": "v0.1.48",
3
+ "version": "v0.1.50",
4
4
  "private": false,
5
5
  "repository": "https://github.com/airweave-ai/typescript-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -552,6 +552,113 @@ await client.collections.searchCollection("readable_id", {
552
552
  </dl>
553
553
  </details>
554
554
 
555
+ <details><summary><code>client.collections.<a href="/src/api/resources/collections/client/Client.ts">searchCollectionAdvanced</a>(readableId, { ...params }) -> AirweaveSDK.SearchResponse</code></summary>
556
+ <dl>
557
+ <dd>
558
+
559
+ #### 📝 Description
560
+
561
+ <dl>
562
+ <dd>
563
+
564
+ <dl>
565
+ <dd>
566
+
567
+ Advanced search with comprehensive filtering and options.
568
+
569
+ This endpoint supports:
570
+
571
+ - Metadata filtering using Qdrant's native filter syntax
572
+ - Pagination with offset and limit
573
+ - Score threshold filtering
574
+ - Query expansion strategies
575
+ - Result summarization
576
+ - Control over included metadata and vectors
577
+
578
+ Example request body:
579
+
580
+ ```json
581
+ {
582
+ "query": "customer payment issues",
583
+ "filter": {
584
+ "must": [
585
+ { "key": "source", "match": { "value": "stripe" } },
586
+ { "key": "created_at", "range": { "gte": "2024-01-01T00:00:00Z" } }
587
+ ]
588
+ },
589
+ "limit": 50,
590
+ "score_threshold": 0.7,
591
+ "response_type": "completion"
592
+ }
593
+ ```
594
+
595
+ </dd>
596
+ </dl>
597
+ </dd>
598
+ </dl>
599
+
600
+ #### 🔌 Usage
601
+
602
+ <dl>
603
+ <dd>
604
+
605
+ <dl>
606
+ <dd>
607
+
608
+ ```typescript
609
+ await client.collections.searchCollectionAdvanced("readable_id", {
610
+ query: "customer payment issues",
611
+ filter: {
612
+ must: {
613
+ key: "key",
614
+ },
615
+ },
616
+ limit: 50,
617
+ score_threshold: 0.7,
618
+ response_type: "completion",
619
+ });
620
+ ```
621
+
622
+ </dd>
623
+ </dl>
624
+ </dd>
625
+ </dl>
626
+
627
+ #### ⚙️ Parameters
628
+
629
+ <dl>
630
+ <dd>
631
+
632
+ <dl>
633
+ <dd>
634
+
635
+ **readableId:** `string` — The unique readable identifier of the collection to search
636
+
637
+ </dd>
638
+ </dl>
639
+
640
+ <dl>
641
+ <dd>
642
+
643
+ **request:** `AirweaveSDK.SearchRequest`
644
+
645
+ </dd>
646
+ </dl>
647
+
648
+ <dl>
649
+ <dd>
650
+
651
+ **requestOptions:** `Collections.RequestOptions`
652
+
653
+ </dd>
654
+ </dl>
655
+ </dd>
656
+ </dl>
657
+
658
+ </dd>
659
+ </dl>
660
+ </details>
661
+
555
662
  <details><summary><code>client.collections.<a href="/src/api/resources/collections/client/Client.ts">refreshAllSourceConnections</a>(readableId) -> AirweaveSDK.SourceConnectionJob[]</code></summary>
556
663
  <dl>
557
664
  <dd>
@@ -1767,7 +1874,7 @@ await client.whiteLabels.listWhiteLabelSourceConnections("white_label_id");
1767
1874
  </dl>
1768
1875
  </details>
1769
1876
 
1770
- <details><summary><code>client.whiteLabels.<a href="/src/api/resources/whiteLabels/client/Client.ts">exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions</a>(whiteLabelId, { ...params }) -> AirweaveSDK.SourceConnection</code></summary>
1877
+ <details><summary><code>client.whiteLabels.<a href="/src/api/resources/whiteLabels/client/Client.ts">exchangeWhiteLabelOauth2Code</a>(whiteLabelId, { ...params }) -> AirweaveSDK.SourceConnection</code></summary>
1771
1878
  <dl>
1772
1879
  <dd>
1773
1880
 
@@ -1802,7 +1909,7 @@ tracking and branding purposes.
1802
1909
  <dd>
1803
1910
 
1804
1911
  ```typescript
1805
- await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
1912
+ await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
1806
1913
  code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7",
1807
1914
  });
1808
1915
  ```
@@ -1828,7 +1935,7 @@ await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOaut
1828
1935
  <dl>
1829
1936
  <dd>
1830
1937
 
1831
- **request:** `AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions`
1938
+ **request:** `AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost`
1832
1939
 
1833
1940
  </dd>
1834
1941
  </dl>