@airweave/sdk 0.1.36 → 0.1.38

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 (56) hide show
  1. package/Client.d.ts +0 -3
  2. package/Client.js +4 -9
  3. package/api/resources/collections/client/Client.d.ts +25 -0
  4. package/api/resources/collections/client/Client.js +90 -5
  5. package/api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.d.ts +20 -0
  6. package/{dist/api/resources/connections/client/index.js → api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.js} +3 -0
  7. package/api/resources/collections/client/requests/index.d.ts +1 -0
  8. package/api/resources/index.d.ts +0 -1
  9. package/api/resources/index.js +1 -2
  10. package/api/resources/sourceConnections/client/Client.js +7 -7
  11. package/api/resources/sources/client/Client.js +2 -2
  12. package/api/resources/whiteLabels/client/Client.js +6 -6
  13. package/dist/Client.d.ts +0 -3
  14. package/dist/Client.js +4 -9
  15. package/dist/api/resources/collections/client/Client.d.ts +25 -0
  16. package/dist/api/resources/collections/client/Client.js +90 -5
  17. package/dist/api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.d.ts +20 -0
  18. package/{api/resources/connections/client/index.js → dist/api/resources/collections/client/requests/SearchCollectionCollectionsReadableIdSearchGetRequest.js} +3 -0
  19. package/dist/api/resources/collections/client/requests/index.d.ts +1 -0
  20. package/dist/api/resources/index.d.ts +0 -1
  21. package/dist/api/resources/index.js +1 -2
  22. package/dist/api/resources/sourceConnections/client/Client.js +7 -7
  23. package/dist/api/resources/sources/client/Client.js +2 -2
  24. package/dist/api/resources/whiteLabels/client/Client.js +6 -6
  25. package/dist/serialization/resources/index.d.ts +0 -1
  26. package/dist/serialization/resources/index.js +1 -2
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/package.json +1 -1
  30. package/reference.md +29 -85
  31. package/serialization/resources/index.d.ts +0 -1
  32. package/serialization/resources/index.js +1 -2
  33. package/version.d.ts +1 -1
  34. package/version.js +1 -1
  35. package/api/resources/connections/client/Client.d.ts +0 -73
  36. package/api/resources/connections/client/Client.js +0 -216
  37. package/api/resources/connections/client/index.d.ts +0 -1
  38. package/api/resources/connections/index.d.ts +0 -1
  39. package/api/resources/connections/index.js +0 -17
  40. package/dist/api/resources/connections/client/Client.d.ts +0 -73
  41. package/dist/api/resources/connections/client/Client.js +0 -216
  42. package/dist/api/resources/connections/client/index.d.ts +0 -1
  43. package/dist/api/resources/connections/index.d.ts +0 -1
  44. package/dist/api/resources/connections/index.js +0 -17
  45. package/dist/serialization/resources/connections/client/index.d.ts +0 -1
  46. package/dist/serialization/resources/connections/client/index.js +0 -37
  47. package/dist/serialization/resources/connections/client/listAllConnectedIntegrations.d.ts +0 -11
  48. package/dist/serialization/resources/connections/client/listAllConnectedIntegrations.js +0 -42
  49. package/dist/serialization/resources/connections/index.d.ts +0 -1
  50. package/dist/serialization/resources/connections/index.js +0 -17
  51. package/serialization/resources/connections/client/index.d.ts +0 -1
  52. package/serialization/resources/connections/client/index.js +0 -37
  53. package/serialization/resources/connections/client/listAllConnectedIntegrations.d.ts +0 -11
  54. package/serialization/resources/connections/client/listAllConnectedIntegrations.js +0 -42
  55. package/serialization/resources/connections/index.d.ts +0 -1
  56. package/serialization/resources/connections/index.js +0 -17
@@ -1,73 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../environments";
5
- import * as core from "../../../../core";
6
- import * as AirweaveSDK from "../../../index";
7
- export declare namespace Connections {
8
- interface Options {
9
- environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
13
- }
14
- interface RequestOptions {
15
- /** The maximum time to wait for a response in seconds. */
16
- timeoutInSeconds?: number;
17
- /** The number of times to retry the request. Defaults to 2. */
18
- maxRetries?: number;
19
- /** A hook to abort the request. */
20
- abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
- /** Additional headers to include in the request. */
24
- headers?: Record<string, string>;
25
- }
26
- }
27
- export declare class Connections {
28
- protected readonly _options: Connections.Options;
29
- constructor(_options: Connections.Options);
30
- /**
31
- * Get a specific connection.
32
- *
33
- * Args:
34
- * -----
35
- * connection_id: The ID of the connection to get.
36
- * db: The database session.
37
- * user: The current user.
38
- *
39
- * Returns:
40
- * -------
41
- * schemas.Connection: The connection.
42
- *
43
- * @param {string} connectionId
44
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
45
- *
46
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
47
- *
48
- * @example
49
- * await client.connections.getConnection("connection_id")
50
- */
51
- getConnection(connectionId: string, requestOptions?: Connections.RequestOptions): Promise<AirweaveSDK.Connection>;
52
- /**
53
- * Get all active connections for the current user across all integration types.
54
- *
55
- * Args:
56
- * -----
57
- * db: The database session.
58
- * user: The current user.
59
- *
60
- * Returns:
61
- * -------
62
- * list[schemas.Connection]: The list of connections.
63
- *
64
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
65
- *
66
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
67
- *
68
- * @example
69
- * await client.connections.listAllConnectedIntegrations()
70
- */
71
- listAllConnectedIntegrations(requestOptions?: Connections.RequestOptions): Promise<AirweaveSDK.Connection[]>;
72
- protected _getAuthorizationHeader(): Promise<string>;
73
- }
@@ -1,216 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
48
- return (mod && mod.__esModule) ? mod : { "default": mod };
49
- };
50
- Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.Connections = void 0;
52
- const environments = __importStar(require("../../../../environments"));
53
- const core = __importStar(require("../../../../core"));
54
- const AirweaveSDK = __importStar(require("../../../index"));
55
- const url_join_1 = __importDefault(require("url-join"));
56
- const serializers = __importStar(require("../../../../serialization/index"));
57
- const errors = __importStar(require("../../../../errors/index"));
58
- class Connections {
59
- constructor(_options) {
60
- this._options = _options;
61
- }
62
- /**
63
- * Get a specific connection.
64
- *
65
- * Args:
66
- * -----
67
- * connection_id: The ID of the connection to get.
68
- * db: The database session.
69
- * user: The current user.
70
- *
71
- * Returns:
72
- * -------
73
- * schemas.Connection: The connection.
74
- *
75
- * @param {string} connectionId
76
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
77
- *
78
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
79
- *
80
- * @example
81
- * await client.connections.getConnection("connection_id")
82
- */
83
- getConnection(connectionId, requestOptions) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- var _a;
86
- const _response = yield core.fetcher({
87
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/detail/${encodeURIComponent(connectionId)}`),
88
- method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
90
- ? yield core.Supplier.get(this._options.apiKey)
91
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
- contentType: "application/json",
93
- requestType: "json",
94
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
95
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
96
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
97
- });
98
- if (_response.ok) {
99
- return serializers.Connection.parseOrThrow(_response.body, {
100
- unrecognizedObjectKeys: "passthrough",
101
- allowUnrecognizedUnionMembers: true,
102
- allowUnrecognizedEnumValues: true,
103
- breadcrumbsPrefix: ["response"],
104
- });
105
- }
106
- if (_response.error.reason === "status-code") {
107
- switch (_response.error.statusCode) {
108
- case 422:
109
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
110
- unrecognizedObjectKeys: "passthrough",
111
- allowUnrecognizedUnionMembers: true,
112
- allowUnrecognizedEnumValues: true,
113
- breadcrumbsPrefix: ["response"],
114
- }));
115
- default:
116
- throw new errors.AirweaveSDKError({
117
- statusCode: _response.error.statusCode,
118
- body: _response.error.body,
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
- });
128
- case "timeout":
129
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /connections/detail/{connection_id}.");
130
- case "unknown":
131
- throw new errors.AirweaveSDKError({
132
- message: _response.error.errorMessage,
133
- });
134
- }
135
- });
136
- }
137
- /**
138
- * Get all active connections for the current user across all integration types.
139
- *
140
- * Args:
141
- * -----
142
- * db: The database session.
143
- * user: The current user.
144
- *
145
- * Returns:
146
- * -------
147
- * list[schemas.Connection]: The list of connections.
148
- *
149
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
150
- *
151
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
152
- *
153
- * @example
154
- * await client.connections.listAllConnectedIntegrations()
155
- */
156
- listAllConnectedIntegrations(requestOptions) {
157
- return __awaiter(this, void 0, void 0, function* () {
158
- var _a;
159
- const _response = yield core.fetcher({
160
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "connections/list"),
161
- method: "GET",
162
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
163
- ? yield core.Supplier.get(this._options.apiKey)
164
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
165
- contentType: "application/json",
166
- requestType: "json",
167
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
168
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
169
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
170
- });
171
- if (_response.ok) {
172
- return serializers.connections.listAllConnectedIntegrations.Response.parseOrThrow(_response.body, {
173
- unrecognizedObjectKeys: "passthrough",
174
- allowUnrecognizedUnionMembers: true,
175
- allowUnrecognizedEnumValues: true,
176
- breadcrumbsPrefix: ["response"],
177
- });
178
- }
179
- if (_response.error.reason === "status-code") {
180
- switch (_response.error.statusCode) {
181
- case 422:
182
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
183
- unrecognizedObjectKeys: "passthrough",
184
- allowUnrecognizedUnionMembers: true,
185
- allowUnrecognizedEnumValues: true,
186
- breadcrumbsPrefix: ["response"],
187
- }));
188
- default:
189
- throw new errors.AirweaveSDKError({
190
- statusCode: _response.error.statusCode,
191
- body: _response.error.body,
192
- });
193
- }
194
- }
195
- switch (_response.error.reason) {
196
- case "non-json":
197
- throw new errors.AirweaveSDKError({
198
- statusCode: _response.error.statusCode,
199
- body: _response.error.rawBody,
200
- });
201
- case "timeout":
202
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /connections/list.");
203
- case "unknown":
204
- throw new errors.AirweaveSDKError({
205
- message: _response.error.errorMessage,
206
- });
207
- }
208
- });
209
- }
210
- _getAuthorizationHeader() {
211
- return __awaiter(this, void 0, void 0, function* () {
212
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
213
- });
214
- }
215
- }
216
- exports.Connections = Connections;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./client";
@@ -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("./client"), exports);
@@ -1,73 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../environments";
5
- import * as core from "../../../../core";
6
- import * as AirweaveSDK from "../../../index";
7
- export declare namespace Connections {
8
- interface Options {
9
- environment?: core.Supplier<environments.AirweaveSDKEnvironment | string>;
10
- token: core.Supplier<core.BearerToken>;
11
- /** Override the x-api-key header */
12
- apiKey?: core.Supplier<string | undefined>;
13
- }
14
- interface RequestOptions {
15
- /** The maximum time to wait for a response in seconds. */
16
- timeoutInSeconds?: number;
17
- /** The number of times to retry the request. Defaults to 2. */
18
- maxRetries?: number;
19
- /** A hook to abort the request. */
20
- abortSignal?: AbortSignal;
21
- /** Override the x-api-key header */
22
- apiKey?: string | undefined;
23
- /** Additional headers to include in the request. */
24
- headers?: Record<string, string>;
25
- }
26
- }
27
- export declare class Connections {
28
- protected readonly _options: Connections.Options;
29
- constructor(_options: Connections.Options);
30
- /**
31
- * Get a specific connection.
32
- *
33
- * Args:
34
- * -----
35
- * connection_id: The ID of the connection to get.
36
- * db: The database session.
37
- * user: The current user.
38
- *
39
- * Returns:
40
- * -------
41
- * schemas.Connection: The connection.
42
- *
43
- * @param {string} connectionId
44
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
45
- *
46
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
47
- *
48
- * @example
49
- * await client.connections.getConnection("connection_id")
50
- */
51
- getConnection(connectionId: string, requestOptions?: Connections.RequestOptions): Promise<AirweaveSDK.Connection>;
52
- /**
53
- * Get all active connections for the current user across all integration types.
54
- *
55
- * Args:
56
- * -----
57
- * db: The database session.
58
- * user: The current user.
59
- *
60
- * Returns:
61
- * -------
62
- * list[schemas.Connection]: The list of connections.
63
- *
64
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
65
- *
66
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
67
- *
68
- * @example
69
- * await client.connections.listAllConnectedIntegrations()
70
- */
71
- listAllConnectedIntegrations(requestOptions?: Connections.RequestOptions): Promise<AirweaveSDK.Connection[]>;
72
- protected _getAuthorizationHeader(): Promise<string>;
73
- }
@@ -1,216 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
48
- return (mod && mod.__esModule) ? mod : { "default": mod };
49
- };
50
- Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.Connections = void 0;
52
- const environments = __importStar(require("../../../../environments"));
53
- const core = __importStar(require("../../../../core"));
54
- const AirweaveSDK = __importStar(require("../../../index"));
55
- const url_join_1 = __importDefault(require("url-join"));
56
- const serializers = __importStar(require("../../../../serialization/index"));
57
- const errors = __importStar(require("../../../../errors/index"));
58
- class Connections {
59
- constructor(_options) {
60
- this._options = _options;
61
- }
62
- /**
63
- * Get a specific connection.
64
- *
65
- * Args:
66
- * -----
67
- * connection_id: The ID of the connection to get.
68
- * db: The database session.
69
- * user: The current user.
70
- *
71
- * Returns:
72
- * -------
73
- * schemas.Connection: The connection.
74
- *
75
- * @param {string} connectionId
76
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
77
- *
78
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
79
- *
80
- * @example
81
- * await client.connections.getConnection("connection_id")
82
- */
83
- getConnection(connectionId, requestOptions) {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- var _a;
86
- const _response = yield core.fetcher({
87
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `connections/detail/${encodeURIComponent(connectionId)}`),
88
- method: "GET",
89
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
90
- ? yield core.Supplier.get(this._options.apiKey)
91
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
- contentType: "application/json",
93
- requestType: "json",
94
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
95
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
96
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
97
- });
98
- if (_response.ok) {
99
- return serializers.Connection.parseOrThrow(_response.body, {
100
- unrecognizedObjectKeys: "passthrough",
101
- allowUnrecognizedUnionMembers: true,
102
- allowUnrecognizedEnumValues: true,
103
- breadcrumbsPrefix: ["response"],
104
- });
105
- }
106
- if (_response.error.reason === "status-code") {
107
- switch (_response.error.statusCode) {
108
- case 422:
109
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
110
- unrecognizedObjectKeys: "passthrough",
111
- allowUnrecognizedUnionMembers: true,
112
- allowUnrecognizedEnumValues: true,
113
- breadcrumbsPrefix: ["response"],
114
- }));
115
- default:
116
- throw new errors.AirweaveSDKError({
117
- statusCode: _response.error.statusCode,
118
- body: _response.error.body,
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
- });
128
- case "timeout":
129
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /connections/detail/{connection_id}.");
130
- case "unknown":
131
- throw new errors.AirweaveSDKError({
132
- message: _response.error.errorMessage,
133
- });
134
- }
135
- });
136
- }
137
- /**
138
- * Get all active connections for the current user across all integration types.
139
- *
140
- * Args:
141
- * -----
142
- * db: The database session.
143
- * user: The current user.
144
- *
145
- * Returns:
146
- * -------
147
- * list[schemas.Connection]: The list of connections.
148
- *
149
- * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
150
- *
151
- * @throws {@link AirweaveSDK.UnprocessableEntityError}
152
- *
153
- * @example
154
- * await client.connections.listAllConnectedIntegrations()
155
- */
156
- listAllConnectedIntegrations(requestOptions) {
157
- return __awaiter(this, void 0, void 0, function* () {
158
- var _a;
159
- const _response = yield core.fetcher({
160
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "connections/list"),
161
- method: "GET",
162
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
163
- ? yield core.Supplier.get(this._options.apiKey)
164
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.36", "User-Agent": "@airweave/sdk/v0.1.36", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
165
- contentType: "application/json",
166
- requestType: "json",
167
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
168
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
169
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
170
- });
171
- if (_response.ok) {
172
- return serializers.connections.listAllConnectedIntegrations.Response.parseOrThrow(_response.body, {
173
- unrecognizedObjectKeys: "passthrough",
174
- allowUnrecognizedUnionMembers: true,
175
- allowUnrecognizedEnumValues: true,
176
- breadcrumbsPrefix: ["response"],
177
- });
178
- }
179
- if (_response.error.reason === "status-code") {
180
- switch (_response.error.statusCode) {
181
- case 422:
182
- throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
183
- unrecognizedObjectKeys: "passthrough",
184
- allowUnrecognizedUnionMembers: true,
185
- allowUnrecognizedEnumValues: true,
186
- breadcrumbsPrefix: ["response"],
187
- }));
188
- default:
189
- throw new errors.AirweaveSDKError({
190
- statusCode: _response.error.statusCode,
191
- body: _response.error.body,
192
- });
193
- }
194
- }
195
- switch (_response.error.reason) {
196
- case "non-json":
197
- throw new errors.AirweaveSDKError({
198
- statusCode: _response.error.statusCode,
199
- body: _response.error.rawBody,
200
- });
201
- case "timeout":
202
- throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /connections/list.");
203
- case "unknown":
204
- throw new errors.AirweaveSDKError({
205
- message: _response.error.errorMessage,
206
- });
207
- }
208
- });
209
- }
210
- _getAuthorizationHeader() {
211
- return __awaiter(this, void 0, void 0, function* () {
212
- return `Bearer ${yield core.Supplier.get(this._options.token)}`;
213
- });
214
- }
215
- }
216
- exports.Connections = Connections;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from "./client";
@@ -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("./client"), exports);
@@ -1 +0,0 @@
1
- export * as listAllConnectedIntegrations from "./listAllConnectedIntegrations";
@@ -1,37 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.listAllConnectedIntegrations = void 0;
37
- exports.listAllConnectedIntegrations = __importStar(require("./listAllConnectedIntegrations"));