@airweave/sdk 0.6.0 → 0.6.3

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