@airweave/sdk 0.3.53 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/Client.d.ts +2 -9
  3. package/dist/cjs/Client.js +3 -5
  4. package/dist/cjs/api/resources/collections/client/Client.d.ts +11 -20
  5. package/dist/cjs/api/resources/collections/client/Client.js +24 -53
  6. package/dist/cjs/api/resources/collections/client/requests/index.d.ts +0 -1
  7. package/dist/cjs/api/resources/sourceConnections/client/Client.d.ts +7 -22
  8. package/dist/cjs/api/resources/sourceConnections/client/Client.js +21 -59
  9. package/dist/cjs/api/resources/sourceConnections/client/requests/index.d.ts +0 -1
  10. package/dist/cjs/api/resources/sources/client/Client.d.ts +5 -9
  11. package/dist/cjs/api/resources/sources/client/Client.js +9 -9
  12. package/dist/cjs/api/resources/whiteLabels/client/Client.d.ts +12 -16
  13. package/dist/cjs/api/resources/whiteLabels/client/Client.js +24 -42
  14. package/dist/cjs/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.ts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.ts} +1 -1
  15. package/dist/cjs/api/resources/whiteLabels/client/requests/index.d.ts +1 -1
  16. package/dist/cjs/api/types/ActionCheckResponse.d.ts +23 -0
  17. package/dist/cjs/api/types/ActionCheckResponse.js +13 -0
  18. package/dist/cjs/api/types/BillingPeriodUsage.d.ts +27 -0
  19. package/dist/cjs/api/types/CancelSubscriptionRequest.d.ts +11 -0
  20. package/dist/cjs/api/types/CheckoutSessionRequest.d.ts +14 -0
  21. package/dist/cjs/api/types/CheckoutSessionRequest.js +5 -0
  22. package/dist/cjs/api/types/CheckoutSessionResponse.d.ts +10 -0
  23. package/dist/cjs/api/types/CheckoutSessionResponse.js +5 -0
  24. package/dist/cjs/api/types/CustomerPortalRequest.d.ts +10 -0
  25. package/dist/cjs/api/types/CustomerPortalRequest.js +5 -0
  26. package/dist/cjs/api/types/CustomerPortalResponse.d.ts +10 -0
  27. package/dist/cjs/api/types/CustomerPortalResponse.js +5 -0
  28. package/dist/cjs/api/types/MessageResponse.d.ts +10 -0
  29. package/dist/cjs/api/types/MessageResponse.js +5 -0
  30. package/dist/cjs/api/types/Organization.d.ts +1 -0
  31. package/dist/cjs/api/types/OrganizationCreate.d.ts +2 -0
  32. package/dist/cjs/api/types/OrganizationWithRole.d.ts +1 -0
  33. package/dist/cjs/api/types/SubscriptionInfo.d.ts +40 -0
  34. package/dist/cjs/api/types/SubscriptionInfo.js +5 -0
  35. package/dist/cjs/api/types/UpdatePlanRequest.d.ts +10 -0
  36. package/dist/cjs/api/types/UpdatePlanRequest.js +5 -0
  37. package/dist/cjs/api/types/UsageDashboard.d.ts +23 -0
  38. package/dist/cjs/api/types/UsageDashboard.js +5 -0
  39. package/dist/cjs/api/types/UsageSnapshot.d.ts +32 -0
  40. package/dist/cjs/api/types/UsageSnapshot.js +5 -0
  41. package/dist/cjs/api/types/UsageTrend.d.ts +14 -0
  42. package/dist/cjs/api/types/UsageTrend.js +5 -0
  43. package/dist/cjs/api/types/index.d.ts +13 -0
  44. package/dist/cjs/api/types/index.js +13 -0
  45. package/dist/cjs/version.d.ts +1 -1
  46. package/dist/cjs/version.js +1 -1
  47. package/dist/esm/Client.d.mts +2 -9
  48. package/dist/esm/Client.mjs +3 -5
  49. package/dist/esm/api/resources/collections/client/Client.d.mts +11 -20
  50. package/dist/esm/api/resources/collections/client/Client.mjs +24 -53
  51. package/dist/esm/api/resources/collections/client/requests/index.d.mts +0 -1
  52. package/dist/esm/api/resources/sourceConnections/client/Client.d.mts +7 -22
  53. package/dist/esm/api/resources/sourceConnections/client/Client.mjs +21 -59
  54. package/dist/esm/api/resources/sourceConnections/client/requests/index.d.mts +0 -1
  55. package/dist/esm/api/resources/sources/client/Client.d.mts +5 -9
  56. package/dist/esm/api/resources/sources/client/Client.mjs +9 -9
  57. package/dist/esm/api/resources/whiteLabels/client/Client.d.mts +12 -16
  58. package/dist/esm/api/resources/whiteLabels/client/Client.mjs +24 -42
  59. package/dist/esm/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.mts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.mts} +1 -1
  60. package/dist/esm/api/resources/whiteLabels/client/requests/index.d.mts +1 -1
  61. package/dist/esm/api/types/ActionCheckResponse.d.mts +23 -0
  62. package/dist/esm/api/types/ActionCheckResponse.mjs +10 -0
  63. package/dist/esm/api/types/BillingPeriodUsage.d.mts +27 -0
  64. package/dist/esm/api/types/CancelSubscriptionRequest.d.mts +11 -0
  65. package/dist/esm/api/types/CheckoutSessionRequest.d.mts +14 -0
  66. package/dist/esm/api/types/CheckoutSessionRequest.mjs +4 -0
  67. package/dist/esm/api/types/CheckoutSessionResponse.d.mts +10 -0
  68. package/dist/esm/api/types/CheckoutSessionResponse.mjs +4 -0
  69. package/dist/esm/api/types/CustomerPortalRequest.d.mts +10 -0
  70. package/dist/esm/api/types/CustomerPortalRequest.mjs +4 -0
  71. package/dist/esm/api/types/CustomerPortalResponse.d.mts +10 -0
  72. package/dist/esm/api/types/CustomerPortalResponse.mjs +4 -0
  73. package/dist/esm/api/types/MessageResponse.d.mts +10 -0
  74. package/dist/esm/api/types/MessageResponse.mjs +4 -0
  75. package/dist/esm/api/types/Organization.d.mts +1 -0
  76. package/dist/esm/api/types/OrganizationCreate.d.mts +2 -0
  77. package/dist/esm/api/types/OrganizationWithRole.d.mts +1 -0
  78. package/dist/esm/api/types/SubscriptionInfo.d.mts +40 -0
  79. package/dist/esm/api/types/SubscriptionInfo.mjs +4 -0
  80. package/dist/esm/api/types/UpdatePlanRequest.d.mts +10 -0
  81. package/dist/esm/api/types/UpdatePlanRequest.mjs +4 -0
  82. package/dist/esm/api/types/UsageDashboard.d.mts +23 -0
  83. package/dist/esm/api/types/UsageDashboard.mjs +4 -0
  84. package/dist/esm/api/types/UsageSnapshot.d.mts +32 -0
  85. package/dist/esm/api/types/UsageSnapshot.mjs +4 -0
  86. package/dist/esm/api/types/UsageTrend.d.mts +14 -0
  87. package/dist/esm/api/types/UsageTrend.mjs +4 -0
  88. package/dist/esm/api/types/index.d.mts +13 -0
  89. package/dist/esm/api/types/index.mjs +13 -0
  90. package/dist/esm/version.d.mts +1 -1
  91. package/dist/esm/version.mjs +1 -1
  92. package/package.json +1 -1
  93. package/reference.md +13 -43
  94. package/dist/cjs/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.d.ts +0 -13
  95. package/dist/cjs/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.d.ts +0 -13
  96. package/dist/esm/api/resources/collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.d.mts +0 -13
  97. package/dist/esm/api/resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.d.mts +0 -13
  98. /package/dist/cjs/api/resources/{collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.js → whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.js} +0 -0
  99. /package/dist/cjs/api/{resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.js → types/BillingPeriodUsage.js} +0 -0
  100. /package/dist/cjs/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js → types/CancelSubscriptionRequest.js} +0 -0
  101. /package/dist/esm/api/resources/{collections/client/requests/DeleteCollectionCollectionsReadableIdDeleteRequest.mjs → whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.mjs} +0 -0
  102. /package/dist/esm/api/{resources/sourceConnections/client/requests/DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest.mjs → types/BillingPeriodUsage.mjs} +0 -0
  103. /package/dist/esm/api/{resources/whiteLabels/client/requests/BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs → types/CancelSubscriptionRequest.mjs} +0 -0
package/README.md CHANGED
@@ -22,7 +22,7 @@ Instantiate and use the client with the following:
22
22
  ```typescript
23
23
  import { AirweaveSDKClient } from "@airweave/sdk";
24
24
 
25
- const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY", organizationId: "YOUR_ORGANIZATION_ID" });
25
+ const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY" });
26
26
  await client.collections.createCollection({
27
27
  name: "Finance Data",
28
28
  readable_id: "finance-data-reports",
@@ -12,10 +12,7 @@ export declare namespace AirweaveSDKClient {
12
12
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
13
13
  /** Specify a custom URL to connect the client to. */
14
14
  baseUrl?: core.Supplier<string>;
15
- /** Override the X-API-Key header */
16
- apiKey?: core.Supplier<string | undefined>;
17
- /** Override the X-Organization-ID header */
18
- organizationId?: core.Supplier<string | undefined>;
15
+ apiKey: core.Supplier<string>;
19
16
  /** Additional headers to include in requests. */
20
17
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
21
18
  }
@@ -26,10 +23,6 @@ export declare namespace AirweaveSDKClient {
26
23
  maxRetries?: number;
27
24
  /** A hook to abort the request. */
28
25
  abortSignal?: AbortSignal;
29
- /** Override the X-API-Key header */
30
- apiKey?: string | undefined;
31
- /** Override the X-Organization-ID header */
32
- organizationId?: string | undefined;
33
26
  /** Additional headers to include in the request. */
34
27
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
35
28
  }
@@ -40,7 +33,7 @@ export declare class AirweaveSDKClient {
40
33
  protected _collections: Collections | undefined;
41
34
  protected _sourceConnections: SourceConnections | undefined;
42
35
  protected _whiteLabels: WhiteLabels | undefined;
43
- constructor(_options?: AirweaveSDKClient.Options);
36
+ constructor(_options: AirweaveSDKClient.Options);
44
37
  get sources(): Sources;
45
38
  get collections(): Collections;
46
39
  get sourceConnections(): SourceConnections;
@@ -44,14 +44,12 @@ const Client_js_2 = require("./api/resources/collections/client/Client.js");
44
44
  const Client_js_3 = require("./api/resources/sourceConnections/client/Client.js");
45
45
  const Client_js_4 = require("./api/resources/whiteLabels/client/Client.js");
46
46
  class AirweaveSDKClient {
47
- constructor(_options = {}) {
47
+ constructor(_options) {
48
48
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
49
- "X-API-Key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
50
- "X-Organization-ID": _options === null || _options === void 0 ? void 0 : _options.organizationId,
51
49
  "X-Fern-Language": "JavaScript",
52
50
  "X-Fern-SDK-Name": "@airweave/sdk",
53
- "X-Fern-SDK-Version": "v0.3.53",
54
- "User-Agent": "@airweave/sdk/v0.3.53",
51
+ "X-Fern-SDK-Version": "v0.4.0",
52
+ "User-Agent": "@airweave/sdk/v0.4.0",
55
53
  "X-Fern-Runtime": core.RUNTIME.type,
56
54
  "X-Fern-Runtime-Version": core.RUNTIME.version,
57
55
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -9,10 +9,7 @@ export declare namespace Collections {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
- /** Override the X-API-Key header */
13
- apiKey?: core.Supplier<string | undefined>;
14
- /** Override the X-Organization-ID header */
15
- organizationId?: core.Supplier<string | undefined>;
12
+ apiKey: core.Supplier<string>;
16
13
  /** Additional headers to include in requests. */
17
14
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
18
15
  }
@@ -23,10 +20,6 @@ export declare namespace Collections {
23
20
  maxRetries?: number;
24
21
  /** A hook to abort the request. */
25
22
  abortSignal?: AbortSignal;
26
- /** Override the X-API-Key header */
27
- apiKey?: string | undefined;
28
- /** Override the X-Organization-ID header */
29
- organizationId?: string | undefined;
30
23
  /** Additional headers to include in the request. */
31
24
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
32
25
  }
@@ -36,7 +29,7 @@ export declare namespace Collections {
36
29
  */
37
30
  export declare class Collections {
38
31
  protected readonly _options: Collections.Options;
39
- constructor(_options?: Collections.Options);
32
+ constructor(_options: Collections.Options);
40
33
  /**
41
34
  * List all collections that belong to your organization.
42
35
  *
@@ -53,7 +46,6 @@ export declare class Collections {
53
46
  /**
54
47
  * Create a new collection.
55
48
  *
56
- * <br/><br/>
57
49
  * The newly created collection is initially empty and does not contain any data
58
50
  * until you explicitly add source connections to it.
59
51
  *
@@ -86,7 +78,6 @@ export declare class Collections {
86
78
  /**
87
79
  * Update a collection's properties.
88
80
  *
89
- * <br/><br/>
90
81
  * Modifies the display name of an existing collection.
91
82
  * Note that the readable ID cannot be changed after creation to maintain stable
92
83
  * API endpoints and preserve any existing integrations or bookmarks.
@@ -105,16 +96,13 @@ export declare class Collections {
105
96
  updateCollection(readableId: string, request?: AirweaveSDK.CollectionUpdate, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Collection>;
106
97
  private __updateCollection;
107
98
  /**
108
- * Delete a collection and optionally its associated data.
99
+ * Delete a collection and all associated data.
109
100
  *
110
- * <br/><br/>
111
- * Permanently removes a collection from your organization. By default, this only
112
- * deletes the collection metadata while preserving the actual data in the
113
- * destination systems.<br/><br/>All source connections within this collection
114
- * will also be deleted as part of the cleanup process.
101
+ * Permanently removes a collection from your organization including all synced data
102
+ * from the destination systems. All source connections within this collection
103
+ * will also be deleted as part of the cleanup process. This action cannot be undone.
115
104
  *
116
105
  * @param {string} readableId - The unique readable identifier of the collection to delete
117
- * @param {AirweaveSDK.DeleteCollectionCollectionsReadableIdDeleteRequest} request
118
106
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
119
107
  *
120
108
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
@@ -122,7 +110,7 @@ export declare class Collections {
122
110
  * @example
123
111
  * await client.collections.deleteCollection("readable_id")
124
112
  */
125
- deleteCollection(readableId: string, request?: AirweaveSDK.DeleteCollectionCollectionsReadableIdDeleteRequest, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Collection>;
113
+ deleteCollection(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.Collection>;
126
114
  private __deleteCollection;
127
115
  /**
128
116
  * Search across all data sources within the specified collection.
@@ -176,7 +164,7 @@ export declare class Collections {
176
164
  /**
177
165
  * Trigger data synchronization for all source connections in the collection.
178
166
  *
179
- * <br/><br/>The sync jobs run asynchronously in the background, so this endpoint
167
+ * The sync jobs run asynchronously in the background, so this endpoint
180
168
  * returns immediately with job details that you can use to track progress. You can
181
169
  * monitor the status of individual data synchronization using the source connection
182
170
  * endpoints.
@@ -191,4 +179,7 @@ export declare class Collections {
191
179
  */
192
180
  refreshAllSourceConnections(readableId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnectionJob[]>;
193
181
  private __refreshAllSourceConnections;
182
+ protected _getCustomAuthorizationHeaders(): Promise<{
183
+ "x-api-key": string;
184
+ }>;
194
185
  }
@@ -55,7 +55,7 @@ const errors = __importStar(require("../../../../errors/index.js"));
55
55
  * API endpoints for managing collections - logical groups of data sources that provide unified search capabilities
56
56
  */
57
57
  class Collections {
58
- constructor(_options = {}) {
58
+ constructor(_options) {
59
59
  this._options = _options;
60
60
  }
61
61
  /**
@@ -86,10 +86,7 @@ class Collections {
86
86
  const _response = yield core.fetcher({
87
87
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, "collections"),
88
88
  method: "GET",
89
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
90
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
91
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
92
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
93
90
  queryParameters: _queryParams,
94
91
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
95
92
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -130,7 +127,6 @@ class Collections {
130
127
  /**
131
128
  * Create a new collection.
132
129
  *
133
- * <br/><br/>
134
130
  * The newly created collection is initially empty and does not contain any data
135
131
  * until you explicitly add source connections to it.
136
132
  *
@@ -154,10 +150,7 @@ class Collections {
154
150
  const _response = yield core.fetcher({
155
151
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, "collections"),
156
152
  method: "POST",
157
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
158
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
159
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
160
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
153
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
161
154
  contentType: "application/json",
162
155
  requestType: "json",
163
156
  body: request,
@@ -217,10 +210,7 @@ class Collections {
217
210
  const _response = yield core.fetcher({
218
211
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}`),
219
212
  method: "GET",
220
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
221
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
222
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
223
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
224
214
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
225
215
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
226
216
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -260,7 +250,6 @@ class Collections {
260
250
  /**
261
251
  * Update a collection's properties.
262
252
  *
263
- * <br/><br/>
264
253
  * Modifies the display name of an existing collection.
265
254
  * Note that the readable ID cannot be changed after creation to maintain stable
266
255
  * API endpoints and preserve any existing integrations or bookmarks.
@@ -285,10 +274,7 @@ class Collections {
285
274
  const _response = yield core.fetcher({
286
275
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}`),
287
276
  method: "PUT",
288
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
289
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
290
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
291
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
277
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
292
278
  contentType: "application/json",
293
279
  requestType: "json",
294
280
  body: request,
@@ -329,16 +315,13 @@ class Collections {
329
315
  });
330
316
  }
331
317
  /**
332
- * Delete a collection and optionally its associated data.
318
+ * Delete a collection and all associated data.
333
319
  *
334
- * <br/><br/>
335
- * Permanently removes a collection from your organization. By default, this only
336
- * deletes the collection metadata while preserving the actual data in the
337
- * destination systems.<br/><br/>All source connections within this collection
338
- * will also be deleted as part of the cleanup process.
320
+ * Permanently removes a collection from your organization including all synced data
321
+ * from the destination systems. All source connections within this collection
322
+ * will also be deleted as part of the cleanup process. This action cannot be undone.
339
323
  *
340
324
  * @param {string} readableId - The unique readable identifier of the collection to delete
341
- * @param {AirweaveSDK.DeleteCollectionCollectionsReadableIdDeleteRequest} request
342
325
  * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
343
326
  *
344
327
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
@@ -346,25 +329,16 @@ class Collections {
346
329
  * @example
347
330
  * await client.collections.deleteCollection("readable_id")
348
331
  */
349
- deleteCollection(readableId, request = {}, requestOptions) {
350
- return core.HttpResponsePromise.fromPromise(this.__deleteCollection(readableId, request, requestOptions));
332
+ deleteCollection(readableId, requestOptions) {
333
+ return core.HttpResponsePromise.fromPromise(this.__deleteCollection(readableId, requestOptions));
351
334
  }
352
- __deleteCollection(readableId_1) {
353
- return __awaiter(this, arguments, void 0, function* (readableId, request = {}, requestOptions) {
335
+ __deleteCollection(readableId, requestOptions) {
336
+ return __awaiter(this, void 0, void 0, function* () {
354
337
  var _a, _b, _c;
355
- const { delete_data: deleteData } = request;
356
- const _queryParams = {};
357
- if (deleteData != null) {
358
- _queryParams["delete_data"] = deleteData.toString();
359
- }
360
338
  const _response = yield core.fetcher({
361
339
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}`),
362
340
  method: "DELETE",
363
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
364
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
365
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
366
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
367
- queryParameters: _queryParams,
341
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
368
342
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
369
343
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
370
344
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -445,10 +419,7 @@ class Collections {
445
419
  const _response = yield core.fetcher({
446
420
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
447
421
  method: "GET",
448
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
449
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
450
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
451
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
422
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
452
423
  queryParameters: _queryParams,
453
424
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
454
425
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -523,10 +494,7 @@ class Collections {
523
494
  const _response = yield core.fetcher({
524
495
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/search`),
525
496
  method: "POST",
526
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
527
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
528
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
529
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
497
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
530
498
  contentType: "application/json",
531
499
  requestType: "json",
532
500
  body: request,
@@ -569,7 +537,7 @@ class Collections {
569
537
  /**
570
538
  * Trigger data synchronization for all source connections in the collection.
571
539
  *
572
- * <br/><br/>The sync jobs run asynchronously in the background, so this endpoint
540
+ * The sync jobs run asynchronously in the background, so this endpoint
573
541
  * returns immediately with job details that you can use to track progress. You can
574
542
  * monitor the status of individual data synchronization using the source connection
575
543
  * endpoints.
@@ -591,10 +559,7 @@ class Collections {
591
559
  const _response = yield core.fetcher({
592
560
  url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirweaveSDKEnvironment.Production, `collections/${encodeURIComponent(readableId)}/refresh_all`),
593
561
  method: "POST",
594
- headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
595
- "X-API-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey,
596
- "X-Organization-ID": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId,
597
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
562
+ headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
598
563
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
599
564
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
600
565
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -631,5 +596,11 @@ class Collections {
631
596
  }
632
597
  });
633
598
  }
599
+ _getCustomAuthorizationHeaders() {
600
+ return __awaiter(this, void 0, void 0, function* () {
601
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
602
+ return { "x-api-key": apiKeyValue };
603
+ });
604
+ }
634
605
  }
635
606
  exports.Collections = Collections;
@@ -1,6 +1,5 @@
1
1
  export { type ListCollectionsCollectionsGetRequest } from "./ListCollectionsCollectionsGetRequest.js";
2
2
  export { type CollectionCreate } from "./CollectionCreate.js";
3
3
  export { type CollectionUpdate } from "./CollectionUpdate.js";
4
- export { type DeleteCollectionCollectionsReadableIdDeleteRequest } from "./DeleteCollectionCollectionsReadableIdDeleteRequest.js";
5
4
  export { type SearchCollectionCollectionsReadableIdSearchGetRequest } from "./SearchCollectionCollectionsReadableIdSearchGetRequest.js";
6
5
  export { type SearchRequest } from "./SearchRequest.js";
@@ -9,10 +9,7 @@ export declare namespace SourceConnections {
9
9
  environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
- /** Override the X-API-Key header */
13
- apiKey?: core.Supplier<string | undefined>;
14
- /** Override the X-Organization-ID header */
15
- organizationId?: core.Supplier<string | undefined>;
12
+ apiKey: core.Supplier<string>;
16
13
  /** Additional headers to include in requests. */
17
14
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
18
15
  }
@@ -23,10 +20,6 @@ export declare namespace SourceConnections {
23
20
  maxRetries?: number;
24
21
  /** A hook to abort the request. */
25
22
  abortSignal?: AbortSignal;
26
- /** Override the X-API-Key header */
27
- apiKey?: string | undefined;
28
- /** Override the X-Organization-ID header */
29
- organizationId?: string | undefined;
30
23
  /** Additional headers to include in the request. */
31
24
  headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
32
25
  }
@@ -36,11 +29,10 @@ export declare namespace SourceConnections {
36
29
  */
37
30
  export declare class SourceConnections {
38
31
  protected readonly _options: SourceConnections.Options;
39
- constructor(_options?: SourceConnections.Options);
32
+ constructor(_options: SourceConnections.Options);
40
33
  /**
41
34
  * List source connections across your organization.
42
35
  *
43
- * <br/><br/>
44
36
  * By default, returns ALL source connections from every collection in your
45
37
  * organization. Use the 'collection' parameter to filter results to a specific
46
38
  * collection. This is useful for getting an overview of all your data sources
@@ -59,8 +51,6 @@ export declare class SourceConnections {
59
51
  /**
60
52
  * Create a new source connection to sync data into your collection.
61
53
  *
62
- * <br/><br/>
63
- *
64
54
  * **This endpoint only works for sources that do not use OAuth2.0.**
65
55
  * Sources that do use OAuth2.0 like Google Drive, Slack, or HubSpot must be
66
56
  * connected through the UI where you can complete the OAuth consent flow.<br/><br/>
@@ -103,8 +93,6 @@ export declare class SourceConnections {
103
93
  /**
104
94
  * Update a source connection's properties.
105
95
  *
106
- * <br/><br/>
107
- *
108
96
  * Modify the configuration of an existing source connection including its name,
109
97
  * authentication credentials, configuration fields, sync schedule, or source-specific settings.
110
98
  *
@@ -120,16 +108,13 @@ export declare class SourceConnections {
120
108
  updateSourceConnection(sourceConnectionId: string, request?: AirweaveSDK.SourceConnectionUpdate, requestOptions?: SourceConnections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
121
109
  private __updateSourceConnection;
122
110
  /**
123
- * Delete a source connection.
124
- *
125
- * <br/><br/>
111
+ * Delete a source connection and all associated data.
126
112
  *
127
113
  * Permanently removes the source connection configuration and credentials.
128
114
  * By default, previously synced data remains in your destination systems for continuity.
129
115
  * Use delete_data=true to also remove all associated data from destination systems.
130
116
  *
131
117
  * @param {string} sourceConnectionId - The unique identifier of the source connection to delete
132
- * @param {AirweaveSDK.DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest} request
133
118
  * @param {SourceConnections.RequestOptions} requestOptions - Request-specific configuration.
134
119
  *
135
120
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
@@ -137,12 +122,11 @@ export declare class SourceConnections {
137
122
  * @example
138
123
  * await client.sourceConnections.deleteSourceConnection("source_connection_id")
139
124
  */
140
- deleteSourceConnection(sourceConnectionId: string, request?: AirweaveSDK.DeleteSourceConnectionSourceConnectionsSourceConnectionIdDeleteRequest, requestOptions?: SourceConnections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
125
+ deleteSourceConnection(sourceConnectionId: string, requestOptions?: SourceConnections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
141
126
  private __deleteSourceConnection;
142
127
  /**
143
128
  * Manually trigger a data sync for this source connection.
144
129
  *
145
- * <br/><br/>
146
130
  * Starts an immediate synchronization job that extracts fresh data from your source,
147
131
  * transforms it according to your configuration, and updates the destination systems.
148
132
  * The job runs asynchronously and endpoint returns immediately with tracking information.
@@ -161,7 +145,6 @@ export declare class SourceConnections {
161
145
  /**
162
146
  * List all sync jobs for a source connection.
163
147
  *
164
- * <br/><br/>
165
148
  * Returns the complete history of data synchronization jobs including successful syncs,
166
149
  * failed attempts, and currently running operations.
167
150
  *
@@ -192,7 +175,6 @@ export declare class SourceConnections {
192
175
  /**
193
176
  * Cancel a running sync job.
194
177
  *
195
- * <br/><br/>
196
178
  * Sends a cancellation signal to stop an in-progress data synchronization.
197
179
  * The job will complete its current operation and then terminate gracefully.
198
180
  * Only jobs in 'created', 'pending', or 'in_progress' states can be cancelled.
@@ -208,4 +190,7 @@ export declare class SourceConnections {
208
190
  */
209
191
  cancelSourceConnectionJob(sourceConnectionId: string, jobId: string, requestOptions?: SourceConnections.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnectionJob>;
210
192
  private __cancelSourceConnectionJob;
193
+ protected _getCustomAuthorizationHeaders(): Promise<{
194
+ "x-api-key": string;
195
+ }>;
211
196
  }