@foris/avocado-not-front 1.5.4 → 1.6.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
+ };
@@ -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.6.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },