@unchainedshop/api 2.0.0-beta6 → 2.0.0-beta8

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 (271) hide show
  1. package/lib/api-index.d.ts +4 -7
  2. package/lib/api-index.js +24 -14
  3. package/lib/api-index.js.map +1 -1
  4. package/lib/context.d.ts +0 -1
  5. package/lib/context.js +0 -11
  6. package/lib/context.js.map +1 -1
  7. package/lib/createGraphQLServer.d.ts +2 -2
  8. package/lib/createGraphQLServer.js +12 -53
  9. package/lib/createGraphQLServer.js.map +1 -1
  10. package/lib/errors.js +8 -3
  11. package/lib/errors.js.map +1 -1
  12. package/lib/express/createApolloMiddleware.d.ts +4 -0
  13. package/lib/express/createApolloMiddleware.js +34 -0
  14. package/lib/express/createApolloMiddleware.js.map +1 -0
  15. package/lib/express/createBulkImportMiddleware.d.ts +2 -0
  16. package/lib/express/createBulkImportMiddleware.js +79 -0
  17. package/lib/express/createBulkImportMiddleware.js.map +1 -0
  18. package/lib/express/createERCMetadataMiddleware.d.ts +3 -0
  19. package/lib/express/createERCMetadataMiddleware.js +56 -0
  20. package/lib/express/createERCMetadataMiddleware.js.map +1 -0
  21. package/lib/express/createSingleSignOnMiddleware.d.ts +6 -0
  22. package/lib/express/createSingleSignOnMiddleware.js +71 -0
  23. package/lib/express/createSingleSignOnMiddleware.js.map +1 -0
  24. package/lib/express/index.d.ts +6 -0
  25. package/lib/express/index.js +27 -0
  26. package/lib/express/index.js.map +1 -0
  27. package/lib/loaders/index.js +50 -0
  28. package/lib/loaders/index.js.map +1 -1
  29. package/lib/resolvers/index.js +1 -1
  30. package/lib/resolvers/index.js.map +1 -1
  31. package/lib/resolvers/mutations/accounts/changePassword.d.ts +0 -2
  32. package/lib/resolvers/mutations/accounts/changePassword.js +2 -2
  33. package/lib/resolvers/mutations/accounts/changePassword.js.map +1 -1
  34. package/lib/resolvers/mutations/accounts/createUser.js +2 -2
  35. package/lib/resolvers/mutations/accounts/createUser.js.map +1 -1
  36. package/lib/resolvers/mutations/accounts/enrollUser.js +1 -1
  37. package/lib/resolvers/mutations/accounts/enrollUser.js.map +1 -1
  38. package/lib/resolvers/mutations/accounts/loginWithPassword.d.ts +0 -1
  39. package/lib/resolvers/mutations/accounts/loginWithPassword.js +3 -3
  40. package/lib/resolvers/mutations/accounts/loginWithPassword.js.map +1 -1
  41. package/lib/resolvers/mutations/accounts/resetPassword.d.ts +0 -1
  42. package/lib/resolvers/mutations/accounts/resetPassword.js +1 -1
  43. package/lib/resolvers/mutations/accounts/resetPassword.js.map +1 -1
  44. package/lib/resolvers/mutations/accounts/setPassword.d.ts +0 -1
  45. package/lib/resolvers/mutations/accounts/setPassword.js +1 -1
  46. package/lib/resolvers/mutations/accounts/setPassword.js.map +1 -1
  47. package/lib/resolvers/mutations/assortments/removeAssortment.js +1 -1
  48. package/lib/resolvers/mutations/assortments/removeAssortment.js.map +1 -1
  49. package/lib/resolvers/mutations/assortments/removeAssortmentFilter.js +1 -1
  50. package/lib/resolvers/mutations/assortments/removeAssortmentFilter.js.map +1 -1
  51. package/lib/resolvers/mutations/assortments/removeAssortmentLink.js +1 -1
  52. package/lib/resolvers/mutations/assortments/removeAssortmentLink.js.map +1 -1
  53. package/lib/resolvers/mutations/assortments/removeAssortmentProduct.js +1 -1
  54. package/lib/resolvers/mutations/assortments/removeAssortmentProduct.js.map +1 -1
  55. package/lib/resolvers/mutations/enrollments/updateEnrollment.d.ts +1 -1
  56. package/lib/resolvers/mutations/filters/removeFilter.js +1 -1
  57. package/lib/resolvers/mutations/filters/removeFilter.js.map +1 -1
  58. package/lib/resolvers/mutations/filters/updateFilter.js +2 -1
  59. package/lib/resolvers/mutations/filters/updateFilter.js.map +1 -1
  60. package/lib/resolvers/mutations/index.d.ts +1 -1
  61. package/lib/resolvers/mutations/pageView.d.ts +1 -1
  62. package/lib/resolvers/mutations/pageView.js +2 -2
  63. package/lib/resolvers/mutations/pageView.js.map +1 -1
  64. package/lib/resolvers/mutations/products/removeProduct.d.ts +1 -1
  65. package/lib/resolvers/mutations/products/removeProduct.js +5 -8
  66. package/lib/resolvers/mutations/products/removeProduct.js.map +1 -1
  67. package/lib/resolvers/queries/products/product.js +1 -1
  68. package/lib/resolvers/queries/products/productCatalogPrices.d.ts +1 -1
  69. package/lib/resolvers/queries/products/productCatalogPrices.js +5 -2
  70. package/lib/resolvers/queries/products/productCatalogPrices.js.map +1 -1
  71. package/lib/resolvers/queries/products/products.js +1 -1
  72. package/lib/resolvers/queries/products/products.js.map +1 -1
  73. package/lib/resolvers/scalars/LowerCaseString.d.ts +1 -1
  74. package/lib/resolvers/scalars/index.d.ts +1 -1
  75. package/lib/resolvers/type/assortment/assortment-filter-types.d.ts +2 -2
  76. package/lib/resolvers/type/assortment/assortment-filter-types.js +13 -6
  77. package/lib/resolvers/type/assortment/assortment-filter-types.js.map +1 -1
  78. package/lib/resolvers/type/assortment/assortment-link-types.d.ts +2 -2
  79. package/lib/resolvers/type/assortment/assortment-link-types.js +14 -6
  80. package/lib/resolvers/type/assortment/assortment-link-types.js.map +1 -1
  81. package/lib/resolvers/type/assortment/assortment-media-types.d.ts +1 -1
  82. package/lib/resolvers/type/assortment/assortment-path-link-types.d.ts +1 -4
  83. package/lib/resolvers/type/assortment/assortment-path-link-types.js +0 -7
  84. package/lib/resolvers/type/assortment/assortment-path-link-types.js.map +1 -1
  85. package/lib/resolvers/type/assortment/assortment-product-types.d.ts +2 -2
  86. package/lib/resolvers/type/assortment/assortment-product-types.js +14 -6
  87. package/lib/resolvers/type/assortment/assortment-product-types.js.map +1 -1
  88. package/lib/resolvers/type/assortment/assortment-types.d.ts +1 -1
  89. package/lib/resolvers/type/bookmark-types.d.ts +1 -1
  90. package/lib/resolvers/type/bookmark-types.js +6 -2
  91. package/lib/resolvers/type/bookmark-types.js.map +1 -1
  92. package/lib/resolvers/type/country-types.d.ts +1 -1
  93. package/lib/resolvers/type/delivery-provider-types.d.ts +1 -1
  94. package/lib/resolvers/type/enrollment/enrollment-delivery-types.d.ts +2 -2
  95. package/lib/resolvers/type/enrollment/enrollment-payment-types.d.ts +2 -2
  96. package/lib/resolvers/type/enrollment/enrollment-period-types.d.ts +2 -2
  97. package/lib/resolvers/type/enrollment/enrollment-plan-tyes.d.ts +2 -2
  98. package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js +6 -2
  99. package/lib/resolvers/type/enrollment/enrollment-plan-tyes.js.map +1 -1
  100. package/lib/resolvers/type/enrollment/enrollment-types.d.ts +2 -2
  101. package/lib/resolvers/type/event-types.d.ts +1 -1
  102. package/lib/resolvers/type/filter/filter-option-types.d.ts +2 -2
  103. package/lib/resolvers/type/filter/filter-types.d.ts +2 -2
  104. package/lib/resolvers/type/order/order-delivery-discount-types.d.ts +1 -1
  105. package/lib/resolvers/type/order/order-delivery-pickup-types.d.ts +1 -1
  106. package/lib/resolvers/type/order/order-delivery-shipping-types.d.ts +1 -1
  107. package/lib/resolvers/type/order/order-discount-types.d.ts +1 -1
  108. package/lib/resolvers/type/order/order-global-discount-types.d.ts +1 -1
  109. package/lib/resolvers/type/order/order-item-discount-types.d.ts +1 -1
  110. package/lib/resolvers/type/order/order-item-types.d.ts +1 -1
  111. package/lib/resolvers/type/order/order-item-types.js +13 -6
  112. package/lib/resolvers/type/order/order-item-types.js.map +1 -1
  113. package/lib/resolvers/type/order/order-payment-card-types.d.ts +1 -1
  114. package/lib/resolvers/type/order/order-payment-discount-types.d.ts +1 -1
  115. package/lib/resolvers/type/order/order-payment-generic-types.d.ts +1 -1
  116. package/lib/resolvers/type/order/order-payment-invoice-types.d.ts +1 -1
  117. package/lib/resolvers/type/order/order-types.d.ts +1 -1
  118. package/lib/resolvers/type/price-types.d.ts +1 -1
  119. package/lib/resolvers/type/product/product-bundle-item-types.js +4 -2
  120. package/lib/resolvers/type/product/product-bundle-item-types.js.map +1 -1
  121. package/lib/resolvers/type/product/product-discount.d.ts +1 -1
  122. package/lib/resolvers/type/product/product-review-types.d.ts +1 -1
  123. package/lib/resolvers/type/product/product-review-types.js +6 -2
  124. package/lib/resolvers/type/product/product-review-types.js.map +1 -1
  125. package/lib/resolvers/type/product/product-tokenized-types.js +1 -0
  126. package/lib/resolvers/type/product/product-tokenized-types.js.map +1 -1
  127. package/lib/resolvers/type/product/product-variation-assignment-types.js +4 -2
  128. package/lib/resolvers/type/product/product-variation-assignment-types.js.map +1 -1
  129. package/lib/resolvers/type/quotation-types.d.ts +2 -2
  130. package/lib/resolvers/type/quotation-types.js +7 -3
  131. package/lib/resolvers/type/quotation-types.js.map +1 -1
  132. package/lib/resolvers/type/shop-types.d.ts +1 -1
  133. package/lib/resolvers/type/token-types.d.ts +1 -1
  134. package/lib/resolvers/type/user-types.d.ts +1 -3
  135. package/lib/resolvers/type/user-types.js +0 -12
  136. package/lib/resolvers/type/user-types.js.map +1 -1
  137. package/lib/resolvers/type/webauthn-credentials-types.d.ts +1 -1
  138. package/lib/resolvers/type/work-types.d.ts +1 -1
  139. package/lib/schema/{types/log.d.ts → directives.d.ts} +0 -0
  140. package/lib/schema/directives.js +15 -0
  141. package/lib/schema/directives.js.map +1 -0
  142. package/lib/schema/index.js +2 -1
  143. package/lib/schema/index.js.map +1 -1
  144. package/lib/schema/inputTypes.js +0 -15
  145. package/lib/schema/inputTypes.js.map +1 -1
  146. package/lib/schema/mutation.js +4 -23
  147. package/lib/schema/mutation.js.map +1 -1
  148. package/lib/schema/query.js +28 -10
  149. package/lib/schema/query.js.map +1 -1
  150. package/lib/schema/types/assortment.js +9 -10
  151. package/lib/schema/types/assortment.js.map +1 -1
  152. package/lib/schema/types/color.js +1 -1
  153. package/lib/schema/types/country.js +1 -1
  154. package/lib/schema/types/currency.js +1 -1
  155. package/lib/schema/types/delivery.js +3 -2
  156. package/lib/schema/types/delivery.js.map +1 -1
  157. package/lib/schema/types/dimensions.js +1 -1
  158. package/lib/schema/types/discount.js +1 -1
  159. package/lib/schema/types/dispatch.js +1 -0
  160. package/lib/schema/types/dispatch.js.map +1 -1
  161. package/lib/schema/types/filter.js +5 -8
  162. package/lib/schema/types/filter.js.map +1 -1
  163. package/lib/schema/types/geo-position.js +1 -1
  164. package/lib/schema/types/language.js +1 -1
  165. package/lib/schema/types/media.js +1 -1
  166. package/lib/schema/types/payment.js +3 -3
  167. package/lib/schema/types/price.js +2 -2
  168. package/lib/schema/types/product/bundle-product.js +2 -3
  169. package/lib/schema/types/product/bundle-product.js.map +1 -1
  170. package/lib/schema/types/product/configurable-product.js +7 -7
  171. package/lib/schema/types/product/plan-product.js +4 -3
  172. package/lib/schema/types/product/plan-product.js.map +1 -1
  173. package/lib/schema/types/product/product.js +11 -11
  174. package/lib/schema/types/product/simple-product.js +5 -4
  175. package/lib/schema/types/product/simple-product.js.map +1 -1
  176. package/lib/schema/types/product/tokenized-product.js +6 -3
  177. package/lib/schema/types/product/tokenized-product.js.map +1 -1
  178. package/lib/schema/types/search.js +3 -8
  179. package/lib/schema/types/search.js.map +1 -1
  180. package/lib/schema/types/shop.js +2 -2
  181. package/lib/schema/types/stock.js +1 -0
  182. package/lib/schema/types/stock.js.map +1 -1
  183. package/lib/schema/types/types.js +1 -1
  184. package/lib/schema/types/user.js +1 -3
  185. package/lib/schema/types/user.js.map +1 -1
  186. package/lib/schema/types/warehousing.js +3 -3
  187. package/package.json +31 -19
  188. package/src/api-index.ts +25 -29
  189. package/src/context.ts +0 -19
  190. package/src/createGraphQLServer.ts +11 -56
  191. package/src/errors.ts +8 -3
  192. package/src/express/createApolloMiddleware.ts +40 -0
  193. package/src/express/createBulkImportMiddleware.ts +90 -0
  194. package/src/express/createERCMetadataMiddleware.ts +72 -0
  195. package/src/express/createSingleSignOnMiddleware.ts +83 -0
  196. package/src/express/index.ts +48 -0
  197. package/src/loaders/index.ts +63 -3
  198. package/src/resolvers/index.ts +1 -1
  199. package/src/resolvers/mutations/accounts/changePassword.ts +2 -4
  200. package/src/resolvers/mutations/accounts/createUser.ts +2 -2
  201. package/src/resolvers/mutations/accounts/enrollUser.ts +1 -1
  202. package/src/resolvers/mutations/accounts/loginWithPassword.ts +3 -4
  203. package/src/resolvers/mutations/accounts/resetPassword.ts +2 -2
  204. package/src/resolvers/mutations/accounts/setPassword.ts +2 -2
  205. package/src/resolvers/mutations/assortments/removeAssortment.ts +1 -1
  206. package/src/resolvers/mutations/assortments/removeAssortmentFilter.ts +1 -1
  207. package/src/resolvers/mutations/assortments/removeAssortmentLink.ts +1 -1
  208. package/src/resolvers/mutations/assortments/removeAssortmentProduct.ts +1 -1
  209. package/src/resolvers/mutations/filters/removeFilter.ts +1 -1
  210. package/src/resolvers/mutations/filters/updateFilter.ts +3 -1
  211. package/src/resolvers/mutations/pageView.ts +2 -2
  212. package/src/resolvers/mutations/products/removeProduct.ts +6 -8
  213. package/src/resolvers/queries/products/product.ts +1 -1
  214. package/src/resolvers/queries/products/productCatalogPrices.ts +5 -2
  215. package/src/resolvers/queries/products/products.ts +1 -1
  216. package/src/resolvers/type/assortment/assortment-filter-types.ts +11 -6
  217. package/src/resolvers/type/assortment/assortment-link-types.ts +12 -6
  218. package/src/resolvers/type/assortment/assortment-path-link-types.ts +0 -11
  219. package/src/resolvers/type/assortment/assortment-product-types.ts +12 -6
  220. package/src/resolvers/type/bookmark-types.ts +7 -2
  221. package/src/resolvers/type/enrollment/enrollment-plan-tyes.ts +6 -2
  222. package/src/resolvers/type/order/order-item-types.ts +13 -6
  223. package/src/resolvers/type/product/product-bundle-item-types.ts +4 -2
  224. package/src/resolvers/type/product/product-review-types.ts +6 -2
  225. package/src/resolvers/type/product/product-tokenized-types.ts +1 -0
  226. package/src/resolvers/type/product/product-variation-assignment-types.ts +4 -2
  227. package/src/resolvers/type/quotation-types.ts +6 -3
  228. package/src/resolvers/type/user-types.ts +0 -15
  229. package/src/schema/directives.js +14 -0
  230. package/src/schema/index.js +2 -1
  231. package/src/schema/inputTypes.js +0 -15
  232. package/src/schema/mutation.js +4 -23
  233. package/src/schema/query.js +28 -10
  234. package/src/schema/types/assortment.js +9 -10
  235. package/src/schema/types/color.js +1 -1
  236. package/src/schema/types/country.js +1 -1
  237. package/src/schema/types/currency.js +1 -1
  238. package/src/schema/types/delivery.js +3 -2
  239. package/src/schema/types/dimensions.js +1 -1
  240. package/src/schema/types/discount.js +1 -1
  241. package/src/schema/types/dispatch.js +1 -0
  242. package/src/schema/types/filter.js +5 -8
  243. package/src/schema/types/geo-position.js +1 -1
  244. package/src/schema/types/language.js +1 -1
  245. package/src/schema/types/media.js +1 -1
  246. package/src/schema/types/payment.js +3 -3
  247. package/src/schema/types/price.js +2 -2
  248. package/src/schema/types/product/bundle-product.js +2 -3
  249. package/src/schema/types/product/configurable-product.js +7 -7
  250. package/src/schema/types/product/plan-product.js +4 -3
  251. package/src/schema/types/product/product.js +11 -11
  252. package/src/schema/types/product/simple-product.js +5 -4
  253. package/src/schema/types/product/tokenized-product.js +6 -3
  254. package/src/schema/types/search.js +3 -8
  255. package/src/schema/types/shop.js +2 -2
  256. package/src/schema/types/stock.js +1 -0
  257. package/src/schema/types/types.js +1 -1
  258. package/src/schema/types/user.js +1 -3
  259. package/src/schema/types/warehousing.js +3 -3
  260. package/tsconfig.json +1 -0
  261. package/lib/createBulkImportServer.d.ts +0 -2
  262. package/lib/createBulkImportServer.js +0 -81
  263. package/lib/createBulkImportServer.js.map +0 -1
  264. package/lib/createERCMetadataServer.d.ts +0 -2
  265. package/lib/createERCMetadataServer.js +0 -59
  266. package/lib/createERCMetadataServer.js.map +0 -1
  267. package/lib/schema/types/log.js +0 -16
  268. package/lib/schema/types/log.js.map +0 -1
  269. package/src/createBulkImportServer.ts +0 -95
  270. package/src/createERCMetadataServer.ts +0 -78
  271. package/src/schema/types/log.js +0 -15
@@ -8,7 +8,6 @@ export default [
8
8
  loginWithPassword(
9
9
  username: String
10
10
  email: String
11
- password: HashedPasswordInput
12
11
  plainPassword: String
13
12
  totpCode: String
14
13
  ): LoginMethodResponse
@@ -31,10 +30,6 @@ export default [
31
30
  createUser(
32
31
  username: String
33
32
  email: String
34
- password: HashedPasswordInput
35
- @deprecated(
36
- reason: "Use plainPassword, there is not a lot of added security by hashing on the client"
37
- )
38
33
  webAuthnPublicKeyCredentials: JSON
39
34
  plainPassword: String
40
35
  profile: UserProfileInput
@@ -50,12 +45,7 @@ export default [
50
45
  """
51
46
  Change the current user's password. Must be logged in.
52
47
  """
53
- changePassword(
54
- oldPassword: HashedPasswordInput
55
- oldPlainPassword: String
56
- newPassword: HashedPasswordInput
57
- newPlainPassword: String
58
- ): SuccessResponse
48
+ changePassword(oldPlainPassword: String, newPlainPassword: String): SuccessResponse
59
49
 
60
50
  """
61
51
  Request a forgot password email.
@@ -65,11 +55,7 @@ export default [
65
55
  """
66
56
  Reset the password for a user using a token received in email. Logs the user in afterwards.
67
57
  """
68
- resetPassword(
69
- newPlainPassword: String
70
- newPassword: HashedPasswordInput
71
- token: String!
72
- ): LoginMethodResponse
58
+ resetPassword(newPlainPassword: String, token: String!): LoginMethodResponse
73
59
 
74
60
  """
75
61
  Log the user out.
@@ -348,12 +334,7 @@ export default [
348
334
  """
349
335
  Enroll a new user, setting enroll to true will let the user choose his password (e-mail gets sent)
350
336
  """
351
- enrollUser(
352
- profile: UserProfileInput!
353
- email: String!
354
- password: HashedPasswordInput
355
- plainPassword: String
356
- ): User
337
+ enrollUser(profile: UserProfileInput!, email: String!, plainPassword: String): User
357
338
 
358
339
  """
359
340
  Forcefully trigger an enrollment email for already added users by e-mail
@@ -368,7 +349,7 @@ export default [
368
349
  """
369
350
  Set a new password for a specific user
370
351
  """
371
- setPassword(newPassword: HashedPasswordInput, newPlainPassword: String, userId: ID!): User
352
+ setPassword(newPlainPassword: String, userId: ID!): User
372
353
 
373
354
  """
374
355
  Set roles of a user
@@ -35,7 +35,7 @@ export default [
35
35
  slugs: [String!]
36
36
  includeDrafts: Boolean = false
37
37
  queryString: String
38
- ): Int!
38
+ ): Int! @cacheControl(maxAge: 180)
39
39
 
40
40
  """
41
41
  Simple list of published products filtered either by tags or explicit slugs
@@ -60,16 +60,18 @@ export default [
60
60
  List products specified prices
61
61
  """
62
62
  productCatalogPrices(productId: ID!): [ProductCatalogPrice!]!
63
+ @cacheControl(scope: PRIVATE, maxAge: 0)
63
64
 
64
65
  """
65
66
  Localization: Meta data for product
66
67
  """
67
- translatedProductTexts(productId: ID!): [ProductTexts!]!
68
+ translatedProductTexts(productId: ID!): [ProductTexts!]! @cacheControl(scope: PRIVATE, maxAge: 0)
68
69
 
69
70
  """
70
71
  Localization: Media title/subtitle of a media that is attached to a product
71
72
  """
72
73
  translatedProductMediaTexts(productMediaId: ID!): [ProductMediaTexts!]!
74
+ @cacheControl(scope: PRIVATE, maxAge: 0)
73
75
 
74
76
  """
75
77
  Localization: Variations and Variation Options
@@ -77,12 +79,13 @@ export default [
77
79
  translatedProductVariationTexts(
78
80
  productVariationId: ID!
79
81
  productVariationOptionValue: String
80
- ): [ProductVariationTexts!]!
82
+ ): [ProductVariationTexts!]! @cacheControl(scope: PRIVATE, maxAge: 0)
81
83
 
82
84
  """
83
85
  Returns total number languages
84
86
  """
85
87
  languagesCount(includeInactive: Boolean = false, queryString: String): Int!
88
+ @cacheControl(maxAge: 180)
86
89
 
87
90
  """
88
91
  Get all languages
@@ -115,6 +118,7 @@ export default [
115
118
  Returns total number of countries
116
119
  """
117
120
  countriesCount(includeInactive: Boolean = false, queryString: String): Int!
121
+ @cacheControl(maxAge: 180)
118
122
 
119
123
  """
120
124
  Get a specific country by ID
@@ -125,6 +129,7 @@ export default [
125
129
  Returns total number of currencies
126
130
  """
127
131
  currenciesCount(includeInactive: Boolean = false, queryString: String): Int!
132
+ @cacheControl(maxAge: 180)
128
133
 
129
134
  """
130
135
  Get all currencies
@@ -145,42 +150,49 @@ export default [
145
150
  """
146
151
  Returns total number of delivery providers, optionally filtered by type
147
152
  """
148
- deliveryProvidersCount(type: DeliveryProviderType): Int!
153
+ deliveryProvidersCount(type: DeliveryProviderType): Int! @cacheControl(scope: PRIVATE, maxAge: 0)
149
154
 
150
155
  """
151
156
  Get all delivery providers, optionally filtered by type
152
157
  """
153
158
  deliveryProviders(type: DeliveryProviderType): [DeliveryProvider!]!
159
+ @cacheControl(scope: PRIVATE, maxAge: 0)
154
160
 
155
161
  """
156
162
  Get a specific delivery provider by ID
157
163
  """
158
164
  deliveryProvider(deliveryProviderId: ID!): DeliveryProvider
165
+ @cacheControl(scope: PRIVATE, maxAge: 0)
159
166
 
160
167
  """
161
168
  Get all delivery interfaces filtered by type
162
169
  """
163
170
  deliveryInterfaces(type: DeliveryProviderType!): [DeliveryInterface!]!
171
+ @cacheControl(scope: PRIVATE, maxAge: 0)
164
172
 
165
173
  """
166
174
  Returns total number of delivery providers, optionally filtered by type
167
175
  """
168
176
  warehousingProvidersCount(type: WarehousingProviderType): Int!
177
+ @cacheControl(scope: PRIVATE, maxAge: 0)
169
178
 
170
179
  """
171
180
  Get all warehousing providers, optionally filtered by type
172
181
  """
173
182
  warehousingProviders(type: WarehousingProviderType): [WarehousingProvider!]!
183
+ @cacheControl(scope: PRIVATE, maxAge: 0)
174
184
 
175
185
  """
176
186
  Get a specific warehousing provider by ID
177
187
  """
178
188
  warehousingProvider(warehousingProviderId: ID!): WarehousingProvider
189
+ @cacheControl(scope: PRIVATE, maxAge: 0)
179
190
 
180
191
  """
181
192
  Get all warehousing interfaces filtered by type
182
193
  """
183
194
  warehousingInterfaces(type: WarehousingProviderType!): [WarehousingInterface!]!
195
+ @cacheControl(scope: PRIVATE, maxAge: 0)
184
196
 
185
197
  """
186
198
  Get token
@@ -190,22 +202,24 @@ export default [
190
202
  """
191
203
  Returns total number of payment providers, optionally filtered by type
192
204
  """
193
- paymentProvidersCount(type: PaymentProviderType): Int!
205
+ paymentProvidersCount(type: PaymentProviderType): Int! @cacheControl(scope: PRIVATE, maxAge: 0)
194
206
 
195
207
  """
196
208
  Get all payment providers, optionally filtered by type
197
209
  """
198
210
  paymentProviders(type: PaymentProviderType): [PaymentProvider!]!
211
+ @cacheControl(scope: PRIVATE, maxAge: 0)
199
212
 
200
213
  """
201
214
  Get a specific payment provider by ID
202
215
  """
203
- paymentProvider(paymentProviderId: ID!): PaymentProvider
216
+ paymentProvider(paymentProviderId: ID!): PaymentProvider @cacheControl(scope: PRIVATE, maxAge: 0)
204
217
 
205
218
  """
206
219
  Get all payment interfaces filtered by type
207
220
  """
208
221
  paymentInterfaces(type: PaymentProviderType!): [PaymentInterface!]!
222
+ @cacheControl(scope: PRIVATE, maxAge: 0)
209
223
 
210
224
  """
211
225
  Returns total number of orders
@@ -256,7 +270,7 @@ export default [
256
270
  includeInactive: Boolean = false
257
271
  includeLeaves: Boolean = false
258
272
  queryString: String
259
- ): Int!
273
+ ): Int! @cacheControl(maxAge: 180)
260
274
 
261
275
  """
262
276
  Get a specific assortment by ID
@@ -267,21 +281,25 @@ export default [
267
281
  Localization: Meta data for assortments
268
282
  """
269
283
  translatedAssortmentTexts(assortmentId: ID!): [AssortmentTexts!]!
284
+ @cacheControl(scope: PRIVATE, maxAge: 0)
270
285
 
271
286
  """
272
287
  Localization: Media title/subtitle of a media that is attached to a assortment
273
288
  """
274
289
  translatedAssortmentMediaTexts(assortmentMediaId: ID!): [AssortmentMediaTexts!]!
290
+ @cacheControl(scope: PRIVATE, maxAge: 0)
275
291
 
276
292
  """
277
293
  Localization: Filters and Filter Options
278
294
  """
279
295
  translatedFilterTexts(filterId: ID!, filterOptionValue: String): [FilterTexts!]!
296
+ @cacheControl(scope: PRIVATE, maxAge: 0)
280
297
 
281
298
  """
282
299
  Returns total number of filters
283
300
  """
284
301
  filtersCount(includeInactive: Boolean = false, queryString: String): Int!
302
+ @cacheControl(maxAge: 180)
285
303
 
286
304
  """
287
305
  Get all filters
@@ -302,7 +320,7 @@ export default [
302
320
  """
303
321
  Returns total number of product reviews
304
322
  """
305
- productReviewsCount(queryString: String): Int!
323
+ productReviewsCount(queryString: String): Int! @cacheControl(scope: PRIVATE, maxAge: 0)
306
324
 
307
325
  """
308
326
  Get all product reviews
@@ -312,12 +330,12 @@ export default [
312
330
  offset: Int = 0
313
331
  sort: [SortOptionInput!]
314
332
  queryString: String
315
- ): [ProductReview!]!
333
+ ): [ProductReview!]! @cacheControl(scope: PRIVATE, maxAge: 0)
316
334
 
317
335
  """
318
336
  Get a specific product review by ID
319
337
  """
320
- productReview(productReviewId: ID!): ProductReview!
338
+ productReview(productReviewId: ID!): ProductReview! @cacheControl(scope: PRIVATE, maxAge: 0)
321
339
 
322
340
  """
323
341
  Returns total number of quotations
@@ -1,13 +1,13 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type AssortmentMediaTexts {
3
+ type AssortmentMediaTexts @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  locale: String
6
6
  title: String
7
7
  subtitle: String
8
8
  }
9
9
 
10
- type AssortmentMedia {
10
+ type AssortmentMedia @cacheControl(maxAge: 180) {
11
11
  _id: ID!
12
12
  tags: [LowerCaseString!]
13
13
  file: Media!
@@ -18,7 +18,7 @@ export default [
18
18
  """
19
19
  Assortment
20
20
  """
21
- type Assortment {
21
+ type Assortment @cacheControl(maxAge: 180) {
22
22
  _id: ID!
23
23
  created: DateTime
24
24
  updated: DateTime
@@ -47,7 +47,7 @@ export default [
47
47
  """
48
48
  Directed assortment to product paths (breadcrumbs)
49
49
  """
50
- type AssortmentPath {
50
+ type AssortmentPath @cacheControl(maxAge: 180) {
51
51
  links: [AssortmentPathLink!]!
52
52
  }
53
53
 
@@ -56,14 +56,13 @@ export default [
56
56
  assortmentId and assortmentTexts are there for convenience
57
57
  to short-circuit breadcrumb lookups
58
58
  """
59
- type AssortmentPathLink {
59
+ type AssortmentPathLink @cacheControl(maxAge: 180) {
60
60
  assortmentId: ID!
61
- assortmentSlug: String! @deprecated(reason: "Please use assortmentTexts")
62
61
  assortmentTexts(forceLocale: String): AssortmentTexts!
63
62
  link: AssortmentLink
64
63
  }
65
64
 
66
- type AssortmentProduct {
65
+ type AssortmentProduct @cacheControl(maxAge: 180) {
67
66
  _id: ID!
68
67
  sortKey: Int!
69
68
  tags: [LowerCaseString!]
@@ -71,7 +70,7 @@ export default [
71
70
  product: Product!
72
71
  }
73
72
 
74
- type AssortmentFilter {
73
+ type AssortmentFilter @cacheControl(maxAge: 180) {
75
74
  _id: ID!
76
75
  sortKey: Int!
77
76
  tags: [LowerCaseString!]
@@ -79,7 +78,7 @@ export default [
79
78
  filter: Filter!
80
79
  }
81
80
 
82
- type AssortmentLink {
81
+ type AssortmentLink @cacheControl(maxAge: 180) {
83
82
  _id: ID!
84
83
  sortKey: Int!
85
84
  tags: [LowerCaseString!]
@@ -87,7 +86,7 @@ export default [
87
86
  child: Assortment!
88
87
  }
89
88
 
90
- type AssortmentTexts {
89
+ type AssortmentTexts @cacheControl(maxAge: 180) {
91
90
  _id: ID!
92
91
  locale: String
93
92
  slug: String
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type Color {
3
+ type Color @cacheControl(maxAge: 180) {
4
4
  name: String
5
5
  hex: String
6
6
  red: Int
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type Country {
3
+ type Country @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  """
6
6
  ISO 3166-1 alpha-2 https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type Currency {
3
+ type Currency @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  isoCode: String!
6
6
  isActive: Boolean
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type DeliveryInterface {
3
+ type DeliveryInterface @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  label: String
6
6
  version: String
@@ -25,7 +25,7 @@ export default [
25
25
  WRONG_CREDENTIALS
26
26
  }
27
27
 
28
- type DeliveryProvider {
28
+ type DeliveryProvider @cacheControl(maxAge: 60) {
29
29
  _id: ID!
30
30
  created: DateTime
31
31
  updated: DateTime
@@ -36,6 +36,7 @@ export default [
36
36
  configurationError: DeliveryProviderError
37
37
  isActive: Boolean
38
38
  simulatedPrice(currency: String, useNetPrice: Boolean = false, orderId: ID, context: JSON): Price
39
+ @cacheControl(scope: PRIVATE, maxAge: 10)
39
40
  }
40
41
  `,
41
42
  ];
@@ -12,7 +12,7 @@ export default [
12
12
  MILLIMETERS
13
13
  }
14
14
 
15
- type Dimensions {
15
+ type Dimensions @cacheControl(maxAge: 180) {
16
16
  weight(unit: MassUnit = KILOGRAM): Float
17
17
  length(unit: LengthUnit = METERS): Float
18
18
  width(unit: LengthUnit = METERS): Float
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type DiscountInterface {
3
+ type DiscountInterface @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  label: String
6
6
  version: String
@@ -1,3 +1,4 @@
1
+ // TODO: Cache?
1
2
  export default [
2
3
  /* GraphQL */ `
3
4
  type Dispatch {
@@ -22,20 +22,20 @@ export default [
22
22
  RANGE
23
23
  }
24
24
 
25
- type FilterTexts {
25
+ type FilterTexts @cacheControl(maxAge: 180) {
26
26
  _id: ID!
27
27
  locale: String
28
28
  title: String
29
29
  subtitle: String
30
30
  }
31
31
 
32
- type FilterOption {
32
+ type FilterOption @cacheControl(maxAge: 180) {
33
33
  _id: ID!
34
34
  texts(forceLocale: String): FilterTexts
35
35
  value: String
36
36
  }
37
37
 
38
- type Filter {
38
+ type Filter @cacheControl(maxAge: 180) {
39
39
  _id: ID!
40
40
  updated: DateTime
41
41
  created: DateTime
@@ -46,17 +46,14 @@ export default [
46
46
  options: [FilterOption!]
47
47
  }
48
48
 
49
- type LoadedFilterOption {
50
- filteredProducts: Int! @deprecated(reason: "Renamed, use the filteredProductsCount field")
49
+ type LoadedFilterOption @cacheControl(maxAge: 180) {
51
50
  filteredProductsCount: Int!
52
51
  definition: FilterOption!
53
52
  isSelected: Boolean
54
53
  }
55
54
 
56
- type LoadedFilter {
57
- examinedProducts: Int! @deprecated(reason: "Renamed, use the productsCount field")
55
+ type LoadedFilter @cacheControl(maxAge: 180) {
58
56
  productsCount: Int!
59
- filteredProducts: Int! @deprecated(reason: "Renamed, use the filteredProductsCount field")
60
57
  filteredProductsCount: Int!
61
58
  definition: Filter!
62
59
  isSelected: Boolean
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type GeoPosition {
3
+ type GeoPosition @cacheControl(maxAge: 180) {
4
4
  latitude: Float!
5
5
  longitude: Float!
6
6
  altitute: Float
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type Language {
3
+ type Language @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  """
6
6
  ISO 639-1 alpha-2 https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type Media {
3
+ type Media @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  name: String!
6
6
  type: String!
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type PaymentInterface {
3
+ type PaymentInterface @cacheControl(maxAge: 180) {
4
4
  _id: ID!
5
5
  label: String
6
6
  version: String
@@ -30,7 +30,7 @@ export default [
30
30
  WRONG_CREDENTIALS
31
31
  }
32
32
 
33
- type PaymentCredentials {
33
+ type PaymentCredentials @cacheControl(maxAge: 0, scope: PRIVATE) {
34
34
  _id: ID!
35
35
  user: User!
36
36
  paymentProvider: PaymentProvider!
@@ -40,7 +40,7 @@ export default [
40
40
  isPreferred: Boolean!
41
41
  }
42
42
 
43
- type PaymentProvider {
43
+ type PaymentProvider @cacheControl(maxAge: 60) {
44
44
  _id: ID!
45
45
  created: DateTime
46
46
  updated: DateTime
@@ -1,6 +1,6 @@
1
1
  export default [
2
2
  /* GraphQL */ `
3
- type Price {
3
+ type Price @cacheControl(maxAge: 60) {
4
4
  _id: ID!
5
5
  isTaxable: Boolean!
6
6
  isNetPrice: Boolean!
@@ -8,7 +8,7 @@ export default [
8
8
  currency: String!
9
9
  }
10
10
 
11
- type PriceRange {
11
+ type PriceRange @cacheControl(maxAge: 60) {
12
12
  _id: ID!
13
13
  minPrice: Price!
14
14
  maxPrice: Price!
@@ -3,7 +3,7 @@ export default [
3
3
  """
4
4
  A Bundle product consists of multiple configured products
5
5
  """
6
- type BundleProduct implements Product {
6
+ type BundleProduct implements Product @cacheControl(maxAge: 180) {
7
7
  _id: ID!
8
8
  sequence: Int!
9
9
  status: ProductStatus!
@@ -20,7 +20,6 @@ export default [
20
20
  sort: [SortOptionInput!]
21
21
  queryString: String
22
22
  ): [ProductReview!]!
23
-
24
23
  assortmentPaths: [ProductAssortmentPath!]!
25
24
  siblings(
26
25
  assortmentId: ID
@@ -30,7 +29,7 @@ export default [
30
29
  ): [Product!]!
31
30
  }
32
31
 
33
- type ProductBundleItem {
32
+ type ProductBundleItem @cacheControl(maxAge: 180) {
34
33
  product: Product!
35
34
  quantity: Int!
36
35
  configuration: [ProductConfigurationParameter!]
@@ -12,20 +12,20 @@ export default [
12
12
  TEXT
13
13
  }
14
14
 
15
- type ProductVariationTexts {
15
+ type ProductVariationTexts @cacheControl(maxAge: 180) {
16
16
  _id: ID!
17
17
  locale: String
18
18
  title: String
19
19
  subtitle: String
20
20
  }
21
21
 
22
- type ProductVariationOption {
22
+ type ProductVariationOption @cacheControl(maxAge: 180) {
23
23
  _id: ID!
24
24
  texts(forceLocale: String): ProductVariationTexts
25
25
  value: String
26
26
  }
27
27
 
28
- type ProductVariation {
28
+ type ProductVariation @cacheControl(maxAge: 180) {
29
29
  _id: ID!
30
30
  texts(forceLocale: String): ProductVariationTexts
31
31
  type: ProductVariationType
@@ -36,7 +36,7 @@ export default [
36
36
  """
37
37
  Key Value Combination
38
38
  """
39
- type ProductVariationAssignmentVector {
39
+ type ProductVariationAssignmentVector @cacheControl(maxAge: 180) {
40
40
  _id: ID!
41
41
  variation: ProductVariation
42
42
  option: ProductVariationOption
@@ -45,7 +45,7 @@ export default [
45
45
  """
46
46
  Key Value Combination to Product Assignment
47
47
  """
48
- type ProductVariationAssignment {
48
+ type ProductVariationAssignment @cacheControl(maxAge: 180) {
49
49
  _id: ID!
50
50
 
51
51
  """
@@ -62,7 +62,7 @@ export default [
62
62
  """
63
63
  Configurable Product (Proxy)
64
64
  """
65
- type ConfigurableProduct implements Product {
65
+ type ConfigurableProduct implements Product @cacheControl(maxAge: 180) {
66
66
  _id: ID!
67
67
  sequence: Int!
68
68
  status: ProductStatus!
@@ -97,7 +97,7 @@ export default [
97
97
  includeInactive: Boolean = false
98
98
  currency: String
99
99
  useNetPrice: Boolean = false
100
- ): PriceRange
100
+ ): PriceRange @cacheControl(scope: PRIVATE)
101
101
 
102
102
  """
103
103
  Reduced list of possible products by key/value combinations
@@ -13,7 +13,7 @@ export default [
13
13
  METERED
14
14
  }
15
15
 
16
- type ProductPlanConfiguration {
16
+ type ProductPlanConfiguration @cacheControl(maxAge: 180) {
17
17
  usageCalculationType: ProductPlanUsageCalculationType!
18
18
  billingInterval: ProductPlanConfigurationInterval!
19
19
  billingIntervalCount: Int
@@ -32,7 +32,7 @@ export default [
32
32
  """
33
33
  Plan (Virtual Product that somebody can enroll to)
34
34
  """
35
- type PlanProduct implements Product {
35
+ type PlanProduct implements Product @cacheControl(maxAge: 180) {
36
36
  _id: ID!
37
37
  sequence: Int!
38
38
  status: ProductStatus!
@@ -45,7 +45,8 @@ export default [
45
45
  catalogPrice(quantity: Int = 1, currency: String): Price
46
46
  leveledCatalogPrices(currency: String): [PriceLevel!]!
47
47
  simulatedPrice(currency: String, useNetPrice: Boolean = false, quantity: Int = 1): Price
48
- simulatedDiscounts(quantity: Int = 1): [ProductDiscount!]
48
+ @cacheControl(scope: PRIVATE)
49
+ simulatedDiscounts(quantity: Int = 1): [ProductDiscount!] @cacheControl(scope: PRIVATE)
49
50
  assortmentPaths(forceLocale: String): [ProductAssortmentPath!]!
50
51
  siblings(
51
52
  assortmentId: ID