@gem-sdk/core 1.8.13 → 1.8.15

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.
@@ -27,9 +27,11 @@ function productSortedByOrder(key) {
27
27
  field: 'CREATED_AT'
28
28
  };
29
29
  case 'none':
30
- return undefined;
31
30
  default:
32
- return undefined;
31
+ return {
32
+ direction: 'ASC',
33
+ field: 'TITLE'
34
+ };
33
35
  }
34
36
  }
35
37
  const getCollection = async (fetcher, arg)=>{
@@ -67,8 +69,8 @@ const loopFetchCollection = async (fetcher, arg)=>{
67
69
  firstVariant: 1,
68
70
  firstMedia: 30,
69
71
  orderBy: {
70
- field: 'UPDATED_AT',
71
- direction: 'DESC'
72
+ field: 'TITLE',
73
+ direction: 'ASC'
72
74
  },
73
75
  orderByMedia: {
74
76
  field: 'POSITION',
@@ -87,6 +89,7 @@ const loopFetchCollection = async (fetcher, arg)=>{
87
89
  },
88
90
  orderByProduct: productSortedByOrder(arg.orderBy),
89
91
  whereProduct: {
92
+ status: 'ACTIVE',
90
93
  ...arg.isStorefront && {
91
94
  isStorefront: arg.isStorefront
92
95
  },
@@ -162,10 +165,11 @@ const fetchVariantsByBaseIds = async (fetcher, { ids , isSample , isStorefront
162
165
  firstVariant: 100,
163
166
  first: ids?.length || 1,
164
167
  orderBy: {
165
- field: 'UPDATED_AT',
166
- direction: 'DESC'
168
+ field: 'TITLE',
169
+ direction: 'ASC'
167
170
  },
168
171
  where: {
172
+ status: 'ACTIVE',
169
173
  isSample,
170
174
  ...isStorefront && {
171
175
  isStorefront
@@ -24,13 +24,14 @@ const getProductBySlug = async (fetcher, slug)=>{
24
24
  };
25
25
  };
26
26
  const orderBy = {
27
- field: 'UPDATED_AT',
28
- direction: 'DESC'
27
+ field: 'TITLE',
28
+ direction: 'ASC'
29
29
  };
30
30
  const fetchProduct = async (fetcher, handle, isStorefront)=>{
31
31
  const variables = {
32
32
  orderBy,
33
33
  where: {
34
+ status: 'ACTIVE',
34
35
  handle,
35
36
  ...isStorefront && {
36
37
  isStorefront
@@ -47,6 +48,7 @@ const fetchVariants = async (fetcher, handle, isStorefront)=>{
47
48
  const initVariables = {
48
49
  orderBy,
49
50
  where: {
51
+ status: 'ACTIVE',
50
52
  handle,
51
53
  ...isStorefront && {
52
54
  isStorefront
@@ -78,6 +80,7 @@ const fetchMedias = async (fetcher, handle, isStorefront)=>{
78
80
  const initVariables = {
79
81
  orderBy,
80
82
  where: {
83
+ status: 'ACTIVE',
81
84
  handle,
82
85
  ...isStorefront && {
83
86
  isStorefront
@@ -36,13 +36,14 @@ const getProduct = async (fetcher, { id , isSample , isStorefront })=>{
36
36
  };
37
37
  };
38
38
  const orderBy = {
39
- field: 'UPDATED_AT',
40
- direction: 'DESC'
39
+ field: 'TITLE',
40
+ direction: 'ASC'
41
41
  };
42
42
  const fetchProduct = async (fetcher, { id , isSample , isStorefront })=>{
43
43
  const variables = {
44
44
  orderBy,
45
45
  where: {
46
+ status: 'ACTIVE',
46
47
  isSample,
47
48
  ...isStorefront && {
48
49
  isStorefront
@@ -62,6 +63,7 @@ const fetchVariants = async (fetcher, { id , isSample , isStorefront })=>{
62
63
  const initVariables = {
63
64
  orderBy,
64
65
  where: {
66
+ status: 'ACTIVE',
65
67
  isSample,
66
68
  ...isStorefront && {
67
69
  isStorefront
@@ -96,6 +98,7 @@ const fetchMedias = async (fetcher, { id , isSample , isStorefront })=>{
96
98
  const initVariables = {
97
99
  orderBy,
98
100
  where: {
101
+ status: 'ACTIVE',
99
102
  isSample,
100
103
  ...isStorefront && {
101
104
  isStorefront
@@ -78,14 +78,15 @@ const loopFetchProducts = async (fetcher, { ids , isSample , isStorefront })=>{
78
78
  firstMedia: 1,
79
79
  firstVariant: 1,
80
80
  orderBy: {
81
- direction: 'DESC',
82
- field: 'UPDATED_AT'
81
+ field: 'TITLE',
82
+ direction: 'ASC'
83
83
  },
84
84
  orderByMedia: {
85
85
  field: 'POSITION',
86
86
  direction: 'ASC'
87
87
  },
88
88
  where: {
89
+ status: 'ACTIVE',
89
90
  isSample,
90
91
  ...isStorefront && {
91
92
  isStorefront
@@ -25,9 +25,11 @@ function productSortedByOrder(key) {
25
25
  field: 'CREATED_AT'
26
26
  };
27
27
  case 'none':
28
- return undefined;
29
28
  default:
30
- return undefined;
29
+ return {
30
+ direction: 'ASC',
31
+ field: 'TITLE'
32
+ };
31
33
  }
32
34
  }
33
35
  const getCollection = async (fetcher, arg)=>{
@@ -65,8 +67,8 @@ const loopFetchCollection = async (fetcher, arg)=>{
65
67
  firstVariant: 1,
66
68
  firstMedia: 30,
67
69
  orderBy: {
68
- field: 'UPDATED_AT',
69
- direction: 'DESC'
70
+ field: 'TITLE',
71
+ direction: 'ASC'
70
72
  },
71
73
  orderByMedia: {
72
74
  field: 'POSITION',
@@ -85,6 +87,7 @@ const loopFetchCollection = async (fetcher, arg)=>{
85
87
  },
86
88
  orderByProduct: productSortedByOrder(arg.orderBy),
87
89
  whereProduct: {
90
+ status: 'ACTIVE',
88
91
  ...arg.isStorefront && {
89
92
  isStorefront: arg.isStorefront
90
93
  },
@@ -160,10 +163,11 @@ const fetchVariantsByBaseIds = async (fetcher, { ids , isSample , isStorefront
160
163
  firstVariant: 100,
161
164
  first: ids?.length || 1,
162
165
  orderBy: {
163
- field: 'UPDATED_AT',
164
- direction: 'DESC'
166
+ field: 'TITLE',
167
+ direction: 'ASC'
165
168
  },
166
169
  where: {
170
+ status: 'ACTIVE',
167
171
  isSample,
168
172
  ...isStorefront && {
169
173
  isStorefront
@@ -22,13 +22,14 @@ const getProductBySlug = async (fetcher, slug)=>{
22
22
  };
23
23
  };
24
24
  const orderBy = {
25
- field: 'UPDATED_AT',
26
- direction: 'DESC'
25
+ field: 'TITLE',
26
+ direction: 'ASC'
27
27
  };
28
28
  const fetchProduct = async (fetcher, handle, isStorefront)=>{
29
29
  const variables = {
30
30
  orderBy,
31
31
  where: {
32
+ status: 'ACTIVE',
32
33
  handle,
33
34
  ...isStorefront && {
34
35
  isStorefront
@@ -45,6 +46,7 @@ const fetchVariants = async (fetcher, handle, isStorefront)=>{
45
46
  const initVariables = {
46
47
  orderBy,
47
48
  where: {
49
+ status: 'ACTIVE',
48
50
  handle,
49
51
  ...isStorefront && {
50
52
  isStorefront
@@ -76,6 +78,7 @@ const fetchMedias = async (fetcher, handle, isStorefront)=>{
76
78
  const initVariables = {
77
79
  orderBy,
78
80
  where: {
81
+ status: 'ACTIVE',
79
82
  handle,
80
83
  ...isStorefront && {
81
84
  isStorefront
@@ -34,13 +34,14 @@ const getProduct = async (fetcher, { id , isSample , isStorefront })=>{
34
34
  };
35
35
  };
36
36
  const orderBy = {
37
- field: 'UPDATED_AT',
38
- direction: 'DESC'
37
+ field: 'TITLE',
38
+ direction: 'ASC'
39
39
  };
40
40
  const fetchProduct = async (fetcher, { id , isSample , isStorefront })=>{
41
41
  const variables = {
42
42
  orderBy,
43
43
  where: {
44
+ status: 'ACTIVE',
44
45
  isSample,
45
46
  ...isStorefront && {
46
47
  isStorefront
@@ -60,6 +61,7 @@ const fetchVariants = async (fetcher, { id , isSample , isStorefront })=>{
60
61
  const initVariables = {
61
62
  orderBy,
62
63
  where: {
64
+ status: 'ACTIVE',
63
65
  isSample,
64
66
  ...isStorefront && {
65
67
  isStorefront
@@ -94,6 +96,7 @@ const fetchMedias = async (fetcher, { id , isSample , isStorefront })=>{
94
96
  const initVariables = {
95
97
  orderBy,
96
98
  where: {
99
+ status: 'ACTIVE',
97
100
  isSample,
98
101
  ...isStorefront && {
99
102
  isStorefront
@@ -76,14 +76,15 @@ const loopFetchProducts = async (fetcher, { ids , isSample , isStorefront })=>{
76
76
  firstMedia: 1,
77
77
  firstVariant: 1,
78
78
  orderBy: {
79
- direction: 'DESC',
80
- field: 'UPDATED_AT'
79
+ field: 'TITLE',
80
+ direction: 'ASC'
81
81
  },
82
82
  orderByMedia: {
83
83
  field: 'POSITION',
84
84
  direction: 'ASC'
85
85
  },
86
86
  where: {
87
+ status: 'ACTIVE',
87
88
  isSample,
88
89
  ...isStorefront && {
89
90
  isStorefront
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.8.13",
3
+ "version": "1.8.15",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",