@ticatec/restful_service_api 0.6.0 → 0.6.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.
@@ -1,6 +1,6 @@
1
- import type UploadCallback from "./UploadCallback";
2
- import type { UploadProgress } from "./UploadCallback";
3
- import type { DataProcessor } from "./RestService";
1
+ import type UploadCallback from "./UploadCallback.js";
2
+ import type { UploadProgress } from "./UploadCallback.js";
3
+ import type { DataProcessor } from "./RestService.js";
4
4
  /**
5
5
  * File service interface for file upload and download operations
6
6
  */
@@ -31,9 +31,9 @@ export type PostInterceptor = (data: any) => Promise<any>;
31
31
  /**
32
32
  * Error handler function type for handling request errors
33
33
  * @param ex The error object
34
- * @returns Boolean indicating if the error was handled (true) or should be thrown (false)
34
+ * @returns Optional boolean or void. Errors always reject the returned Promise.
35
35
  */
36
- export type ErrorHandler = (ex: Error) => boolean;
36
+ export type ErrorHandler = (ex: Error) => boolean | void;
37
37
  /**
38
38
  * RESTful API request options
39
39
  */
@@ -35,7 +35,7 @@ export default interface UploadCallback {
35
35
  /**
36
36
  * HTTP request method, defaults to POST, but allows PUT or other methods in special cases
37
37
  */
38
- method: string;
38
+ method?: string;
39
39
  /**
40
40
  * Optional upload progress update callback function
41
41
  */
package/dist/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
- import ApiError from "./ApiError";
2
- import type { ApiErrorPayload } from "./ApiError";
3
- import RestService from "./RestService";
4
- import FileService from "./FileService";
5
- import { ErrorHandler, PostInterceptor, PreInterceptor, DataProcessor } from "./RestService";
6
- import { PreInterceptorResult } from "./RestService";
7
- import { CONTENT_TYPE_NAME, TYPE_JSON, TYPE_HTML, TYPE_TEXT } from "./RestService";
8
- import UploadCallback, { UploadProgress, ProgressUpdate, OnCompleted, OnUploaded } from "./UploadCallback";
9
- import { RestfulOptions } from "./RestService";
1
+ import ApiError from "./ApiError.js";
2
+ import type { ApiErrorPayload } from "./ApiError.js";
3
+ import RestService from "./RestService.js";
4
+ import FileService from "./FileService.js";
5
+ import type { ErrorHandler, PostInterceptor, PreInterceptor, DataProcessor, PreInterceptorResult, RestfulOptions } from "./RestService.js";
6
+ import { CONTENT_TYPE_NAME, TYPE_JSON, TYPE_HTML, TYPE_TEXT } from "./RestService.js";
7
+ import type UploadCallback from "./UploadCallback.js";
8
+ import type { UploadProgress, ProgressUpdate, OnCompleted, OnUploaded } from "./UploadCallback.js";
10
9
  export default RestService;
11
10
  export { ApiError };
12
11
  export type { ApiErrorPayload };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import ApiError from "./ApiError";
2
- import { CONTENT_TYPE_NAME, TYPE_JSON, TYPE_HTML, TYPE_TEXT } from "./RestService";
1
+ import ApiError from "./ApiError.js";
2
+ import { CONTENT_TYPE_NAME, TYPE_JSON, TYPE_HTML, TYPE_TEXT } from "./RestService.js";
3
3
  export { ApiError };
4
4
  export { CONTENT_TYPE_NAME, TYPE_JSON, TYPE_HTML, TYPE_TEXT };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@ticatec/restful_service_api",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "description": "A lightweight TypeScript RESTful API client for browsers with error handling. (ESM only, v0.6.0+)",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",