@airweave/sdk 0.6.0 → 0.6.26
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 +14 -3
- package/dist/cjs/Client.d.ts +4 -8
- package/dist/cjs/Client.js +6 -16
- package/dist/cjs/api/resources/collections/client/Client.d.ts +14 -27
- package/dist/cjs/api/resources/collections/client/Client.js +37 -85
- package/dist/cjs/api/resources/collections/client/requests/ListCollectionsGetRequest.d.ts +6 -7
- package/dist/cjs/api/resources/collections/client/requests/SearchCollectionsReadableIdSearchGetRequest.d.ts +10 -16
- package/dist/cjs/api/resources/collections/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/index.d.ts +0 -4
- package/dist/cjs/api/resources/index.js +1 -5
- package/dist/cjs/api/resources/sourceConnections/client/Client.d.ts +60 -80
- package/dist/cjs/api/resources/sourceConnections/client/Client.js +104 -157
- package/dist/cjs/api/resources/sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.d.ts +12 -0
- package/dist/cjs/api/resources/sourceConnections/client/requests/ListSourceConnectionsGetRequest.d.ts +6 -10
- package/dist/cjs/api/resources/sourceConnections/client/requests/SourceConnectionCreate.d.ts +21 -20
- package/dist/cjs/api/resources/sourceConnections/client/requests/SourceConnectionUpdate.d.ts +7 -18
- package/dist/cjs/api/resources/sourceConnections/client/requests/index.d.ts +1 -2
- package/dist/cjs/api/resources/sources/client/Client.d.ts +17 -17
- package/dist/cjs/api/resources/sources/client/Client.js +24 -20
- package/dist/cjs/api/types/ActionCheckRequest.d.ts +10 -0
- package/dist/cjs/api/types/ActionCheckResponse.d.ts +3 -16
- package/dist/cjs/api/types/ActionCheckResponse.js +0 -8
- package/dist/cjs/api/types/AuthProvider.d.ts +0 -2
- package/dist/cjs/api/types/AuthProviderAuthentication.d.ts +12 -0
- package/dist/cjs/api/types/AuthProviderConnection.d.ts +2 -0
- package/dist/cjs/api/{resources/authProviders/client/requests → types}/AuthProviderConnectionCreate.d.ts +2 -10
- package/dist/cjs/api/types/AuthenticationDetails.d.ts +19 -0
- package/dist/cjs/api/types/AuthenticationMethod.d.ts +14 -0
- package/dist/cjs/api/types/AuthenticationMethod.js +13 -0
- package/dist/cjs/api/{resources/collections/client/requests → types}/CollectionUpdate.d.ts +4 -4
- package/dist/cjs/api/types/Destination.d.ts +0 -2
- package/dist/cjs/api/types/DestinationWithAuthenticationFields.d.ts +0 -1
- package/dist/cjs/api/types/DirectAuthentication.d.ts +10 -0
- package/dist/cjs/api/types/EmbeddingModel.d.ts +0 -2
- package/dist/cjs/api/types/EmbeddingModelWithAuthenticationFields.d.ts +0 -1
- package/dist/cjs/api/types/EntityCountWithDefinition.d.ts +1 -0
- package/dist/cjs/api/types/EntitySummary.d.ts +11 -0
- package/dist/cjs/api/types/EntityTypeStats.d.ts +10 -0
- package/dist/cjs/api/types/FieldCondition.d.ts +3 -3
- package/dist/cjs/api/types/IntegrationCredentialInDb.d.ts +2 -1
- package/dist/cjs/api/types/IntegrationCredentialRawCreate.d.ts +2 -1
- package/dist/cjs/api/types/MatchPhrase.d.ts +10 -0
- package/dist/cjs/api/types/OAuthBrowserAuthentication.d.ts +14 -0
- package/dist/cjs/api/types/OAuthTokenAuthentication.d.ts +14 -0
- package/dist/cjs/api/types/OAuthType.d.ts +12 -0
- package/dist/cjs/api/types/OAuthType.js +11 -0
- package/dist/cjs/api/types/ScheduleConfig.d.ts +14 -0
- package/dist/cjs/api/types/ScheduleDetails.d.ts +13 -0
- package/dist/cjs/api/types/SingleActionCheckResponse.d.ts +23 -0
- package/dist/cjs/api/types/SingleActionCheckResponse.js +13 -0
- package/dist/cjs/api/types/Source.d.ts +13 -9
- package/dist/cjs/api/types/SourceConnection.d.ts +9 -52
- package/dist/cjs/api/types/SourceConnectionJob.d.ts +9 -34
- package/dist/cjs/api/types/SourceConnectionListItem.d.ts +8 -16
- package/dist/cjs/api/types/SourceConnectionStatus.d.ts +7 -4
- package/dist/cjs/api/types/SourceConnectionStatus.js +5 -2
- package/dist/cjs/api/types/SubscriptionInfo.d.ts +12 -0
- package/dist/cjs/api/types/Sync.d.ts +0 -1
- package/dist/cjs/api/types/SyncCreate.d.ts +0 -1
- package/dist/cjs/api/types/SyncDetails.d.ts +13 -0
- package/dist/cjs/api/types/SyncJobDetails.d.ts +20 -0
- package/dist/cjs/api/types/SyncJobStatus.d.ts +3 -2
- package/dist/cjs/api/types/SyncJobStatus.js +2 -1
- package/dist/cjs/api/types/SyncUpdate.d.ts +0 -1
- package/dist/cjs/api/types/SyncWithSourceConnection.d.ts +0 -1
- package/dist/cjs/api/types/UpdatePlanRequest.d.ts +2 -0
- package/dist/cjs/api/types/UsageSnapshot.d.ts +4 -8
- package/dist/cjs/api/types/index.d.ts +18 -10
- package/dist/cjs/api/types/index.js +18 -10
- package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.js +22 -0
- package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -3
- package/dist/cjs/core/fetcher/Fetcher.js +4 -3
- package/dist/cjs/core/fetcher/index.d.ts +7 -5
- package/dist/cjs/core/fetcher/index.js +7 -5
- package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
- package/dist/cjs/core/headers.d.ts +2 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +4 -8
- package/dist/esm/Client.mjs +2 -12
- package/dist/esm/api/resources/collections/client/Client.d.mts +14 -27
- package/dist/esm/api/resources/collections/client/Client.mjs +37 -85
- package/dist/esm/api/resources/collections/client/requests/ListCollectionsGetRequest.d.mts +6 -7
- package/dist/esm/api/resources/collections/client/requests/SearchCollectionsReadableIdSearchGetRequest.d.mts +10 -16
- package/dist/esm/api/resources/collections/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/index.d.mts +0 -4
- package/dist/esm/api/resources/index.mjs +0 -4
- package/dist/esm/api/resources/sourceConnections/client/Client.d.mts +60 -80
- package/dist/esm/api/resources/sourceConnections/client/Client.mjs +104 -157
- package/dist/esm/api/resources/sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.d.mts +12 -0
- package/dist/esm/api/resources/sourceConnections/client/requests/ListSourceConnectionsGetRequest.d.mts +6 -10
- package/dist/esm/api/resources/sourceConnections/client/requests/SourceConnectionCreate.d.mts +21 -20
- package/dist/esm/api/resources/sourceConnections/client/requests/SourceConnectionUpdate.d.mts +7 -18
- package/dist/esm/api/resources/sourceConnections/client/requests/index.d.mts +1 -2
- package/dist/esm/api/resources/sources/client/Client.d.mts +17 -17
- package/dist/esm/api/resources/sources/client/Client.mjs +24 -20
- package/dist/esm/api/types/ActionCheckRequest.d.mts +10 -0
- package/dist/esm/api/types/ActionCheckResponse.d.mts +3 -16
- package/dist/esm/api/types/ActionCheckResponse.mjs +1 -7
- package/dist/esm/api/types/AuthProvider.d.mts +0 -2
- package/dist/esm/api/types/AuthProviderAuthentication.d.mts +12 -0
- package/dist/esm/api/types/AuthProviderConnection.d.mts +2 -0
- package/dist/esm/api/{resources/authProviders/client/requests → types}/AuthProviderConnectionCreate.d.mts +2 -10
- package/dist/esm/api/types/AuthenticationDetails.d.mts +19 -0
- package/dist/esm/api/types/AuthenticationMethod.d.mts +14 -0
- package/dist/esm/api/types/AuthenticationMethod.mjs +10 -0
- package/dist/esm/api/{resources/collections/client/requests → types}/CollectionUpdate.d.mts +4 -4
- package/dist/esm/api/types/Destination.d.mts +0 -2
- package/dist/esm/api/types/DestinationWithAuthenticationFields.d.mts +0 -1
- package/dist/esm/api/types/DirectAuthentication.d.mts +10 -0
- package/dist/esm/api/types/EmbeddingModel.d.mts +0 -2
- package/dist/esm/api/types/EmbeddingModelWithAuthenticationFields.d.mts +0 -1
- package/dist/esm/api/types/EntityCountWithDefinition.d.mts +1 -0
- package/dist/esm/api/types/EntitySummary.d.mts +11 -0
- package/dist/esm/api/types/EntityTypeStats.d.mts +10 -0
- package/dist/esm/api/types/FieldCondition.d.mts +3 -3
- package/dist/esm/api/types/IntegrationCredentialInDb.d.mts +2 -1
- package/dist/esm/api/types/IntegrationCredentialRawCreate.d.mts +2 -1
- package/dist/esm/api/types/MatchPhrase.d.mts +10 -0
- package/dist/esm/api/types/OAuthBrowserAuthentication.d.mts +14 -0
- package/dist/esm/api/types/OAuthTokenAuthentication.d.mts +14 -0
- package/dist/esm/api/types/OAuthType.d.mts +12 -0
- package/dist/esm/api/types/OAuthType.mjs +8 -0
- package/dist/esm/api/types/ScheduleConfig.d.mts +14 -0
- package/dist/esm/api/types/ScheduleDetails.d.mts +13 -0
- package/dist/esm/api/types/SingleActionCheckResponse.d.mts +23 -0
- package/dist/esm/api/types/SingleActionCheckResponse.mjs +10 -0
- package/dist/esm/api/types/Source.d.mts +13 -9
- package/dist/esm/api/types/SourceConnection.d.mts +9 -52
- package/dist/esm/api/types/SourceConnectionJob.d.mts +9 -34
- package/dist/esm/api/types/SourceConnectionListItem.d.mts +8 -16
- package/dist/esm/api/types/SourceConnectionStatus.d.mts +7 -4
- package/dist/esm/api/types/SourceConnectionStatus.mjs +5 -2
- package/dist/esm/api/types/SubscriptionInfo.d.mts +12 -0
- package/dist/esm/api/types/Sync.d.mts +0 -1
- package/dist/esm/api/types/SyncCreate.d.mts +0 -1
- package/dist/esm/api/types/SyncDetails.d.mts +13 -0
- package/dist/esm/api/types/SyncJobDetails.d.mts +20 -0
- package/dist/esm/api/types/SyncJobStatus.d.mts +3 -2
- package/dist/esm/api/types/SyncJobStatus.mjs +2 -1
- package/dist/esm/api/types/SyncUpdate.d.mts +0 -1
- package/dist/esm/api/types/SyncWithSourceConnection.d.mts +0 -1
- package/dist/esm/api/types/UpdatePlanRequest.d.mts +2 -0
- package/dist/esm/api/types/UsageSnapshot.d.mts +4 -8
- package/dist/esm/api/types/index.d.mts +18 -10
- package/dist/esm/api/types/index.mjs +18 -10
- package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +5 -3
- package/dist/esm/core/fetcher/Fetcher.mjs +4 -3
- package/dist/esm/core/fetcher/index.d.mts +7 -5
- package/dist/esm/core/fetcher/index.mjs +3 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
- package/dist/esm/core/headers.d.mts +2 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +8 -13
- package/reference.md +218 -1092
- package/dist/cjs/api/resources/authProviders/client/Client.d.ts +0 -90
- package/dist/cjs/api/resources/authProviders/client/Client.js +0 -213
- package/dist/cjs/api/resources/authProviders/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/authProviders/client/index.js +0 -17
- package/dist/cjs/api/resources/authProviders/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/authProviders/index.d.ts +0 -1
- package/dist/cjs/api/resources/authProviders/index.js +0 -17
- package/dist/cjs/api/resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.d.ts +0 -11
- package/dist/cjs/api/resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.d.ts +0 -13
- package/dist/cjs/api/resources/whiteLabels/client/Client.d.ts +0 -189
- package/dist/cjs/api/resources/whiteLabels/client/Client.js +0 -585
- package/dist/cjs/api/resources/whiteLabels/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/whiteLabels/client/index.js +0 -17
- package/dist/cjs/api/resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.ts +0 -16
- package/dist/cjs/api/resources/whiteLabels/client/requests/WhiteLabelCreate.d.ts +0 -28
- package/dist/cjs/api/resources/whiteLabels/client/requests/WhiteLabelUpdate.d.ts +0 -23
- package/dist/cjs/api/resources/whiteLabels/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/whiteLabels/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/whiteLabels/index.d.ts +0 -1
- package/dist/cjs/api/resources/whiteLabels/index.js +0 -17
- package/dist/cjs/api/types/AuthType.d.ts +0 -27
- package/dist/cjs/api/types/AuthType.js +0 -16
- package/dist/cjs/api/types/BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.d.ts +0 -13
- package/dist/cjs/api/types/CancelSubscriptionRequest.d.ts +0 -11
- package/dist/cjs/api/types/OAuth2AuthUrl.d.ts +0 -13
- package/dist/cjs/api/types/SourceConnectionContinuousResponse.d.ts +0 -67
- package/dist/cjs/api/types/SourceConnectionCreateContinuous.d.ts +0 -33
- package/dist/cjs/api/types/SourceConnectionCreateWithCredential.d.ts +0 -25
- package/dist/cjs/api/types/SourceConnectionCreateWithWhiteLabel.d.ts +0 -29
- package/dist/cjs/api/types/SourceConnectionMakeContinuous.d.ts +0 -14
- package/dist/cjs/api/types/WhiteLabel.d.ts +0 -32
- package/dist/esm/api/resources/authProviders/client/Client.d.mts +0 -90
- package/dist/esm/api/resources/authProviders/client/Client.mjs +0 -176
- package/dist/esm/api/resources/authProviders/client/index.d.mts +0 -2
- package/dist/esm/api/resources/authProviders/client/index.mjs +0 -1
- package/dist/esm/api/resources/authProviders/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/authProviders/index.d.mts +0 -1
- package/dist/esm/api/resources/authProviders/index.mjs +0 -1
- package/dist/esm/api/resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.d.mts +0 -11
- package/dist/esm/api/resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.d.mts +0 -13
- package/dist/esm/api/resources/whiteLabels/client/Client.d.mts +0 -189
- package/dist/esm/api/resources/whiteLabels/client/Client.mjs +0 -548
- package/dist/esm/api/resources/whiteLabels/client/index.d.mts +0 -2
- package/dist/esm/api/resources/whiteLabels/client/index.mjs +0 -1
- package/dist/esm/api/resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.mts +0 -16
- package/dist/esm/api/resources/whiteLabels/client/requests/WhiteLabelCreate.d.mts +0 -28
- package/dist/esm/api/resources/whiteLabels/client/requests/WhiteLabelUpdate.d.mts +0 -23
- package/dist/esm/api/resources/whiteLabels/client/requests/index.d.mts +0 -3
- package/dist/esm/api/resources/whiteLabels/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/whiteLabels/index.d.mts +0 -1
- package/dist/esm/api/resources/whiteLabels/index.mjs +0 -1
- package/dist/esm/api/types/AuthType.d.mts +0 -27
- package/dist/esm/api/types/AuthType.mjs +0 -13
- package/dist/esm/api/types/BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.d.mts +0 -13
- package/dist/esm/api/types/CancelSubscriptionRequest.d.mts +0 -11
- package/dist/esm/api/types/OAuth2AuthUrl.d.mts +0 -13
- package/dist/esm/api/types/SourceConnectionContinuousResponse.d.mts +0 -67
- package/dist/esm/api/types/SourceConnectionCreateContinuous.d.mts +0 -33
- package/dist/esm/api/types/SourceConnectionCreateWithCredential.d.mts +0 -25
- package/dist/esm/api/types/SourceConnectionCreateWithWhiteLabel.d.mts +0 -29
- package/dist/esm/api/types/SourceConnectionMakeContinuous.d.mts +0 -14
- package/dist/esm/api/types/WhiteLabel.d.mts +0 -32
- /package/dist/cjs/api/resources/{authProviders/client/requests/AuthProviderConnectionCreate.js → sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.js} +0 -0
- /package/dist/cjs/api/{resources/collections/client/requests/CollectionUpdate.js → types/ActionCheckRequest.js} +0 -0
- /package/dist/cjs/api/{resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.js → types/AuthProviderAuthentication.js} +0 -0
- /package/dist/cjs/api/{resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.js → types/AuthProviderConnectionCreate.js} +0 -0
- /package/dist/cjs/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js → types/AuthenticationDetails.js} +0 -0
- /package/dist/cjs/api/{resources/whiteLabels/client/requests/WhiteLabelCreate.js → types/CollectionUpdate.js} +0 -0
- /package/dist/cjs/api/{resources/whiteLabels/client/requests/WhiteLabelUpdate.js → types/DirectAuthentication.js} +0 -0
- /package/dist/cjs/api/types/{BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.js → EntitySummary.js} +0 -0
- /package/dist/cjs/api/types/{CancelSubscriptionRequest.js → EntityTypeStats.js} +0 -0
- /package/dist/cjs/api/types/{OAuth2AuthUrl.js → MatchPhrase.js} +0 -0
- /package/dist/cjs/api/types/{SourceConnectionContinuousResponse.js → OAuthBrowserAuthentication.js} +0 -0
- /package/dist/cjs/api/types/{SourceConnectionCreateContinuous.js → OAuthTokenAuthentication.js} +0 -0
- /package/dist/cjs/api/types/{SourceConnectionCreateWithCredential.js → ScheduleConfig.js} +0 -0
- /package/dist/cjs/api/types/{SourceConnectionCreateWithWhiteLabel.js → ScheduleDetails.js} +0 -0
- /package/dist/cjs/api/types/{SourceConnectionMakeContinuous.js → SyncDetails.js} +0 -0
- /package/dist/cjs/api/types/{WhiteLabel.js → SyncJobDetails.js} +0 -0
- /package/dist/cjs/{api/resources/authProviders/client/requests/index.js → core/fetcher/EndpointMetadata.js} +0 -0
- /package/dist/esm/api/resources/{authProviders/client/requests/AuthProviderConnectionCreate.mjs → sourceConnections/client/requests/GetSourceConnectionJobsSourceConnectionsSourceConnectionIdJobsGetRequest.mjs} +0 -0
- /package/dist/esm/api/{resources/collections/client/requests/CollectionUpdate.mjs → types/ActionCheckRequest.mjs} +0 -0
- /package/dist/esm/api/{resources/sourceConnections/client/requests/BodyRunSourceConnectionsSourceConnectionIdRunPost.mjs → types/AuthProviderAuthentication.mjs} +0 -0
- /package/dist/esm/api/{resources/sourceConnections/client/requests/GetSourceConnectionsSourceConnectionIdGetRequest.mjs → types/AuthProviderConnectionCreate.mjs} +0 -0
- /package/dist/esm/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs → types/AuthenticationDetails.mjs} +0 -0
- /package/dist/esm/api/{resources/whiteLabels/client/requests/WhiteLabelCreate.mjs → types/CollectionUpdate.mjs} +0 -0
- /package/dist/esm/api/{resources/whiteLabels/client/requests/WhiteLabelUpdate.mjs → types/DirectAuthentication.mjs} +0 -0
- /package/dist/esm/api/types/{BodyCreateCredentialsFromAuthorizationCodeSourceConnectionsSourceShortNameCodeToTokenCredentialsPost.mjs → EntitySummary.mjs} +0 -0
- /package/dist/esm/api/types/{CancelSubscriptionRequest.mjs → EntityTypeStats.mjs} +0 -0
- /package/dist/esm/api/types/{OAuth2AuthUrl.mjs → MatchPhrase.mjs} +0 -0
- /package/dist/esm/api/types/{SourceConnectionContinuousResponse.mjs → OAuthBrowserAuthentication.mjs} +0 -0
- /package/dist/esm/api/types/{SourceConnectionCreateContinuous.mjs → OAuthTokenAuthentication.mjs} +0 -0
- /package/dist/esm/api/types/{SourceConnectionCreateWithCredential.mjs → ScheduleConfig.mjs} +0 -0
- /package/dist/esm/api/types/{SourceConnectionCreateWithWhiteLabel.mjs → ScheduleDetails.mjs} +0 -0
- /package/dist/esm/api/types/{SourceConnectionMakeContinuous.mjs → SyncDetails.mjs} +0 -0
- /package/dist/esm/api/types/{WhiteLabel.mjs → SyncJobDetails.mjs} +0 -0
- /package/dist/esm/{api/resources/authProviders/client/requests/index.mjs → core/fetcher/EndpointMetadata.mjs} +0 -0
|
@@ -1,548 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
import * as environments from "../../../../environments.mjs";
|
|
14
|
-
import * as core from "../../../../core/index.mjs";
|
|
15
|
-
import * as AirweaveSDK from "../../../index.mjs";
|
|
16
|
-
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
|
-
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
-
/**
|
|
19
|
-
* API endpoints for managing custom OAuth2 integrations with your own branding and credentials
|
|
20
|
-
*/
|
|
21
|
-
export class WhiteLabels {
|
|
22
|
-
constructor(_options) {
|
|
23
|
-
this._options = _options;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* List all white label integrations for your organization.
|
|
27
|
-
*
|
|
28
|
-
* <br/><br/>
|
|
29
|
-
* Returns all custom OAuth integrations configured with your own branding and
|
|
30
|
-
* credentials. These integrations allow you to present OAuth consent screens with
|
|
31
|
-
* your company name instead of Airweave.<br/><br/>**White label integrations only
|
|
32
|
-
* work with OAuth2.0 sources** like Slack, Google Drive, or HubSpot that require
|
|
33
|
-
* OAuth consent flows.
|
|
34
|
-
*
|
|
35
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
-
*
|
|
37
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* await client.whiteLabels.listWhiteLabels()
|
|
41
|
-
*/
|
|
42
|
-
listWhiteLabels(requestOptions) {
|
|
43
|
-
return core.HttpResponsePromise.fromPromise(this.__listWhiteLabels(requestOptions));
|
|
44
|
-
}
|
|
45
|
-
__listWhiteLabels(requestOptions) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
var _a, _b, _c;
|
|
48
|
-
const _response = yield core.fetcher({
|
|
49
|
-
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"),
|
|
50
|
-
method: "GET",
|
|
51
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
52
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
53
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
54
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
55
|
-
});
|
|
56
|
-
if (_response.ok) {
|
|
57
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
58
|
-
}
|
|
59
|
-
if (_response.error.reason === "status-code") {
|
|
60
|
-
switch (_response.error.statusCode) {
|
|
61
|
-
case 422:
|
|
62
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
63
|
-
default:
|
|
64
|
-
throw new errors.AirweaveSDKError({
|
|
65
|
-
statusCode: _response.error.statusCode,
|
|
66
|
-
body: _response.error.body,
|
|
67
|
-
rawResponse: _response.rawResponse,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
switch (_response.error.reason) {
|
|
72
|
-
case "non-json":
|
|
73
|
-
throw new errors.AirweaveSDKError({
|
|
74
|
-
statusCode: _response.error.statusCode,
|
|
75
|
-
body: _response.error.rawBody,
|
|
76
|
-
rawResponse: _response.rawResponse,
|
|
77
|
-
});
|
|
78
|
-
case "timeout":
|
|
79
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /white-labels/list.");
|
|
80
|
-
case "unknown":
|
|
81
|
-
throw new errors.AirweaveSDKError({
|
|
82
|
-
message: _response.error.errorMessage,
|
|
83
|
-
rawResponse: _response.rawResponse,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Create a new white label integration.
|
|
90
|
-
*
|
|
91
|
-
* <br/><br/>
|
|
92
|
-
* **This only works for sources that use OAuth2.0 authentication** like Slack,
|
|
93
|
-
* Google Drive, GitHub, or HubSpot.<br/><br/>Sets up a custom OAuth integration
|
|
94
|
-
* using your own OAuth application credentials and branding. Once created,
|
|
95
|
-
* customers will see your company name during OAuth consent flows instead of
|
|
96
|
-
* Airweave. This requires you to have already configured your own OAuth
|
|
97
|
-
* application with the target service provider.
|
|
98
|
-
*
|
|
99
|
-
* @param {AirweaveSDK.WhiteLabelCreate} request
|
|
100
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
101
|
-
*
|
|
102
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* await client.whiteLabels.createWhiteLabel({
|
|
106
|
-
* name: "Customer Portal Slack Integration",
|
|
107
|
-
* source_short_name: "slack",
|
|
108
|
-
* redirect_url: "https://yourapp.com/auth/slack/callback",
|
|
109
|
-
* client_id: "1234567890.1234567890123",
|
|
110
|
-
* client_secret: "abcdefghijklmnopqrstuvwxyz123456",
|
|
111
|
-
* allowed_origins: "https://yourapp.com,https://app.yourapp.com"
|
|
112
|
-
* })
|
|
113
|
-
*/
|
|
114
|
-
createWhiteLabel(request, requestOptions) {
|
|
115
|
-
return core.HttpResponsePromise.fromPromise(this.__createWhiteLabel(request, requestOptions));
|
|
116
|
-
}
|
|
117
|
-
__createWhiteLabel(request, requestOptions) {
|
|
118
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
var _a, _b, _c;
|
|
120
|
-
const _response = yield core.fetcher({
|
|
121
|
-
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"),
|
|
122
|
-
method: "POST",
|
|
123
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
124
|
-
contentType: "application/json",
|
|
125
|
-
requestType: "json",
|
|
126
|
-
body: request,
|
|
127
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
128
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
129
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
130
|
-
});
|
|
131
|
-
if (_response.ok) {
|
|
132
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
133
|
-
}
|
|
134
|
-
if (_response.error.reason === "status-code") {
|
|
135
|
-
switch (_response.error.statusCode) {
|
|
136
|
-
case 422:
|
|
137
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
138
|
-
default:
|
|
139
|
-
throw new errors.AirweaveSDKError({
|
|
140
|
-
statusCode: _response.error.statusCode,
|
|
141
|
-
body: _response.error.body,
|
|
142
|
-
rawResponse: _response.rawResponse,
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
switch (_response.error.reason) {
|
|
147
|
-
case "non-json":
|
|
148
|
-
throw new errors.AirweaveSDKError({
|
|
149
|
-
statusCode: _response.error.statusCode,
|
|
150
|
-
body: _response.error.rawBody,
|
|
151
|
-
rawResponse: _response.rawResponse,
|
|
152
|
-
});
|
|
153
|
-
case "timeout":
|
|
154
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /white-labels.");
|
|
155
|
-
case "unknown":
|
|
156
|
-
throw new errors.AirweaveSDKError({
|
|
157
|
-
message: _response.error.errorMessage,
|
|
158
|
-
rawResponse: _response.rawResponse,
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Retrieve a specific white label integration by its ID.
|
|
165
|
-
*
|
|
166
|
-
* @param {string} whiteLabelId - The unique identifier of the white label integration
|
|
167
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
168
|
-
*
|
|
169
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* await client.whiteLabels.getWhiteLabel("white_label_id")
|
|
173
|
-
*/
|
|
174
|
-
getWhiteLabel(whiteLabelId, requestOptions) {
|
|
175
|
-
return core.HttpResponsePromise.fromPromise(this.__getWhiteLabel(whiteLabelId, requestOptions));
|
|
176
|
-
}
|
|
177
|
-
__getWhiteLabel(whiteLabelId, requestOptions) {
|
|
178
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
-
var _a, _b, _c;
|
|
180
|
-
const _response = yield core.fetcher({
|
|
181
|
-
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)}`),
|
|
182
|
-
method: "GET",
|
|
183
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
184
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
185
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
186
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
187
|
-
});
|
|
188
|
-
if (_response.ok) {
|
|
189
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
190
|
-
}
|
|
191
|
-
if (_response.error.reason === "status-code") {
|
|
192
|
-
switch (_response.error.statusCode) {
|
|
193
|
-
case 422:
|
|
194
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
195
|
-
default:
|
|
196
|
-
throw new errors.AirweaveSDKError({
|
|
197
|
-
statusCode: _response.error.statusCode,
|
|
198
|
-
body: _response.error.body,
|
|
199
|
-
rawResponse: _response.rawResponse,
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
switch (_response.error.reason) {
|
|
204
|
-
case "non-json":
|
|
205
|
-
throw new errors.AirweaveSDKError({
|
|
206
|
-
statusCode: _response.error.statusCode,
|
|
207
|
-
body: _response.error.rawBody,
|
|
208
|
-
rawResponse: _response.rawResponse,
|
|
209
|
-
});
|
|
210
|
-
case "timeout":
|
|
211
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /white-labels/{white_label_id}.");
|
|
212
|
-
case "unknown":
|
|
213
|
-
throw new errors.AirweaveSDKError({
|
|
214
|
-
message: _response.error.errorMessage,
|
|
215
|
-
rawResponse: _response.rawResponse,
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Update a white label integration's configuration.
|
|
222
|
-
*
|
|
223
|
-
* @param {string} whiteLabelId - The unique identifier of the white label integration to update
|
|
224
|
-
* @param {AirweaveSDK.WhiteLabelUpdate} request
|
|
225
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
226
|
-
*
|
|
227
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* await client.whiteLabels.updateWhiteLabel("white_label_id", {
|
|
231
|
-
* name: "Updated Customer Portal Integration",
|
|
232
|
-
* redirect_url: "https://v2.yourapp.com/auth/slack/callback",
|
|
233
|
-
* allowed_origins: "https://v2.yourapp.com,https://api.yourapp.com"
|
|
234
|
-
* })
|
|
235
|
-
*/
|
|
236
|
-
updateWhiteLabel(whiteLabelId, request = {}, requestOptions) {
|
|
237
|
-
return core.HttpResponsePromise.fromPromise(this.__updateWhiteLabel(whiteLabelId, request, requestOptions));
|
|
238
|
-
}
|
|
239
|
-
__updateWhiteLabel(whiteLabelId_1) {
|
|
240
|
-
return __awaiter(this, arguments, void 0, function* (whiteLabelId, request = {}, requestOptions) {
|
|
241
|
-
var _a, _b, _c;
|
|
242
|
-
const _response = yield core.fetcher({
|
|
243
|
-
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)}`),
|
|
244
|
-
method: "PUT",
|
|
245
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
246
|
-
contentType: "application/json",
|
|
247
|
-
requestType: "json",
|
|
248
|
-
body: request,
|
|
249
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
250
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
251
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
252
|
-
});
|
|
253
|
-
if (_response.ok) {
|
|
254
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
255
|
-
}
|
|
256
|
-
if (_response.error.reason === "status-code") {
|
|
257
|
-
switch (_response.error.statusCode) {
|
|
258
|
-
case 422:
|
|
259
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
260
|
-
default:
|
|
261
|
-
throw new errors.AirweaveSDKError({
|
|
262
|
-
statusCode: _response.error.statusCode,
|
|
263
|
-
body: _response.error.body,
|
|
264
|
-
rawResponse: _response.rawResponse,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
switch (_response.error.reason) {
|
|
269
|
-
case "non-json":
|
|
270
|
-
throw new errors.AirweaveSDKError({
|
|
271
|
-
statusCode: _response.error.statusCode,
|
|
272
|
-
body: _response.error.rawBody,
|
|
273
|
-
rawResponse: _response.rawResponse,
|
|
274
|
-
});
|
|
275
|
-
case "timeout":
|
|
276
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling PUT /white-labels/{white_label_id}.");
|
|
277
|
-
case "unknown":
|
|
278
|
-
throw new errors.AirweaveSDKError({
|
|
279
|
-
message: _response.error.errorMessage,
|
|
280
|
-
rawResponse: _response.rawResponse,
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Delete a white label integration.
|
|
287
|
-
*
|
|
288
|
-
* <br/><br/>
|
|
289
|
-
* Permanently removes the white label configuration and OAuth credentials.
|
|
290
|
-
* Existing source connections created through this integration will continue to work,
|
|
291
|
-
* but no new OAuth flows can be initiated until a new white label integration is created.
|
|
292
|
-
*
|
|
293
|
-
* @param {string} whiteLabelId - The unique identifier of the white label integration to delete
|
|
294
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
295
|
-
*
|
|
296
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
297
|
-
*
|
|
298
|
-
* @example
|
|
299
|
-
* await client.whiteLabels.deleteWhiteLabel("white_label_id")
|
|
300
|
-
*/
|
|
301
|
-
deleteWhiteLabel(whiteLabelId, requestOptions) {
|
|
302
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteWhiteLabel(whiteLabelId, requestOptions));
|
|
303
|
-
}
|
|
304
|
-
__deleteWhiteLabel(whiteLabelId, requestOptions) {
|
|
305
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
306
|
-
var _a, _b, _c;
|
|
307
|
-
const _response = yield core.fetcher({
|
|
308
|
-
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)}`),
|
|
309
|
-
method: "DELETE",
|
|
310
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
311
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
312
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
313
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
314
|
-
});
|
|
315
|
-
if (_response.ok) {
|
|
316
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
317
|
-
}
|
|
318
|
-
if (_response.error.reason === "status-code") {
|
|
319
|
-
switch (_response.error.statusCode) {
|
|
320
|
-
case 422:
|
|
321
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
322
|
-
default:
|
|
323
|
-
throw new errors.AirweaveSDKError({
|
|
324
|
-
statusCode: _response.error.statusCode,
|
|
325
|
-
body: _response.error.body,
|
|
326
|
-
rawResponse: _response.rawResponse,
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
switch (_response.error.reason) {
|
|
331
|
-
case "non-json":
|
|
332
|
-
throw new errors.AirweaveSDKError({
|
|
333
|
-
statusCode: _response.error.statusCode,
|
|
334
|
-
body: _response.error.rawBody,
|
|
335
|
-
rawResponse: _response.rawResponse,
|
|
336
|
-
});
|
|
337
|
-
case "timeout":
|
|
338
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling DELETE /white-labels/{white_label_id}.");
|
|
339
|
-
case "unknown":
|
|
340
|
-
throw new errors.AirweaveSDKError({
|
|
341
|
-
message: _response.error.errorMessage,
|
|
342
|
-
rawResponse: _response.rawResponse,
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Generate a branded OAuth2 authorization URL for customer authentication.
|
|
349
|
-
*
|
|
350
|
-
* <br/><br/>
|
|
351
|
-
* Creates the OAuth consent URL that customers should be redirected to for
|
|
352
|
-
* authentication. The OAuth consent screen will display your company name and
|
|
353
|
-
* branding instead of Airweave.
|
|
354
|
-
*
|
|
355
|
-
* @param {string} whiteLabelId - The unique identifier of the white label integration
|
|
356
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
357
|
-
*
|
|
358
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
359
|
-
*
|
|
360
|
-
* @example
|
|
361
|
-
* await client.whiteLabels.getWhiteLabelOauth2AuthUrl("white_label_id")
|
|
362
|
-
*/
|
|
363
|
-
getWhiteLabelOauth2AuthUrl(whiteLabelId, requestOptions) {
|
|
364
|
-
return core.HttpResponsePromise.fromPromise(this.__getWhiteLabelOauth2AuthUrl(whiteLabelId, requestOptions));
|
|
365
|
-
}
|
|
366
|
-
__getWhiteLabelOauth2AuthUrl(whiteLabelId, requestOptions) {
|
|
367
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
-
var _a, _b, _c;
|
|
369
|
-
const _response = yield core.fetcher({
|
|
370
|
-
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`),
|
|
371
|
-
method: "GET",
|
|
372
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
373
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
374
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
375
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
376
|
-
});
|
|
377
|
-
if (_response.ok) {
|
|
378
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
379
|
-
}
|
|
380
|
-
if (_response.error.reason === "status-code") {
|
|
381
|
-
switch (_response.error.statusCode) {
|
|
382
|
-
case 422:
|
|
383
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
384
|
-
default:
|
|
385
|
-
throw new errors.AirweaveSDKError({
|
|
386
|
-
statusCode: _response.error.statusCode,
|
|
387
|
-
body: _response.error.body,
|
|
388
|
-
rawResponse: _response.rawResponse,
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
switch (_response.error.reason) {
|
|
393
|
-
case "non-json":
|
|
394
|
-
throw new errors.AirweaveSDKError({
|
|
395
|
-
statusCode: _response.error.statusCode,
|
|
396
|
-
body: _response.error.rawBody,
|
|
397
|
-
rawResponse: _response.rawResponse,
|
|
398
|
-
});
|
|
399
|
-
case "timeout":
|
|
400
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /white-labels/{white_label_id}/oauth2/auth_url.");
|
|
401
|
-
case "unknown":
|
|
402
|
-
throw new errors.AirweaveSDKError({
|
|
403
|
-
message: _response.error.errorMessage,
|
|
404
|
-
rawResponse: _response.rawResponse,
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* List all source connections created through a specific white label integration.
|
|
411
|
-
*
|
|
412
|
-
* <br/><br/>
|
|
413
|
-
* Returns source connections that were established using this white label's OAuth flow.
|
|
414
|
-
*
|
|
415
|
-
* @param {string} whiteLabelId - The unique identifier of the white label integration
|
|
416
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
417
|
-
*
|
|
418
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
419
|
-
*
|
|
420
|
-
* @example
|
|
421
|
-
* await client.whiteLabels.listWhiteLabelSourceConnections("white_label_id")
|
|
422
|
-
*/
|
|
423
|
-
listWhiteLabelSourceConnections(whiteLabelId, requestOptions) {
|
|
424
|
-
return core.HttpResponsePromise.fromPromise(this.__listWhiteLabelSourceConnections(whiteLabelId, requestOptions));
|
|
425
|
-
}
|
|
426
|
-
__listWhiteLabelSourceConnections(whiteLabelId, requestOptions) {
|
|
427
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
428
|
-
var _a, _b, _c;
|
|
429
|
-
const _response = yield core.fetcher({
|
|
430
|
-
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`),
|
|
431
|
-
method: "GET",
|
|
432
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
433
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
434
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
435
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
436
|
-
});
|
|
437
|
-
if (_response.ok) {
|
|
438
|
-
return {
|
|
439
|
-
data: _response.body,
|
|
440
|
-
rawResponse: _response.rawResponse,
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
if (_response.error.reason === "status-code") {
|
|
444
|
-
switch (_response.error.statusCode) {
|
|
445
|
-
case 422:
|
|
446
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
447
|
-
default:
|
|
448
|
-
throw new errors.AirweaveSDKError({
|
|
449
|
-
statusCode: _response.error.statusCode,
|
|
450
|
-
body: _response.error.body,
|
|
451
|
-
rawResponse: _response.rawResponse,
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
switch (_response.error.reason) {
|
|
456
|
-
case "non-json":
|
|
457
|
-
throw new errors.AirweaveSDKError({
|
|
458
|
-
statusCode: _response.error.statusCode,
|
|
459
|
-
body: _response.error.rawBody,
|
|
460
|
-
rawResponse: _response.rawResponse,
|
|
461
|
-
});
|
|
462
|
-
case "timeout":
|
|
463
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /white-labels/{white_label_id}/source-connections.");
|
|
464
|
-
case "unknown":
|
|
465
|
-
throw new errors.AirweaveSDKError({
|
|
466
|
-
message: _response.error.errorMessage,
|
|
467
|
-
rawResponse: _response.rawResponse,
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* Complete the OAuth flow and create a source connection.
|
|
474
|
-
*
|
|
475
|
-
* <br/><br/>
|
|
476
|
-
* **This is the core endpoint that converts OAuth authorization codes into working
|
|
477
|
-
* source connections.**<br/><br/>The OAuth credentials are obtained automatically
|
|
478
|
-
* from the authorization code - you do not need to provide auth_fields. The white
|
|
479
|
-
* label integration is automatically linked to the created source connection for
|
|
480
|
-
* tracking and branding purposes.
|
|
481
|
-
*
|
|
482
|
-
* @param {string} whiteLabelId - The unique identifier of the white label integration
|
|
483
|
-
* @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions} request
|
|
484
|
-
* @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
|
|
485
|
-
*
|
|
486
|
-
* @throws {@link AirweaveSDK.UnprocessableEntityError}
|
|
487
|
-
*
|
|
488
|
-
* @example
|
|
489
|
-
* await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
|
|
490
|
-
* code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
|
|
491
|
-
* })
|
|
492
|
-
*/
|
|
493
|
-
exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
|
|
494
|
-
return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions));
|
|
495
|
-
}
|
|
496
|
-
__exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
|
|
497
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
498
|
-
var _a, _b, _c;
|
|
499
|
-
const _response = yield core.fetcher({
|
|
500
|
-
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`),
|
|
501
|
-
method: "POST",
|
|
502
|
-
headers: mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
503
|
-
contentType: "application/json",
|
|
504
|
-
requestType: "json",
|
|
505
|
-
body: request,
|
|
506
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
507
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
508
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
509
|
-
});
|
|
510
|
-
if (_response.ok) {
|
|
511
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
512
|
-
}
|
|
513
|
-
if (_response.error.reason === "status-code") {
|
|
514
|
-
switch (_response.error.statusCode) {
|
|
515
|
-
case 422:
|
|
516
|
-
throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
517
|
-
default:
|
|
518
|
-
throw new errors.AirweaveSDKError({
|
|
519
|
-
statusCode: _response.error.statusCode,
|
|
520
|
-
body: _response.error.body,
|
|
521
|
-
rawResponse: _response.rawResponse,
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
switch (_response.error.reason) {
|
|
526
|
-
case "non-json":
|
|
527
|
-
throw new errors.AirweaveSDKError({
|
|
528
|
-
statusCode: _response.error.statusCode,
|
|
529
|
-
body: _response.error.rawBody,
|
|
530
|
-
rawResponse: _response.rawResponse,
|
|
531
|
-
});
|
|
532
|
-
case "timeout":
|
|
533
|
-
throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /white-labels/{white_label_id}/oauth2/code.");
|
|
534
|
-
case "unknown":
|
|
535
|
-
throw new errors.AirweaveSDKError({
|
|
536
|
-
message: _response.error.errorMessage,
|
|
537
|
-
rawResponse: _response.rawResponse,
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
_getCustomAuthorizationHeaders() {
|
|
543
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
544
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
545
|
-
return { "x-api-key": apiKeyValue };
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./requests/index.mjs";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as AirweaveSDK from "../../../../index.mjs";
|
|
5
|
-
/**
|
|
6
|
-
* @example
|
|
7
|
-
* {
|
|
8
|
-
* code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
|
|
9
|
-
* }
|
|
10
|
-
*/
|
|
11
|
-
export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions {
|
|
12
|
-
/** The OAuth2 authorization code received from the OAuth callback after customer authentication */
|
|
13
|
-
code: string;
|
|
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. */
|
|
15
|
-
source_connection_in?: AirweaveSDK.SourceConnectionCreateWithWhiteLabel;
|
|
16
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* @example
|
|
6
|
-
* {
|
|
7
|
-
* name: "Customer Portal Slack Integration",
|
|
8
|
-
* source_short_name: "slack",
|
|
9
|
-
* redirect_url: "https://yourapp.com/auth/slack/callback",
|
|
10
|
-
* client_id: "1234567890.1234567890123",
|
|
11
|
-
* client_secret: "abcdefghijklmnopqrstuvwxyz123456",
|
|
12
|
-
* allowed_origins: "https://yourapp.com,https://app.yourapp.com"
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export interface WhiteLabelCreate {
|
|
16
|
-
/** Human-readable name for the white label integration. This helps you identify the integration in the UI and should clearly describe its purpose (e.g., 'Customer Portal Slack Integration', 'Enterprise Google Drive Access'). */
|
|
17
|
-
name: string;
|
|
18
|
-
/** Technical identifier of the source type that this integration supports (e.g., 'slack', 'google_drive', 'github'). This determines which service provider the OAuth integration connects to. */
|
|
19
|
-
source_short_name: string;
|
|
20
|
-
/** OAuth2 callback URL where users are redirected after completing authentication. This must be a valid HTTPS URL that your application can handle to receive the authorization code. */
|
|
21
|
-
redirect_url: string;
|
|
22
|
-
/** OAuth2 client identifier provided by the service provider. This identifies your application during the OAuth consent flow and must match the client ID configured in the service provider's developer console. */
|
|
23
|
-
client_id: string;
|
|
24
|
-
/** OAuth2 client secret from your registered application. This is used to securely authenticate your application when exchanging authorization codes for access tokens. Keep this value secure and never expose it in client-side code. */
|
|
25
|
-
client_secret: string;
|
|
26
|
-
/** Comma-separated list of allowed domains for OAuth flows and CORS. This prevents unauthorized websites from using your OAuth credentials and should include all domains where your application is hosted. */
|
|
27
|
-
allowed_origins: string;
|
|
28
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* @example
|
|
6
|
-
* {
|
|
7
|
-
* name: "Updated Customer Portal Integration",
|
|
8
|
-
* redirect_url: "https://v2.yourapp.com/auth/slack/callback",
|
|
9
|
-
* allowed_origins: "https://v2.yourapp.com,https://api.yourapp.com"
|
|
10
|
-
* }
|
|
11
|
-
*/
|
|
12
|
-
export interface WhiteLabelUpdate {
|
|
13
|
-
/** Updated name for the white label integration. */
|
|
14
|
-
name?: string;
|
|
15
|
-
/** Updated OAuth callback URL. Must be a valid HTTPS URL that matches your OAuth application configuration. */
|
|
16
|
-
redirect_url?: string;
|
|
17
|
-
/** Updated OAuth2 client ID. Must match the client ID in your service provider's developer console. */
|
|
18
|
-
client_id?: string;
|
|
19
|
-
/** Updated OAuth2 client secret. This will replace the existing secret and affect all future OAuth flows. */
|
|
20
|
-
client_secret?: string;
|
|
21
|
-
/** Updated comma-separated list of allowed domains for OAuth flows. */
|
|
22
|
-
allowed_origins?: string;
|
|
23
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { type WhiteLabelCreate } from "./WhiteLabelCreate.mjs";
|
|
2
|
-
export { type WhiteLabelUpdate } from "./WhiteLabelUpdate.mjs";
|
|
3
|
-
export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./client/index.mjs";
|