@airweave/sdk 0.3.53 → 0.3.54
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/README.md +1 -1
- package/dist/cjs/Client.d.ts +2 -9
- package/dist/cjs/Client.js +3 -5
- package/dist/cjs/api/resources/collections/client/Client.d.ts +10 -17
- package/dist/cjs/api/resources/collections/client/Client.js +23 -50
- package/dist/cjs/api/resources/collections/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/sourceConnections/client/Client.d.ts +9 -15
- package/dist/cjs/api/resources/sourceConnections/client/Client.js +23 -52
- package/dist/cjs/api/resources/sourceConnections/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/sources/client/Client.d.ts +5 -9
- package/dist/cjs/api/resources/sources/client/Client.js +9 -9
- package/dist/cjs/api/resources/whiteLabels/client/Client.d.ts +5 -9
- package/dist/cjs/api/resources/whiteLabels/client/Client.js +15 -33
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +2 -9
- package/dist/esm/Client.mjs +3 -5
- package/dist/esm/api/resources/collections/client/Client.d.mts +10 -17
- package/dist/esm/api/resources/collections/client/Client.mjs +23 -50
- package/dist/esm/api/resources/collections/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/sourceConnections/client/Client.d.mts +9 -15
- package/dist/esm/api/resources/sourceConnections/client/Client.mjs +23 -52
- package/dist/esm/api/resources/sourceConnections/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/sources/client/Client.d.mts +5 -9
- package/dist/esm/api/resources/sources/client/Client.mjs +9 -9
- package/dist/esm/api/resources/whiteLabels/client/Client.d.mts +5 -9
- package/dist/esm/api/resources/whiteLabels/client/Client.mjs +15 -33
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +9 -28
- package/dist/cjs/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.d.ts +0 -13
- package/dist/cjs/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.js +0 -5
- package/dist/cjs/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.d.ts +0 -13
- package/dist/cjs/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.js +0 -5
- package/dist/esm/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.d.mts +0 -13
- package/dist/esm/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.mjs +0 -4
- package/dist/esm/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.d.mts +0 -13
- package/dist/esm/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.mjs +0 -4
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Instantiate and use the client with the following:
|
|
|
22
22
|
```typescript
|
|
23
23
|
import { AirweaveSDKClient } from "@airweave/sdk";
|
|
24
24
|
|
|
25
|
-
const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY"
|
|
25
|
+
const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY" });
|
|
26
26
|
await client.collections.createCollection({
|
|
27
27
|
name: "Finance Data",
|
|
28
28
|
readable_id: "finance-data-reports",
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -12,10 +12,7 @@ export declare namespace AirweaveSDKClient {
|
|
|
12
12
|
environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
|
|
13
13
|
/** Specify a custom URL to connect the client to. */
|
|
14
14
|
baseUrl?: core.Supplier<string>;
|
|
15
|
-
|
|
16
|
-
apiKey?: core.Supplier<string | undefined>;
|
|
17
|
-
/** Override the X-Organization-ID header */
|
|
18
|
-
organizationId?: core.Supplier<string | undefined>;
|
|
15
|
+
apiKey: core.Supplier<string>;
|
|
19
16
|
/** Additional headers to include in requests. */
|
|
20
17
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
21
18
|
}
|
|
@@ -26,10 +23,6 @@ export declare namespace AirweaveSDKClient {
|
|
|
26
23
|
maxRetries?: number;
|
|
27
24
|
/** A hook to abort the request. */
|
|
28
25
|
abortSignal?: AbortSignal;
|
|
29
|
-
/** Override the X-API-Key header */
|
|
30
|
-
apiKey?: string | undefined;
|
|
31
|
-
/** Override the X-Organization-ID header */
|
|
32
|
-
organizationId?: string | undefined;
|
|
33
26
|
/** Additional headers to include in the request. */
|
|
34
27
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
35
28
|
}
|
|
@@ -40,7 +33,7 @@ export declare class AirweaveSDKClient {
|
|
|
40
33
|
protected _collections: Collections | undefined;
|
|
41
34
|
protected _sourceConnections: SourceConnections | undefined;
|
|
42
35
|
protected _whiteLabels: WhiteLabels | undefined;
|
|
43
|
-
constructor(_options
|
|
36
|
+
constructor(_options: AirweaveSDKClient.Options);
|
|
44
37
|
get sources(): Sources;
|
|
45
38
|
get collections(): Collections;
|
|
46
39
|
get sourceConnections(): SourceConnections;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -44,14 +44,12 @@ const Client_js_2 = require("./api/resources/collections/client/Client.js");
|
|
|
44
44
|
const Client_js_3 = require("./api/resources/sourceConnections/client/Client.js");
|
|
45
45
|
const Client_js_4 = require("./api/resources/whiteLabels/client/Client.js");
|
|
46
46
|
class AirweaveSDKClient {
|
|
47
|
-
constructor(_options
|
|
47
|
+
constructor(_options) {
|
|
48
48
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
49
|
-
"X-API-Key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
50
|
-
"X-Organization-ID": _options === null || _options === void 0 ? void 0 : _options.organizationId,
|
|
51
49
|
"X-Fern-Language": "JavaScript",
|
|
52
50
|
"X-Fern-SDK-Name": "@airweave/sdk",
|
|
53
|
-
"X-Fern-SDK-Version": "v0.3.
|
|
54
|
-
"User-Agent": "@airweave/sdk/v0.3.
|
|
51
|
+
"X-Fern-SDK-Version": "v0.3.54",
|
|
52
|
+
"User-Agent": "@airweave/sdk/v0.3.54",
|
|
55
53
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
54
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
55
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -9,10 +9,7 @@ export declare namespace Collections {
|
|
|
9
9
|
environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
|
-
|
|
13
|
-
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
-
/** Override the X-Organization-ID header */
|
|
15
|
-
organizationId?: core.Supplier<string | undefined>;
|
|
12
|
+
apiKey: core.Supplier<string>;
|
|
16
13
|
/** Additional headers to include in requests. */
|
|
17
14
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
18
15
|
}
|
|
@@ -23,10 +20,6 @@ export declare namespace Collections {
|
|
|
23
20
|
maxRetries?: number;
|
|
24
21
|
/** A hook to abort the request. */
|
|
25
22
|
abortSignal?: AbortSignal;
|
|
26
|
-
/** Override the X-API-Key header */
|
|
27
|
-
apiKey?: string | undefined;
|
|
28
|
-
/** Override the X-Organization-ID header */
|
|
29
|
-
organizationId?: string | undefined;
|
|
30
23
|
/** Additional headers to include in the request. */
|
|
31
24
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
32
25
|
}
|
|
@@ -36,7 +29,7 @@ export declare namespace Collections {
|
|
|
36
29
|
*/
|
|
37
30
|
export declare class Collections {
|
|
38
31
|
protected readonly _options: Collections.Options;
|
|
39
|
-
constructor(_options
|
|
32
|
+
constructor(_options: Collections.Options);
|
|
40
33
|
/**
|
|
41
34
|
* List all collections that belong to your organization.
|
|
42
35
|
*
|
|
@@ -105,16 +98,13 @@ export declare class Collections {
|
|
|
105
98
|
updateCollection(readableId: string, request?: AirweaveSDK.CollectionUpdate, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Collection>;
|
|
106
99
|
private __updateCollection;
|
|
107
100
|
/**
|
|
108
|
-
* Delete a collection and
|
|
101
|
+
* Delete a collection and all associated data.
|
|
109
102
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* destination systems.<br/><br/>All source connections within this collection
|
|
114
|
-
* will also be deleted as part of the cleanup process.
|
|
103
|
+
* Permanently removes a collection from your organization including all synced data
|
|
104
|
+
* from the destination systems. All source connections within this collection
|
|
105
|
+
* will also be deleted as part of the cleanup process. This action cannot be undone.
|
|
115
106
|
*
|
|
116
107
|
* @param {string} readableId - The unique readable identifier of the collection to delete
|
|
117
|
-
* @param {AirweaveSDK.DeleteCollectionCollectionsReadableIdDeleteRequest} request
|
|
118
108
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
109
|
*
|
|
120
110
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
@@ -122,7 +112,7 @@ export declare class Collections {
|
|
|
122
112
|
* @example
|
|
123
113
|
* await client.collections.deleteCollection("readable_id")
|
|
124
114
|
*/
|
|
125
|
-
deleteCollection(readableId: string,
|
|
115
|
+
deleteCollection(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Collection>;
|
|
126
116
|
private __deleteCollection;
|
|
127
117
|
/**
|
|
128
118
|
* Search across all data sources within the specified collection.
|
|
@@ -191,4 +181,7 @@ export declare class Collections {
|
|
|
191
181
|
*/
|
|
192
182
|
refreshAllSourceConnections(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnectionJob[]>;
|
|
193
183
|
private __refreshAllSourceConnections;
|
|
184
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
185
|
+
"x-api-key": string;
|
|
186
|
+
}>;
|
|
194
187
|
}
|
|
@@ -55,7 +55,7 @@ const errors = __importStar(require("../../../../errors/index.js"));
|
|
|
55
55
|
* API endpoints for managing collections - logical groups of data sources that provide unified search capabilities
|
|
56
56
|
*/
|
|
57
57
|
class Collections {
|
|
58
|
-
constructor(_options
|
|
58
|
+
constructor(_options) {
|
|
59
59
|
this._options = _options;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -86,10 +86,7 @@ class Collections {
|
|
|
86
86
|
const _response = yield core.fetcher({
|
|
87
87
|
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"),
|
|
88
88
|
method: "GET",
|
|
89
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
90
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
91
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
92
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
89
|
+
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),
|
|
93
90
|
queryParameters: _queryParams,
|
|
94
91
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
95
92
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -154,10 +151,7 @@ class Collections {
|
|
|
154
151
|
const _response = yield core.fetcher({
|
|
155
152
|
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"),
|
|
156
153
|
method: "POST",
|
|
157
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
158
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
159
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
160
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
154
|
+
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),
|
|
161
155
|
contentType: "application/json",
|
|
162
156
|
requestType: "json",
|
|
163
157
|
body: request,
|
|
@@ -217,10 +211,7 @@ class Collections {
|
|
|
217
211
|
const _response = yield core.fetcher({
|
|
218
212
|
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)}`),
|
|
219
213
|
method: "GET",
|
|
220
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
221
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
222
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
223
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
214
|
+
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),
|
|
224
215
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
225
216
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
226
217
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -285,10 +276,7 @@ class Collections {
|
|
|
285
276
|
const _response = yield core.fetcher({
|
|
286
277
|
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)}`),
|
|
287
278
|
method: "PUT",
|
|
288
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
289
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
290
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
291
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
279
|
+
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),
|
|
292
280
|
contentType: "application/json",
|
|
293
281
|
requestType: "json",
|
|
294
282
|
body: request,
|
|
@@ -329,16 +317,13 @@ class Collections {
|
|
|
329
317
|
});
|
|
330
318
|
}
|
|
331
319
|
/**
|
|
332
|
-
* Delete a collection and
|
|
320
|
+
* Delete a collection and all associated data.
|
|
333
321
|
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
* destination systems.<br/><br/>All source connections within this collection
|
|
338
|
-
* will also be deleted as part of the cleanup process.
|
|
322
|
+
* Permanently removes a collection from your organization including all synced data
|
|
323
|
+
* from the destination systems. All source connections within this collection
|
|
324
|
+
* will also be deleted as part of the cleanup process. This action cannot be undone.
|
|
339
325
|
*
|
|
340
326
|
* @param {string} readableId - The unique readable identifier of the collection to delete
|
|
341
|
-
* @param {AirweaveSDK.DeleteCollectionCollectionsReadableIdDeleteRequest} request
|
|
342
327
|
* @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
|
|
343
328
|
*
|
|
344
329
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
@@ -346,25 +331,16 @@ class Collections {
|
|
|
346
331
|
* @example
|
|
347
332
|
* await client.collections.deleteCollection("readable_id")
|
|
348
333
|
*/
|
|
349
|
-
deleteCollection(readableId,
|
|
350
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteCollection(readableId,
|
|
334
|
+
deleteCollection(readableId, requestOptions) {
|
|
335
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCollection(readableId, requestOptions));
|
|
351
336
|
}
|
|
352
|
-
__deleteCollection(
|
|
353
|
-
return __awaiter(this,
|
|
337
|
+
__deleteCollection(readableId, requestOptions) {
|
|
338
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
354
339
|
var _a, _b, _c;
|
|
355
|
-
const { delete_data: deleteData } = request;
|
|
356
|
-
const _queryParams = {};
|
|
357
|
-
if (deleteData != null) {
|
|
358
|
-
_queryParams["delete_data"] = deleteData.toString();
|
|
359
|
-
}
|
|
360
340
|
const _response = yield core.fetcher({
|
|
361
341
|
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)}`),
|
|
362
342
|
method: "DELETE",
|
|
363
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
364
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
365
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
366
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
367
|
-
queryParameters: _queryParams,
|
|
343
|
+
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),
|
|
368
344
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
369
345
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
370
346
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -445,10 +421,7 @@ class Collections {
|
|
|
445
421
|
const _response = yield core.fetcher({
|
|
446
422
|
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`),
|
|
447
423
|
method: "GET",
|
|
448
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
449
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
450
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
451
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
424
|
+
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),
|
|
452
425
|
queryParameters: _queryParams,
|
|
453
426
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
454
427
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -523,10 +496,7 @@ class Collections {
|
|
|
523
496
|
const _response = yield core.fetcher({
|
|
524
497
|
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
498
|
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)({
|
|
527
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
528
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
529
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
499
|
+
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),
|
|
530
500
|
contentType: "application/json",
|
|
531
501
|
requestType: "json",
|
|
532
502
|
body: request,
|
|
@@ -591,10 +561,7 @@ class Collections {
|
|
|
591
561
|
const _response = yield core.fetcher({
|
|
592
562
|
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)}/refresh_all`),
|
|
593
563
|
method: "POST",
|
|
594
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
595
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
596
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
597
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
564
|
+
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),
|
|
598
565
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
599
566
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
600
567
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -631,5 +598,11 @@ class Collections {
|
|
|
631
598
|
}
|
|
632
599
|
});
|
|
633
600
|
}
|
|
601
|
+
_getCustomAuthorizationHeaders() {
|
|
602
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
603
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
604
|
+
return { "x-api-key": apiKeyValue };
|
|
605
|
+
});
|
|
606
|
+
}
|
|
634
607
|
}
|
|
635
608
|
exports.Collections = Collections;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { type ListCollectionsCollectionsGetRequest } from "./ListCollectionsCollectionsGetRequest.js";
|
|
2
2
|
export { type CollectionCreate } from "./CollectionCreate.js";
|
|
3
3
|
export { type CollectionUpdate } from "./CollectionUpdate.js";
|
|
4
|
-
export { type DeleteCollectionCollectionsReadableIdDeleteRequest } from "./DeleteCollectionCollectionsReadableIdDeleteRequest.js";
|
|
5
4
|
export { type SearchCollectionCollectionsReadableIdSearchGetRequest } from "./SearchCollectionCollectionsReadableIdSearchGetRequest.js";
|
|
6
5
|
export { type SearchRequest } from "./SearchRequest.js";
|
|
@@ -9,10 +9,7 @@ export declare namespace SourceConnections {
|
|
|
9
9
|
environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
|
-
|
|
13
|
-
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
-
/** Override the X-Organization-ID header */
|
|
15
|
-
organizationId?: core.Supplier<string | undefined>;
|
|
12
|
+
apiKey: core.Supplier<string>;
|
|
16
13
|
/** Additional headers to include in requests. */
|
|
17
14
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
18
15
|
}
|
|
@@ -23,10 +20,6 @@ export declare namespace SourceConnections {
|
|
|
23
20
|
maxRetries?: number;
|
|
24
21
|
/** A hook to abort the request. */
|
|
25
22
|
abortSignal?: AbortSignal;
|
|
26
|
-
/** Override the X-API-Key header */
|
|
27
|
-
apiKey?: string | undefined;
|
|
28
|
-
/** Override the X-Organization-ID header */
|
|
29
|
-
organizationId?: string | undefined;
|
|
30
23
|
/** Additional headers to include in the request. */
|
|
31
24
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
32
25
|
}
|
|
@@ -36,7 +29,7 @@ export declare namespace SourceConnections {
|
|
|
36
29
|
*/
|
|
37
30
|
export declare class SourceConnections {
|
|
38
31
|
protected readonly _options: SourceConnections.Options;
|
|
39
|
-
constructor(_options
|
|
32
|
+
constructor(_options: SourceConnections.Options);
|
|
40
33
|
/**
|
|
41
34
|
* List source connections across your organization.
|
|
42
35
|
*
|
|
@@ -120,16 +113,14 @@ export declare class SourceConnections {
|
|
|
120
113
|
updateSourceConnection(sourceConnectionId: string, request?: AirweaveSDK.SourceConnectionUpdate, requestOptions?: SourceConnections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
|
|
121
114
|
private __updateSourceConnection;
|
|
122
115
|
/**
|
|
123
|
-
* Delete a source connection.
|
|
116
|
+
* Delete a source connection and all associated data.
|
|
124
117
|
*
|
|
125
118
|
* <br/><br/>
|
|
126
119
|
*
|
|
127
|
-
* Permanently removes the source connection configuration and
|
|
128
|
-
*
|
|
129
|
-
* Use delete_data=true to also remove all associated data from destination systems.
|
|
120
|
+
* Permanently removes the source connection configuration, credentials, and all synced data
|
|
121
|
+
* from the destination systems. This action cannot be undone.
|
|
130
122
|
*
|
|
131
123
|
* @param {string} sourceConnectionId - The unique identifier of the source connection to delete
|
|
132
|
-
* @param {AirweaveSDK.DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest} request
|
|
133
124
|
* @param {SourceConnections.RequestOptions} requestOptions - Request-specific configuration.
|
|
134
125
|
*
|
|
135
126
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
@@ -137,7 +128,7 @@ export declare class SourceConnections {
|
|
|
137
128
|
* @example
|
|
138
129
|
* await client.sourceConnections.deleteSourceConnection("source_connection_id")
|
|
139
130
|
*/
|
|
140
|
-
deleteSourceConnection(sourceConnectionId: string,
|
|
131
|
+
deleteSourceConnection(sourceConnectionId: string, requestOptions?: SourceConnections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
|
|
141
132
|
private __deleteSourceConnection;
|
|
142
133
|
/**
|
|
143
134
|
* Manually trigger a data sync for this source connection.
|
|
@@ -208,4 +199,7 @@ export declare class SourceConnections {
|
|
|
208
199
|
*/
|
|
209
200
|
cancelSourceConnectionJob(sourceConnectionId: string, jobId: string, requestOptions?: SourceConnections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnectionJob>;
|
|
210
201
|
private __cancelSourceConnectionJob;
|
|
202
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
203
|
+
"x-api-key": string;
|
|
204
|
+
}>;
|
|
211
205
|
}
|
|
@@ -55,7 +55,7 @@ const errors = __importStar(require("../../../../errors/index.js"));
|
|
|
55
55
|
* API endpoints for managing live connections to data sources. Source connections are the actual configured instances that Airweave uses to sync data from your apps and databases, transforming it into searchable, structured information within collections
|
|
56
56
|
*/
|
|
57
57
|
class SourceConnections {
|
|
58
|
-
constructor(_options
|
|
58
|
+
constructor(_options) {
|
|
59
59
|
this._options = _options;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -95,10 +95,7 @@ class SourceConnections {
|
|
|
95
95
|
const _response = yield core.fetcher({
|
|
96
96
|
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, "source-connections"),
|
|
97
97
|
method: "GET",
|
|
98
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
99
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
100
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
101
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
98
|
+
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),
|
|
102
99
|
queryParameters: _queryParams,
|
|
103
100
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
104
101
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -176,10 +173,7 @@ class SourceConnections {
|
|
|
176
173
|
const _response = yield core.fetcher({
|
|
177
174
|
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, "source-connections"),
|
|
178
175
|
method: "POST",
|
|
179
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
180
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
181
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
182
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
176
|
+
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),
|
|
183
177
|
contentType: "application/json",
|
|
184
178
|
requestType: "json",
|
|
185
179
|
body: request,
|
|
@@ -245,10 +239,7 @@ class SourceConnections {
|
|
|
245
239
|
const _response = yield core.fetcher({
|
|
246
240
|
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, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
|
|
247
241
|
method: "GET",
|
|
248
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
249
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
250
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
251
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
242
|
+
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),
|
|
252
243
|
queryParameters: _queryParams,
|
|
253
244
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
254
245
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -312,10 +303,7 @@ class SourceConnections {
|
|
|
312
303
|
const _response = yield core.fetcher({
|
|
313
304
|
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, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
|
|
314
305
|
method: "PUT",
|
|
315
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
316
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
317
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
318
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
306
|
+
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),
|
|
319
307
|
contentType: "application/json",
|
|
320
308
|
requestType: "json",
|
|
321
309
|
body: request,
|
|
@@ -356,16 +344,14 @@ class SourceConnections {
|
|
|
356
344
|
});
|
|
357
345
|
}
|
|
358
346
|
/**
|
|
359
|
-
* Delete a source connection.
|
|
347
|
+
* Delete a source connection and all associated data.
|
|
360
348
|
*
|
|
361
349
|
* <br/><br/>
|
|
362
350
|
*
|
|
363
|
-
* Permanently removes the source connection configuration and
|
|
364
|
-
*
|
|
365
|
-
* Use delete_data=true to also remove all associated data from destination systems.
|
|
351
|
+
* Permanently removes the source connection configuration, credentials, and all synced data
|
|
352
|
+
* from the destination systems. This action cannot be undone.
|
|
366
353
|
*
|
|
367
354
|
* @param {string} sourceConnectionId - The unique identifier of the source connection to delete
|
|
368
|
-
* @param {AirweaveSDK.DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest} request
|
|
369
355
|
* @param {SourceConnections.RequestOptions} requestOptions - Request-specific configuration.
|
|
370
356
|
*
|
|
371
357
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
@@ -373,25 +359,16 @@ class SourceConnections {
|
|
|
373
359
|
* @example
|
|
374
360
|
* await client.sourceConnections.deleteSourceConnection("source_connection_id")
|
|
375
361
|
*/
|
|
376
|
-
deleteSourceConnection(sourceConnectionId,
|
|
377
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteSourceConnection(sourceConnectionId,
|
|
362
|
+
deleteSourceConnection(sourceConnectionId, requestOptions) {
|
|
363
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteSourceConnection(sourceConnectionId, requestOptions));
|
|
378
364
|
}
|
|
379
|
-
__deleteSourceConnection(
|
|
380
|
-
return __awaiter(this,
|
|
365
|
+
__deleteSourceConnection(sourceConnectionId, requestOptions) {
|
|
366
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
381
367
|
var _a, _b, _c;
|
|
382
|
-
const { delete_data: deleteData } = request;
|
|
383
|
-
const _queryParams = {};
|
|
384
|
-
if (deleteData != null) {
|
|
385
|
-
_queryParams["delete_data"] = deleteData.toString();
|
|
386
|
-
}
|
|
387
368
|
const _response = yield core.fetcher({
|
|
388
369
|
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, `source-connections/${encodeURIComponent(sourceConnectionId)}`),
|
|
389
370
|
method: "DELETE",
|
|
390
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
391
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
392
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
393
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
394
|
-
queryParameters: _queryParams,
|
|
371
|
+
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),
|
|
395
372
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
396
373
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
397
374
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -454,10 +431,7 @@ class SourceConnections {
|
|
|
454
431
|
const _response = yield core.fetcher({
|
|
455
432
|
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, `source-connections/${encodeURIComponent(sourceConnectionId)}/run`),
|
|
456
433
|
method: "POST",
|
|
457
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
458
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
459
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
460
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
434
|
+
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),
|
|
461
435
|
contentType: "application/json",
|
|
462
436
|
requestType: "json",
|
|
463
437
|
body: request,
|
|
@@ -521,10 +495,7 @@ class SourceConnections {
|
|
|
521
495
|
const _response = yield core.fetcher({
|
|
522
496
|
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, `source-connections/${encodeURIComponent(sourceConnectionId)}/jobs`),
|
|
523
497
|
method: "GET",
|
|
524
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
525
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
526
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
527
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
498
|
+
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),
|
|
528
499
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
529
500
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
530
501
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -582,10 +553,7 @@ class SourceConnections {
|
|
|
582
553
|
const _response = yield core.fetcher({
|
|
583
554
|
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, `source-connections/${encodeURIComponent(sourceConnectionId)}/jobs/${encodeURIComponent(jobId)}`),
|
|
584
555
|
method: "GET",
|
|
585
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
586
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
587
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
588
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
556
|
+
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),
|
|
589
557
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
590
558
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
591
559
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -648,10 +616,7 @@ class SourceConnections {
|
|
|
648
616
|
const _response = yield core.fetcher({
|
|
649
617
|
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, `source-connections/${encodeURIComponent(sourceConnectionId)}/jobs/${encodeURIComponent(jobId)}/cancel`),
|
|
650
618
|
method: "POST",
|
|
651
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
652
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
653
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
654
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
619
|
+
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),
|
|
655
620
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
656
621
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
657
622
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -688,5 +653,11 @@ class SourceConnections {
|
|
|
688
653
|
}
|
|
689
654
|
});
|
|
690
655
|
}
|
|
656
|
+
_getCustomAuthorizationHeaders() {
|
|
657
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
658
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
659
|
+
return { "x-api-key": apiKeyValue };
|
|
660
|
+
});
|
|
661
|
+
}
|
|
691
662
|
}
|
|
692
663
|
exports.SourceConnections = SourceConnections;
|
|
@@ -2,5 +2,4 @@ export { type ListSourceConnectionsSourceConnectionsGetRequest } from "./ListSou
|
|
|
2
2
|
export { type SourceConnectionCreate } from "./SourceConnectionCreate.js";
|
|
3
3
|
export { type GetSourceConnectionSourceConnectionsSourceConnectionIdGetRequest } from "./GetSourceConnectionSourceConnectionsSourceConnectionIdGetRequest.js";
|
|
4
4
|
export { type SourceConnectionUpdate } from "./SourceConnectionUpdate.js";
|
|
5
|
-
export { type DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest } from "./DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.js";
|
|
6
5
|
export { type BodyRunSourceConnectionSourceConnectionsSourceConnectionIdRunPost } from "./BodyRunSourceConnectionSourceConnectionsSourceConnectionIdRunPost.js";
|
|
@@ -9,10 +9,7 @@ export declare namespace Sources {
|
|
|
9
9
|
environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
|
-
|
|
13
|
-
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
-
/** Override the X-Organization-ID header */
|
|
15
|
-
organizationId?: core.Supplier<string | undefined>;
|
|
12
|
+
apiKey: core.Supplier<string>;
|
|
16
13
|
/** Additional headers to include in requests. */
|
|
17
14
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
18
15
|
}
|
|
@@ -23,10 +20,6 @@ export declare namespace Sources {
|
|
|
23
20
|
maxRetries?: number;
|
|
24
21
|
/** A hook to abort the request. */
|
|
25
22
|
abortSignal?: AbortSignal;
|
|
26
|
-
/** Override the X-API-Key header */
|
|
27
|
-
apiKey?: string | undefined;
|
|
28
|
-
/** Override the X-Organization-ID header */
|
|
29
|
-
organizationId?: string | undefined;
|
|
30
23
|
/** Additional headers to include in the request. */
|
|
31
24
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
32
25
|
}
|
|
@@ -36,7 +29,7 @@ export declare namespace Sources {
|
|
|
36
29
|
*/
|
|
37
30
|
export declare class Sources {
|
|
38
31
|
protected readonly _options: Sources.Options;
|
|
39
|
-
constructor(_options
|
|
32
|
+
constructor(_options: Sources.Options);
|
|
40
33
|
/**
|
|
41
34
|
* Get detailed information about a specific data source connector.
|
|
42
35
|
*
|
|
@@ -65,4 +58,7 @@ export declare class Sources {
|
|
|
65
58
|
*/
|
|
66
59
|
readSources(requestOptions?: Sources.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Source[]>;
|
|
67
60
|
private __readSources;
|
|
61
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
62
|
+
"x-api-key": string;
|
|
63
|
+
}>;
|
|
68
64
|
}
|