@labdigital/commercetools-mock 0.5.12 → 0.5.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.
Files changed (107) hide show
  1. package/README.md +6 -2
  2. package/dist/commercetools-mock.cjs.development.js +3153 -1689
  3. package/dist/commercetools-mock.cjs.development.js.map +1 -1
  4. package/dist/commercetools-mock.cjs.production.min.js +1 -1
  5. package/dist/commercetools-mock.cjs.production.min.js.map +1 -1
  6. package/dist/commercetools-mock.esm.js +3153 -1689
  7. package/dist/commercetools-mock.esm.js.map +1 -1
  8. package/dist/ctMock.d.ts +1 -0
  9. package/dist/lib/masking.d.ts +1 -0
  10. package/dist/repositories/abstract.d.ts +10 -7
  11. package/dist/repositories/cart-discount.d.ts +9 -0
  12. package/dist/repositories/cart.d.ts +16 -3
  13. package/dist/repositories/category.d.ts +18 -0
  14. package/dist/repositories/channel.d.ts +6 -0
  15. package/dist/repositories/custom-object.d.ts +2 -2
  16. package/dist/repositories/customer-group.d.ts +11 -0
  17. package/dist/repositories/customer.d.ts +2 -2
  18. package/dist/repositories/discount-code.d.ts +8 -0
  19. package/dist/repositories/errors.d.ts +2 -2
  20. package/dist/repositories/extension.d.ts +8 -0
  21. package/dist/repositories/inventory-entry.d.ts +2 -2
  22. package/dist/repositories/order.d.ts +2 -2
  23. package/dist/repositories/payment.d.ts +4 -3
  24. package/dist/repositories/product-projection.d.ts +2 -2
  25. package/dist/repositories/product-type.d.ts +5 -4
  26. package/dist/repositories/product.d.ts +2 -2
  27. package/dist/repositories/project.d.ts +8 -0
  28. package/dist/repositories/shipping-method.d.ts +7 -5
  29. package/dist/repositories/shopping-list.d.ts +2 -2
  30. package/dist/repositories/state.d.ts +5 -4
  31. package/dist/repositories/store.d.ts +6 -3
  32. package/dist/repositories/subscription.d.ts +6 -0
  33. package/dist/repositories/tax-category.d.ts +6 -5
  34. package/dist/repositories/type.d.ts +5 -3
  35. package/dist/repositories/zone.d.ts +8 -0
  36. package/dist/services/abstract.d.ts +4 -3
  37. package/dist/services/cart-discount.d.ts +9 -0
  38. package/dist/services/category.d.ts +9 -0
  39. package/dist/services/channel.d.ts +9 -0
  40. package/dist/services/customer-group.d.ts +9 -0
  41. package/dist/services/discount-code.d.ts +9 -0
  42. package/dist/services/extension.d.ts +9 -0
  43. package/dist/services/my-cart.d.ts +11 -0
  44. package/dist/services/project.d.ts +11 -0
  45. package/dist/services/subscription.d.ts +9 -0
  46. package/dist/services/zone.d.ts +9 -0
  47. package/dist/storage.d.ts +12 -1
  48. package/dist/types.d.ts +2 -1
  49. package/package.json +20 -20
  50. package/src/ctMock.ts +44 -17
  51. package/src/lib/masking.ts +22 -0
  52. package/src/oauth/server.ts +3 -1
  53. package/src/repositories/abstract.ts +47 -33
  54. package/src/repositories/cart-discount.ts +140 -0
  55. package/src/repositories/cart.ts +247 -3
  56. package/src/repositories/category.ts +140 -0
  57. package/src/repositories/channel.ts +23 -0
  58. package/src/repositories/custom-object.ts +2 -2
  59. package/src/repositories/customer-group.ts +42 -0
  60. package/src/repositories/customer.ts +2 -2
  61. package/src/repositories/discount-code.ts +143 -0
  62. package/src/repositories/errors.ts +7 -2
  63. package/src/repositories/extension.ts +65 -0
  64. package/src/repositories/inventory-entry.ts +2 -2
  65. package/src/repositories/order.ts +2 -2
  66. package/src/repositories/payment.ts +10 -6
  67. package/src/repositories/product-projection.ts +2 -2
  68. package/src/repositories/product-type.ts +57 -4
  69. package/src/repositories/product.ts +4 -2
  70. package/src/repositories/project.ts +156 -0
  71. package/src/repositories/shipping-method.ts +149 -13
  72. package/src/repositories/shopping-list.ts +2 -2
  73. package/src/repositories/state.ts +48 -4
  74. package/src/repositories/store.ts +69 -4
  75. package/src/repositories/subscription.ts +50 -0
  76. package/src/repositories/tax-category.ts +80 -6
  77. package/src/repositories/type.ts +133 -3
  78. package/src/repositories/zone.ts +77 -0
  79. package/src/server.ts +6 -1
  80. package/src/services/abstract.ts +26 -18
  81. package/src/services/cart-discount.ts +17 -0
  82. package/src/services/cart.test.ts +314 -3
  83. package/src/services/category.test.ts +37 -0
  84. package/src/services/category.ts +17 -0
  85. package/src/services/channel.ts +17 -0
  86. package/src/services/custom-object.test.ts +3 -3
  87. package/src/services/customer-group.ts +17 -0
  88. package/src/services/discount-code.ts +17 -0
  89. package/src/services/extension.ts +17 -0
  90. package/src/services/inventory-entry.test.ts +3 -3
  91. package/src/services/my-cart.test.ts +93 -0
  92. package/src/services/my-cart.ts +44 -0
  93. package/src/services/my-payment.test.ts +2 -2
  94. package/src/services/order.test.ts +4 -4
  95. package/src/services/payment.test.ts +2 -2
  96. package/src/services/product-projection.test.ts +12 -5
  97. package/src/services/product-type.test.ts +2 -2
  98. package/src/services/product.test.ts +6 -2
  99. package/src/services/project.ts +42 -0
  100. package/src/services/shipping-method.test.ts +3 -3
  101. package/src/services/state.test.ts +2 -2
  102. package/src/services/store.test.ts +60 -0
  103. package/src/services/subscription.ts +17 -0
  104. package/src/services/tax-category.test.ts +3 -3
  105. package/src/services/zone.ts +17 -0
  106. package/src/storage.ts +99 -1
  107. package/src/types.ts +2 -1
@@ -21,7 +21,7 @@ describe('Order Query', () => {
21
21
  },
22
22
  },
23
23
  })
24
- expect(response.status).toBe(200)
24
+ expect(response.status).toBe(201)
25
25
  const cart = response.body
26
26
 
27
27
  response = await supertest(ctMock.app)
@@ -33,7 +33,7 @@ describe('Order Query', () => {
33
33
  },
34
34
  orderNumber: 'foobar',
35
35
  })
36
- expect(response.status).toBe(200)
36
+ expect(response.status).toBe(201)
37
37
  order = response.body
38
38
  })
39
39
 
@@ -279,7 +279,7 @@ describe('Order Update Actions', () => {
279
279
  .send({
280
280
  currency: 'EUR',
281
281
  })
282
- expect(response.status).toBe(200)
282
+ expect(response.status).toBe(201)
283
283
  const cart = response.body
284
284
 
285
285
  response = await supertest(ctMock.app)
@@ -290,7 +290,7 @@ describe('Order Update Actions', () => {
290
290
  id: cart.id,
291
291
  },
292
292
  })
293
- expect(response.status).toBe(200)
293
+ expect(response.status).toBe(201)
294
294
  order = response.body
295
295
  })
296
296
 
@@ -15,7 +15,7 @@ describe('Payment', () => {
15
15
  },
16
16
  resourceTypeIds: ['payment'],
17
17
  })
18
- expect(response.status).toBe(200)
18
+ expect(response.status).toBe(201)
19
19
  })
20
20
 
21
21
  test('Create payment', async () => {
@@ -32,7 +32,7 @@ describe('Payment', () => {
32
32
  .post('/dummy/payments')
33
33
  .send(draft)
34
34
 
35
- expect(response.status).toBe(200)
35
+ expect(response.status).toBe(201)
36
36
  expect(response.body).toEqual({
37
37
  id: expect.anything(),
38
38
  createdAt: expect.anything(),
@@ -1,8 +1,4 @@
1
- import {
2
- Product,
3
- ProductDraft,
4
- ProductProjection,
5
- } from '@commercetools/platform-sdk'
1
+ import { ProductDraft, ProductProjection } from '@commercetools/platform-sdk'
6
2
  import supertest from 'supertest'
7
3
  import { CommercetoolsMock } from '../index'
8
4
  import * as qs from 'querystring'
@@ -60,6 +56,17 @@ describe('Product Projection', () => {
60
56
  })
61
57
  })
62
58
 
59
+ test('Get product projection by 404 when not found by key with expand', async () => {
60
+ const response = await supertest(ctMock.app).get(
61
+ '/dummy/product-projections/key=DOESNOTEXIST?' +
62
+ qs.stringify({
63
+ expand: ['categories[*]'],
64
+ })
65
+ )
66
+
67
+ expect(response.status).toBe(404)
68
+ })
69
+
63
70
  test('Search product projection', async () => {
64
71
  ctMock.project('dummy').add('product-projection', {
65
72
  id: '',
@@ -22,7 +22,7 @@ describe('Product type', () => {
22
22
  .post('/dummy/product-types')
23
23
  .send(draft)
24
24
 
25
- expect(response.status).toBe(200)
25
+ expect(response.status).toBe(201)
26
26
 
27
27
  expect(response.body).toEqual({
28
28
  attributes: [
@@ -58,7 +58,7 @@ describe('Product type', () => {
58
58
  .post('/dummy/product-types')
59
59
  .send(draft)
60
60
 
61
- expect(createResponse.status).toBe(200)
61
+ expect(createResponse.status).toBe(201)
62
62
 
63
63
  const response = await supertest(ctMock.app).get(
64
64
  `/dummy/product-types/${createResponse.body.id}`
@@ -1,4 +1,8 @@
1
- import { Product, ProductDraft } from '@commercetools/platform-sdk'
1
+ import {
2
+ CentPrecisionMoney,
3
+ Product,
4
+ ProductDraft,
5
+ } from '@commercetools/platform-sdk'
2
6
  import supertest from 'supertest'
3
7
  import { CommercetoolsMock } from '../index'
4
8
  import assert from 'assert'
@@ -88,7 +92,7 @@ describe('Product update actions', () => {
88
92
  .post('/dummy/products')
89
93
  .send(draft)
90
94
 
91
- expect(response.status).toBe(200)
95
+ expect(response.status).toBe(201)
92
96
  product = response.body
93
97
  })
94
98
 
@@ -0,0 +1,42 @@
1
+ import { Router } from 'express'
2
+ import { Request, Response } from 'express'
3
+ import { AbstractStorage } from '../storage'
4
+ import { ProjectRepository } from '../repositories/project'
5
+ import { Update } from '@commercetools/platform-sdk'
6
+
7
+ export class ProjectService {
8
+ public repository: ProjectRepository
9
+
10
+ constructor(parent: Router, storage: AbstractStorage) {
11
+ this.repository = new ProjectRepository(storage)
12
+ this.registerRoutes(parent)
13
+ }
14
+
15
+ registerRoutes(parent: Router) {
16
+ parent.get('', this.get.bind(this))
17
+ parent.post('', this.post.bind(this))
18
+ }
19
+
20
+ get(request: Request, response: Response) {
21
+ const projectKey = request.params.projectKey
22
+ const project = this.repository.get(projectKey)
23
+ return response.status(200).send(project)
24
+ }
25
+
26
+ post(request: Request, response: Response) {
27
+ const updateRequest: Update = request.body
28
+ const project = this.repository.get(request.params.projectKey)
29
+
30
+ if (!project) {
31
+ return response.status(404).send({})
32
+ }
33
+
34
+ const updatedResource = this.repository.processUpdateActions(
35
+ request.params.projectKey,
36
+ project,
37
+ updateRequest.actions
38
+ )
39
+
40
+ return response.status(200).send({})
41
+ }
42
+ }
@@ -17,7 +17,7 @@ describe('Shipping method', () => {
17
17
  const createResponse = await supertest(ctMock.app)
18
18
  .post('/dummy/tax-categories')
19
19
  .send(draft)
20
- expect(createResponse.status).toEqual(200)
20
+ expect(createResponse.status).toEqual(201)
21
21
  })
22
22
 
23
23
  afterEach(async () => {
@@ -35,7 +35,7 @@ describe('Shipping method', () => {
35
35
  .post('/dummy/shipping-methods')
36
36
  .send(draft)
37
37
 
38
- expect(response.status).toBe(200)
38
+ expect(response.status).toBe(201)
39
39
 
40
40
  expect(response.body).toEqual({
41
41
  createdAt: expect.anything(),
@@ -63,7 +63,7 @@ describe('Shipping method', () => {
63
63
  .post('/dummy/shipping-methods')
64
64
  .send(draft)
65
65
 
66
- expect(createResponse.status).toBe(200)
66
+ expect(createResponse.status).toBe(201)
67
67
 
68
68
  const response = await supertest(ctMock.app).get(
69
69
  `/dummy/shipping-methods/${createResponse.body.id}`
@@ -14,7 +14,7 @@ describe('State', () => {
14
14
  .post('/dummy/states')
15
15
  .send(draft)
16
16
 
17
- expect(response.status).toBe(200)
17
+ expect(response.status).toBe(201)
18
18
 
19
19
  expect(response.body).toEqual({
20
20
  builtIn: false,
@@ -38,7 +38,7 @@ describe('State', () => {
38
38
  .post('/dummy/states')
39
39
  .send(draft)
40
40
 
41
- expect(createResponse.status).toBe(200)
41
+ expect(createResponse.status).toBe(201)
42
42
 
43
43
  const response = await supertest(ctMock.app).get(
44
44
  `/dummy/states/${createResponse.body.id}`
@@ -0,0 +1,60 @@
1
+ import supertest from 'supertest'
2
+ import { CommercetoolsMock } from '../index'
3
+
4
+ const ctMock = new CommercetoolsMock()
5
+
6
+ describe('Store', () => {
7
+ beforeAll(() => {
8
+ ctMock.start()
9
+ })
10
+
11
+ afterEach(() => {
12
+ ctMock.clear()
13
+ })
14
+
15
+ afterAll(() => {
16
+ ctMock.stop()
17
+ })
18
+
19
+ test('Get store by key', async () => {
20
+ ctMock.project('dummy').add('store', {
21
+ id: 'fake-store',
22
+ version: 1,
23
+ createdAt: '',
24
+ lastModifiedAt: '',
25
+ key: 'STOREKEY',
26
+ distributionChannels: [],
27
+ })
28
+
29
+ const response = await supertest(ctMock.app).get(
30
+ `/dummy/stores/key=STOREKEY`
31
+ )
32
+
33
+ expect(response.status).toBe(200)
34
+ expect(response.body).toEqual({
35
+ createdAt: '',
36
+ distributionChannels: [],
37
+ id: 'fake-store',
38
+ key: 'STOREKEY',
39
+ lastModifiedAt: '',
40
+ version: 1,
41
+ })
42
+ })
43
+
44
+ test('Get store by 404 when not found by key', async () => {
45
+ ctMock.project('dummy').add('store', {
46
+ id: 'fake-store',
47
+ version: 1,
48
+ createdAt: '',
49
+ lastModifiedAt: '',
50
+ key: 'STOREKEY',
51
+ distributionChannels: [],
52
+ })
53
+
54
+ const response = await supertest(ctMock.app).get(
55
+ `/dummy/stores/key=DOESNOTEXIST`
56
+ )
57
+
58
+ expect(response.status).toBe(404)
59
+ })
60
+ })
@@ -0,0 +1,17 @@
1
+ import AbstractService from './abstract'
2
+ import { Router } from 'express'
3
+ import { AbstractStorage } from '../storage'
4
+ import { SubscriptionRepository } from '../repositories/subscription'
5
+
6
+ export class SubscriptionService extends AbstractService {
7
+ public repository: SubscriptionRepository
8
+
9
+ constructor(parent: Router, storage: AbstractStorage) {
10
+ super(parent)
11
+ this.repository = new SubscriptionRepository(storage)
12
+ }
13
+
14
+ getBasePath() {
15
+ return 'subscriptions'
16
+ }
17
+ }
@@ -18,7 +18,7 @@ describe('Tax Category', () => {
18
18
  .post('/dummy/tax-categories')
19
19
  .send(draft)
20
20
 
21
- expect(response.status).toBe(200)
21
+ expect(response.status).toBe(201)
22
22
 
23
23
  expect(response.body).toEqual({
24
24
  createdAt: expect.anything(),
@@ -41,7 +41,7 @@ describe('Tax Category', () => {
41
41
  .post('/dummy/tax-categories')
42
42
  .send(draft)
43
43
 
44
- expect(createResponse.status).toBe(200)
44
+ expect(createResponse.status).toBe(201)
45
45
 
46
46
  const response = await supertest(ctMock.app).get(
47
47
  `/dummy/tax-categories/${createResponse.body.id}`
@@ -61,7 +61,7 @@ describe('Tax Category', () => {
61
61
  .post('/dummy/tax-categories')
62
62
  .send(draft)
63
63
 
64
- expect(createResponse.status).toBe(200)
64
+ expect(createResponse.status).toBe(201)
65
65
 
66
66
  const response = await supertest(ctMock.app)
67
67
  .get(`/dummy/tax-categories/`)
@@ -0,0 +1,17 @@
1
+ import { Router } from 'express'
2
+ import AbstractService from './abstract'
3
+ import { AbstractStorage } from '../storage'
4
+ import { ZoneRepository } from '../repositories/zone'
5
+
6
+ export class ZoneService extends AbstractService {
7
+ public repository: ZoneRepository
8
+
9
+ constructor(parent: Router, storage: AbstractStorage) {
10
+ super(parent)
11
+ this.repository = new ZoneRepository(storage)
12
+ }
13
+
14
+ getBasePath() {
15
+ return 'zones'
16
+ }
17
+ }
package/src/storage.ts CHANGED
@@ -2,6 +2,7 @@ import assert from 'assert'
2
2
  import {
3
3
  BaseResource,
4
4
  Cart,
5
+ Category,
5
6
  Customer,
6
7
  CustomObject,
7
8
  InventoryEntry,
@@ -14,6 +15,7 @@ import {
14
15
  Store,
15
16
  Type,
16
17
  Payment,
18
+ Project,
17
19
  State,
18
20
  TaxCategory,
19
21
  ShippingMethod,
@@ -21,6 +23,13 @@ import {
21
23
  InvalidInputError,
22
24
  ProductProjection,
23
25
  ShoppingList,
26
+ Extension,
27
+ CartDiscount,
28
+ CustomerGroup,
29
+ DiscountCode,
30
+ Zone,
31
+ Channel,
32
+ Subscription,
24
33
  } from '@commercetools/platform-sdk'
25
34
  import { parseExpandClause } from './lib/expandParser'
26
35
  import { RepositoryTypes, ResourceMap, Writable } from './types'
@@ -61,6 +70,17 @@ export abstract class AbstractStorage {
61
70
  params: GetParams
62
71
  ): ResourceMap[RepositoryTypes] | null
63
72
 
73
+ abstract getByKey<RepositoryTypes extends keyof ResourceMap>(
74
+ projectKey: string,
75
+ typeId: RepositoryTypes,
76
+ key: string,
77
+ params: GetParams
78
+ ): ResourceMap[RepositoryTypes] | null
79
+
80
+ abstract addProject(projectKey: string): Project
81
+ abstract getProject(projectKey: string): Project
82
+ abstract saveProject(project: Project): Project
83
+
64
84
  abstract delete(
65
85
  projectKey: string,
66
86
  typeId: RepositoryTypes,
@@ -91,25 +111,40 @@ export class InMemoryStorage extends AbstractStorage {
91
111
  [projectKey: string]: ProjectStorage
92
112
  } = {}
93
113
 
114
+ protected projects: {
115
+ [projectKey: string]: Project
116
+ } = {}
117
+
94
118
  private forProjectKey(projectKey: string) {
119
+ this.addProject(projectKey)
120
+
95
121
  let projectStorage = this.resources[projectKey]
96
122
  if (!projectStorage) {
97
123
  projectStorage = this.resources[projectKey] = {
98
124
  cart: new Map<string, Cart>(),
125
+ 'cart-discount': new Map<string, CartDiscount>(),
126
+ category: new Map<string, Category>(),
127
+ channel: new Map<string, Channel>(),
99
128
  customer: new Map<string, Customer>(),
129
+ 'customer-group': new Map<string, CustomerGroup>(),
130
+ 'discount-code': new Map<string, DiscountCode>(),
131
+ extension: new Map<string, Extension>(),
100
132
  'inventory-entry': new Map<string, InventoryEntry>(),
101
133
  'key-value-document': new Map<string, CustomObject>(),
102
134
  order: new Map<string, Order>(),
103
135
  payment: new Map<string, Payment>(),
104
136
  'product-type': new Map<string, ProductType>(),
105
137
  product: new Map<string, Product>(),
138
+ 'product-selection': new Map<string, any>(),
106
139
  'product-projection': new Map<string, ProductProjection>(),
107
140
  'shipping-method': new Map<string, ShippingMethod>(),
108
141
  state: new Map<string, State>(),
109
142
  store: new Map<string, Store>(),
110
143
  'shopping-list': new Map<string, ShoppingList>(),
144
+ subscription: new Map<string, Subscription>(),
111
145
  'tax-category': new Map<string, TaxCategory>(),
112
146
  type: new Map<string, Type>(),
147
+ zone: new Map<string, Zone>(),
113
148
  }
114
149
  }
115
150
  return projectStorage
@@ -163,6 +198,29 @@ export class InMemoryStorage extends AbstractStorage {
163
198
  return null
164
199
  }
165
200
 
201
+ getByKey<RepositoryTypes extends keyof ResourceMap>(
202
+ projectKey: string,
203
+ typeId: RepositoryTypes,
204
+ key: string,
205
+ params: GetParams = {}
206
+ ): ResourceMap[RepositoryTypes] | null {
207
+ const store = this.forProjectKey(projectKey)[typeId]
208
+ if (!store) {
209
+ throw new Error('No type')
210
+ }
211
+
212
+ const resources: any[] = Array.from(store.values())
213
+ const resource = resources.find(e => e.key === key)
214
+ if (resource) {
215
+ return this.expand(
216
+ projectKey,
217
+ resource,
218
+ params.expand
219
+ ) as ResourceMap[RepositoryTypes]
220
+ }
221
+ return null
222
+ }
223
+
166
224
  delete(
167
225
  projectKey: string,
168
226
  typeId: RepositoryTypes,
@@ -203,7 +261,7 @@ export class InMemoryStorage extends AbstractStorage {
203
261
  throw new CommercetoolsError<InvalidInputError>(
204
262
  {
205
263
  code: 'InvalidInput',
206
- message: err.message,
264
+ message: (err as any).message,
207
265
  },
208
266
  400
209
267
  )
@@ -271,6 +329,46 @@ export class InMemoryStorage extends AbstractStorage {
271
329
  return undefined
272
330
  }
273
331
 
332
+ addProject = (projectKey: string): Project => {
333
+ if (!this.projects[projectKey]) {
334
+ this.projects[projectKey] = {
335
+ key: projectKey,
336
+ name: '',
337
+ countries: [],
338
+ currencies: [],
339
+ languages: [],
340
+ createdAt: '2018-10-04T11:32:12.603Z',
341
+ trialUntil: '2018-12',
342
+ carts: {
343
+ countryTaxRateFallbackEnabled: false,
344
+ deleteDaysAfterLastModification: 90,
345
+ },
346
+ messages: { enabled: false, deleteDaysAfterCreation: 15 },
347
+ shippingRateInputType: undefined,
348
+ externalOAuth: undefined,
349
+ searchIndexing: {
350
+ products: {
351
+ status: 'Deactivated',
352
+ },
353
+ orders: {
354
+ status: 'Deactivated',
355
+ },
356
+ },
357
+ version: 1,
358
+ }
359
+ }
360
+ return this.projects[projectKey]
361
+ }
362
+
363
+ saveProject = (project: Project): Project => {
364
+ this.projects[project.key] = project
365
+ return project
366
+ }
367
+
368
+ getProject = (projectKey: string): Project => {
369
+ return this.addProject(projectKey)
370
+ }
371
+
274
372
  private expand = <T>(
275
373
  projectKey: string,
276
374
  obj: T,
package/src/types.ts CHANGED
@@ -18,7 +18,7 @@ import { TaxCategoryRepository } from './repositories/tax-category'
18
18
  export type Writable<T> = { -readonly [P in keyof T]: Writable<T[P]> }
19
19
 
20
20
  export type RepositoryTypes = ReferenceTypeId | 'product-projection'
21
- export type ServiceTypes = RepositoryTypes | 'my-payment'
21
+ export type ServiceTypes = RepositoryTypes | 'my-cart' | 'my-payment'
22
22
 
23
23
  export type Services = Partial<
24
24
  {
@@ -43,6 +43,7 @@ export type ResourceMap = {
43
43
  product: ctp.Product
44
44
  'product-discount': ctp.ProductDiscount
45
45
  'product-projection': ctp.ProductProjection
46
+ 'product-selection': ctp.ProductSelection
46
47
  'product-type': ctp.ProductType
47
48
  review: ctp.Review
48
49
  'shipping-method': ctp.ShippingMethod