@griddo/core 1.75.133 → 1.75.134

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.
@@ -98,7 +98,7 @@ export declare type SourceReturnComplex<FromData> = FromData extends false ? {
98
98
  id?: number;
99
99
  label?: string;
100
100
  };
101
- declare type SourceReturn<Relations, FromData> = Relations extends true ? SourceReturnComplex<FromData> : number;
101
+ export declare type SourceReturn<Relations, FromData> = Relations extends true ? SourceReturnComplex<FromData> : number;
102
102
  export declare type MultiCheckSelect<Relations = unknown, FromData = false> = Relations extends false ? Array<SourceReturn<false, FromData>> : Array<SourceReturn<true, FromData>>;
103
103
  export declare type MultiCheckSelectGroup<T extends string, Relations = unknown> = {
104
104
  [K in T]: MultiCheckSelect<Relations>;
@@ -170,12 +170,14 @@ interface MenuChildrenLinkType extends MenuItemBase {
170
170
  }
171
171
  export declare type MenuElement = MenuChildrenGroupType | MenuChildrenLinkType;
172
172
  export declare type Menu = {
173
- elements: Array<MenuElement>;
173
+ elements?: Array<MenuElement>;
174
174
  };
175
175
  export declare type TemplateSection<GriddoModule> = {
176
176
  modules: Array<GriddoModule>;
177
177
  };
178
178
  export declare type QueriedData<ContentType> = Array<{
179
+ /** Item Id */
180
+ id?: number;
179
181
  /** ContentType content */
180
182
  content?: Partial<ContentType>;
181
183
  /** ContentType name */
@@ -14,11 +14,11 @@ export interface SetQueryProps<ContentType> {
14
14
  /** Site id, if not provided, will be obtained from the context */
15
15
  site?: number;
16
16
  /** String array of the keys/properties in order to restrict the query. */
17
- fields?: Array<keyof Omit<ContentType, "contentTypeName">>;
17
+ fields?: Array<keyof ContentTypeItemWithId<ContentType>>;
18
18
  /** Array of content type ids to filter the query */
19
19
  filterIds?: Array<number>;
20
20
  /** String as HASH to cache the query (Mostly interal use) */
21
- cached?: string;
21
+ cached?: string | number | undefined;
22
22
  /** Search string, the spaces will be removed */
23
23
  search?: string;
24
24
  /** Operator OR | AND */
@@ -29,11 +29,36 @@ export interface SetQueryProps<ContentType> {
29
29
  globalOperator?: "and" | "or" | "AND" | "OR";
30
30
  /** Array of content types ids to exclude from the query */
31
31
  exclude?: Array<number>;
32
- /** Indicates if we want to obtain a list with all the available relationship options, for example to make search filters. */
32
+ /** Indicates if the data queried include a list with all the available relationship options, for example to make search filters. */
33
33
  relations?: boolean;
34
- /** Indicates if we could use pending publishing items */
34
+ /** Indicates if the query includes pending publish data */
35
35
  includePending?: boolean;
36
36
  /** Indicates if we should limit results to one language */
37
37
  allLanguages?: boolean;
38
38
  }
39
+ export interface ListApiQueryResponseProps<ContentTypeFields> {
40
+ page?: number;
41
+ items?: Array<ContentTypeFields>;
42
+ totalItems?: number;
43
+ totalPages?: number;
44
+ }
45
+ declare type FilterDataItem = {
46
+ label: string;
47
+ id: number;
48
+ };
49
+ export declare type FiltersDataApiQueryResponseProps<ContentType> = ContentType extends {
50
+ relatedContentTypeNames: Array<string>;
51
+ } ? {
52
+ [P in ContentType["relatedContentTypeNames"][number]]: {
53
+ label: string;
54
+ items: Array<FilterDataItem>;
55
+ };
56
+ } : never;
57
+ export declare type ContentTypeItemWithId<Item> = Omit<Item, "contentTypeName" | "relatedContentTypeNames"> & {
58
+ id: number;
59
+ };
60
+ export declare type PickRename<T, K extends keyof T, R extends PropertyKey> = Omit<T, K> & {
61
+ [P in R]: T[K];
62
+ };
39
63
  export declare type Hideable<T> = T | null;
64
+ export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@griddo/core",
3
3
  "description": "Reload version of Griddo Core",
4
4
  "license": "MIT",
5
- "version": "1.75.133",
5
+ "version": "1.75.134",
6
6
  "authors": [
7
7
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
8
8
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -78,5 +78,5 @@
78
78
  "resolutions": {
79
79
  "colors": "1.4.0"
80
80
  },
81
- "gitHead": "e403a2641fb444d9a15e325d213b64cf893572c4"
81
+ "gitHead": "a8edc3b04a848d1efd8f177f9abd0f9ba49f3212"
82
82
  }