@foris/avocado-not-front 1.5.4 → 1.7.0

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.
@@ -9,3 +9,22 @@
9
9
  * @returns An array of options formatted as `{ label, value }` objects.
10
10
  */
11
11
  export declare const parseOptionsFromResponse: (data: any, jsonPathOptions: string, jsonPathLabel: string, jsonPathValue?: string) => any;
12
+ /**
13
+ * Extracts pagination data from a JSON response using JSONPath expressions.
14
+ * Falls back to reading from meta object when jsonPathPagination is not provided.
15
+ *
16
+ * @param response - The response data object from the data source.
17
+ * @param page - The current page number (used to calculate hasMore).
18
+ * @param jsonPathPagination - Optional JSONPath expressions for pagination fields.
19
+ * @param defaultSize - Default page size to use as fallback (default: 10).
20
+ * @returns An object with pageSize, total, and hasMore.
21
+ */
22
+ export declare const parsePaginationFromResponse: (response: any, page: number, jsonPathPagination?: {
23
+ size?: string;
24
+ total: string;
25
+ totalPages?: string;
26
+ }, defaultSize?: number) => {
27
+ pageSize: number;
28
+ total: number;
29
+ hasMore: boolean;
30
+ };
@@ -40,3 +40,13 @@ export declare const put: <T>(api: string, headers?: ApiConfig['headers'] | Reco
40
40
  * @returns {call, controller}
41
41
  */
42
42
  export declare const patch: <T>(api: string, headers?: ApiConfig['headers'] | Record<string, string>, data?: {}, params?: {}, abort?: boolean, userFlow?: string) => AxiosCall<T>;
43
+ /**
44
+ * Axios Delete
45
+ * @param api
46
+ * @param headers
47
+ * @param data
48
+ * @param params
49
+ * @param abort
50
+ * @returns {call, controller}
51
+ */
52
+ export declare const deleteRequest: <T>(api: string, headers?: ApiConfig['headers'] | Record<string, string>, data?: {}, params?: {}, abort?: boolean, userFlow?: string) => AxiosCall<T>;
@@ -5,7 +5,7 @@ export interface NotFrontBaseProps {
5
5
  export type NotFrontActionType = 'GO_TO_NEXT_UI' | 'FETCH_AND_GO_TO_NEXT_UI' | 'REDIRECT' | 'GET_DATA_SOURCE' | 'AUTOCLOSE_AND_REDIRECT' | 'CLOSE_MODAL' | 'CLOSE_DRAWER' | 'OPEN_DRAWER';
6
6
  interface BaseDataSource {
7
7
  url: string;
8
- method: 'post' | 'get' | 'put' | 'patch';
8
+ method: 'post' | 'get' | 'put' | 'patch' | 'delete';
9
9
  headers?: Record<string, string>;
10
10
  params?: any;
11
11
  }
@@ -24,6 +24,11 @@ export interface SelectDataSource {
24
24
  jsonPathOptions: string;
25
25
  jsonPathLabel: string;
26
26
  jsonPathValue?: string;
27
+ jsonPathPagination?: {
28
+ size?: string;
29
+ total: string;
30
+ totalPages?: string;
31
+ };
27
32
  }
28
33
  interface MapperDataItem {
29
34
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foris/avocado-not-front",
3
- "version": "1.5.4",
3
+ "version": "1.7.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },