@airweave/sdk 0.4.19 → 0.5.1

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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +13 -8
  4. package/dist/cjs/api/resources/authProviders/client/Client.d.ts +90 -0
  5. package/dist/cjs/api/resources/authProviders/client/Client.js +213 -0
  6. package/dist/cjs/api/resources/authProviders/client/index.d.ts +2 -0
  7. package/dist/cjs/api/resources/authProviders/client/index.js +17 -0
  8. package/dist/cjs/api/{types → resources/authProviders/client/requests}/AuthProviderConnectionCreate.d.ts +10 -2
  9. package/dist/cjs/api/resources/authProviders/client/requests/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/authProviders/client/requests/index.js +2 -0
  11. package/dist/cjs/api/resources/authProviders/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/authProviders/index.js +17 -0
  13. package/dist/cjs/api/resources/collections/client/requests/SearchRequest.d.ts +1 -1
  14. package/dist/cjs/api/resources/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/index.js +3 -1
  16. package/dist/cjs/api/resources/whiteLabels/client/Client.d.ts +4 -4
  17. package/dist/cjs/api/resources/whiteLabels/client/Client.js +5 -5
  18. package/dist/cjs/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.ts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.ts} +1 -1
  19. package/dist/cjs/api/resources/whiteLabels/client/requests/index.d.ts +1 -1
  20. package/dist/cjs/api/types/EntityCountWithDefinition.d.ts +13 -0
  21. package/dist/cjs/api/types/SourceConnectionCreateContinuous.d.ts +2 -0
  22. package/dist/cjs/api/types/SourceConnectionMakeContinuous.d.ts +14 -0
  23. package/dist/cjs/api/types/SourceConnectionMakeContinuous.js +5 -0
  24. package/dist/cjs/api/types/index.d.ts +2 -2
  25. package/dist/cjs/api/types/index.js +2 -2
  26. package/dist/cjs/version.d.ts +1 -1
  27. package/dist/cjs/version.js +1 -1
  28. package/dist/esm/Client.d.mts +3 -0
  29. package/dist/esm/Client.mjs +7 -2
  30. package/dist/esm/api/resources/authProviders/client/Client.d.mts +90 -0
  31. package/dist/esm/api/resources/authProviders/client/Client.mjs +176 -0
  32. package/dist/esm/api/resources/authProviders/client/index.d.mts +2 -0
  33. package/dist/esm/api/resources/authProviders/client/index.mjs +1 -0
  34. package/dist/esm/api/{types → resources/authProviders/client/requests}/AuthProviderConnectionCreate.d.mts +10 -2
  35. package/dist/esm/api/resources/authProviders/client/requests/index.d.mts +1 -0
  36. package/dist/esm/api/resources/authProviders/client/requests/index.mjs +1 -0
  37. package/dist/esm/api/resources/authProviders/index.d.mts +1 -0
  38. package/dist/esm/api/resources/authProviders/index.mjs +1 -0
  39. package/dist/esm/api/resources/collections/client/requests/SearchRequest.d.mts +1 -1
  40. package/dist/esm/api/resources/index.d.mts +2 -0
  41. package/dist/esm/api/resources/index.mjs +2 -0
  42. package/dist/esm/api/resources/whiteLabels/client/Client.d.mts +4 -4
  43. package/dist/esm/api/resources/whiteLabels/client/Client.mjs +5 -5
  44. package/dist/esm/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.d.mts → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.d.mts} +1 -1
  45. package/dist/esm/api/resources/whiteLabels/client/requests/index.d.mts +1 -1
  46. package/dist/esm/api/types/EntityCountWithDefinition.d.mts +13 -0
  47. package/dist/esm/api/types/SourceConnectionCreateContinuous.d.mts +2 -0
  48. package/dist/esm/api/types/SourceConnectionMakeContinuous.d.mts +14 -0
  49. package/dist/esm/api/types/SourceConnectionMakeContinuous.mjs +4 -0
  50. package/dist/esm/api/types/index.d.mts +2 -2
  51. package/dist/esm/api/types/index.mjs +2 -2
  52. package/dist/esm/version.d.mts +1 -1
  53. package/dist/esm/version.mjs +1 -1
  54. package/package.json +1 -1
  55. package/reference.md +162 -3
  56. package/dist/cjs/api/types/EntityDefinitionUpdate.d.ts +0 -19
  57. package/dist/esm/api/types/EntityDefinitionUpdate.d.mts +0 -19
  58. /package/dist/cjs/api/{types → resources/authProviders/client/requests}/AuthProviderConnectionCreate.js +0 -0
  59. /package/dist/cjs/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.js → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js} +0 -0
  60. /package/dist/cjs/api/types/{EntityDefinitionUpdate.js → EntityCountWithDefinition.js} +0 -0
  61. /package/dist/esm/api/{types → resources/authProviders/client/requests}/AuthProviderConnectionCreate.mjs +0 -0
  62. /package/dist/esm/api/resources/whiteLabels/client/requests/{BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.mjs → BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.mjs} +0 -0
  63. /package/dist/esm/api/types/{EntityDefinitionUpdate.mjs → EntityCountWithDefinition.mjs} +0 -0
package/README.md CHANGED
@@ -37,7 +37,7 @@ following namespace:
37
37
  ```typescript
38
38
  import { AirweaveSDK } from "@airweave/sdk";
39
39
 
40
- const request: AirweaveSDK.ListCollectionsGetRequest = {
40
+ const request: AirweaveSDK.AuthProviderConnectionCreate = {
41
41
  ...
42
42
  };
43
43
  ```
@@ -4,6 +4,7 @@
4
4
  import * as environments from "./environments.js";
5
5
  import * as core from "./core/index.js";
6
6
  import { Sources } from "./api/resources/sources/client/Client.js";
7
+ import { AuthProviders } from "./api/resources/authProviders/client/Client.js";
7
8
  import { Collections } from "./api/resources/collections/client/Client.js";
8
9
  import { SourceConnections } from "./api/resources/sourceConnections/client/Client.js";
9
10
  import { WhiteLabels } from "./api/resources/whiteLabels/client/Client.js";
@@ -30,11 +31,13 @@ export declare namespace AirweaveSDKClient {
30
31
  export declare class AirweaveSDKClient {
31
32
  protected readonly _options: AirweaveSDKClient.Options;
32
33
  protected _sources: Sources | undefined;
34
+ protected _authProviders: AuthProviders | undefined;
33
35
  protected _collections: Collections | undefined;
34
36
  protected _sourceConnections: SourceConnections | undefined;
35
37
  protected _whiteLabels: WhiteLabels | undefined;
36
38
  constructor(_options: AirweaveSDKClient.Options);
37
39
  get sources(): Sources;
40
+ get authProviders(): AuthProviders;
38
41
  get collections(): Collections;
39
42
  get sourceConnections(): SourceConnections;
40
43
  get whiteLabels(): WhiteLabels;
@@ -40,16 +40,17 @@ exports.AirweaveSDKClient = void 0;
40
40
  const core = __importStar(require("./core/index.js"));
41
41
  const headers_js_1 = require("./core/headers.js");
42
42
  const Client_js_1 = require("./api/resources/sources/client/Client.js");
43
- const Client_js_2 = require("./api/resources/collections/client/Client.js");
44
- const Client_js_3 = require("./api/resources/sourceConnections/client/Client.js");
45
- const Client_js_4 = require("./api/resources/whiteLabels/client/Client.js");
43
+ const Client_js_2 = require("./api/resources/authProviders/client/Client.js");
44
+ const Client_js_3 = require("./api/resources/collections/client/Client.js");
45
+ const Client_js_4 = require("./api/resources/sourceConnections/client/Client.js");
46
+ const Client_js_5 = require("./api/resources/whiteLabels/client/Client.js");
46
47
  class AirweaveSDKClient {
47
48
  constructor(_options) {
48
49
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
49
50
  "X-Fern-Language": "JavaScript",
50
51
  "X-Fern-SDK-Name": "@airweave/sdk",
51
- "X-Fern-SDK-Version": "v0.4.19",
52
- "User-Agent": "@airweave/sdk/v0.4.19",
52
+ "X-Fern-SDK-Version": "v0.5.1",
53
+ "User-Agent": "@airweave/sdk/v0.5.1",
53
54
  "X-Fern-Runtime": core.RUNTIME.type,
54
55
  "X-Fern-Runtime-Version": core.RUNTIME.version,
55
56
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -58,17 +59,21 @@ class AirweaveSDKClient {
58
59
  var _a;
59
60
  return ((_a = this._sources) !== null && _a !== void 0 ? _a : (this._sources = new Client_js_1.Sources(this._options)));
60
61
  }
62
+ get authProviders() {
63
+ var _a;
64
+ return ((_a = this._authProviders) !== null && _a !== void 0 ? _a : (this._authProviders = new Client_js_2.AuthProviders(this._options)));
65
+ }
61
66
  get collections() {
62
67
  var _a;
63
- return ((_a = this._collections) !== null && _a !== void 0 ? _a : (this._collections = new Client_js_2.Collections(this._options)));
68
+ return ((_a = this._collections) !== null && _a !== void 0 ? _a : (this._collections = new Client_js_3.Collections(this._options)));
64
69
  }
65
70
  get sourceConnections() {
66
71
  var _a;
67
- return ((_a = this._sourceConnections) !== null && _a !== void 0 ? _a : (this._sourceConnections = new Client_js_3.SourceConnections(this._options)));
72
+ return ((_a = this._sourceConnections) !== null && _a !== void 0 ? _a : (this._sourceConnections = new Client_js_4.SourceConnections(this._options)));
68
73
  }
69
74
  get whiteLabels() {
70
75
  var _a;
71
- return ((_a = this._whiteLabels) !== null && _a !== void 0 ? _a : (this._whiteLabels = new Client_js_4.WhiteLabels(this._options)));
76
+ return ((_a = this._whiteLabels) !== null && _a !== void 0 ? _a : (this._whiteLabels = new Client_js_5.WhiteLabels(this._options)));
72
77
  }
73
78
  }
74
79
  exports.AirweaveSDKClient = AirweaveSDKClient;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments.js";
5
+ import * as core from "../../../../core/index.js";
6
+ import * as AirweaveSDK from "../../../index.js";
7
+ export declare namespace AuthProviders {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ apiKey: core.Supplier<string>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
15
+ }
16
+ interface RequestOptions {
17
+ /** The maximum time to wait for a response in seconds. */
18
+ timeoutInSeconds?: number;
19
+ /** The number of times to retry the request. Defaults to 2. */
20
+ maxRetries?: number;
21
+ /** A hook to abort the request. */
22
+ abortSignal?: AbortSignal;
23
+ /** Additional headers to include in the request. */
24
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
25
+ }
26
+ }
27
+ export declare class AuthProviders {
28
+ protected readonly _options: AuthProviders.Options;
29
+ constructor(_options: AuthProviders.Options);
30
+ /**
31
+ * Create or update an auth provider connection.
32
+ *
33
+ * If a connection for this auth provider already exists for the organization,
34
+ * it will be updated with the new credentials and fields.
35
+ * If no connection exists, a new one will be created.
36
+ *
37
+ * Args:
38
+ * -----
39
+ * db: The database session
40
+ * ctx: The current authentication context
41
+ * auth_provider_connection_in: The auth provider connection data
42
+ *
43
+ * Returns:
44
+ * --------
45
+ * schemas.AuthProviderConnection: The created or updated connection
46
+ *
47
+ * @param {AirweaveSDK.AuthProviderConnectionCreate} request
48
+ * @param {AuthProviders.RequestOptions} requestOptions - Request-specific configuration.
49
+ *
50
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
51
+ *
52
+ * @example
53
+ * await client.authProviders.connectOrUpdateAuthProvider({
54
+ * name: "My Composio Connection",
55
+ * description: "My Composio Connection",
56
+ * short_name: "composio",
57
+ * auth_fields: {
58
+ * "api_key": "comp_1234567890abcdef"
59
+ * }
60
+ * })
61
+ */
62
+ connectOrUpdateAuthProvider(request: AirweaveSDK.AuthProviderConnectionCreate, requestOptions?: AuthProviders.RequestOptions): core.HttpResponsePromise<AirweaveSDK.AuthProviderConnection>;
63
+ private __connectOrUpdateAuthProvider;
64
+ /**
65
+ * Get details of a specific auth provider.
66
+ *
67
+ * Args:
68
+ * -----
69
+ * db: The database session
70
+ * short_name: The short name of the auth provider
71
+ * ctx: The current authentication context
72
+ *
73
+ * Returns:
74
+ * --------
75
+ * schemas.AuthProvider: The auth provider details
76
+ *
77
+ * @param {string} shortName
78
+ * @param {AuthProviders.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
81
+ *
82
+ * @example
83
+ * await client.authProviders.getAuthProvider("short_name")
84
+ */
85
+ getAuthProvider(shortName: string, requestOptions?: AuthProviders.RequestOptions): core.HttpResponsePromise<AirweaveSDK.AuthProvider>;
86
+ private __getAuthProvider;
87
+ protected _getCustomAuthorizationHeaders(): Promise<{
88
+ "x-api-key": string;
89
+ }>;
90
+ }
@@ -0,0 +1,213 @@
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.AuthProviders = 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
+ class AuthProviders {
55
+ constructor(_options) {
56
+ this._options = _options;
57
+ }
58
+ /**
59
+ * Create or update an auth provider connection.
60
+ *
61
+ * If a connection for this auth provider already exists for the organization,
62
+ * it will be updated with the new credentials and fields.
63
+ * If no connection exists, a new one will be created.
64
+ *
65
+ * Args:
66
+ * -----
67
+ * db: The database session
68
+ * ctx: The current authentication context
69
+ * auth_provider_connection_in: The auth provider connection data
70
+ *
71
+ * Returns:
72
+ * --------
73
+ * schemas.AuthProviderConnection: The created or updated connection
74
+ *
75
+ * @param {AirweaveSDK.AuthProviderConnectionCreate} request
76
+ * @param {AuthProviders.RequestOptions} requestOptions - Request-specific configuration.
77
+ *
78
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
79
+ *
80
+ * @example
81
+ * await client.authProviders.connectOrUpdateAuthProvider({
82
+ * name: "My Composio Connection",
83
+ * description: "My Composio Connection",
84
+ * short_name: "composio",
85
+ * auth_fields: {
86
+ * "api_key": "comp_1234567890abcdef"
87
+ * }
88
+ * })
89
+ */
90
+ connectOrUpdateAuthProvider(request, requestOptions) {
91
+ return core.HttpResponsePromise.fromPromise(this.__connectOrUpdateAuthProvider(request, requestOptions));
92
+ }
93
+ __connectOrUpdateAuthProvider(request, requestOptions) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ var _a, _b, _c;
96
+ const _response = yield core.fetcher({
97
+ 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, "auth-providers/connect"),
98
+ method: "PUT",
99
+ 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),
100
+ contentType: "application/json",
101
+ requestType: "json",
102
+ body: request,
103
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
104
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
105
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
+ });
107
+ if (_response.ok) {
108
+ return { data: _response.body, rawResponse: _response.rawResponse };
109
+ }
110
+ if (_response.error.reason === "status-code") {
111
+ switch (_response.error.statusCode) {
112
+ case 422:
113
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
114
+ default:
115
+ throw new errors.AirweaveSDKError({
116
+ statusCode: _response.error.statusCode,
117
+ body: _response.error.body,
118
+ rawResponse: _response.rawResponse,
119
+ });
120
+ }
121
+ }
122
+ switch (_response.error.reason) {
123
+ case "non-json":
124
+ throw new errors.AirweaveSDKError({
125
+ statusCode: _response.error.statusCode,
126
+ body: _response.error.rawBody,
127
+ rawResponse: _response.rawResponse,
128
+ });
129
+ case "timeout":
130
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling PUT /auth-providers/connect.");
131
+ case "unknown":
132
+ throw new errors.AirweaveSDKError({
133
+ message: _response.error.errorMessage,
134
+ rawResponse: _response.rawResponse,
135
+ });
136
+ }
137
+ });
138
+ }
139
+ /**
140
+ * Get details of a specific auth provider.
141
+ *
142
+ * Args:
143
+ * -----
144
+ * db: The database session
145
+ * short_name: The short name of the auth provider
146
+ * ctx: The current authentication context
147
+ *
148
+ * Returns:
149
+ * --------
150
+ * schemas.AuthProvider: The auth provider details
151
+ *
152
+ * @param {string} shortName
153
+ * @param {AuthProviders.RequestOptions} requestOptions - Request-specific configuration.
154
+ *
155
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
156
+ *
157
+ * @example
158
+ * await client.authProviders.getAuthProvider("short_name")
159
+ */
160
+ getAuthProvider(shortName, requestOptions) {
161
+ return core.HttpResponsePromise.fromPromise(this.__getAuthProvider(shortName, requestOptions));
162
+ }
163
+ __getAuthProvider(shortName, requestOptions) {
164
+ return __awaiter(this, void 0, void 0, function* () {
165
+ var _a, _b, _c;
166
+ const _response = yield core.fetcher({
167
+ 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, `auth-providers/detail/${encodeURIComponent(shortName)}`),
168
+ method: "GET",
169
+ 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),
170
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
171
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
172
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
173
+ });
174
+ if (_response.ok) {
175
+ return { data: _response.body, rawResponse: _response.rawResponse };
176
+ }
177
+ if (_response.error.reason === "status-code") {
178
+ switch (_response.error.statusCode) {
179
+ case 422:
180
+ throw new AirweaveSDK.UnprocessableEntityError(_response.error.body, _response.rawResponse);
181
+ default:
182
+ throw new errors.AirweaveSDKError({
183
+ statusCode: _response.error.statusCode,
184
+ body: _response.error.body,
185
+ rawResponse: _response.rawResponse,
186
+ });
187
+ }
188
+ }
189
+ switch (_response.error.reason) {
190
+ case "non-json":
191
+ throw new errors.AirweaveSDKError({
192
+ statusCode: _response.error.statusCode,
193
+ body: _response.error.rawBody,
194
+ rawResponse: _response.rawResponse,
195
+ });
196
+ case "timeout":
197
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /auth-providers/detail/{short_name}.");
198
+ case "unknown":
199
+ throw new errors.AirweaveSDKError({
200
+ message: _response.error.errorMessage,
201
+ rawResponse: _response.rawResponse,
202
+ });
203
+ }
204
+ });
205
+ }
206
+ _getCustomAuthorizationHeaders() {
207
+ return __awaiter(this, void 0, void 0, function* () {
208
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
209
+ return { "x-api-key": apiKeyValue };
210
+ });
211
+ }
212
+ }
213
+ exports.AuthProviders = AuthProviders;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
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,9 +1,17 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as AirweaveSDK from "../index.js";
4
+ import * as AirweaveSDK from "../../../../index.js";
5
5
  /**
6
- * Schema for creating an auth provider connection with credentials.
6
+ * @example
7
+ * {
8
+ * name: "My Composio Connection",
9
+ * description: "My Composio Connection",
10
+ * short_name: "composio",
11
+ * auth_fields: {
12
+ * "api_key": "comp_1234567890abcdef"
13
+ * }
14
+ * }
7
15
  */
8
16
  export interface AuthProviderConnectionCreate {
9
17
  /** Human-readable name for this auth provider connection */
@@ -0,0 +1 @@
1
+ export { type AuthProviderConnectionCreate } from "./AuthProviderConnectionCreate.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
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("./client/index.js"), exports);
@@ -23,7 +23,7 @@ export interface SearchRequest {
23
23
  filter?: AirweaveSDK.Filter;
24
24
  /** Number of results to skip (DEFAULT: 0) */
25
25
  offset?: number;
26
- /** Maximum number of results to return (DEFAULT: 20) */
26
+ /** Maximum number of results to return (DEFAULT: 100) */
27
27
  limit?: number;
28
28
  /** Minimum similarity score threshold (DEFAULT: None - no filtering) */
29
29
  score_threshold?: number;
@@ -1,7 +1,9 @@
1
1
  export * as sources from "./sources/index.js";
2
+ export * as authProviders from "./authProviders/index.js";
2
3
  export * as collections from "./collections/index.js";
3
4
  export * as sourceConnections from "./sourceConnections/index.js";
4
5
  export * as whiteLabels from "./whiteLabels/index.js";
6
+ export * from "./authProviders/client/requests/index.js";
5
7
  export * from "./collections/client/requests/index.js";
6
8
  export * from "./sourceConnections/client/requests/index.js";
7
9
  export * from "./whiteLabels/client/requests/index.js";
@@ -36,11 +36,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.whiteLabels = exports.sourceConnections = exports.collections = exports.sources = void 0;
39
+ exports.whiteLabels = exports.sourceConnections = exports.collections = exports.authProviders = exports.sources = void 0;
40
40
  exports.sources = __importStar(require("./sources/index.js"));
41
+ exports.authProviders = __importStar(require("./authProviders/index.js"));
41
42
  exports.collections = __importStar(require("./collections/index.js"));
42
43
  exports.sourceConnections = __importStar(require("./sourceConnections/index.js"));
43
44
  exports.whiteLabels = __importStar(require("./whiteLabels/index.js"));
45
+ __exportStar(require("./authProviders/client/requests/index.js"), exports);
44
46
  __exportStar(require("./collections/client/requests/index.js"), exports);
45
47
  __exportStar(require("./sourceConnections/client/requests/index.js"), exports);
46
48
  __exportStar(require("./whiteLabels/client/requests/index.js"), exports);
@@ -171,18 +171,18 @@ export declare class WhiteLabels {
171
171
  * tracking and branding purposes.
172
172
  *
173
173
  * @param {string} whiteLabelId - The unique identifier of the white label integration
174
- * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
174
+ * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions} request
175
175
  * @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
176
176
  *
177
177
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
178
178
  *
179
179
  * @example
180
- * await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
180
+ * await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
181
181
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
182
182
  * })
183
183
  */
184
- exchangeWhiteLabelOauth2Code(whiteLabelId: string, request: AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
185
- private __exchangeWhiteLabelOauth2Code;
184
+ exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId: string, request: AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions, requestOptions?: WhiteLabels.RequestOptions): core.HttpResponsePromise<AirweaveSDK.SourceConnection>;
185
+ private __exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions;
186
186
  protected _getCustomAuthorizationHeaders(): Promise<{
187
187
  "x-api-key": string;
188
188
  }>;
@@ -516,20 +516,20 @@ class WhiteLabels {
516
516
  * tracking and branding purposes.
517
517
  *
518
518
  * @param {string} whiteLabelId - The unique identifier of the white label integration
519
- * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost} request
519
+ * @param {AirweaveSDK.BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions} request
520
520
  * @param {WhiteLabels.RequestOptions} requestOptions - Request-specific configuration.
521
521
  *
522
522
  * @throws {@link AirweaveSDK.UnprocessableEntityError}
523
523
  *
524
524
  * @example
525
- * await client.whiteLabels.exchangeWhiteLabelOauth2Code("white_label_id", {
525
+ * await client.whiteLabels.exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions("white_label_id", {
526
526
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
527
527
  * })
528
528
  */
529
- exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
530
- return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions));
529
+ exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
530
+ return core.HttpResponsePromise.fromPromise(this.__exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions));
531
531
  }
532
- __exchangeWhiteLabelOauth2Code(whiteLabelId, request, requestOptions) {
532
+ __exchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions(whiteLabelId, request, requestOptions) {
533
533
  return __awaiter(this, void 0, void 0, function* () {
534
534
  var _a, _b, _c;
535
535
  const _response = yield core.fetcher({
@@ -8,7 +8,7 @@ import * as AirweaveSDK from "../../../../index.js";
8
8
  * code: "4/P7q7W91a-oMsCeLvIaQm6bTrgtp7"
9
9
  * }
10
10
  */
11
- export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost {
11
+ export interface BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions {
12
12
  /** The OAuth2 authorization code received from the OAuth callback after customer authentication */
13
13
  code: string;
14
14
  /** Optional configuration for the source connection. If not provided, a source connection will be created automatically with default settings. The white label integration is automatically linked to the source connection. */
@@ -1,3 +1,3 @@
1
1
  export { type WhiteLabelCreate } from "./WhiteLabelCreate.js";
2
2
  export { type WhiteLabelUpdate } from "./WhiteLabelUpdate.js";
3
- export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodePost.js";
3
+ export { type BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions } from "./BodyExchangeWhiteLabelOauth2CodeWhiteLabelsWhiteLabelIdOauth2CodeOptions.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Entity count with entity definition details.
6
+ */
7
+ export interface EntityCountWithDefinition {
8
+ count: number;
9
+ entity_definition_id: string;
10
+ entity_definition_name: string;
11
+ entity_definition_type: string;
12
+ entity_definition_description?: string;
13
+ }
@@ -20,6 +20,8 @@ export interface SourceConnectionCreateContinuous {
20
20
  short_name: string;
21
21
  /** Readable ID of the collection where synced data will be stored. If not provided, a new collection will be automatically created. */
22
22
  collection?: string;
23
+ /** Whether to create a daily forced full sync with entity cleanup. Defaults to true for resilience; set to false to rely solely on incremental changes. */
24
+ enable_daily_cleanup?: boolean;
23
25
  /** Authentication credentials required to access the data source. The required fields vary by source type. Check the documentation of a specific source (for example [Github](https://docs.airweave.ai/docs/connectors/github)) to see what is required. */
24
26
  auth_fields?: AirweaveSDK.ConfigValues;
25
27
  /** Unique readable ID of a connected auth provider to use for authentication instead of providing auth_fields directly. */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Schema for converting an existing source connection to continuous (BETA).
6
+ */
7
+ export interface SourceConnectionMakeContinuous {
8
+ /** Specify which field in the entity should be used as the cursor for incremental syncs. If omitted, the source's default cursor field will be used if available. Required for sources without a default (e.g., PostgreSQL). */
9
+ cursor_field?: string;
10
+ /** Whether to create a daily forced full sync with entity cleanup. This helps remove orphaned entities that incremental syncs cannot detect. */
11
+ enable_daily_cleanup?: boolean;
12
+ /** Whether to immediately trigger a sync job after enabling continuous mode. If no cursor data exists yet, this initial run will perform a full sync. */
13
+ run_initial_sync?: boolean;
14
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,7 +3,6 @@ export * from "./ApiKeyCreate.js";
3
3
  export * from "./ActionCheckResponse.js";
4
4
  export * from "./AuthProvider.js";
5
5
  export * from "./AuthProviderConnection.js";
6
- export * from "./AuthProviderConnectionCreate.js";
7
6
  export * from "./AuthProviderConnectionUpdate.js";
8
7
  export * from "./AuthType.js";
9
8
  export * from "./BillingPeriodUsage.js";
@@ -30,9 +29,9 @@ export * from "./DestinationWithAuthenticationFields.js";
30
29
  export * from "./EmbeddingModel.js";
31
30
  export * from "./EmbeddingModelWithAuthenticationFields.js";
32
31
  export * from "./EntityCount.js";
32
+ export * from "./EntityCountWithDefinition.js";
33
33
  export * from "./EntityDefinition.js";
34
34
  export * from "./EntityDefinitionCreate.js";
35
- export * from "./EntityDefinitionUpdate.js";
36
35
  export * from "./EntityType.js";
37
36
  export * from "./Range.js";
38
37
  export * from "./FieldCondition.js";
@@ -82,6 +81,7 @@ export * from "./SourceConnectionCreateWithCredential.js";
82
81
  export * from "./SourceConnectionCreateWithWhiteLabel.js";
83
82
  export * from "./SourceConnectionJob.js";
84
83
  export * from "./SourceConnectionListItem.js";
84
+ export * from "./SourceConnectionMakeContinuous.js";
85
85
  export * from "./SourceConnectionStatus.js";
86
86
  export * from "./SubscriptionInfo.js";
87
87
  export * from "./Sync.js";