@airweave/sdk 0.3.53 → 0.4.0
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 +11 -20
- package/dist/cjs/api/resources/collections/client/Client.js +24 -53
- package/dist/cjs/api/resources/collections/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/sourceConnections/client/Client.d.ts +7 -22
- package/dist/cjs/api/resources/sourceConnections/client/Client.js +21 -59
- 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 +12 -16
- package/dist/cjs/api/resources/whiteLabels/client/Client.js +24 -42
- package/dist/cjs/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.ts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.ts} +1 -1
- package/dist/cjs/api/resources/whiteLabels/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/types/ActionCheckResponse.d.ts +23 -0
- package/dist/cjs/api/types/ActionCheckResponse.js +13 -0
- package/dist/cjs/api/types/BillingPeriodUsage.d.ts +27 -0
- package/dist/cjs/api/types/CancelSubscriptionRequest.d.ts +11 -0
- package/dist/cjs/api/types/CheckoutSessionRequest.d.ts +14 -0
- package/dist/cjs/api/types/CheckoutSessionRequest.js +5 -0
- package/dist/cjs/api/types/CheckoutSessionResponse.d.ts +10 -0
- package/dist/cjs/api/types/CheckoutSessionResponse.js +5 -0
- package/dist/cjs/api/types/CustomerPortalRequest.d.ts +10 -0
- package/dist/cjs/api/types/CustomerPortalRequest.js +5 -0
- package/dist/cjs/api/types/CustomerPortalResponse.d.ts +10 -0
- package/dist/cjs/api/types/CustomerPortalResponse.js +5 -0
- package/dist/cjs/api/types/MessageResponse.d.ts +10 -0
- package/dist/cjs/api/types/MessageResponse.js +5 -0
- package/dist/cjs/api/types/Organization.d.ts +1 -0
- package/dist/cjs/api/types/OrganizationCreate.d.ts +2 -0
- package/dist/cjs/api/types/OrganizationWithRole.d.ts +1 -0
- package/dist/cjs/api/types/SubscriptionInfo.d.ts +40 -0
- package/dist/cjs/api/types/SubscriptionInfo.js +5 -0
- package/dist/cjs/api/types/UpdatePlanRequest.d.ts +10 -0
- package/dist/cjs/api/types/UpdatePlanRequest.js +5 -0
- package/dist/cjs/api/types/UsageDashboard.d.ts +23 -0
- package/dist/cjs/api/types/UsageDashboard.js +5 -0
- package/dist/cjs/api/types/UsageSnapshot.d.ts +32 -0
- package/dist/cjs/api/types/UsageSnapshot.js +5 -0
- package/dist/cjs/api/types/UsageTrend.d.ts +14 -0
- package/dist/cjs/api/types/UsageTrend.js +5 -0
- package/dist/cjs/api/types/index.d.ts +13 -0
- package/dist/cjs/api/types/index.js +13 -0
- 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 +11 -20
- package/dist/esm/api/resources/collections/client/Client.mjs +24 -53
- package/dist/esm/api/resources/collections/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/sourceConnections/client/Client.d.mts +7 -22
- package/dist/esm/api/resources/sourceConnections/client/Client.mjs +21 -59
- 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 +12 -16
- package/dist/esm/api/resources/whiteLabels/client/Client.mjs +24 -42
- package/dist/esm/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.mts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.mts} +1 -1
- package/dist/esm/api/resources/whiteLabels/client/requests/index.d.mts +1 -1
- package/dist/esm/api/types/ActionCheckResponse.d.mts +23 -0
- package/dist/esm/api/types/ActionCheckResponse.mjs +10 -0
- package/dist/esm/api/types/BillingPeriodUsage.d.mts +27 -0
- package/dist/esm/api/types/CancelSubscriptionRequest.d.mts +11 -0
- package/dist/esm/api/types/CheckoutSessionRequest.d.mts +14 -0
- package/dist/esm/api/types/CheckoutSessionRequest.mjs +4 -0
- package/dist/esm/api/types/CheckoutSessionResponse.d.mts +10 -0
- package/dist/esm/api/types/CheckoutSessionResponse.mjs +4 -0
- package/dist/esm/api/types/CustomerPortalRequest.d.mts +10 -0
- package/dist/esm/api/types/CustomerPortalRequest.mjs +4 -0
- package/dist/esm/api/types/CustomerPortalResponse.d.mts +10 -0
- package/dist/esm/api/types/CustomerPortalResponse.mjs +4 -0
- package/dist/esm/api/types/MessageResponse.d.mts +10 -0
- package/dist/esm/api/types/MessageResponse.mjs +4 -0
- package/dist/esm/api/types/Organization.d.mts +1 -0
- package/dist/esm/api/types/OrganizationCreate.d.mts +2 -0
- package/dist/esm/api/types/OrganizationWithRole.d.mts +1 -0
- package/dist/esm/api/types/SubscriptionInfo.d.mts +40 -0
- package/dist/esm/api/types/SubscriptionInfo.mjs +4 -0
- package/dist/esm/api/types/UpdatePlanRequest.d.mts +10 -0
- package/dist/esm/api/types/UpdatePlanRequest.mjs +4 -0
- package/dist/esm/api/types/UsageDashboard.d.mts +23 -0
- package/dist/esm/api/types/UsageDashboard.mjs +4 -0
- package/dist/esm/api/types/UsageSnapshot.d.mts +32 -0
- package/dist/esm/api/types/UsageSnapshot.mjs +4 -0
- package/dist/esm/api/types/UsageTrend.d.mts +14 -0
- package/dist/esm/api/types/UsageTrend.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +13 -0
- package/dist/esm/api/types/index.mjs +13 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +13 -43
- package/dist/cjs/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.d.ts +0 -13
- package/dist/cjs/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.d.ts +0 -13
- package/dist/esm/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.d.mts +0 -13
- package/dist/esm/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.d.mts +0 -13
- /package/dist/cjs/api/resources/{collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.js → whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.js} +0 -0
- /package/dist/cjs/api/{resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.js → types/BillingPeriodUsage.js} +0 -0
- /package/dist/cjs/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js → types/CancelSubscriptionRequest.js} +0 -0
- /package/dist/esm/api/resources/{collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.mjs → whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.mjs} +0 -0
- /package/dist/esm/api/{resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.mjs → types/BillingPeriodUsage.mjs} +0 -0
- /package/dist/esm/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs → types/CancelSubscriptionRequest.mjs} +0 -0
|
@@ -55,13 +55,12 @@ 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
|
/**
|
|
62
62
|
* List source connections across your organization.
|
|
63
63
|
*
|
|
64
|
-
* <br/><br/>
|
|
65
64
|
* By default, returns ALL source connections from every collection in your
|
|
66
65
|
* organization. Use the 'collection' parameter to filter results to a specific
|
|
67
66
|
* collection. This is useful for getting an overview of all your data sources
|
|
@@ -95,10 +94,7 @@ class SourceConnections {
|
|
|
95
94
|
const _response = yield core.fetcher({
|
|
96
95
|
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
96
|
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),
|
|
97
|
+
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
98
|
queryParameters: _queryParams,
|
|
103
99
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
104
100
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -142,8 +138,6 @@ class SourceConnections {
|
|
|
142
138
|
/**
|
|
143
139
|
* Create a new source connection to sync data into your collection.
|
|
144
140
|
*
|
|
145
|
-
* <br/><br/>
|
|
146
|
-
*
|
|
147
141
|
* **This endpoint only works for sources that do not use OAuth2.0.**
|
|
148
142
|
* Sources that do use OAuth2.0 like Google Drive, Slack, or HubSpot must be
|
|
149
143
|
* connected through the UI where you can complete the OAuth consent flow.<br/><br/>
|
|
@@ -176,10 +170,7 @@ class SourceConnections {
|
|
|
176
170
|
const _response = yield core.fetcher({
|
|
177
171
|
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
172
|
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),
|
|
173
|
+
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
174
|
contentType: "application/json",
|
|
184
175
|
requestType: "json",
|
|
185
176
|
body: request,
|
|
@@ -245,10 +236,7 @@ class SourceConnections {
|
|
|
245
236
|
const _response = yield core.fetcher({
|
|
246
237
|
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
238
|
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),
|
|
239
|
+
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
240
|
queryParameters: _queryParams,
|
|
253
241
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
254
242
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
@@ -289,8 +277,6 @@ class SourceConnections {
|
|
|
289
277
|
/**
|
|
290
278
|
* Update a source connection's properties.
|
|
291
279
|
*
|
|
292
|
-
* <br/><br/>
|
|
293
|
-
*
|
|
294
280
|
* Modify the configuration of an existing source connection including its name,
|
|
295
281
|
* authentication credentials, configuration fields, sync schedule, or source-specific settings.
|
|
296
282
|
*
|
|
@@ -312,10 +298,7 @@ class SourceConnections {
|
|
|
312
298
|
const _response = yield core.fetcher({
|
|
313
299
|
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
300
|
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),
|
|
301
|
+
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
302
|
contentType: "application/json",
|
|
320
303
|
requestType: "json",
|
|
321
304
|
body: request,
|
|
@@ -356,16 +339,13 @@ class SourceConnections {
|
|
|
356
339
|
});
|
|
357
340
|
}
|
|
358
341
|
/**
|
|
359
|
-
* Delete a source connection.
|
|
360
|
-
*
|
|
361
|
-
* <br/><br/>
|
|
342
|
+
* Delete a source connection and all associated data.
|
|
362
343
|
*
|
|
363
344
|
* Permanently removes the source connection configuration and credentials.
|
|
364
345
|
* By default, previously synced data remains in your destination systems for continuity.
|
|
365
346
|
* Use delete_data=true to also remove all associated data from destination systems.
|
|
366
347
|
*
|
|
367
348
|
* @param {string} sourceConnectionId - The unique identifier of the source connection to delete
|
|
368
|
-
* @param {AirweaveSDK.DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest} request
|
|
369
349
|
* @param {SourceConnections.RequestOptions} requestOptions - Request-specific configuration.
|
|
370
350
|
*
|
|
371
351
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
@@ -373,25 +353,16 @@ class SourceConnections {
|
|
|
373
353
|
* @example
|
|
374
354
|
* await client.sourceConnections.deleteSourceConnection("source_connection_id")
|
|
375
355
|
*/
|
|
376
|
-
deleteSourceConnection(sourceConnectionId,
|
|
377
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteSourceConnection(sourceConnectionId,
|
|
356
|
+
deleteSourceConnection(sourceConnectionId, requestOptions) {
|
|
357
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteSourceConnection(sourceConnectionId, requestOptions));
|
|
378
358
|
}
|
|
379
|
-
__deleteSourceConnection(
|
|
380
|
-
return __awaiter(this,
|
|
359
|
+
__deleteSourceConnection(sourceConnectionId, requestOptions) {
|
|
360
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
381
361
|
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
362
|
const _response = yield core.fetcher({
|
|
388
363
|
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
364
|
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,
|
|
365
|
+
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
366
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
396
367
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
397
368
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -431,7 +402,6 @@ class SourceConnections {
|
|
|
431
402
|
/**
|
|
432
403
|
* Manually trigger a data sync for this source connection.
|
|
433
404
|
*
|
|
434
|
-
* <br/><br/>
|
|
435
405
|
* Starts an immediate synchronization job that extracts fresh data from your source,
|
|
436
406
|
* transforms it according to your configuration, and updates the destination systems.
|
|
437
407
|
* The job runs asynchronously and endpoint returns immediately with tracking information.
|
|
@@ -454,10 +424,7 @@ class SourceConnections {
|
|
|
454
424
|
const _response = yield core.fetcher({
|
|
455
425
|
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
426
|
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),
|
|
427
|
+
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
428
|
contentType: "application/json",
|
|
462
429
|
requestType: "json",
|
|
463
430
|
body: request,
|
|
@@ -500,7 +467,6 @@ class SourceConnections {
|
|
|
500
467
|
/**
|
|
501
468
|
* List all sync jobs for a source connection.
|
|
502
469
|
*
|
|
503
|
-
* <br/><br/>
|
|
504
470
|
* Returns the complete history of data synchronization jobs including successful syncs,
|
|
505
471
|
* failed attempts, and currently running operations.
|
|
506
472
|
*
|
|
@@ -521,10 +487,7 @@ class SourceConnections {
|
|
|
521
487
|
const _response = yield core.fetcher({
|
|
522
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, `source-connections/${encodeURIComponent(sourceConnectionId)}/jobs`),
|
|
523
489
|
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),
|
|
490
|
+
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
491
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
529
492
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
530
493
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -582,10 +545,7 @@ class SourceConnections {
|
|
|
582
545
|
const _response = yield core.fetcher({
|
|
583
546
|
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
547
|
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),
|
|
548
|
+
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
549
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
590
550
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
591
551
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -625,7 +585,6 @@ class SourceConnections {
|
|
|
625
585
|
/**
|
|
626
586
|
* Cancel a running sync job.
|
|
627
587
|
*
|
|
628
|
-
* <br/><br/>
|
|
629
588
|
* Sends a cancellation signal to stop an in-progress data synchronization.
|
|
630
589
|
* The job will complete its current operation and then terminate gracefully.
|
|
631
590
|
* Only jobs in 'created', 'pending', or 'in_progress' states can be cancelled.
|
|
@@ -648,10 +607,7 @@ class SourceConnections {
|
|
|
648
607
|
const _response = yield core.fetcher({
|
|
649
608
|
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
609
|
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),
|
|
610
|
+
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
611
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
656
612
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
657
613
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -688,5 +644,11 @@ class SourceConnections {
|
|
|
688
644
|
}
|
|
689
645
|
});
|
|
690
646
|
}
|
|
647
|
+
_getCustomAuthorizationHeaders() {
|
|
648
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
649
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
650
|
+
return { "x-api-key": apiKeyValue };
|
|
651
|
+
});
|
|
652
|
+
}
|
|
691
653
|
}
|
|
692
654
|
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
|
}
|
|
@@ -55,7 +55,7 @@ const errors = __importStar(require("../../../../errors/index.js"));
|
|
|
55
55
|
* API endpoints for discovering available data source connectors and their configuration requirements
|
|
56
56
|
*/
|
|
57
57
|
class Sources {
|
|
58
|
-
constructor(_options
|
|
58
|
+
constructor(_options) {
|
|
59
59
|
this._options = _options;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -78,10 +78,7 @@ class Sources {
|
|
|
78
78
|
const _response = yield core.fetcher({
|
|
79
79
|
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, `sources/detail/${encodeURIComponent(shortName)}`),
|
|
80
80
|
method: "GET",
|
|
81
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
82
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
83
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
84
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
81
|
+
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),
|
|
85
82
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
86
83
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
87
84
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -140,10 +137,7 @@ class Sources {
|
|
|
140
137
|
const _response = yield core.fetcher({
|
|
141
138
|
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, "sources/list"),
|
|
142
139
|
method: "GET",
|
|
143
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
144
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
145
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
146
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
140
|
+
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),
|
|
147
141
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
148
142
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
149
143
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -180,5 +174,11 @@ class Sources {
|
|
|
180
174
|
}
|
|
181
175
|
});
|
|
182
176
|
}
|
|
177
|
+
_getCustomAuthorizationHeaders() {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
180
|
+
return { "x-api-key": apiKeyValue };
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
183
|
}
|
|
184
184
|
exports.Sources = Sources;
|
|
@@ -9,10 +9,7 @@ export declare namespace WhiteLabels {
|
|
|
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 WhiteLabels {
|
|
|
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 WhiteLabels {
|
|
|
36
29
|
*/
|
|
37
30
|
export declare class WhiteLabels {
|
|
38
31
|
protected readonly _options: WhiteLabels.Options;
|
|
39
|
-
constructor(_options
|
|
32
|
+
constructor(_options: WhiteLabels.Options);
|
|
40
33
|
/**
|
|
41
34
|
* List all white label integrations for your organization.
|
|
42
35
|
*
|
|
@@ -147,10 +140,10 @@ export declare class WhiteLabels {
|
|
|
147
140
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
148
141
|
*
|
|
149
142
|
* @example
|
|
150
|
-
* await client.whiteLabels.
|
|
143
|
+
* await client.whiteLabels.getWhiteLabelOauth2AuthUrl("white_label_id")
|
|
151
144
|
*/
|
|
152
|
-
|
|
153
|
-
private
|
|
145
|
+
getWhiteLabelOauth2AuthUrl(whiteLabelId: string, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<string>;
|
|
146
|
+
private __getWhiteLabelOauth2AuthUrl;
|
|
154
147
|
/**
|
|
155
148
|
* List all source connections created through a specific white label integration.
|
|
156
149
|
*
|
|
@@ -178,16 +171,19 @@ export declare class WhiteLabels {
|
|
|
178
171
|
* tracking and branding purposes.
|
|
179
172
|
*
|
|
180
173
|
* @param {string} whiteLabelId - The unique identifier of the white label integration
|
|
181
|
-
* @param {AirweaveSDK.
|
|
174
|
+
* @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
|
|
182
175
|
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
183
176
|
*
|
|
184
177
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
185
178
|
*
|
|
186
179
|
* @example
|
|
187
|
-
* await client.whiteLabels.
|
|
180
|
+
* await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
|
|
188
181
|
* code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
|
|
189
182
|
* })
|
|
190
183
|
*/
|
|
191
|
-
|
|
192
|
-
private
|
|
184
|
+
exchangeWhiteLabelOauth2Code(whiteLabelId: string, request: AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
|
|
185
|
+
private __exchangeWhiteLabelOauth2Code;
|
|
186
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
187
|
+
"x-api-key": string;
|
|
188
|
+
}>;
|
|
193
189
|
}
|
|
@@ -55,7 +55,7 @@ const errors = __importStar(require("../../../../errors/index.js"));
|
|
|
55
55
|
* API endpoints for managing custom OAuth2 integrations with your own branding and credentials
|
|
56
56
|
*/
|
|
57
57
|
class WhiteLabels {
|
|
58
|
-
constructor(_options
|
|
58
|
+
constructor(_options) {
|
|
59
59
|
this._options = _options;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -84,10 +84,7 @@ class WhiteLabels {
|
|
|
84
84
|
const _response = yield core.fetcher({
|
|
85
85
|
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, "white-labels/list"),
|
|
86
86
|
method: "GET",
|
|
87
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
88
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
89
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
90
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
87
|
+
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),
|
|
91
88
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
92
89
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
93
90
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -159,10 +156,7 @@ class WhiteLabels {
|
|
|
159
156
|
const _response = yield core.fetcher({
|
|
160
157
|
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, "white-labels"),
|
|
161
158
|
method: "POST",
|
|
162
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
163
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
164
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
165
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
159
|
+
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),
|
|
166
160
|
contentType: "application/json",
|
|
167
161
|
requestType: "json",
|
|
168
162
|
body: request,
|
|
@@ -222,10 +216,7 @@ class WhiteLabels {
|
|
|
222
216
|
const _response = yield core.fetcher({
|
|
223
217
|
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, `white-labels/${encodeURIComponent(whiteLabelId)}`),
|
|
224
218
|
method: "GET",
|
|
225
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
226
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
227
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
228
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
219
|
+
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),
|
|
229
220
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
230
221
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
231
222
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -287,10 +278,7 @@ class WhiteLabels {
|
|
|
287
278
|
const _response = yield core.fetcher({
|
|
288
279
|
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, `white-labels/${encodeURIComponent(whiteLabelId)}`),
|
|
289
280
|
method: "PUT",
|
|
290
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
291
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
292
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
293
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
281
|
+
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),
|
|
294
282
|
contentType: "application/json",
|
|
295
283
|
requestType: "json",
|
|
296
284
|
body: request,
|
|
@@ -355,10 +343,7 @@ class WhiteLabels {
|
|
|
355
343
|
const _response = yield core.fetcher({
|
|
356
344
|
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, `white-labels/${encodeURIComponent(whiteLabelId)}`),
|
|
357
345
|
method: "DELETE",
|
|
358
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
359
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
360
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
361
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
346
|
+
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),
|
|
362
347
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
363
348
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
364
349
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -409,21 +394,18 @@ class WhiteLabels {
|
|
|
409
394
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
410
395
|
*
|
|
411
396
|
* @example
|
|
412
|
-
* await client.whiteLabels.
|
|
397
|
+
* await client.whiteLabels.getWhiteLabelOauth2AuthUrl("white_label_id")
|
|
413
398
|
*/
|
|
414
|
-
|
|
415
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
399
|
+
getWhiteLabelOauth2AuthUrl(whiteLabelId, requestOptions) {
|
|
400
|
+
return core.HttpResponsePromise.fromPromise(this.__getWhiteLabelOauth2AuthUrl(whiteLabelId, requestOptions));
|
|
416
401
|
}
|
|
417
|
-
|
|
402
|
+
__getWhiteLabelOauth2AuthUrl(whiteLabelId, requestOptions) {
|
|
418
403
|
return __awaiter(this, void 0, void 0, function* () {
|
|
419
404
|
var _a, _b, _c;
|
|
420
405
|
const _response = yield core.fetcher({
|
|
421
406
|
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, `white-labels/${encodeURIComponent(whiteLabelId)}/oauth2/auth_url`),
|
|
422
407
|
method: "GET",
|
|
423
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
424
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
425
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
426
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
408
|
+
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),
|
|
427
409
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
428
410
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
429
411
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -483,10 +465,7 @@ class WhiteLabels {
|
|
|
483
465
|
const _response = yield core.fetcher({
|
|
484
466
|
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, `white-labels/${encodeURIComponent(whiteLabelId)}/source-connections`),
|
|
485
467
|
method: "GET",
|
|
486
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
487
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
488
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
489
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
468
|
+
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),
|
|
490
469
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
491
470
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
492
471
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -537,29 +516,26 @@ class WhiteLabels {
|
|
|
537
516
|
* tracking and branding purposes.
|
|
538
517
|
*
|
|
539
518
|
* @param {string} whiteLabelId - The unique identifier of the white label integration
|
|
540
|
-
* @param {AirweaveSDK.
|
|
519
|
+
* @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
|
|
541
520
|
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
542
521
|
*
|
|
543
522
|
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
544
523
|
*
|
|
545
524
|
* @example
|
|
546
|
-
* await client.whiteLabels.
|
|
525
|
+
* await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
|
|
547
526
|
* code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
|
|
548
527
|
* })
|
|
549
528
|
*/
|
|
550
|
-
|
|
551
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
529
|
+
exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
|
|
530
|
+
return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions));
|
|
552
531
|
}
|
|
553
|
-
|
|
532
|
+
__exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
|
|
554
533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
555
534
|
var _a, _b, _c;
|
|
556
535
|
const _response = yield core.fetcher({
|
|
557
536
|
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, `white-labels/${encodeURIComponent(whiteLabelId)}/oauth2/code`),
|
|
558
537
|
method: "POST",
|
|
559
|
-
headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
560
|
-
"X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
|
|
561
|
-
"X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
|
|
562
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
538
|
+
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),
|
|
563
539
|
contentType: "application/json",
|
|
564
540
|
requestType: "json",
|
|
565
541
|
body: request,
|
|
@@ -599,5 +575,11 @@ class WhiteLabels {
|
|
|
599
575
|
}
|
|
600
576
|
});
|
|
601
577
|
}
|
|
578
|
+
_getCustomAuthorizationHeaders() {
|
|
579
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
580
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
581
|
+
return { "x-api-key": apiKeyValue };
|
|
582
|
+
});
|
|
583
|
+
}
|
|
602
584
|
}
|
|
603
585
|
exports.WhiteLabels = WhiteLabels;
|
|
@@ -8,7 +8,7 @@ import * as AirweaveSDK from "../../../../index.js";
|
|
|
8
8
|
* code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
|
-
export interface
|
|
11
|
+
export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost {
|
|
12
12
|
/** The OAuth2 authorization code received from the OAuth callback after customer authentication */
|
|
13
13
|
code: string;
|
|
14
14
|
/** Optional configuration for the source connection. If not provided, a source connection will be created automatically with default settings. The white label integration is automatically linked to the source connection. */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { type WhiteLabelCreate } from "./WhiteLabelCreate.js";
|
|
2
2
|
export { type WhiteLabelUpdate } from "./WhiteLabelUpdate.js";
|
|
3
|
-
export { type
|
|
3
|
+
export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Response schema for action permission checks.
|
|
6
|
+
*/
|
|
7
|
+
export interface ActionCheckResponse {
|
|
8
|
+
/** Whether the action is allowed for the organization */
|
|
9
|
+
allowed: boolean;
|
|
10
|
+
/** The action type that was checked */
|
|
11
|
+
action: string;
|
|
12
|
+
/** Reason why the action is not allowed (if applicable) */
|
|
13
|
+
reason?: ActionCheckResponse.Reason;
|
|
14
|
+
/** Additional details about why the action is not allowed */
|
|
15
|
+
details?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace ActionCheckResponse {
|
|
18
|
+
type Reason = "payment_required" | "usage_limit_exceeded";
|
|
19
|
+
const Reason: {
|
|
20
|
+
readonly PaymentRequired: "payment_required";
|
|
21
|
+
readonly UsageLimitExceeded: "usage_limit_exceeded";
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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.ActionCheckResponse = void 0;
|
|
7
|
+
var ActionCheckResponse;
|
|
8
|
+
(function (ActionCheckResponse) {
|
|
9
|
+
ActionCheckResponse.Reason = {
|
|
10
|
+
PaymentRequired: "payment_required",
|
|
11
|
+
UsageLimitExceeded: "usage_limit_exceeded",
|
|
12
|
+
};
|
|
13
|
+
})(ActionCheckResponse || (exports.ActionCheckResponse = ActionCheckResponse = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as AirweaveSDK from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Complete usage data for a billing period.
|
|
7
|
+
*/
|
|
8
|
+
export interface BillingPeriodUsage {
|
|
9
|
+
/** Billing period ID */
|
|
10
|
+
period_id: string;
|
|
11
|
+
/** Period start date */
|
|
12
|
+
period_start: string;
|
|
13
|
+
/** Period end date */
|
|
14
|
+
period_end: string;
|
|
15
|
+
/** Period status (active, trial, ended, etc) */
|
|
16
|
+
status: string;
|
|
17
|
+
/** Subscription plan for this period */
|
|
18
|
+
plan: string;
|
|
19
|
+
/** Current usage snapshot */
|
|
20
|
+
usage: AirweaveSDK.UsageSnapshot;
|
|
21
|
+
/** Daily snapshots for trend visualization */
|
|
22
|
+
daily_usage?: AirweaveSDK.UsageSnapshot[];
|
|
23
|
+
/** Days left in period */
|
|
24
|
+
days_remaining?: number;
|
|
25
|
+
/** Whether this is the current period */
|
|
26
|
+
is_current?: boolean;
|
|
27
|
+
}
|