@credal/actions 0.2.51 → 0.2.52

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.
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { axiosClient } from "../../util/axiosClient.js";
10
+ import { createAxiosClientWithTimeout } from "../../util/axiosClient.js";
11
11
  import mammoth from "mammoth";
12
12
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
13
13
  import { extractTextFromPdf } from "../../../utils/pdf.js";
@@ -18,6 +18,7 @@ const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function
18
18
  }
19
19
  const BASE_URL = "https://www.googleapis.com/drive/v3/files/";
20
20
  const { fileId, limit } = params;
21
+ const axiosClient = createAxiosClientWithTimeout(20000);
21
22
  try {
22
23
  // First, get file metadata to determine the file type and if it's in a shared drive
23
24
  const metadataUrl = `${BASE_URL}${encodeURIComponent(fileId)}?fields=name,mimeType,size,driveId,parents&supportsAllDrives=true`;
@@ -5,3 +5,4 @@ export declare class ApiError extends Error {
5
5
  constructor(message: string, status?: number, data?: any);
6
6
  }
7
7
  export declare const axiosClient: AxiosInstance;
8
+ export declare function createAxiosClientWithTimeout(timeout: number): AxiosInstance;
@@ -8,8 +8,10 @@ export class ApiError extends Error {
8
8
  }
9
9
  }
10
10
  /** Create a configured axios instance with interceptors */
11
- function createAxiosClient() {
12
- const instance = axios.create();
11
+ function createAxiosClient(timeout) {
12
+ const instance = axios.create({
13
+ timeout: timeout,
14
+ });
13
15
  instance.interceptors.request.use(config => {
14
16
  return config;
15
17
  }, error => {
@@ -36,3 +38,6 @@ function createAxiosClient() {
36
38
  return instance;
37
39
  }
38
40
  export const axiosClient = createAxiosClient();
41
+ export function createAxiosClientWithTimeout(timeout) {
42
+ return createAxiosClient(timeout);
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.51",
3
+ "version": "0.2.52",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,