@airweave/sdk 0.1.28 → 0.1.34

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 (259) hide show
  1. package/Client.d.ts +15 -0
  2. package/Client.js +45 -20
  3. package/README.md +7 -11
  4. package/api/resources/apiKeys/client/Client.d.ts +131 -0
  5. package/api/resources/apiKeys/client/Client.js +391 -0
  6. package/api/resources/apiKeys/client/index.d.ts +1 -0
  7. package/api/resources/apiKeys/client/index.js +17 -0
  8. package/api/{types → resources/apiKeys/client/requests}/ApiKeyCreate.d.ts +2 -1
  9. package/api/resources/apiKeys/client/requests/DeleteApiKeyApiKeysDeleteRequest.d.ts +12 -0
  10. package/api/resources/apiKeys/client/requests/ReadApiKeysApiKeysGetRequest.d.ts +11 -0
  11. package/api/resources/apiKeys/client/requests/index.d.ts +3 -0
  12. package/api/resources/apiKeys/client/requests/index.js +2 -0
  13. package/api/resources/apiKeys/index.d.ts +1 -0
  14. package/api/resources/apiKeys/index.js +17 -0
  15. package/api/resources/chat/client/Client.d.ts +209 -0
  16. package/api/resources/chat/client/Client.js +669 -0
  17. package/api/resources/chat/client/index.d.ts +1 -0
  18. package/api/resources/chat/client/index.js +17 -0
  19. package/api/{types → resources/chat/client/requests}/ChatCreate.d.ts +5 -1
  20. package/api/{types → resources/chat/client/requests}/ChatMessageCreate.d.ts +4 -1
  21. package/{dist/api/types → api/resources/chat/client/requests}/ChatUpdate.d.ts +2 -1
  22. package/api/resources/chat/client/requests/ListChatsChatGetRequest.d.ts +11 -0
  23. package/api/resources/chat/client/requests/index.d.ts +4 -0
  24. package/api/resources/chat/client/requests/index.js +2 -0
  25. package/api/resources/chat/index.d.ts +1 -0
  26. package/api/resources/chat/index.js +17 -0
  27. package/api/resources/connections/client/Client.d.ts +26 -25
  28. package/api/resources/connections/client/Client.js +88 -84
  29. package/api/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +13 -0
  30. package/api/resources/connections/client/requests/index.d.ts +1 -0
  31. package/api/resources/cursorDevelopment/client/Client.d.ts +78 -0
  32. package/api/resources/cursorDevelopment/client/Client.js +218 -0
  33. package/api/resources/cursorDevelopment/client/index.d.ts +1 -0
  34. package/api/resources/cursorDevelopment/client/index.js +2 -0
  35. package/api/resources/cursorDevelopment/index.d.ts +1 -0
  36. package/api/resources/cursorDevelopment/index.js +17 -0
  37. package/api/resources/dag/client/Client.js +4 -4
  38. package/api/resources/destinations/client/Client.js +2 -2
  39. package/api/resources/embeddingModels/client/Client.js +2 -2
  40. package/api/resources/entities/client/Client.js +8 -8
  41. package/api/resources/health/client/Client.d.ts +41 -0
  42. package/api/resources/health/client/Client.js +118 -0
  43. package/api/resources/health/client/index.d.ts +1 -0
  44. package/api/resources/health/client/index.js +2 -0
  45. package/api/resources/health/index.d.ts +1 -0
  46. package/api/resources/health/index.js +17 -0
  47. package/api/resources/index.d.ts +8 -0
  48. package/api/resources/index.js +9 -1
  49. package/api/resources/search/client/Client.d.ts +55 -0
  50. package/api/resources/search/client/Client.js +147 -0
  51. package/api/resources/search/client/index.d.ts +1 -0
  52. package/api/resources/search/client/index.js +17 -0
  53. package/api/resources/search/client/requests/SearchSearchGetRequest.d.ts +20 -0
  54. package/api/resources/search/client/requests/SearchSearchGetRequest.js +5 -0
  55. package/api/resources/search/client/requests/index.d.ts +1 -0
  56. package/api/resources/search/client/requests/index.js +2 -0
  57. package/api/resources/search/index.d.ts +1 -0
  58. package/api/resources/search/index.js +17 -0
  59. package/api/resources/sources/client/Client.js +2 -2
  60. package/api/resources/sync/client/Client.js +11 -11
  61. package/api/resources/transformers/client/Client.js +3 -3
  62. package/api/resources/users/client/Client.js +1 -1
  63. package/api/resources/whiteLabels/client/Client.js +8 -8
  64. package/api/types/index.d.ts +0 -4
  65. package/api/types/index.js +0 -4
  66. package/dist/Client.d.ts +15 -0
  67. package/dist/Client.js +45 -20
  68. package/dist/api/resources/apiKeys/client/Client.d.ts +131 -0
  69. package/dist/api/resources/apiKeys/client/Client.js +391 -0
  70. package/dist/api/resources/apiKeys/client/index.d.ts +1 -0
  71. package/dist/api/resources/apiKeys/client/index.js +17 -0
  72. package/dist/api/{types → resources/apiKeys/client/requests}/ApiKeyCreate.d.ts +2 -1
  73. package/dist/api/resources/apiKeys/client/requests/ApiKeyCreate.js +5 -0
  74. package/dist/api/resources/apiKeys/client/requests/DeleteApiKeyApiKeysDeleteRequest.d.ts +12 -0
  75. package/dist/api/resources/apiKeys/client/requests/DeleteApiKeyApiKeysDeleteRequest.js +5 -0
  76. package/dist/api/resources/apiKeys/client/requests/ReadApiKeysApiKeysGetRequest.d.ts +11 -0
  77. package/dist/api/resources/apiKeys/client/requests/ReadApiKeysApiKeysGetRequest.js +5 -0
  78. package/dist/api/resources/apiKeys/client/requests/index.d.ts +3 -0
  79. package/dist/api/resources/apiKeys/client/requests/index.js +2 -0
  80. package/dist/api/resources/apiKeys/index.d.ts +1 -0
  81. package/dist/api/resources/apiKeys/index.js +17 -0
  82. package/dist/api/resources/chat/client/Client.d.ts +209 -0
  83. package/dist/api/resources/chat/client/Client.js +669 -0
  84. package/dist/api/resources/chat/client/index.d.ts +1 -0
  85. package/dist/api/resources/chat/client/index.js +17 -0
  86. package/dist/api/{types → resources/chat/client/requests}/ChatCreate.d.ts +5 -1
  87. package/dist/api/resources/chat/client/requests/ChatCreate.js +5 -0
  88. package/dist/api/{types → resources/chat/client/requests}/ChatMessageCreate.d.ts +4 -1
  89. package/dist/api/resources/chat/client/requests/ChatMessageCreate.js +5 -0
  90. package/{api/types → dist/api/resources/chat/client/requests}/ChatUpdate.d.ts +2 -1
  91. package/dist/api/resources/chat/client/requests/ChatUpdate.js +5 -0
  92. package/dist/api/resources/chat/client/requests/ListChatsChatGetRequest.d.ts +11 -0
  93. package/dist/api/resources/chat/client/requests/ListChatsChatGetRequest.js +5 -0
  94. package/dist/api/resources/chat/client/requests/index.d.ts +4 -0
  95. package/dist/api/resources/chat/client/requests/index.js +2 -0
  96. package/dist/api/resources/chat/index.d.ts +1 -0
  97. package/dist/api/resources/chat/index.js +17 -0
  98. package/dist/api/resources/connections/client/Client.d.ts +26 -25
  99. package/dist/api/resources/connections/client/Client.js +88 -84
  100. package/dist/api/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +13 -0
  101. package/dist/api/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js +5 -0
  102. package/dist/api/resources/connections/client/requests/index.d.ts +1 -0
  103. package/dist/api/resources/cursorDevelopment/client/Client.d.ts +78 -0
  104. package/dist/api/resources/cursorDevelopment/client/Client.js +218 -0
  105. package/dist/api/resources/cursorDevelopment/client/index.d.ts +1 -0
  106. package/dist/api/resources/cursorDevelopment/client/index.js +2 -0
  107. package/dist/api/resources/cursorDevelopment/index.d.ts +1 -0
  108. package/dist/api/resources/cursorDevelopment/index.js +17 -0
  109. package/dist/api/resources/dag/client/Client.js +4 -4
  110. package/dist/api/resources/destinations/client/Client.js +2 -2
  111. package/dist/api/resources/embeddingModels/client/Client.js +2 -2
  112. package/dist/api/resources/entities/client/Client.js +8 -8
  113. package/dist/api/resources/health/client/Client.d.ts +41 -0
  114. package/dist/api/resources/health/client/Client.js +118 -0
  115. package/dist/api/resources/health/client/index.d.ts +1 -0
  116. package/dist/api/resources/health/client/index.js +2 -0
  117. package/dist/api/resources/health/index.d.ts +1 -0
  118. package/dist/api/resources/health/index.js +17 -0
  119. package/dist/api/resources/index.d.ts +8 -0
  120. package/dist/api/resources/index.js +9 -1
  121. package/dist/api/resources/search/client/Client.d.ts +55 -0
  122. package/dist/api/resources/search/client/Client.js +147 -0
  123. package/dist/api/resources/search/client/index.d.ts +1 -0
  124. package/dist/api/resources/search/client/index.js +17 -0
  125. package/dist/api/resources/search/client/requests/SearchSearchGetRequest.d.ts +20 -0
  126. package/dist/api/resources/search/client/requests/SearchSearchGetRequest.js +5 -0
  127. package/dist/api/resources/search/client/requests/index.d.ts +1 -0
  128. package/dist/api/resources/search/client/requests/index.js +2 -0
  129. package/dist/api/resources/search/index.d.ts +1 -0
  130. package/dist/api/resources/search/index.js +17 -0
  131. package/dist/api/resources/sources/client/Client.js +2 -2
  132. package/dist/api/resources/sync/client/Client.js +11 -11
  133. package/dist/api/resources/transformers/client/Client.js +3 -3
  134. package/dist/api/resources/users/client/Client.js +1 -1
  135. package/dist/api/resources/whiteLabels/client/Client.js +8 -8
  136. package/dist/api/types/index.d.ts +0 -4
  137. package/dist/api/types/index.js +0 -4
  138. package/dist/serialization/resources/apiKeys/client/index.d.ts +2 -0
  139. package/dist/serialization/resources/apiKeys/client/index.js +41 -0
  140. package/dist/serialization/resources/apiKeys/client/readApiKeys.d.ts +11 -0
  141. package/dist/serialization/resources/apiKeys/client/readApiKeys.js +42 -0
  142. package/dist/serialization/resources/apiKeys/client/requests/ApiKeyCreate.d.ts +12 -0
  143. package/dist/serialization/{types → resources/apiKeys/client/requests}/ApiKeyCreate.js +1 -1
  144. package/dist/serialization/resources/apiKeys/client/requests/index.d.ts +1 -0
  145. package/dist/serialization/resources/apiKeys/client/requests/index.js +5 -0
  146. package/dist/serialization/resources/apiKeys/index.d.ts +1 -0
  147. package/dist/serialization/resources/apiKeys/index.js +17 -0
  148. package/dist/serialization/resources/chat/client/index.d.ts +3 -0
  149. package/dist/serialization/resources/chat/client/index.js +42 -0
  150. package/dist/serialization/resources/chat/client/listChats.d.ts +11 -0
  151. package/dist/serialization/resources/chat/client/listChats.js +42 -0
  152. package/dist/serialization/resources/chat/client/openaiKeySet.d.ts +9 -0
  153. package/dist/serialization/resources/chat/client/openaiKeySet.js +41 -0
  154. package/{serialization/types → dist/serialization/resources/chat/client/requests}/ChatCreate.d.ts +4 -4
  155. package/{serialization/types → dist/serialization/resources/chat/client/requests}/ChatCreate.js +1 -1
  156. package/dist/serialization/resources/chat/client/requests/ChatMessageCreate.d.ts +13 -0
  157. package/dist/serialization/{types → resources/chat/client/requests}/ChatMessageCreate.js +1 -1
  158. package/{serialization/types → dist/serialization/resources/chat/client/requests}/ChatUpdate.d.ts +4 -4
  159. package/dist/serialization/{types → resources/chat/client/requests}/ChatUpdate.js +1 -1
  160. package/dist/serialization/resources/chat/client/requests/index.d.ts +3 -0
  161. package/dist/serialization/resources/chat/client/requests/index.js +9 -0
  162. package/dist/serialization/resources/chat/index.d.ts +1 -0
  163. package/dist/serialization/resources/chat/index.js +17 -0
  164. package/dist/serialization/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +13 -0
  165. package/dist/serialization/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js +44 -0
  166. package/dist/serialization/resources/connections/client/requests/index.d.ts +1 -0
  167. package/dist/serialization/resources/connections/client/requests/index.js +3 -1
  168. package/dist/serialization/resources/cursorDevelopment/client/checkConnectionStatus.d.ts +11 -0
  169. package/dist/serialization/resources/cursorDevelopment/client/checkConnectionStatus.js +42 -0
  170. package/dist/serialization/resources/cursorDevelopment/client/index.d.ts +1 -0
  171. package/dist/serialization/resources/cursorDevelopment/client/index.js +37 -0
  172. package/dist/serialization/resources/cursorDevelopment/index.d.ts +1 -0
  173. package/dist/serialization/resources/cursorDevelopment/index.js +17 -0
  174. package/dist/serialization/resources/health/client/healthCheck.d.ts +9 -0
  175. package/dist/serialization/resources/health/client/healthCheck.js +41 -0
  176. package/dist/serialization/resources/health/client/index.d.ts +1 -0
  177. package/dist/serialization/resources/health/client/index.js +37 -0
  178. package/dist/serialization/resources/health/index.d.ts +1 -0
  179. package/dist/serialization/resources/health/index.js +17 -0
  180. package/dist/serialization/resources/index.d.ts +7 -0
  181. package/dist/serialization/resources/index.js +8 -1
  182. package/dist/serialization/resources/search/client/index.d.ts +1 -0
  183. package/dist/serialization/resources/search/client/index.js +37 -0
  184. package/dist/serialization/resources/search/client/search.d.ts +9 -0
  185. package/dist/serialization/resources/search/client/search.js +41 -0
  186. package/dist/serialization/resources/search/index.d.ts +1 -0
  187. package/dist/serialization/resources/search/index.js +17 -0
  188. package/dist/serialization/types/index.d.ts +0 -4
  189. package/dist/serialization/types/index.js +0 -4
  190. package/dist/version.d.ts +1 -1
  191. package/dist/version.js +1 -1
  192. package/package.json +1 -1
  193. package/reference.md +1646 -447
  194. package/serialization/resources/apiKeys/client/index.d.ts +2 -0
  195. package/serialization/resources/apiKeys/client/index.js +41 -0
  196. package/serialization/resources/apiKeys/client/readApiKeys.d.ts +11 -0
  197. package/serialization/resources/apiKeys/client/readApiKeys.js +42 -0
  198. package/serialization/resources/apiKeys/client/requests/ApiKeyCreate.d.ts +12 -0
  199. package/serialization/{types → resources/apiKeys/client/requests}/ApiKeyCreate.js +1 -1
  200. package/serialization/resources/apiKeys/client/requests/index.d.ts +1 -0
  201. package/serialization/resources/apiKeys/client/requests/index.js +5 -0
  202. package/serialization/resources/apiKeys/index.d.ts +1 -0
  203. package/serialization/resources/apiKeys/index.js +17 -0
  204. package/serialization/resources/chat/client/index.d.ts +3 -0
  205. package/serialization/resources/chat/client/index.js +42 -0
  206. package/serialization/resources/chat/client/listChats.d.ts +11 -0
  207. package/serialization/resources/chat/client/listChats.js +42 -0
  208. package/serialization/resources/chat/client/openaiKeySet.d.ts +9 -0
  209. package/serialization/resources/chat/client/openaiKeySet.js +41 -0
  210. package/{dist/serialization/types → serialization/resources/chat/client/requests}/ChatCreate.d.ts +4 -4
  211. package/{dist/serialization/types → serialization/resources/chat/client/requests}/ChatCreate.js +1 -1
  212. package/serialization/resources/chat/client/requests/ChatMessageCreate.d.ts +13 -0
  213. package/serialization/{types → resources/chat/client/requests}/ChatMessageCreate.js +1 -1
  214. package/{dist/serialization/types → serialization/resources/chat/client/requests}/ChatUpdate.d.ts +4 -4
  215. package/serialization/{types → resources/chat/client/requests}/ChatUpdate.js +1 -1
  216. package/serialization/resources/chat/client/requests/index.d.ts +3 -0
  217. package/serialization/resources/chat/client/requests/index.js +9 -0
  218. package/serialization/resources/chat/index.d.ts +1 -0
  219. package/serialization/resources/chat/index.js +17 -0
  220. package/serialization/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.d.ts +13 -0
  221. package/serialization/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js +44 -0
  222. package/serialization/resources/connections/client/requests/index.d.ts +1 -0
  223. package/serialization/resources/connections/client/requests/index.js +3 -1
  224. package/serialization/resources/cursorDevelopment/client/checkConnectionStatus.d.ts +11 -0
  225. package/serialization/resources/cursorDevelopment/client/checkConnectionStatus.js +42 -0
  226. package/serialization/resources/cursorDevelopment/client/index.d.ts +1 -0
  227. package/serialization/resources/cursorDevelopment/client/index.js +37 -0
  228. package/serialization/resources/cursorDevelopment/index.d.ts +1 -0
  229. package/serialization/resources/cursorDevelopment/index.js +17 -0
  230. package/serialization/resources/health/client/healthCheck.d.ts +9 -0
  231. package/serialization/resources/health/client/healthCheck.js +41 -0
  232. package/serialization/resources/health/client/index.d.ts +1 -0
  233. package/serialization/resources/health/client/index.js +37 -0
  234. package/serialization/resources/health/index.d.ts +1 -0
  235. package/serialization/resources/health/index.js +17 -0
  236. package/serialization/resources/index.d.ts +7 -0
  237. package/serialization/resources/index.js +8 -1
  238. package/serialization/resources/search/client/index.d.ts +1 -0
  239. package/serialization/resources/search/client/index.js +37 -0
  240. package/serialization/resources/search/client/search.d.ts +9 -0
  241. package/serialization/resources/search/client/search.js +41 -0
  242. package/serialization/resources/search/index.d.ts +1 -0
  243. package/serialization/resources/search/index.js +17 -0
  244. package/serialization/types/index.d.ts +0 -4
  245. package/serialization/types/index.js +0 -4
  246. package/version.d.ts +1 -1
  247. package/version.js +1 -1
  248. package/dist/serialization/types/ApiKeyCreate.d.ts +0 -12
  249. package/dist/serialization/types/ChatMessageCreate.d.ts +0 -13
  250. package/serialization/types/ApiKeyCreate.d.ts +0 -12
  251. package/serialization/types/ChatMessageCreate.d.ts +0 -13
  252. /package/api/{types → resources/apiKeys/client/requests}/ApiKeyCreate.js +0 -0
  253. /package/api/{types/ChatCreate.js → resources/apiKeys/client/requests/DeleteApiKeyApiKeysDeleteRequest.js} +0 -0
  254. /package/api/{types/ChatMessageCreate.js → resources/apiKeys/client/requests/ReadApiKeysApiKeysGetRequest.js} +0 -0
  255. /package/{dist/api/types → api/resources/chat/client/requests}/ChatCreate.js +0 -0
  256. /package/{dist/api/types → api/resources/chat/client/requests}/ChatMessageCreate.js +0 -0
  257. /package/api/{types → resources/chat/client/requests}/ChatUpdate.js +0 -0
  258. /package/{dist/api/types/ApiKeyCreate.js → api/resources/chat/client/requests/ListChatsChatGetRequest.js} +0 -0
  259. /package/{dist/api/types/ChatUpdate.js → api/resources/connections/client/requests/BodyConnectSlackWithTokenConnectionsDirectTokenSlackPost.js} +0 -0
@@ -0,0 +1,391 @@
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.ApiKeys = 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 ApiKeys {
59
+ constructor(_options = {}) {
60
+ this._options = _options;
61
+ }
62
+ /**
63
+ * Retrieve all API keys for the current user.
64
+ *
65
+ * Args:
66
+ * ----
67
+ * db (AsyncSession): The database session.
68
+ * skip (int): Number of records to skip for pagination.
69
+ * limit (int): Maximum number of records to return.
70
+ * user (schemas.User): The current user.
71
+ *
72
+ * Returns:
73
+ * -------
74
+ * List[schemas.APIKey]: A list of API keys.
75
+ *
76
+ * @param {AirweaveSDK.ReadApiKeysApiKeysGetRequest} request
77
+ * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration.
78
+ *
79
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
80
+ *
81
+ * @example
82
+ * await client.apiKeys.readApiKeys()
83
+ */
84
+ readApiKeys() {
85
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
86
+ var _a;
87
+ const { skip, limit } = request;
88
+ const _queryParams = {};
89
+ if (skip != null) {
90
+ _queryParams["skip"] = skip.toString();
91
+ }
92
+ if (limit != null) {
93
+ _queryParams["limit"] = limit.toString();
94
+ }
95
+ const _response = yield core.fetcher({
96
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "api_keys/"),
97
+ method: "GET",
98
+ headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
99
+ ? yield core.Supplier.get(this._options.apiKey)
100
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.34", "User-Agent": "@airweave/sdk/v0.1.34", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
101
+ contentType: "application/json",
102
+ queryParameters: _queryParams,
103
+ requestType: "json",
104
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
105
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
106
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
107
+ });
108
+ if (_response.ok) {
109
+ return serializers.apiKeys.readApiKeys.Response.parseOrThrow(_response.body, {
110
+ unrecognizedObjectKeys: "passthrough",
111
+ allowUnrecognizedUnionMembers: true,
112
+ allowUnrecognizedEnumValues: true,
113
+ breadcrumbsPrefix: ["response"],
114
+ });
115
+ }
116
+ if (_response.error.reason === "status-code") {
117
+ switch (_response.error.statusCode) {
118
+ case 422:
119
+ throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
120
+ unrecognizedObjectKeys: "passthrough",
121
+ allowUnrecognizedUnionMembers: true,
122
+ allowUnrecognizedEnumValues: true,
123
+ breadcrumbsPrefix: ["response"],
124
+ }));
125
+ default:
126
+ throw new errors.AirweaveSDKError({
127
+ statusCode: _response.error.statusCode,
128
+ body: _response.error.body,
129
+ });
130
+ }
131
+ }
132
+ switch (_response.error.reason) {
133
+ case "non-json":
134
+ throw new errors.AirweaveSDKError({
135
+ statusCode: _response.error.statusCode,
136
+ body: _response.error.rawBody,
137
+ });
138
+ case "timeout":
139
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /api_keys/.");
140
+ case "unknown":
141
+ throw new errors.AirweaveSDKError({
142
+ message: _response.error.errorMessage,
143
+ });
144
+ }
145
+ });
146
+ }
147
+ /**
148
+ * Create a new API key for the current user.
149
+ *
150
+ * Returns a temporary plain key for the user to store securely.
151
+ * This is not stored in the database.
152
+ *
153
+ * Args:
154
+ * ----
155
+ * db (AsyncSession): The database session.
156
+ * api_key_in (schemas.APIKeyCreate): The API key creation data.
157
+ * user (schemas.User): The current user.
158
+ *
159
+ * Returns:
160
+ * -------
161
+ * schemas.APIKeyWithPlainKey: The created API key object, including the key.
162
+ *
163
+ * @param {AirweaveSDK.ApiKeyCreate} request
164
+ * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration.
165
+ *
166
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
167
+ *
168
+ * @example
169
+ * await client.apiKeys.createApiKey()
170
+ */
171
+ createApiKey() {
172
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
173
+ var _a;
174
+ const _response = yield core.fetcher({
175
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "api_keys/"),
176
+ method: "POST",
177
+ headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
178
+ ? yield core.Supplier.get(this._options.apiKey)
179
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.34", "User-Agent": "@airweave/sdk/v0.1.34", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
180
+ contentType: "application/json",
181
+ requestType: "json",
182
+ body: serializers.ApiKeyCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
183
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
184
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
185
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
186
+ });
187
+ if (_response.ok) {
188
+ return serializers.ApiKeyWithPlainKey.parseOrThrow(_response.body, {
189
+ unrecognizedObjectKeys: "passthrough",
190
+ allowUnrecognizedUnionMembers: true,
191
+ allowUnrecognizedEnumValues: true,
192
+ breadcrumbsPrefix: ["response"],
193
+ });
194
+ }
195
+ if (_response.error.reason === "status-code") {
196
+ switch (_response.error.statusCode) {
197
+ case 422:
198
+ throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
199
+ unrecognizedObjectKeys: "passthrough",
200
+ allowUnrecognizedUnionMembers: true,
201
+ allowUnrecognizedEnumValues: true,
202
+ breadcrumbsPrefix: ["response"],
203
+ }));
204
+ default:
205
+ throw new errors.AirweaveSDKError({
206
+ statusCode: _response.error.statusCode,
207
+ body: _response.error.body,
208
+ });
209
+ }
210
+ }
211
+ switch (_response.error.reason) {
212
+ case "non-json":
213
+ throw new errors.AirweaveSDKError({
214
+ statusCode: _response.error.statusCode,
215
+ body: _response.error.rawBody,
216
+ });
217
+ case "timeout":
218
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling POST /api_keys/.");
219
+ case "unknown":
220
+ throw new errors.AirweaveSDKError({
221
+ message: _response.error.errorMessage,
222
+ });
223
+ }
224
+ });
225
+ }
226
+ /**
227
+ * Delete an API key.
228
+ *
229
+ * Args:
230
+ * ----
231
+ * db (AsyncSession): The database session.
232
+ * id (UUID): The ID of the API key.
233
+ * user (schemas.User): The current user.
234
+ *
235
+ * Returns:
236
+ * -------
237
+ * schemas.APIKey: The revoked API key object.
238
+ *
239
+ * Raises:
240
+ * ------
241
+ * HTTPException: If the API key is not found.
242
+ *
243
+ * @param {AirweaveSDK.DeleteApiKeyApiKeysDeleteRequest} request
244
+ * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration.
245
+ *
246
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
247
+ *
248
+ * @example
249
+ * await client.apiKeys.deleteApiKey({
250
+ * id: "id"
251
+ * })
252
+ */
253
+ deleteApiKey(request, requestOptions) {
254
+ return __awaiter(this, void 0, void 0, function* () {
255
+ var _a;
256
+ const { id } = request;
257
+ const _queryParams = {};
258
+ _queryParams["id"] = id;
259
+ const _response = yield core.fetcher({
260
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, "api_keys/"),
261
+ method: "DELETE",
262
+ headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
263
+ ? yield core.Supplier.get(this._options.apiKey)
264
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.34", "User-Agent": "@airweave/sdk/v0.1.34", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
265
+ contentType: "application/json",
266
+ queryParameters: _queryParams,
267
+ requestType: "json",
268
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
269
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
270
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
271
+ });
272
+ if (_response.ok) {
273
+ return serializers.ApiKey.parseOrThrow(_response.body, {
274
+ unrecognizedObjectKeys: "passthrough",
275
+ allowUnrecognizedUnionMembers: true,
276
+ allowUnrecognizedEnumValues: true,
277
+ breadcrumbsPrefix: ["response"],
278
+ });
279
+ }
280
+ if (_response.error.reason === "status-code") {
281
+ switch (_response.error.statusCode) {
282
+ case 422:
283
+ throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
284
+ unrecognizedObjectKeys: "passthrough",
285
+ allowUnrecognizedUnionMembers: true,
286
+ allowUnrecognizedEnumValues: true,
287
+ breadcrumbsPrefix: ["response"],
288
+ }));
289
+ default:
290
+ throw new errors.AirweaveSDKError({
291
+ statusCode: _response.error.statusCode,
292
+ body: _response.error.body,
293
+ });
294
+ }
295
+ }
296
+ switch (_response.error.reason) {
297
+ case "non-json":
298
+ throw new errors.AirweaveSDKError({
299
+ statusCode: _response.error.statusCode,
300
+ body: _response.error.rawBody,
301
+ });
302
+ case "timeout":
303
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling DELETE /api_keys/.");
304
+ case "unknown":
305
+ throw new errors.AirweaveSDKError({
306
+ message: _response.error.errorMessage,
307
+ });
308
+ }
309
+ });
310
+ }
311
+ /**
312
+ * Retrieve an API key by ID.
313
+ *
314
+ * Args:
315
+ * ----
316
+ * db (AsyncSession): The database session.
317
+ * id (UUID): The ID of the API key.
318
+ * user (schemas.User): The current user.
319
+ *
320
+ * Returns:
321
+ * -------
322
+ * schemas.APIKey: The API key object.
323
+ *
324
+ * Raises:
325
+ * ------
326
+ * HTTPException: If the API key is not found.
327
+ *
328
+ * @param {string} id
329
+ * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration.
330
+ *
331
+ * @throws {@link AirweaveSDK.UnprocessableEntityError}
332
+ *
333
+ * @example
334
+ * await client.apiKeys.readApiKey("id")
335
+ */
336
+ readApiKey(id, requestOptions) {
337
+ return __awaiter(this, void 0, void 0, function* () {
338
+ var _a;
339
+ const _response = yield core.fetcher({
340
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.AirweaveSDKEnvironment.Production, `api_keys/${encodeURIComponent(id)}`),
341
+ method: "GET",
342
+ headers: Object.assign({ "x-api-key": (yield core.Supplier.get(this._options.apiKey)) != null
343
+ ? yield core.Supplier.get(this._options.apiKey)
344
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airweave/sdk", "X-Fern-SDK-Version": "v0.1.34", "User-Agent": "@airweave/sdk/v0.1.34", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
345
+ contentType: "application/json",
346
+ requestType: "json",
347
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
348
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
349
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
350
+ });
351
+ if (_response.ok) {
352
+ return serializers.ApiKey.parseOrThrow(_response.body, {
353
+ unrecognizedObjectKeys: "passthrough",
354
+ allowUnrecognizedUnionMembers: true,
355
+ allowUnrecognizedEnumValues: true,
356
+ breadcrumbsPrefix: ["response"],
357
+ });
358
+ }
359
+ if (_response.error.reason === "status-code") {
360
+ switch (_response.error.statusCode) {
361
+ case 422:
362
+ throw new AirweaveSDK.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
363
+ unrecognizedObjectKeys: "passthrough",
364
+ allowUnrecognizedUnionMembers: true,
365
+ allowUnrecognizedEnumValues: true,
366
+ breadcrumbsPrefix: ["response"],
367
+ }));
368
+ default:
369
+ throw new errors.AirweaveSDKError({
370
+ statusCode: _response.error.statusCode,
371
+ body: _response.error.body,
372
+ });
373
+ }
374
+ }
375
+ switch (_response.error.reason) {
376
+ case "non-json":
377
+ throw new errors.AirweaveSDKError({
378
+ statusCode: _response.error.statusCode,
379
+ body: _response.error.rawBody,
380
+ });
381
+ case "timeout":
382
+ throw new errors.AirweaveSDKTimeoutError("Timeout exceeded when calling GET /api_keys/{id}.");
383
+ case "unknown":
384
+ throw new errors.AirweaveSDKError({
385
+ message: _response.error.errorMessage,
386
+ });
387
+ }
388
+ });
389
+ }
390
+ }
391
+ exports.ApiKeys = ApiKeys;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -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"), exports);
@@ -2,7 +2,8 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * Schema for creating an APIKey object.
5
+ * @example
6
+ * {}
6
7
  */
7
8
  export interface ApiKeyCreate {
8
9
  expirationDate?: Date;
@@ -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 });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * id: "id"
8
+ * }
9
+ */
10
+ export interface DeleteApiKeyApiKeysDeleteRequest {
11
+ id: string;
12
+ }
@@ -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 });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface ReadApiKeysApiKeysGetRequest {
9
+ skip?: number;
10
+ limit?: number;
11
+ }
@@ -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 });
@@ -0,0 +1,3 @@
1
+ export { type ReadApiKeysApiKeysGetRequest } from "./ReadApiKeysApiKeysGetRequest";
2
+ export { type ApiKeyCreate } from "./ApiKeyCreate";
3
+ export { type DeleteApiKeyApiKeysDeleteRequest } from "./DeleteApiKeyApiKeysDeleteRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -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"), exports);