@airweave/sdk 0.1.48 → 0.1.49
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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/collections/client/Client.d.ts +48 -0
- package/dist/cjs/api/resources/collections/client/Client.js +95 -0
- package/dist/cjs/api/{types → resources/collections/client/requests}/SearchRequest.d.ts +13 -2
- package/dist/cjs/api/resources/collections/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/whiteLabels/client/Client.d.ts +3 -3
- package/dist/cjs/api/resources/whiteLabels/client/Client.js +4 -4
- package/dist/cjs/api/types/index.d.ts +0 -1
- package/dist/cjs/api/types/index.js +0 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/collections/client/Client.d.mts +48 -0
- package/dist/esm/api/resources/collections/client/Client.mjs +95 -0
- package/dist/esm/api/{types → resources/collections/client/requests}/SearchRequest.d.mts +13 -2
- package/dist/esm/api/resources/collections/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/whiteLabels/client/Client.d.mts +3 -3
- package/dist/esm/api/resources/whiteLabels/client/Client.mjs +4 -4
- package/dist/esm/api/types/index.d.mts +0 -1
- package/dist/esm/api/types/index.mjs +0 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +109 -2
- /package/dist/cjs/api/{types → resources/collections/client/requests}/SearchRequest.js +0 -0
- /package/dist/esm/api/{types → resources/collections/client/requests}/SearchRequest.mjs +0 -0
package/dist/cjs/Client.js
CHANGED
|
@@ -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.
|
|
52
|
-
"User-Agent": "@airweave/sdk/v0.1.
|
|
51
|
+
"X-Fern-SDK-Version": "v0.1.49",
|
|
52
|
+
"User-Agent": "@airweave/sdk/v0.1.49",
|
|
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 "
|
|
4
|
+
import * as AirweaveSDK from "../../../../index.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
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 */
|
|
@@ -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";
|
|
@@ -140,10 +140,10 @@ export declare class WhiteLabels {
|
|
|
140
140
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
141
141
|
*
|
|
142
142
|
* @example
|
|
143
|
-
* await client.whiteLabels.
|
|
143
|
+
* await client.whiteLabels.getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions("white_label_id")
|
|
144
144
|
*/
|
|
145
|
-
|
|
146
|
-
private
|
|
145
|
+
getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId: string, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<string>;
|
|
146
|
+
private __getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions;
|
|
147
147
|
/**
|
|
148
148
|
* List all source connections created through a specific white label integration.
|
|
149
149
|
*
|
|
@@ -394,12 +394,12 @@ class WhiteLabels {
|
|
|
394
394
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
395
395
|
*
|
|
396
396
|
* @example
|
|
397
|
-
* await client.whiteLabels.
|
|
397
|
+
* await client.whiteLabels.getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions("white_label_id")
|
|
398
398
|
*/
|
|
399
|
-
|
|
400
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
399
|
+
getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId, requestOptions) {
|
|
400
|
+
return core.HttpResponsePromise.fromPromise(this.__getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId, requestOptions));
|
|
401
401
|
}
|
|
402
|
-
|
|
402
|
+
__getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId, requestOptions) {
|
|
403
403
|
return __awaiter(this, void 0, void 0, function* () {
|
|
404
404
|
var _a, _b, _c;
|
|
405
405
|
const _response = yield core.fetcher({
|
|
@@ -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);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "v0.1.
|
|
1
|
+
export declare const SDK_VERSION = "v0.1.49";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -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.
|
|
16
|
-
"User-Agent": "@airweave/sdk/v0.1.
|
|
15
|
+
"X-Fern-SDK-Version": "v0.1.49",
|
|
16
|
+
"User-Agent": "@airweave/sdk/v0.1.49",
|
|
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 "
|
|
4
|
+
import * as AirweaveSDK from "../../../../index.mjs";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
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 */
|
|
@@ -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";
|
|
@@ -140,10 +140,10 @@ export declare class WhiteLabels {
|
|
|
140
140
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
141
141
|
*
|
|
142
142
|
* @example
|
|
143
|
-
* await client.whiteLabels.
|
|
143
|
+
* await client.whiteLabels.getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions("white_label_id")
|
|
144
144
|
*/
|
|
145
|
-
|
|
146
|
-
private
|
|
145
|
+
getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId: string, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<string>;
|
|
146
|
+
private __getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions;
|
|
147
147
|
/**
|
|
148
148
|
* List all source connections created through a specific white label integration.
|
|
149
149
|
*
|
|
@@ -358,12 +358,12 @@ export class WhiteLabels {
|
|
|
358
358
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
359
359
|
*
|
|
360
360
|
* @example
|
|
361
|
-
* await client.whiteLabels.
|
|
361
|
+
* await client.whiteLabels.getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions("white_label_id")
|
|
362
362
|
*/
|
|
363
|
-
|
|
364
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
363
|
+
getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId, requestOptions) {
|
|
364
|
+
return core.HttpResponsePromise.fromPromise(this.__getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId, requestOptions));
|
|
365
365
|
}
|
|
366
|
-
|
|
366
|
+
__getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions(whiteLabelId, requestOptions) {
|
|
367
367
|
return __awaiter(this, void 0, void 0, function* () {
|
|
368
368
|
var _a, _b, _c;
|
|
369
369
|
const _response = yield core.fetcher({
|
|
@@ -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";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "v0.1.
|
|
1
|
+
export declare const SDK_VERSION = "v0.1.49";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "v0.1.
|
|
1
|
+
export const SDK_VERSION = "v0.1.49";
|
package/package.json
CHANGED
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>
|
|
@@ -1633,7 +1740,7 @@ await client.whiteLabels.deleteWhiteLabel("white_label_id");
|
|
|
1633
1740
|
</dl>
|
|
1634
1741
|
</details>
|
|
1635
1742
|
|
|
1636
|
-
<details><summary><code>client.whiteLabels.<a href="/src/api/resources/whiteLabels/client/Client.ts">
|
|
1743
|
+
<details><summary><code>client.whiteLabels.<a href="/src/api/resources/whiteLabels/client/Client.ts">getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions</a>(whiteLabelId) -> string</code></summary>
|
|
1637
1744
|
<dl>
|
|
1638
1745
|
<dd>
|
|
1639
1746
|
|
|
@@ -1666,7 +1773,7 @@ branding instead of Airweave.
|
|
|
1666
1773
|
<dd>
|
|
1667
1774
|
|
|
1668
1775
|
```typescript
|
|
1669
|
-
await client.whiteLabels.
|
|
1776
|
+
await client.whiteLabels.getWhiteLabelOauth2AuthUrlWhiteLabelsWhiteLabelIdOauth2AuthUrlOptions("white_label_id");
|
|
1670
1777
|
```
|
|
1671
1778
|
|
|
1672
1779
|
</dd>
|
|
File without changes
|
|
File without changes
|