@griddo/core 10.1.87 → 10.1.89

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,5 +1,5 @@
1
1
  import { ImagePosition } from "../core";
2
- import { HTMLHeadingTag } from "../global";
2
+ import { FilterItemFromFilterEndPoint, HTMLHeadingTag } from "../global";
3
3
  import { ContentTypeNameOfUnion } from "../utilities";
4
4
  export type FieldsDivider = string;
5
5
  export type ArrayFieldGroup<Fields> = Array<Fields>;
@@ -111,9 +111,15 @@ type MultiCheckSelectWithNoRelations<FromDistributor> = FromDistributor extends
111
111
  id?: number;
112
112
  label?: string;
113
113
  } : number;
114
- export type MultiCheckSelect<Relations = false, FromList = false, RelatedContentType = unknown, FromDistributor = false> = FromList extends true ? Array<Relations extends true ? {
114
+ export type MultiCheckSelect<Relations = false, FromList = false, RelatedContentType = unknown, FromDistributor = false> = FromList extends true ? Array<Relations extends true | "simple" ? {
115
115
  id?: number;
116
116
  label?: string;
117
+ } : Relations extends "full" ? {
118
+ id?: number;
119
+ content?: {
120
+ title?: string;
121
+ code?: string;
122
+ };
117
123
  } : number> : FromDistributor extends true ? Array<Relations extends true ? MultiCheckSelectWithRelations<FromDistributor, RelatedContentType> : MultiCheckSelectWithNoRelations<FromDistributor>> : Array<{
118
124
  name?: number;
119
125
  value?: number;
@@ -133,16 +139,24 @@ export interface Reference<ContentType> {
133
139
  source?: Array<ContentTypeNameOfUnion<ContentType>>;
134
140
  /** 0 means all */
135
141
  quantity?: number;
136
- filter?: Array<{
142
+ filter?: ContentType extends {
143
+ __contentTypeName: string;
144
+ } ? Array<{
137
145
  id: number;
138
146
  label: string;
139
- source: string;
140
- } | number>;
147
+ source: ContentType["__contentTypeName"];
148
+ } | number> : never;
141
149
  fullRelations?: boolean;
142
150
  allLanguages?: boolean;
143
151
  preferenceLanguage?: boolean;
144
152
  referenceId?: number;
145
- related?: number | Array<number>;
153
+ related?: ContentType extends {
154
+ __contentTypeName: string;
155
+ } ? number | Array<number> | Array<{
156
+ id: number;
157
+ label: string;
158
+ source: ContentType["__contentTypeName"];
159
+ }> | Record<ContentType["__contentTypeName"], FilterItemFromFilterEndPoint> : never;
146
160
  filterOperator?: "and" | "or" | "AND" | "OR";
147
161
  globalOperator?: "and" | "or" | "AND" | "OR";
148
162
  }
@@ -37,7 +37,7 @@ export interface SetQueryProps<ContentType> {
37
37
  /** Array of content types ids to exclude from the query */
38
38
  exclude?: Array<number>;
39
39
  /** Indicates if the data queried include a list with all the available relationship options, for example to make search filters. */
40
- relations?: boolean;
40
+ relations?: boolean | "off" | "simple" | "full";
41
41
  /** Indicates if the query includes pending publish data */
42
42
  includePending?: boolean;
43
43
  /** Indicates if we should limit results to one language */
@@ -93,6 +93,7 @@ export interface FilterItemFromFilterEndPoint {
93
93
  items: Array<{
94
94
  id: number;
95
95
  label: string;
96
+ language: number;
96
97
  }>;
97
98
  }
98
99
  export {};
@@ -131,6 +131,6 @@ export type WithWhiteList = {
131
131
  };
132
132
  export type WithRelations_AutoTypes = {
133
133
  _autoType?: {
134
- relations?: boolean;
134
+ relations?: boolean | "off" | "simple" | "full";
135
135
  };
136
136
  };
@@ -31,7 +31,7 @@ interface ConfigTabs {
31
31
  }
32
32
  interface _AutoTypes {
33
33
  _autoType?: {
34
- relations?: boolean;
34
+ relations?: boolean | "off" | "simple" | "full";
35
35
  };
36
36
  }
37
37
  export { ConfigTabs, Thumbnails, ExpirationData, Dimension, DataPacks, _AutoTypes, };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@griddo/core",
3
3
  "description": "Reload version of Griddo Core",
4
4
  "license": "UNLICENSED",
5
- "version": "10.1.87",
5
+ "version": "10.1.89",
6
6
  "authors": [
7
7
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
8
8
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -78,5 +78,5 @@
78
78
  "resolutions": {
79
79
  "colors": "1.4.0"
80
80
  },
81
- "gitHead": "f6e590cbc5491eaaca69f41b8672bb2f147be99d"
81
+ "gitHead": "90e5df2fae5446dc3359e967ca8a9fcbedd8dfc1"
82
82
  }