@gem-sdk/core 1.7.0 → 1.7.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.
@@ -87,7 +87,9 @@ const loopFetchCollection = async (fetcher, arg)=>{
87
87
  },
88
88
  orderByProduct: productSortedByOrder(arg.orderBy),
89
89
  whereProduct: {
90
- isStorefront: arg.isStorefront,
90
+ ...arg.isStorefront && {
91
+ isStorefront: arg.isStorefront
92
+ },
91
93
  isSample: arg.isSample
92
94
  },
93
95
  productsAfter: productAfterFetcher
@@ -164,8 +166,10 @@ const fetchVariantsByBaseIds = async (fetcher, { ids , isSample , isStorefront
164
166
  direction: 'DESC'
165
167
  },
166
168
  where: {
167
- isStorefront,
168
169
  isSample,
170
+ ...isStorefront && {
171
+ isStorefront
172
+ },
169
173
  ...ids?.length && {
170
174
  baseIDIn: ids.sort()
171
175
  }
@@ -32,7 +32,9 @@ const fetchProduct = async (fetcher, handle, isStorefront)=>{
32
32
  orderBy,
33
33
  where: {
34
34
  handle,
35
- isStorefront
35
+ ...isStorefront && {
36
+ isStorefront
37
+ }
36
38
  }
37
39
  };
38
40
  const response = await fetcher([
@@ -46,7 +48,9 @@ const fetchVariants = async (fetcher, handle, isStorefront)=>{
46
48
  orderBy,
47
49
  where: {
48
50
  handle,
49
- isStorefront
51
+ ...isStorefront && {
52
+ isStorefront
53
+ }
50
54
  }
51
55
  };
52
56
  const query = async (variables, olds)=>{
@@ -75,7 +79,9 @@ const fetchMedias = async (fetcher, handle, isStorefront)=>{
75
79
  orderBy,
76
80
  where: {
77
81
  handle,
78
- isStorefront
82
+ ...isStorefront && {
83
+ isStorefront
84
+ }
79
85
  },
80
86
  orderByMedia: {
81
87
  field: 'POSITION',
@@ -43,8 +43,10 @@ const fetchProduct = async (fetcher, { id , isSample , isStorefront })=>{
43
43
  const variables = {
44
44
  orderBy,
45
45
  where: {
46
- isStorefront,
47
46
  isSample,
47
+ ...isStorefront && {
48
+ isStorefront
49
+ },
48
50
  ...id && id.toLowerCase() !== 'latest' && {
49
51
  baseID: id
50
52
  }
@@ -60,8 +62,10 @@ const fetchVariants = async (fetcher, { id , isSample , isStorefront })=>{
60
62
  const initVariables = {
61
63
  orderBy,
62
64
  where: {
63
- isStorefront,
64
65
  isSample,
66
+ ...isStorefront && {
67
+ isStorefront
68
+ },
65
69
  ...id && id.toLowerCase() !== 'latest' && {
66
70
  baseID: id
67
71
  }
@@ -92,8 +96,10 @@ const fetchMedias = async (fetcher, { id , isSample , isStorefront })=>{
92
96
  const initVariables = {
93
97
  orderBy,
94
98
  where: {
95
- isStorefront,
96
99
  isSample,
100
+ ...isStorefront && {
101
+ isStorefront
102
+ },
97
103
  ...id && id.toLowerCase() !== 'latest' && {
98
104
  baseID: id
99
105
  }
@@ -86,8 +86,10 @@ const loopFetchProducts = async (fetcher, { ids , isSample , isStorefront })=>{
86
86
  direction: 'ASC'
87
87
  },
88
88
  where: {
89
- isStorefront,
90
89
  isSample,
90
+ ...isStorefront && {
91
+ isStorefront
92
+ },
91
93
  ...ids?.length ? {
92
94
  baseIDIn: ids
93
95
  } : {}
@@ -85,7 +85,9 @@ const loopFetchCollection = async (fetcher, arg)=>{
85
85
  },
86
86
  orderByProduct: productSortedByOrder(arg.orderBy),
87
87
  whereProduct: {
88
- isStorefront: arg.isStorefront,
88
+ ...arg.isStorefront && {
89
+ isStorefront: arg.isStorefront
90
+ },
89
91
  isSample: arg.isSample
90
92
  },
91
93
  productsAfter: productAfterFetcher
@@ -162,8 +164,10 @@ const fetchVariantsByBaseIds = async (fetcher, { ids , isSample , isStorefront
162
164
  direction: 'DESC'
163
165
  },
164
166
  where: {
165
- isStorefront,
166
167
  isSample,
168
+ ...isStorefront && {
169
+ isStorefront
170
+ },
167
171
  ...ids?.length && {
168
172
  baseIDIn: ids.sort()
169
173
  }
@@ -30,7 +30,9 @@ const fetchProduct = async (fetcher, handle, isStorefront)=>{
30
30
  orderBy,
31
31
  where: {
32
32
  handle,
33
- isStorefront
33
+ ...isStorefront && {
34
+ isStorefront
35
+ }
34
36
  }
35
37
  };
36
38
  const response = await fetcher([
@@ -44,7 +46,9 @@ const fetchVariants = async (fetcher, handle, isStorefront)=>{
44
46
  orderBy,
45
47
  where: {
46
48
  handle,
47
- isStorefront
49
+ ...isStorefront && {
50
+ isStorefront
51
+ }
48
52
  }
49
53
  };
50
54
  const query = async (variables, olds)=>{
@@ -73,7 +77,9 @@ const fetchMedias = async (fetcher, handle, isStorefront)=>{
73
77
  orderBy,
74
78
  where: {
75
79
  handle,
76
- isStorefront
80
+ ...isStorefront && {
81
+ isStorefront
82
+ }
77
83
  },
78
84
  orderByMedia: {
79
85
  field: 'POSITION',
@@ -41,8 +41,10 @@ const fetchProduct = async (fetcher, { id , isSample , isStorefront })=>{
41
41
  const variables = {
42
42
  orderBy,
43
43
  where: {
44
- isStorefront,
45
44
  isSample,
45
+ ...isStorefront && {
46
+ isStorefront
47
+ },
46
48
  ...id && id.toLowerCase() !== 'latest' && {
47
49
  baseID: id
48
50
  }
@@ -58,8 +60,10 @@ const fetchVariants = async (fetcher, { id , isSample , isStorefront })=>{
58
60
  const initVariables = {
59
61
  orderBy,
60
62
  where: {
61
- isStorefront,
62
63
  isSample,
64
+ ...isStorefront && {
65
+ isStorefront
66
+ },
63
67
  ...id && id.toLowerCase() !== 'latest' && {
64
68
  baseID: id
65
69
  }
@@ -90,8 +94,10 @@ const fetchMedias = async (fetcher, { id , isSample , isStorefront })=>{
90
94
  const initVariables = {
91
95
  orderBy,
92
96
  where: {
93
- isStorefront,
94
97
  isSample,
98
+ ...isStorefront && {
99
+ isStorefront
100
+ },
95
101
  ...id && id.toLowerCase() !== 'latest' && {
96
102
  baseID: id
97
103
  }
@@ -84,8 +84,10 @@ const loopFetchProducts = async (fetcher, { ids , isSample , isStorefront })=>{
84
84
  direction: 'ASC'
85
85
  },
86
86
  where: {
87
- isStorefront,
88
87
  isSample,
88
+ ...isStorefront && {
89
+ isStorefront
90
+ },
89
91
  ...ids?.length ? {
90
92
  baseIDIn: ids
91
93
  } : {}
@@ -777,7 +777,12 @@ type UniqueIdControlType<T> = SharedControlType<T> & {
777
777
  placeholder?: string;
778
778
  };
779
779
 
780
- type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | CustomCodeEditor | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor;
780
+ type SwatchesLinkControlType<T> = SharedControlType<T> & {
781
+ id?: string;
782
+ type: 'swatchesLink';
783
+ };
784
+
785
+ type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | CustomCodeEditor | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | SwatchesLinkControlType<T>;
781
786
  type Setting<P extends BaseProps> = {
782
787
  id: 'setting';
783
788
  note?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",