@evenicanpm/storefront-graphql-codegen 1.1.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.
Files changed (138) hide show
  1. package/README.md +9 -0
  2. package/codegen.ts +26 -0
  3. package/documents/Account/index.ts +1 -0
  4. package/documents/Account/interfaces.ts +124 -0
  5. package/documents/Account/read.ts +22 -0
  6. package/documents/Account/readList.ts +28 -0
  7. package/documents/Account/update.ts +12 -0
  8. package/documents/Address/addressType.ts +12 -0
  9. package/documents/Address/countries.ts +27 -0
  10. package/documents/Address/create.ts +12 -0
  11. package/documents/Address/delete.ts +7 -0
  12. package/documents/Address/fragments.ts +56 -0
  13. package/documents/Address/index.ts +2 -0
  14. package/documents/Address/interfaces.ts +41 -0
  15. package/documents/Address/update.ts +12 -0
  16. package/documents/Cart/add.ts +64 -0
  17. package/documents/Cart/checkoutRead.ts +88 -0
  18. package/documents/Cart/checkoutSubmit.ts +18 -0
  19. package/documents/Cart/createCartAddress.ts +12 -0
  20. package/documents/Cart/deleteLine.ts +64 -0
  21. package/documents/Cart/fragments.ts +204 -0
  22. package/documents/Cart/interfaces.ts +56 -0
  23. package/documents/Cart/read.ts +44 -0
  24. package/documents/Cart/setOrderEmail.ts +9 -0
  25. package/documents/Cart/shippingMethodRead.ts +44 -0
  26. package/documents/Cart/shippingMethodUpdate.ts +64 -0
  27. package/documents/Cart/submit.ts +18 -0
  28. package/documents/Cart/updateCartAddress.ts +9 -0
  29. package/documents/Cart/updateLine.ts +64 -0
  30. package/documents/Catalog/create.ts +15 -0
  31. package/documents/Catalog/delete.ts +9 -0
  32. package/documents/Catalog/deleteProducts.ts +10 -0
  33. package/documents/Catalog/fragments.ts +80 -0
  34. package/documents/Catalog/interfaces.ts +34 -0
  35. package/documents/Catalog/linkMedia/create.ts +20 -0
  36. package/documents/Catalog/linkMedia/delete.ts +9 -0
  37. package/documents/Catalog/linkMedia/update.ts +11 -0
  38. package/documents/Catalog/linkProduct.ts +12 -0
  39. package/documents/Catalog/list.ts +23 -0
  40. package/documents/Catalog/read.ts +56 -0
  41. package/documents/Catalog/removeProduct.ts +11 -0
  42. package/documents/Catalog/save.ts +17 -0
  43. package/documents/Catalog/statusList.ts +12 -0
  44. package/documents/Catalog/update.ts +15 -0
  45. package/documents/Category/fragments.ts +54 -0
  46. package/documents/Category/interfaces.ts +18 -0
  47. package/documents/Category/list.ts +55 -0
  48. package/documents/MediaLibrary/File/create.ts +44 -0
  49. package/documents/MediaLibrary/File/delete.ts +12 -0
  50. package/documents/MediaLibrary/File/read.ts +36 -0
  51. package/documents/MediaLibrary/File/update.ts +43 -0
  52. package/documents/MediaLibrary/Folder/create.ts +24 -0
  53. package/documents/MediaLibrary/Folder/delete.ts +11 -0
  54. package/documents/MediaLibrary/Folder/read.ts +101 -0
  55. package/documents/MediaLibrary/Folder/update.ts +10 -0
  56. package/documents/MediaLibrary/move.ts +44 -0
  57. package/documents/MediaLibrary/search.ts +84 -0
  58. package/documents/Order/fragments.ts +116 -0
  59. package/documents/Order/index.ts +2 -0
  60. package/documents/Order/interfaces.ts +30 -0
  61. package/documents/Order/list.ts +129 -0
  62. package/documents/Order/read.ts +44 -0
  63. package/documents/Product/facets.ts +34 -0
  64. package/documents/Product/fragments.ts +167 -0
  65. package/documents/Product/getAll.ts +77 -0
  66. package/documents/Product/interfaces.ts +45 -0
  67. package/documents/Product/list.ts +248 -0
  68. package/documents/Product/read.ts +70 -0
  69. package/documents/Product/search.ts +170 -0
  70. package/documents/Review/create.ts +22 -0
  71. package/documents/ServerCache/productIndex.ts +11 -0
  72. package/documents/Session/Customer/init.ts +12 -0
  73. package/documents/Session/Customer/logout.ts +11 -0
  74. package/documents/Session/Customer/read.ts +15 -0
  75. package/documents/Session/fragments.ts +69 -0
  76. package/documents/Session/index.ts +8 -0
  77. package/documents/Session/interfaces.ts +11 -0
  78. package/documents/Session/login.ts +36 -0
  79. package/documents/Session/logout.ts +11 -0
  80. package/documents/Session/read.ts +43 -0
  81. package/documents/Settings/ClearCache/clearcache.ts +10 -0
  82. package/documents/Settings/SystemInformation/index.ts +1 -0
  83. package/documents/Settings/SystemInformation/interfaces.ts +16 -0
  84. package/documents/Settings/SystemInformation/system-information.ts +20 -0
  85. package/documents/Settings/aliases.ts +96 -0
  86. package/documents/Settings/claims.ts +124 -0
  87. package/documents/Settings/contacts.ts +133 -0
  88. package/documents/Settings/index.ts +12 -0
  89. package/documents/Settings/indexes.ts +73 -0
  90. package/documents/Settings/roles.ts +93 -0
  91. package/documents/Settings/settingsGroup.ts +266 -0
  92. package/documents/Settings/users.ts +19 -0
  93. package/documents/Settings/words.ts +115 -0
  94. package/documents/Theme/create.ts +46 -0
  95. package/documents/Theme/delete.ts +9 -0
  96. package/documents/Theme/interfaces.ts +63 -0
  97. package/documents/Theme/read.ts +83 -0
  98. package/documents/User/changePassword.ts +11 -0
  99. package/documents/User/counts.ts +8 -0
  100. package/documents/User/fragments.ts +61 -0
  101. package/documents/User/index.ts +2 -0
  102. package/documents/User/interfaces.ts +29 -0
  103. package/documents/User/read.ts +44 -0
  104. package/documents/User/register.ts +11 -0
  105. package/documents/User/resetPassword.ts +11 -0
  106. package/documents/User/update.ts +44 -0
  107. package/documents/WishList/add.ts +10 -0
  108. package/documents/WishList/create.ts +12 -0
  109. package/documents/WishList/delete.ts +7 -0
  110. package/documents/WishList/deleteLine.ts +7 -0
  111. package/documents/WishList/fragments.ts +98 -0
  112. package/documents/WishList/index.ts +2 -0
  113. package/documents/WishList/interfaces.ts +68 -0
  114. package/documents/WishList/list.ts +136 -0
  115. package/documents/WishList/read.ts +44 -0
  116. package/documents/base/interfaces.ts +34 -0
  117. package/documents/base/logger.ts +20 -0
  118. package/documents/base/pageInfoFragments.ts +25 -0
  119. package/documents/base/refresh-token.ts +15 -0
  120. package/documents/core/Logger/create.ts +64 -0
  121. package/documents/core/Logger/delete.ts +14 -0
  122. package/documents/core/Logger/fragments.ts +55 -0
  123. package/documents/core/Logger/index.ts +2 -0
  124. package/documents/core/Logger/interfaces.ts +39 -0
  125. package/documents/core/Logger/list.ts +56 -0
  126. package/documents/core/Logger/read.ts +44 -0
  127. package/documents/core/Logger/update.ts +64 -0
  128. package/documents/core/SampleData/create.ts +76 -0
  129. package/documents/core/SampleData/delete.ts +14 -0
  130. package/documents/core/SampleData/fragments.ts +48 -0
  131. package/documents/core/SampleData/index.ts +7 -0
  132. package/documents/core/SampleData/interfaces.ts +11 -0
  133. package/documents/core/SampleData/list.ts +233 -0
  134. package/documents/core/SampleData/read.ts +44 -0
  135. package/documents/core/SampleData/update.ts +76 -0
  136. package/documents/core/index.ts +2 -0
  137. package/documents/messages/messages.ts +21 -0
  138. package/package.json +22 -0
@@ -0,0 +1,248 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ import {
4
+ PRODUCT_FRAGMENT_XS,
5
+ PRODUCT_FRAGMENT_SM,
6
+ PRODUCT_FRAGMENT_MD,
7
+ PRODUCT_FRAGMENT_LG,
8
+ ATTRIBUTE_VALUE_FRAGMENT,
9
+ } from "./fragments";
10
+
11
+ const PRODUCT_LIST_XS = gql`
12
+ ${PRODUCT_FRAGMENT_XS}
13
+ query e4ProductListXS(
14
+ $categoryId: ID!
15
+ $categoryFilter: ID
16
+ $top: Int
17
+ $skip: Int
18
+ $sort: String
19
+ $sortDesc: Boolean
20
+ $filters: [ODataFilter]
21
+ ) {
22
+ categoryById(id: $categoryId) {
23
+ id
24
+ name
25
+ displayName
26
+ }
27
+ products(
28
+ categoryId: $categoryFilter
29
+ top: $top
30
+ skip: $skip
31
+ sort: $sort
32
+ sortDesc: $sortDesc
33
+ filters: $filters
34
+ ) {
35
+ resultsReturned
36
+ recordCount
37
+ top
38
+ skip
39
+ selectedSort
40
+ products {
41
+ ...ProductFragmentXS
42
+ }
43
+ }
44
+ }
45
+ `;
46
+
47
+ const PRODUCT_LIST_SM = gql`
48
+ ${PRODUCT_FRAGMENT_SM}
49
+ query e4ProductListSM(
50
+ $categoryId: ID!
51
+ $categoryFilter: ID
52
+ $top: Int
53
+ $skip: Int
54
+ $sort: String
55
+ $sortDesc: Boolean
56
+ $filters: [ODataFilter]
57
+ ) {
58
+ categoryById(id: $categoryId) {
59
+ id
60
+ name
61
+ displayName
62
+ breadcrumb {
63
+ CategoryId
64
+ Name
65
+ seoName
66
+ }
67
+ }
68
+ products(
69
+ categoryId: $categoryFilter
70
+ top: $top
71
+ skip: $skip
72
+ sort: $sort
73
+ sortDesc: $sortDesc
74
+ filters: $filters
75
+ ) {
76
+ resultsReturned
77
+ recordCount
78
+ top
79
+ skip
80
+ selectedSort
81
+ products {
82
+ ...ProductFragmentSM
83
+ }
84
+ }
85
+ }
86
+ `;
87
+
88
+ const PRODUCT_LIST_MD = gql`
89
+ ${PRODUCT_FRAGMENT_MD}
90
+ ${ATTRIBUTE_VALUE_FRAGMENT}
91
+ query e4ProductListMD(
92
+ $categoryId: ID!
93
+ $categoryFilter: ID
94
+ $top: Int
95
+ $skip: Int
96
+ $sort: String
97
+ $sortDesc: Boolean
98
+ $filters: [ODataFilter]
99
+ ) {
100
+ categoryById(id: $categoryId) {
101
+ id
102
+ name
103
+ displayName
104
+ breadcrumb {
105
+ CategoryId
106
+ Name
107
+ seoName
108
+ }
109
+ }
110
+ products(
111
+ categoryId: $categoryFilter
112
+ top: $top
113
+ skip: $skip
114
+ sort: $sort
115
+ sortDesc: $sortDesc
116
+ filters: $filters
117
+ ) {
118
+ resultsReturned
119
+ recordCount
120
+ top
121
+ skip
122
+ selectedSort
123
+ filters {
124
+ id
125
+ displayName
126
+ AttributeId
127
+ AttributeName
128
+ value {
129
+ ...AttributeValueFragment
130
+ }
131
+ }
132
+ products {
133
+ ...ProductFragmentMD
134
+ }
135
+ }
136
+ }
137
+ `;
138
+
139
+ const PRODUCT_LIST_LG = gql`
140
+ ${PRODUCT_FRAGMENT_LG}
141
+ ${ATTRIBUTE_VALUE_FRAGMENT}
142
+ query e4ProductListLG(
143
+ $categoryId: ID!
144
+ $categoryFilter: ID
145
+ $top: Int
146
+ $skip: Int
147
+ $sort: String
148
+ $sortDesc: Boolean
149
+ $filters: [ODataFilter]
150
+ ) {
151
+ categoryById(id: $categoryId) {
152
+ id
153
+ name
154
+ displayName
155
+ breadcrumb {
156
+ CategoryId
157
+ Name
158
+ seoName
159
+ }
160
+ }
161
+ products(
162
+ categoryId: $categoryFilter
163
+ top: $top
164
+ skip: $skip
165
+ sort: $sort
166
+ sortDesc: $sortDesc
167
+ filters: $filters
168
+ ) {
169
+ resultsReturned
170
+ recordCount
171
+ top
172
+ skip
173
+ selectedSort
174
+ filters {
175
+ id
176
+ displayName
177
+ AttributeId
178
+ AttributeName
179
+ value {
180
+ ...AttributeValueFragment
181
+ }
182
+ }
183
+ products {
184
+ ...ProductFragmentLG
185
+ }
186
+ }
187
+ }
188
+ `;
189
+
190
+ const PRODUCTS_BY_SKU = gql`
191
+ query GetProductsByIds($ids: [String!]!) {
192
+ getProductsByIds(ids: $ids) {
193
+ name
194
+ sku
195
+ id
196
+ shortDescription
197
+ uom {
198
+ nodes {
199
+ id
200
+ displayName
201
+ }
202
+ }
203
+ category {
204
+ id
205
+ displayName
206
+ }
207
+ code
208
+ price
209
+ }
210
+ }
211
+ `;
212
+
213
+ const PRODUCT_LIST_GET_ALL = gql`
214
+ query getAllProducts($input: ProductQueryInput) {
215
+ getAllProducts(input: $input) {
216
+ recordCount
217
+ pageInfo {
218
+ top
219
+ skip
220
+ sort
221
+ sortDesc
222
+ search
223
+ }
224
+ nodes {
225
+ id
226
+ masterProductId
227
+ name
228
+ sku
229
+ listPrice
230
+ img {
231
+ id
232
+ alt
233
+ cdnURL
234
+ }
235
+ productStatus {
236
+ id
237
+ name
238
+ }
239
+ productEntity {
240
+ id
241
+ name
242
+ }
243
+ modified
244
+ created
245
+ }
246
+ }
247
+ }
248
+ `;
@@ -0,0 +1,70 @@
1
+ import { gql } from "graphql-request";
2
+ import {
3
+ PRODUCT_FRAGMENT_XS,
4
+ PRODUCT_FRAGMENT_SM,
5
+ PRODUCT_FRAGMENT_MD,
6
+ PRODUCT_FRAGMENT_LG,
7
+ REVIEW_FRAGMENT,
8
+ } from "./fragments";
9
+
10
+ const PRODUCT_READ_XS = gql`
11
+ ${PRODUCT_FRAGMENT_XS}
12
+ query e4ProductReadXS(
13
+ $id: String!
14
+ $productLookupType: ProductLookupType! = CODE
15
+ ) {
16
+ product(id: $id, productLookupType: $productLookupType) {
17
+ ...ProductFragmentXS
18
+ }
19
+ }
20
+ `;
21
+
22
+ const PRODUCT_READ_SM = gql`
23
+ ${PRODUCT_FRAGMENT_SM}
24
+ query e4ProductReadSM(
25
+ $id: String!
26
+ $productLookupType: ProductLookupType! = CODE
27
+ ) {
28
+ product(id: $id, productLookupType: $productLookupType) {
29
+ ...ProductFragmentSM
30
+ }
31
+ }
32
+ `;
33
+
34
+ const PRODUCT_READ_MD = gql`
35
+ ${PRODUCT_FRAGMENT_MD}
36
+ query e4ProductReadMD(
37
+ $id: String!
38
+ $productLookupType: ProductLookupType! = CODE
39
+ ) {
40
+ product(id: $id, productLookupType: $productLookupType) {
41
+ ...ProductFragmentMD
42
+ }
43
+ }
44
+ `;
45
+
46
+ const PRODUCT_READ_LG = gql`
47
+ ${PRODUCT_FRAGMENT_LG}
48
+ query e4ProductReadLG(
49
+ $id: String!
50
+ $productLookupType: ProductLookupType! = CODE
51
+ ) {
52
+ product(id: $id, productLookupType: $productLookupType) {
53
+ ...ProductFragmentLG
54
+ }
55
+ }
56
+ `;
57
+
58
+ // const PRODUCT_READ_W_REVIEWS = gql`
59
+ // ${PRODUCT_FRAGMENT_MD}
60
+ // ${REVIEW_FRAGMENT}
61
+ // query e4ProductReadMD(
62
+ // $id: String!
63
+ // $productLookupType: ProductLookupType! = CODE
64
+ // ) {
65
+ // product(id: $id, productLookupType: $productLookupType) {
66
+ // ...ProductFragmentMD
67
+ // ...ProductReview
68
+ // }
69
+ // }
70
+ // `;
@@ -0,0 +1,170 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ import {
4
+ PRODUCT_FRAGMENT_XS,
5
+ PRODUCT_FRAGMENT_SM,
6
+ PRODUCT_FRAGMENT_MD,
7
+ PRODUCT_FRAGMENT_LG,
8
+ ATTRIBUTE_VALUE_FRAGMENT,
9
+ } from "./fragments";
10
+
11
+ const PRODUCT_SEARCH_XS = gql`
12
+ ${PRODUCT_FRAGMENT_XS}
13
+ query e4ProductSearchXS(
14
+ $search: String
15
+ $top: Int
16
+ $skip: Int
17
+ $sort: String
18
+ $sortDesc: Boolean
19
+ $filters: [ODataFilter]
20
+ ) {
21
+ products(
22
+ search: $search
23
+ top: $top
24
+ skip: $skip
25
+ sort: $sort
26
+ sortDesc: $sortDesc
27
+ filters: $filters
28
+ ) {
29
+ resultsReturned
30
+ recordCount
31
+ top
32
+ skip
33
+ selectedSort
34
+ search
35
+ products {
36
+ ...ProductFragmentXS
37
+ }
38
+ }
39
+ }
40
+ `;
41
+
42
+ const PRODUCT_SEARCH_SM = gql`
43
+ ${PRODUCT_FRAGMENT_SM}
44
+ query e4ProductSearchSM(
45
+ $search: String
46
+ $top: Int
47
+ $skip: Int
48
+ $sort: String
49
+ $sortDesc: Boolean
50
+ $filters: [ODataFilter]
51
+ ) {
52
+ products(
53
+ search: $search
54
+ top: $top
55
+ skip: $skip
56
+ sort: $sort
57
+ sortDesc: $sortDesc
58
+ filters: $filters
59
+ ) {
60
+ resultsReturned
61
+ recordCount
62
+ top
63
+ skip
64
+ selectedSort
65
+ search
66
+ products {
67
+ ...ProductFragmentSM
68
+ }
69
+ }
70
+ }
71
+ `;
72
+
73
+ const PRODUCT_SEARCH_MD = gql`
74
+ ${PRODUCT_FRAGMENT_MD}
75
+ ${ATTRIBUTE_VALUE_FRAGMENT}
76
+ query e4ProductSearchMD(
77
+ $search: String
78
+ $top: Int
79
+ $skip: Int
80
+ $sort: String
81
+ $sortDesc: Boolean
82
+ $filters: [ODataFilter]
83
+ ) {
84
+ products(
85
+ search: $search
86
+ top: $top
87
+ skip: $skip
88
+ sort: $sort
89
+ sortDesc: $sortDesc
90
+ filters: $filters
91
+ ) {
92
+ resultsReturned
93
+ recordCount
94
+ top
95
+ skip
96
+ selectedSort
97
+ search
98
+ filters {
99
+ AttributeId
100
+ AttributeName
101
+ value {
102
+ ...AttributeValueFragment
103
+ }
104
+ }
105
+ products {
106
+ ...ProductFragmentMD
107
+ }
108
+ }
109
+ }
110
+ `;
111
+
112
+ const PRODUCT_SEARCH_LG = gql`
113
+ ${PRODUCT_FRAGMENT_LG}
114
+ ${ATTRIBUTE_VALUE_FRAGMENT}
115
+ query e4ProductSearchLG(
116
+ $search: String
117
+ $top: Int
118
+ $skip: Int
119
+ $sort: String
120
+ $sortDesc: Boolean
121
+ $filters: [ODataFilter]
122
+ ) {
123
+ products(
124
+ search: $search
125
+ top: $top
126
+ skip: $skip
127
+ sort: $sort
128
+ sortDesc: $sortDesc
129
+ filters: $filters
130
+ ) {
131
+ resultsReturned
132
+ recordCount
133
+ top
134
+ skip
135
+ selectedSort
136
+ search
137
+ filters {
138
+ AttributeId
139
+ AttributeName
140
+ value {
141
+ ...AttributeValueFragment
142
+ }
143
+ }
144
+ products {
145
+ ...ProductFragmentLG
146
+ }
147
+ }
148
+ }
149
+ `;
150
+
151
+ const PRODUCT_TYPEAHEAD_SEARCH_MD_WITH_CATEGORY = gql`
152
+ query productTypeaheadSearchByCategory($input: ProductTypeaheadInput) {
153
+ productsTypeAhead(input: $input) {
154
+ id
155
+ code
156
+ sku
157
+ name
158
+ img {
159
+ id
160
+ cdnURL
161
+ alt
162
+ }
163
+ category {
164
+ name
165
+ id
166
+ parentId
167
+ }
168
+ }
169
+ }
170
+ `;
@@ -0,0 +1,22 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ export const REVIEW_CREATE = gql`
4
+ mutation AddReview($review: ReviewForCreation) {
5
+ addReview(review: $review) {
6
+ Body
7
+ ContactId
8
+ Created
9
+ IsVerifiedPurchase
10
+ Modified
11
+ ModifiedBy
12
+ OriginCode
13
+ ProductId
14
+ ProductReviewId
15
+ ProductReviewStatusId
16
+ PurchaseDate
17
+ Rating
18
+ Sort
19
+ Title
20
+ }
21
+ }
22
+ `;
@@ -0,0 +1,11 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ // const SERVER_CACHE_PRODUCT_INDEX = gql`
4
+ // mutation reindex {
5
+ // reindex {
6
+ // index
7
+ // id
8
+ // status
9
+ // }
10
+ // }
11
+ // `;
@@ -0,0 +1,12 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ import { SESSION_FRAGMENT_SM } from "../fragments";
4
+
5
+ const CUSTOMER_INIT_SESSION = gql`
6
+ ${SESSION_FRAGMENT_SM}
7
+ mutation customerInitSession($input: CustomerInitSessionInput!) {
8
+ customerInitSession(input: $input) {
9
+ ...SessionFragmentSM
10
+ }
11
+ }
12
+ `;
@@ -0,0 +1,11 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ const CUSTOMER_SESSION_LOGOUT = gql`
4
+ mutation e4CustomerLogoutSession {
5
+ customerLogout {
6
+ success
7
+ code
8
+ message
9
+ }
10
+ }
11
+ `;
@@ -0,0 +1,15 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ import { SESSION_FRAGMENT_CUSTOMER_WITH_CART } from "../fragments";
4
+
5
+ const SESSION_READ_CUSTOMER = gql`
6
+ ${SESSION_FRAGMENT_CUSTOMER_WITH_CART}
7
+ query e4ReadSessionCustomer(
8
+ $withCart: Boolean = true
9
+ $withSobo: Boolean = true
10
+ ) {
11
+ sessionRead(withCart: $withCart, withSobo: $withSobo) {
12
+ ...SessionFragmentCustomerWithCart
13
+ }
14
+ }
15
+ `;
@@ -0,0 +1,69 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ import { CART_FRAGMENT_MD, CART_FRAGMENT_LG } from "../Cart/fragments";
4
+
5
+ export const SESSION_FRAGMENT_XS = gql`
6
+ fragment SessionFragmentXS on Session {
7
+ id
8
+ user {
9
+ aspNetUserId
10
+ }
11
+ }
12
+ `;
13
+
14
+ export const SESSION_FRAGMENT_SM = gql`
15
+ fragment SessionFragmentSM on Session {
16
+ id
17
+ user {
18
+ aspNetUserId
19
+ firstName
20
+ lastName
21
+ email
22
+ }
23
+ }
24
+ `;
25
+
26
+ export const SESSION_FRAGMENT_MANAGEMENT_WITH_CLAIMS = gql`
27
+ fragment SessionFragmentManagementWithClaims on Session {
28
+ id
29
+ user {
30
+ aspNetUserId
31
+ firstName
32
+ lastName
33
+ email
34
+ claims {
35
+ id
36
+ actionId
37
+ action
38
+ subjectId
39
+ subject
40
+ fieldId
41
+ field
42
+ isCan
43
+ isPassThrough
44
+ claimType
45
+ roleClaimId
46
+ }
47
+ }
48
+ }
49
+ `;
50
+
51
+ export const SESSION_FRAGMENT_CUSTOMER_WITH_CART = gql`
52
+ ${CART_FRAGMENT_LG}
53
+ fragment SessionFragmentCustomerWithCart on Session {
54
+ id
55
+ user {
56
+ aspNetUserId
57
+ firstName
58
+ lastName
59
+ email
60
+ }
61
+ cart @include(if: $withCart) {
62
+ ...e4CartFragmentLG
63
+ }
64
+ soboUser @include(if: $withSobo) {
65
+ firstName
66
+ lastName
67
+ }
68
+ }
69
+ `;
@@ -0,0 +1,8 @@
1
+ export * from "./fragments";
2
+ export * from "./interfaces";
3
+
4
+ import "./read";
5
+ import "./login";
6
+ import "./logout";
7
+ import "./Customer/init";
8
+ import "./Customer/read";
@@ -0,0 +1,11 @@
1
+ export interface LoginInput {
2
+ userName: string;
3
+ password?: string;
4
+ authToken?: string;
5
+ withCart?: boolean;
6
+ withSobo?: boolean;
7
+ }
8
+ export interface CustomerInitSessionInput {
9
+ userName: string;
10
+ authToken: string;
11
+ }
@@ -0,0 +1,36 @@
1
+ import { gql } from "graphql-request"
2
+
3
+ import { SESSION_FRAGMENT_XS, SESSION_FRAGMENT_SM } from './fragments';
4
+
5
+
6
+
7
+ const SESSION_LOGIN_XS = gql`
8
+ ${SESSION_FRAGMENT_XS}
9
+ mutation e4LoginXS($input: LoginInput!) {
10
+ login(input: $input) {
11
+ token
12
+ refreshToken
13
+ session {
14
+ ...SessionFragmentXS
15
+ }
16
+ }
17
+ }
18
+ `;
19
+
20
+ const SESSION_LOGIN_SM = gql`
21
+ ${SESSION_FRAGMENT_SM}
22
+ mutation e4LoginSM($input: LoginInput!) {
23
+ login(input: $input) {
24
+ token
25
+ refreshToken
26
+ session {
27
+ ...SessionFragmentSM
28
+ }
29
+ }
30
+ }
31
+ `;
32
+
33
+
34
+ SESSION_LOGIN_XS,
35
+ SESSION_LOGIN_SM
36
+ });
@@ -0,0 +1,11 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ const SESSION_LOGOUT = gql`
4
+ mutation e4Logout {
5
+ logout {
6
+ success
7
+ code
8
+ message
9
+ }
10
+ }
11
+ `;