@airweave/sdk 0.6.37 → 0.6.38

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 (67) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/index.d.ts +1 -1
  3. package/dist/cjs/api/index.js +1 -1
  4. package/dist/cjs/api/resources/collections/client/Client.d.ts +32 -56
  5. package/dist/cjs/api/resources/collections/client/Client.js +65 -86
  6. package/dist/cjs/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.d.ts → SearchGetLegacyCollectionsReadableIdSearchGetRequest.d.ts} +3 -3
  7. package/dist/cjs/api/resources/collections/client/requests/index.d.ts +1 -2
  8. package/dist/cjs/api/resources/collections/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/collections/index.js +1 -0
  10. package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.d.ts +5 -0
  11. package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.js +5 -0
  12. package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.d.ts +5 -0
  13. package/dist/cjs/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.js +5 -0
  14. package/dist/cjs/api/resources/collections/types/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/collections/types/index.js +18 -0
  16. package/dist/cjs/api/resources/index.d.ts +2 -1
  17. package/dist/cjs/api/resources/index.js +3 -2
  18. package/dist/cjs/api/types/LegacySearchRequest.d.ts +39 -0
  19. package/dist/cjs/api/{resources/collections/client/requests/SearchRequest.js → types/LegacySearchRequest.js} +5 -5
  20. package/dist/cjs/api/types/LegacySearchResponse.d.ts +17 -0
  21. package/dist/cjs/api/types/LegacySearchResponse.js +5 -0
  22. package/dist/cjs/api/types/RetrievalStrategy.d.ts +12 -0
  23. package/dist/cjs/api/types/RetrievalStrategy.js +11 -0
  24. package/dist/cjs/api/types/SearchRequest.d.ts +29 -0
  25. package/dist/cjs/api/types/SearchRequest.js +5 -0
  26. package/dist/cjs/api/types/SearchResponse.d.ts +1 -6
  27. package/dist/cjs/api/types/index.d.ts +4 -0
  28. package/dist/cjs/api/types/index.js +4 -0
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/esm/Client.mjs +2 -2
  32. package/dist/esm/api/index.d.mts +1 -1
  33. package/dist/esm/api/index.mjs +1 -1
  34. package/dist/esm/api/resources/collections/client/Client.d.mts +32 -56
  35. package/dist/esm/api/resources/collections/client/Client.mjs +65 -86
  36. package/dist/esm/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.d.mts → SearchGetLegacyCollectionsReadableIdSearchGetRequest.d.mts} +3 -3
  37. package/dist/esm/api/resources/collections/client/requests/index.d.mts +1 -2
  38. package/dist/esm/api/resources/collections/index.d.mts +1 -0
  39. package/dist/esm/api/resources/collections/index.mjs +1 -0
  40. package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.d.mts +5 -0
  41. package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostRequest.mjs +4 -0
  42. package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.d.mts +5 -0
  43. package/dist/esm/api/resources/collections/types/SearchCollectionsReadableIdSearchPostResponse.mjs +4 -0
  44. package/dist/esm/api/resources/collections/types/index.d.mts +2 -0
  45. package/dist/esm/api/resources/collections/types/index.mjs +2 -0
  46. package/dist/esm/api/resources/index.d.mts +2 -1
  47. package/dist/esm/api/resources/index.mjs +2 -1
  48. package/dist/esm/api/types/LegacySearchRequest.d.mts +39 -0
  49. package/dist/esm/api/types/LegacySearchRequest.mjs +11 -0
  50. package/dist/esm/api/types/LegacySearchResponse.d.mts +17 -0
  51. package/dist/esm/api/types/LegacySearchResponse.mjs +4 -0
  52. package/dist/esm/api/types/RetrievalStrategy.d.mts +12 -0
  53. package/dist/esm/api/types/RetrievalStrategy.mjs +8 -0
  54. package/dist/esm/api/types/SearchRequest.d.mts +29 -0
  55. package/dist/esm/api/types/SearchRequest.mjs +4 -0
  56. package/dist/esm/api/types/SearchResponse.d.mts +1 -6
  57. package/dist/esm/api/types/index.d.mts +4 -0
  58. package/dist/esm/api/types/index.mjs +4 -0
  59. package/dist/esm/version.d.mts +1 -1
  60. package/dist/esm/version.mjs +1 -1
  61. package/package.json +1 -1
  62. package/reference.md +39 -65
  63. package/dist/cjs/api/resources/collections/client/requests/SearchRequest.d.ts +0 -50
  64. package/dist/esm/api/resources/collections/client/requests/SearchRequest.d.mts +0 -50
  65. package/dist/esm/api/resources/collections/client/requests/SearchRequest.mjs +0 -11
  66. /package/dist/cjs/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.js → SearchGetLegacyCollectionsReadableIdSearchGetRequest.js} +0 -0
  67. /package/dist/esm/api/resources/collections/client/requests/{SearchCollectionsReadableIdSearchGetRequest.mjs → SearchGetLegacyCollectionsReadableIdSearchGetRequest.mjs} +0 -0
@@ -47,8 +47,8 @@ class AirweaveSDKClient {
47
47
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
48
48
  "X-Fern-Language": "JavaScript",
49
49
  "X-Fern-SDK-Name": "@airweave/sdk",
50
- "X-Fern-SDK-Version": "v0.6.37",
51
- "User-Agent": "@airweave/sdk/v0.6.37",
50
+ "X-Fern-SDK-Version": "v0.6.38",
51
+ "User-Agent": "@airweave/sdk/v0.6.38",
52
52
  "X-Fern-Runtime": core.RUNTIME.type,
53
53
  "X-Fern-Runtime-Version": core.RUNTIME.version,
54
54
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -1,3 +1,3 @@
1
+ export * from "./resources/index.js";
1
2
  export * from "./types/index.js";
2
3
  export * from "./errors/index.js";
3
- export * from "./resources/index.js";
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./resources/index.js"), exports);
17
18
  __exportStar(require("./types/index.js"), exports);
18
19
  __exportStar(require("./errors/index.js"), exports);
19
- __exportStar(require("./resources/index.js"), exports);
@@ -98,88 +98,64 @@ export declare class Collections {
98
98
  delete(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Collection>;
99
99
  private __delete;
100
100
  /**
101
- * Search across all data sources within the specified collection.
101
+ * Trigger data synchronization for all source connections in the collection.
102
102
  *
103
- * This GET endpoint provides basic search functionality. For advanced filtering
104
- * and options, use the POST /search endpoint.
103
+ * The sync jobs run asynchronously in the background, so this endpoint
104
+ * returns immediately with job details that you can use to track progress. You can
105
+ * monitor the status of individual data synchronization using the source connection
106
+ * endpoints.
105
107
  *
106
- * @param {string} readableId - The unique readable identifier of the collection to search
107
- * @param {AirweaveSDK.SearchCollectionsReadableIdSearchGetRequest} request
108
+ * @param {string} readableId - The unique readable identifier of the collection to refresh
108
109
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
109
110
  *
110
111
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
111
112
  *
112
113
  * @example
113
- * await client.collections.search("readable_id", {
114
- * query: "customer payment issues",
115
- * response_type: "raw",
116
- * limit: 1,
117
- * offset: 1,
118
- * recency_bias: 1.1
119
- * })
114
+ * await client.collections.refreshAllSourceConnections("readable_id")
120
115
  */
121
- search(readableId: string, request: AirweaveSDK.SearchCollectionsReadableIdSearchGetRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchResponse>;
122
- private __search;
116
+ refreshAllSourceConnections(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnectionJob[]>;
117
+ private __refreshAllSourceConnections;
123
118
  /**
124
- * Advanced search with comprehensive filtering and options.
125
- *
126
- * This endpoint supports:
127
- * - Metadata filtering using Qdrant's native filter syntax
128
- * - Pagination with offset and limit
129
- * - Score threshold filtering
130
- * - Query expansion strategies (default: AUTO, generates up to 4 variations)
131
- * - Automatic filter extraction from natural language (default: ON)
132
- * - LLM-based result reranking (default: ON)
133
- *
134
- * Default behavior:
135
- * - Query expansion: ON (AUTO strategy)
136
- * - Query interpretation: ON (extracts filters from natural language)
137
- * - Reranking: ON (improves relevance using LLM)
138
- * - Score threshold: None (no filtering)
139
- *
140
- * To disable features, explicitly set:
141
- * - enable_reranking: false
142
- * - enable_query_interpretation: false
143
- * - expansion_strategy: "no_expansion"
119
+ * Legacy GET search endpoint for backwards compatibility.
120
+ *
121
+ * DEPRECATED: This endpoint uses the old schema. Please migrate to POST with the new
122
+ * SearchRequest format for access to all features.
144
123
  *
145
124
  * @param {string} readableId - The unique readable identifier of the collection to search
146
- * @param {AirweaveSDK.SearchRequest} request
125
+ * @param {AirweaveSDK.SearchGetLegacyCollectionsReadableIdSearchGetRequest} request
147
126
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
148
127
  *
149
128
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
150
129
  *
151
130
  * @example
152
- * await client.collections.searchAdvanced("readable_id", {
153
- * query: "customer payment issues",
154
- * filter: {
155
- * must: {
156
- * key: "key"
157
- * }
158
- * },
159
- * limit: 10,
160
- * score_threshold: 0.7,
161
- * response_type: "completion"
131
+ * await client.collections.searchGetLegacy("readable_id", {
132
+ * query: "query",
133
+ * response_type: "raw",
134
+ * limit: 1,
135
+ * offset: 1,
136
+ * recency_bias: 1.1
162
137
  * })
163
138
  */
164
- searchAdvanced(readableId: string, request: AirweaveSDK.SearchRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchResponse>;
165
- private __searchAdvanced;
139
+ searchGetLegacy(readableId: string, request: AirweaveSDK.SearchGetLegacyCollectionsReadableIdSearchGetRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.LegacySearchResponse>;
140
+ private __searchGetLegacy;
166
141
  /**
167
- * Trigger data synchronization for all source connections in the collection.
142
+ * Search your collection.
168
143
  *
169
- * The sync jobs run asynchronously in the background, so this endpoint
170
- * returns immediately with job details that you can use to track progress. You can
171
- * monitor the status of individual data synchronization using the source connection
172
- * endpoints.
144
+ * Accepts both new SearchRequest and legacy LegacySearchRequest formats
145
+ * for backwards compatibility.
173
146
  *
174
- * @param {string} readableId - The unique readable identifier of the collection to refresh
147
+ * @param {string} readableId - The unique readable identifier of the collection
148
+ * @param {AirweaveSDK.SearchCollectionsReadableIdSearchPostRequest} request
175
149
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
176
150
  *
177
151
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
178
152
  *
179
153
  * @example
180
- * await client.collections.refreshAllSourceConnections("readable_id")
154
+ * await client.collections.search("readable_id", {
155
+ * query: "query"
156
+ * })
181
157
  */
182
- refreshAllSourceConnections(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnectionJob[]>;
183
- private __refreshAllSourceConnections;
158
+ search(readableId: string, request: AirweaveSDK.SearchCollectionsReadableIdSearchPostRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SearchCollectionsReadableIdSearchPostResponse>;
159
+ private __search;
184
160
  protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
185
161
  }
@@ -319,53 +319,33 @@ class Collections {
319
319
  });
320
320
  }
321
321
  /**
322
- * Search across all data sources within the specified collection.
322
+ * Trigger data synchronization for all source connections in the collection.
323
323
  *
324
- * This GET endpoint provides basic search functionality. For advanced filtering
325
- * and options, use the POST /search endpoint.
324
+ * The sync jobs run asynchronously in the background, so this endpoint
325
+ * returns immediately with job details that you can use to track progress. You can
326
+ * monitor the status of individual data synchronization using the source connection
327
+ * endpoints.
326
328
  *
327
- * @param {string} readableId - The unique readable identifier of the collection to search
328
- * @param {AirweaveSDK.SearchCollectionsReadableIdSearchGetRequest} request
329
+ * @param {string} readableId - The unique readable identifier of the collection to refresh
329
330
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
330
331
  *
331
332
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
332
333
  *
333
334
  * @example
334
- * await client.collections.search("readable_id", {
335
- * query: "customer payment issues",
336
- * response_type: "raw",
337
- * limit: 1,
338
- * offset: 1,
339
- * recency_bias: 1.1
340
- * })
335
+ * await client.collections.refreshAllSourceConnections("readable_id")
341
336
  */
342
- search(readableId, request, requestOptions) {
343
- return core.HttpResponsePromise.fromPromise(this.__search(readableId, request, requestOptions));
337
+ refreshAllSourceConnections(readableId, requestOptions) {
338
+ return core.HttpResponsePromise.fromPromise(this.__refreshAllSourceConnections(readableId, requestOptions));
344
339
  }
345
- __search(readableId, request, requestOptions) {
340
+ __refreshAllSourceConnections(readableId, requestOptions) {
346
341
  return __awaiter(this, void 0, void 0, function* () {
347
342
  var _a, _b, _c;
348
- const { query, response_type: responseType, limit, offset, recency_bias: recencyBias } = request;
349
- const _queryParams = {};
350
- _queryParams["query"] = query;
351
- if (responseType != null) {
352
- _queryParams["response_type"] = responseType;
353
- }
354
- if (limit != null) {
355
- _queryParams["limit"] = limit.toString();
356
- }
357
- if (offset != null) {
358
- _queryParams["offset"] = offset.toString();
359
- }
360
- if (recencyBias != null) {
361
- _queryParams["recency_bias"] = recencyBias.toString();
362
- }
363
343
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
364
344
  const _response = yield core.fetcher({
365
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
366
- method: "GET",
345
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/refresh_all`),
346
+ method: "POST",
367
347
  headers: _headers,
368
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
348
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
369
349
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
370
350
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
371
351
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -393,7 +373,7 @@ class Collections {
393
373
  rawResponse: _response.rawResponse,
394
374
  });
395
375
  case "timeout":
396
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /collections/{readable_id}/search.");
376
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/refresh_all.");
397
377
  case "unknown":
398
378
  throw new errors.AirweaveSDKError({
399
379
  message: _response.error.errorMessage,
@@ -403,61 +383,53 @@ class Collections {
403
383
  });
404
384
  }
405
385
  /**
406
- * Advanced search with comprehensive filtering and options.
407
- *
408
- * This endpoint supports:
409
- * - Metadata filtering using Qdrant's native filter syntax
410
- * - Pagination with offset and limit
411
- * - Score threshold filtering
412
- * - Query expansion strategies (default: AUTO, generates up to 4 variations)
413
- * - Automatic filter extraction from natural language (default: ON)
414
- * - LLM-based result reranking (default: ON)
415
- *
416
- * Default behavior:
417
- * - Query expansion: ON (AUTO strategy)
418
- * - Query interpretation: ON (extracts filters from natural language)
419
- * - Reranking: ON (improves relevance using LLM)
420
- * - Score threshold: None (no filtering)
386
+ * Legacy GET search endpoint for backwards compatibility.
421
387
  *
422
- * To disable features, explicitly set:
423
- * - enable_reranking: false
424
- * - enable_query_interpretation: false
425
- * - expansion_strategy: "no_expansion"
388
+ * DEPRECATED: This endpoint uses the old schema. Please migrate to POST with the new
389
+ * SearchRequest format for access to all features.
426
390
  *
427
391
  * @param {string} readableId - The unique readable identifier of the collection to search
428
- * @param {AirweaveSDK.SearchRequest} request
392
+ * @param {AirweaveSDK.SearchGetLegacyCollectionsReadableIdSearchGetRequest} request
429
393
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
430
394
  *
431
395
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
432
396
  *
433
397
  * @example
434
- * await client.collections.searchAdvanced("readable_id", {
435
- * query: "customer payment issues",
436
- * filter: {
437
- * must: {
438
- * key: "key"
439
- * }
440
- * },
441
- * limit: 10,
442
- * score_threshold: 0.7,
443
- * response_type: "completion"
398
+ * await client.collections.searchGetLegacy("readable_id", {
399
+ * query: "query",
400
+ * response_type: "raw",
401
+ * limit: 1,
402
+ * offset: 1,
403
+ * recency_bias: 1.1
444
404
  * })
445
405
  */
446
- searchAdvanced(readableId, request, requestOptions) {
447
- return core.HttpResponsePromise.fromPromise(this.__searchAdvanced(readableId, request, requestOptions));
406
+ searchGetLegacy(readableId, request, requestOptions) {
407
+ return core.HttpResponsePromise.fromPromise(this.__searchGetLegacy(readableId, request, requestOptions));
448
408
  }
449
- __searchAdvanced(readableId, request, requestOptions) {
409
+ __searchGetLegacy(readableId, request, requestOptions) {
450
410
  return __awaiter(this, void 0, void 0, function* () {
451
411
  var _a, _b, _c;
412
+ const { query, response_type: responseType, limit, offset, recency_bias: recencyBias } = request;
413
+ const _queryParams = {};
414
+ _queryParams["query"] = query;
415
+ if (responseType != null) {
416
+ _queryParams["response_type"] = responseType;
417
+ }
418
+ if (limit != null) {
419
+ _queryParams["limit"] = limit.toString();
420
+ }
421
+ if (offset != null) {
422
+ _queryParams["offset"] = offset.toString();
423
+ }
424
+ if (recencyBias != null) {
425
+ _queryParams["recency_bias"] = recencyBias.toString();
426
+ }
452
427
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
453
428
  const _response = yield core.fetcher({
454
429
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
455
- method: "POST",
430
+ method: "GET",
456
431
  headers: _headers,
457
- contentType: "application/json",
458
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
459
- requestType: "json",
460
- body: request,
432
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
461
433
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
462
434
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
463
435
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -485,7 +457,7 @@ class Collections {
485
457
  rawResponse: _response.rawResponse,
486
458
  });
487
459
  case "timeout":
488
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/search.");
460
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /collections/{readable_id}/search.");
489
461
  case "unknown":
490
462
  throw new errors.AirweaveSDKError({
491
463
  message: _response.error.errorMessage,
@@ -495,39 +467,46 @@ class Collections {
495
467
  });
496
468
  }
497
469
  /**
498
- * Trigger data synchronization for all source connections in the collection.
470
+ * Search your collection.
499
471
  *
500
- * The sync jobs run asynchronously in the background, so this endpoint
501
- * returns immediately with job details that you can use to track progress. You can
502
- * monitor the status of individual data synchronization using the source connection
503
- * endpoints.
472
+ * Accepts both new SearchRequest and legacy LegacySearchRequest formats
473
+ * for backwards compatibility.
504
474
  *
505
- * @param {string} readableId - The unique readable identifier of the collection to refresh
475
+ * @param {string} readableId - The unique readable identifier of the collection
476
+ * @param {AirweaveSDK.SearchCollectionsReadableIdSearchPostRequest} request
506
477
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
507
478
  *
508
479
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
509
480
  *
510
481
  * @example
511
- * await client.collections.refreshAllSourceConnections("readable_id")
482
+ * await client.collections.search("readable_id", {
483
+ * query: "query"
484
+ * })
512
485
  */
513
- refreshAllSourceConnections(readableId, requestOptions) {
514
- return core.HttpResponsePromise.fromPromise(this.__refreshAllSourceConnections(readableId, requestOptions));
486
+ search(readableId, request, requestOptions) {
487
+ return core.HttpResponsePromise.fromPromise(this.__search(readableId, request, requestOptions));
515
488
  }
516
- __refreshAllSourceConnections(readableId, requestOptions) {
489
+ __search(readableId, request, requestOptions) {
517
490
  return __awaiter(this, void 0, void 0, function* () {
518
491
  var _a, _b, _c;
519
492
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
520
493
  const _response = yield core.fetcher({
521
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/refresh_all`),
494
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
522
495
  method: "POST",
523
496
  headers: _headers,
497
+ contentType: "application/json",
524
498
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
499
+ requestType: "json",
500
+ body: request,
525
501
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
526
502
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
527
503
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
528
504
  });
529
505
  if (_response.ok) {
530
- return { data: _response.body, rawResponse: _response.rawResponse };
506
+ return {
507
+ data: _response.body,
508
+ rawResponse: _response.rawResponse,
509
+ };
531
510
  }
532
511
  if (_response.error.reason === "status-code") {
533
512
  switch (_response.error.statusCode) {
@@ -549,7 +528,7 @@ class Collections {
549
528
  rawResponse: _response.rawResponse,
550
529
  });
551
530
  case "timeout":
552
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/refresh_all.");
531
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /collections/{readable_id}/search.");
553
532
  case "unknown":
554
533
  throw new errors.AirweaveSDKError({
555
534
  message: _response.error.errorMessage,
@@ -5,14 +5,14 @@ import * as AirweaveSDK from "../../../../index.js";
5
5
  /**
6
6
  * @example
7
7
  * {
8
- * query: "customer payment issues",
8
+ * query: "query",
9
9
  * response_type: "raw",
10
10
  * limit: 1,
11
11
  * offset: 1,
12
12
  * recency_bias: 1.1
13
13
  * }
14
14
  */
15
- export interface SearchCollectionsReadableIdSearchGetRequest {
15
+ export interface SearchGetLegacyCollectionsReadableIdSearchGetRequest {
16
16
  /** The search query text to find relevant documents and data */
17
17
  query: string;
18
18
  /** Format of the response: 'raw' returns search results, 'completion' returns AI-generated answers */
@@ -21,6 +21,6 @@ export interface SearchCollectionsReadableIdSearchGetRequest {
21
21
  limit?: number;
22
22
  /** Number of results to skip for pagination */
23
23
  offset?: number;
24
- /** How much to weigh recency vs similarity (0..1). 0 = no recency effect; 1 = rank by recency only. */
24
+ /** How much to weigh recency vs similarity (0..1) */
25
25
  recency_bias?: number;
26
26
  }
@@ -1,4 +1,3 @@
1
1
  export { type ListCollectionsGetRequest } from "./ListCollectionsGetRequest.js";
2
2
  export { type CollectionCreate } from "./CollectionCreate.js";
3
- export { type SearchCollectionsReadableIdSearchGetRequest } from "./SearchCollectionsReadableIdSearchGetRequest.js";
4
- export { type SearchRequest } from "./SearchRequest.js";
3
+ export { type SearchGetLegacyCollectionsReadableIdSearchGetRequest } from "./SearchGetLegacyCollectionsReadableIdSearchGetRequest.js";
@@ -1 +1,2 @@
1
+ export * from "./types/index.js";
1
2
  export * from "./client/index.js";
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types/index.js"), exports);
17
18
  __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AirweaveSDK from "../../../index.js";
5
+ export type SearchCollectionsReadableIdSearchPostRequest = AirweaveSDK.SearchRequest | AirweaveSDK.LegacySearchRequest;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AirweaveSDK from "../../../index.js";
5
+ export type SearchCollectionsReadableIdSearchPostResponse = AirweaveSDK.SearchResponse | AirweaveSDK.LegacySearchResponse;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./SearchCollectionsReadableIdSearchPostRequest.js";
2
+ export * from "./SearchCollectionsReadableIdSearchPostResponse.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SearchCollectionsReadableIdSearchPostRequest.js"), exports);
18
+ __exportStar(require("./SearchCollectionsReadableIdSearchPostResponse.js"), exports);
@@ -1,5 +1,6 @@
1
- export * as sources from "./sources/index.js";
2
1
  export * as collections from "./collections/index.js";
2
+ export * from "./collections/types/index.js";
3
+ export * as sources from "./sources/index.js";
3
4
  export * as sourceConnections from "./sourceConnections/index.js";
4
5
  export * from "./collections/client/requests/index.js";
5
6
  export * from "./sourceConnections/client/requests/index.js";
@@ -36,9 +36,10 @@ 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.sourceConnections = exports.collections = exports.sources = void 0;
40
- exports.sources = __importStar(require("./sources/index.js"));
39
+ exports.sourceConnections = exports.sources = exports.collections = void 0;
41
40
  exports.collections = __importStar(require("./collections/index.js"));
41
+ __exportStar(require("./collections/types/index.js"), exports);
42
+ exports.sources = __importStar(require("./sources/index.js"));
42
43
  exports.sourceConnections = __importStar(require("./sourceConnections/index.js"));
43
44
  __exportStar(require("./collections/client/requests/index.js"), exports);
44
45
  __exportStar(require("./sourceConnections/client/requests/index.js"), exports);
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AirweaveSDK from "../index.js";
5
+ /**
6
+ * Legacy search request schema for backwards compatibility.
7
+ */
8
+ export interface LegacySearchRequest {
9
+ /** The search query text */
10
+ query: string;
11
+ /** Qdrant native filter for metadata-based filtering */
12
+ filter?: AirweaveSDK.Filter;
13
+ /** Number of results to skip */
14
+ offset?: number;
15
+ /** Maximum number of results */
16
+ limit?: number;
17
+ /** Minimum similarity score threshold (deprecated, will be ignored) */
18
+ score_threshold?: number;
19
+ /** Type of response - 'raw' or 'completion' */
20
+ response_type?: AirweaveSDK.ResponseType;
21
+ /** Search method to use */
22
+ search_method?: LegacySearchRequest.SearchMethod;
23
+ /** How much document age affects the similarity score (0..1) */
24
+ recency_bias?: number;
25
+ /** Query expansion strategy */
26
+ expansion_strategy?: AirweaveSDK.QueryExpansionStrategy;
27
+ /** Enable LLM-based reranking to improve result relevance */
28
+ enable_reranking?: boolean;
29
+ /** Enable automatic filter extraction from natural language query */
30
+ enable_query_interpretation?: boolean;
31
+ }
32
+ export declare namespace LegacySearchRequest {
33
+ type SearchMethod = "hybrid" | "neural" | "keyword";
34
+ const SearchMethod: {
35
+ readonly Hybrid: "hybrid";
36
+ readonly Neural: "neural";
37
+ readonly Keyword: "keyword";
38
+ };
39
+ }
@@ -3,12 +3,12 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SearchRequest = void 0;
7
- var SearchRequest;
8
- (function (SearchRequest) {
9
- SearchRequest.SearchMethod = {
6
+ exports.LegacySearchRequest = void 0;
7
+ var LegacySearchRequest;
8
+ (function (LegacySearchRequest) {
9
+ LegacySearchRequest.SearchMethod = {
10
10
  Hybrid: "hybrid",
11
11
  Neural: "neural",
12
12
  Keyword: "keyword",
13
13
  };
14
- })(SearchRequest || (exports.SearchRequest = SearchRequest = {}));
14
+ })(LegacySearchRequest || (exports.LegacySearchRequest = LegacySearchRequest = {}));
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as AirweaveSDK from "../index.js";
5
+ /**
6
+ * Legacy search response schema for backwards compatibility.
7
+ */
8
+ export interface LegacySearchResponse {
9
+ /** Array of search result objects */
10
+ results: Record<string, unknown>[];
11
+ /** Indicates whether results are raw search matches or AI-generated completions */
12
+ response_type: AirweaveSDK.ResponseType;
13
+ /** AI-generated natural language answer when response_type is 'completion' */
14
+ completion?: string;
15
+ /** Status of the search operation */
16
+ status: AirweaveSDK.SearchStatus;
17
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Retrieval strategies for search.
6
+ */
7
+ export type RetrievalStrategy = "hybrid" | "neural" | "keyword";
8
+ export declare const RetrievalStrategy: {
9
+ readonly Hybrid: "hybrid";
10
+ readonly Neural: "neural";
11
+ readonly Keyword: "keyword";
12
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RetrievalStrategy = void 0;
7
+ exports.RetrievalStrategy = {
8
+ Hybrid: "hybrid",
9
+ Neural: "neural",
10
+ Keyword: "keyword",
11
+ };