@labdigital/commercetools-mock 0.10.0 → 0.10.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.
- package/dist/index.d.ts +353 -188
- package/dist/index.global.js +930 -874
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +271 -215
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +271 -215
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/ctMock.ts +15 -9
- package/src/helpers.ts +1 -1
- package/src/lib/projectionSearchFilter.ts +3 -2
- package/src/priceSelector.test.ts +1 -3
- package/src/product-projection-search.ts +1 -3
- package/src/projectAPI.test.ts +7 -0
- package/src/projectAPI.ts +17 -22
- package/src/repositories/abstract.ts +31 -24
- package/src/repositories/cart-discount.ts +3 -4
- package/src/repositories/cart.ts +20 -15
- package/src/repositories/category.ts +6 -7
- package/src/repositories/channel.ts +4 -5
- package/src/repositories/custom-object.ts +9 -13
- package/src/repositories/customer-group.ts +3 -4
- package/src/repositories/customer.ts +4 -5
- package/src/repositories/discount-code.ts +4 -5
- package/src/repositories/errors.ts +1 -3
- package/src/repositories/extension.ts +7 -8
- package/src/repositories/helpers.ts +2 -2
- package/src/repositories/index.ts +19 -3
- package/src/repositories/inventory-entry.ts +4 -5
- package/src/repositories/my-order.ts +2 -2
- package/src/repositories/order-edit.ts +39 -0
- package/src/repositories/order.test.ts +16 -11
- package/src/repositories/order.ts +15 -8
- package/src/repositories/payment.ts +6 -7
- package/src/repositories/product-discount.ts +4 -24
- package/src/repositories/product-projection.ts +11 -5
- package/src/repositories/product-selection.ts +40 -0
- package/src/repositories/product-type.ts +11 -28
- package/src/repositories/product.ts +7 -8
- package/src/repositories/project.ts +8 -8
- package/src/repositories/quote-request.ts +28 -0
- package/src/repositories/quote.ts +28 -0
- package/src/repositories/review.ts +34 -0
- package/src/repositories/shipping-method.ts +10 -11
- package/src/repositories/shopping-list.ts +4 -4
- package/src/repositories/staged-quote.ts +29 -0
- package/src/repositories/standalone-price.ts +36 -0
- package/src/repositories/state.ts +7 -8
- package/src/repositories/store.ts +11 -27
- package/src/repositories/subscription.ts +3 -4
- package/src/repositories/tax-category.ts +5 -22
- package/src/repositories/type.ts +12 -13
- package/src/repositories/zone.ts +4 -5
- package/src/server.ts +4 -4
- package/src/services/abstract.ts +3 -5
- package/src/services/cart-discount.ts +1 -1
- package/src/services/cart.test.ts +1 -1
- package/src/services/cart.ts +40 -33
- package/src/services/category.ts +1 -1
- package/src/services/channel.ts +1 -1
- package/src/services/custom-object.test.ts +1 -1
- package/src/services/custom-object.ts +2 -2
- package/src/services/customer-group.ts +1 -1
- package/src/services/customer.test.ts +1 -1
- package/src/services/customer.ts +3 -3
- package/src/services/discount-code.ts +1 -1
- package/src/services/extension.ts +1 -1
- package/src/services/inventory-entry.test.ts +1 -1
- package/src/services/inventory-entry.ts +1 -1
- package/src/services/my-cart.test.ts +2 -0
- package/src/services/my-cart.ts +1 -1
- package/src/services/my-customer.ts +1 -1
- package/src/services/my-order.ts +1 -1
- package/src/services/my-payment.ts +1 -1
- package/src/services/order.test.ts +24 -20
- package/src/services/order.ts +2 -2
- package/src/services/payment.ts +1 -1
- package/src/services/product-discount.ts +1 -17
- package/src/services/product-projection.test.ts +1 -1
- package/src/services/product-projection.ts +2 -2
- package/src/services/product-type.ts +1 -17
- package/src/services/product.test.ts +1 -1
- package/src/services/product.ts +1 -1
- package/src/services/project.ts +2 -3
- package/src/services/shipping-method.ts +1 -1
- package/src/services/shopping-list.ts +1 -1
- package/src/services/state.ts +1 -1
- package/src/services/store.ts +2 -18
- package/src/services/subscription.ts +1 -1
- package/src/services/tax-category.ts +1 -17
- package/src/services/type.ts +1 -1
- package/src/services/zone.ts +1 -1
- package/src/storage/abstract.ts +82 -0
- package/src/{storage.ts → storage/in-memory.ts} +57 -118
- package/src/storage/index.ts +2 -0
- package/src/types.ts +48 -119
|
@@ -1,117 +1,54 @@
|
|
|
1
|
-
import assert from 'assert'
|
|
2
1
|
import {
|
|
3
|
-
BaseResource,
|
|
4
2
|
Cart,
|
|
3
|
+
CartDiscount,
|
|
5
4
|
Category,
|
|
5
|
+
Channel,
|
|
6
6
|
Customer,
|
|
7
|
+
CustomerGroup,
|
|
7
8
|
CustomObject,
|
|
9
|
+
DiscountCode,
|
|
10
|
+
Extension,
|
|
11
|
+
InvalidInputError,
|
|
8
12
|
InventoryEntry,
|
|
9
13
|
Order,
|
|
10
14
|
PagedQueryResponse,
|
|
11
|
-
QueryParam,
|
|
12
|
-
Reference,
|
|
13
|
-
ResourceIdentifier,
|
|
14
|
-
Product,
|
|
15
|
-
Store,
|
|
16
|
-
Type,
|
|
17
15
|
Payment,
|
|
16
|
+
Product,
|
|
17
|
+
ProductDiscount,
|
|
18
|
+
ProductProjection,
|
|
19
|
+
ProductType,
|
|
18
20
|
Project,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
Quote,
|
|
22
|
+
QuoteRequest,
|
|
23
|
+
Reference,
|
|
24
|
+
ResourceIdentifier,
|
|
21
25
|
ShippingMethod,
|
|
22
|
-
ProductType,
|
|
23
|
-
InvalidInputError,
|
|
24
|
-
ProductProjection,
|
|
25
26
|
ShoppingList,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
DiscountCode,
|
|
30
|
-
Zone,
|
|
31
|
-
Channel,
|
|
27
|
+
StagedQuote,
|
|
28
|
+
State,
|
|
29
|
+
Store,
|
|
32
30
|
Subscription,
|
|
33
|
-
|
|
31
|
+
TaxCategory,
|
|
32
|
+
Type,
|
|
33
|
+
Zone,
|
|
34
34
|
} from '@commercetools/platform-sdk'
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
[key: string]: QueryParam
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export abstract class AbstractStorage {
|
|
56
|
-
abstract clear(): void
|
|
57
|
-
|
|
58
|
-
abstract all<RT extends RepositoryTypes>(
|
|
59
|
-
projectKey: string,
|
|
60
|
-
typeId: RT
|
|
61
|
-
): Array<ResourceMap[RT]>
|
|
62
|
-
|
|
63
|
-
abstract add<RT extends RepositoryTypes>(
|
|
64
|
-
projectKey: string,
|
|
65
|
-
typeId: RT,
|
|
66
|
-
obj: ResourceMap[RT]
|
|
67
|
-
): void
|
|
68
|
-
|
|
69
|
-
abstract get<RT extends RepositoryTypes>(
|
|
70
|
-
projectKey: string,
|
|
71
|
-
typeId: RT,
|
|
72
|
-
id: string,
|
|
73
|
-
params?: GetParams
|
|
74
|
-
): ResourceMap[RT] | null
|
|
75
|
-
|
|
76
|
-
abstract getByKey<RT extends RepositoryTypes>(
|
|
77
|
-
projectKey: string,
|
|
78
|
-
typeId: RT,
|
|
79
|
-
key: string,
|
|
80
|
-
params: GetParams
|
|
81
|
-
): ResourceMap[RT] | null
|
|
82
|
-
|
|
83
|
-
abstract addProject(projectKey: string): Project
|
|
84
|
-
abstract getProject(projectKey: string): Project
|
|
85
|
-
abstract saveProject(project: Project): Project
|
|
86
|
-
|
|
87
|
-
abstract delete<RT extends RepositoryTypes>(
|
|
88
|
-
projectKey: string,
|
|
89
|
-
typeId: RT,
|
|
90
|
-
id: string,
|
|
91
|
-
params: GetParams
|
|
92
|
-
): BaseResource | null
|
|
93
|
-
|
|
94
|
-
abstract query(
|
|
95
|
-
projectKey: string,
|
|
96
|
-
typeId: RepositoryTypes,
|
|
97
|
-
params: QueryParams
|
|
98
|
-
): PagedQueryResponse
|
|
99
|
-
|
|
100
|
-
abstract getByResourceIdentifier<RT extends RepositoryTypes>(
|
|
101
|
-
projectKey: string,
|
|
102
|
-
identifier: ResourceIdentifier
|
|
103
|
-
): ResourceMap[RT] | undefined
|
|
104
|
-
|
|
105
|
-
abstract expand<T>(
|
|
106
|
-
projectKey: string,
|
|
107
|
-
obj: T,
|
|
108
|
-
clause: undefined | string | string[]
|
|
109
|
-
): T
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
type ProjectStorage = {
|
|
113
|
-
[index in RepositoryTypes]: Map<string, BaseResource>
|
|
114
|
-
}
|
|
35
|
+
import assert from 'assert'
|
|
36
|
+
import { CommercetoolsError } from '../exceptions'
|
|
37
|
+
import { cloneObject } from '../helpers'
|
|
38
|
+
import { parseExpandClause } from '../lib/expandParser'
|
|
39
|
+
import { parseQueryExpression } from '../lib/predicateParser'
|
|
40
|
+
import {
|
|
41
|
+
PagedQueryResponseMap,
|
|
42
|
+
ResourceMap,
|
|
43
|
+
ResourceType,
|
|
44
|
+
Writable,
|
|
45
|
+
} from '../types'
|
|
46
|
+
import {
|
|
47
|
+
AbstractStorage,
|
|
48
|
+
GetParams,
|
|
49
|
+
ProjectStorage,
|
|
50
|
+
QueryParams,
|
|
51
|
+
} from './abstract'
|
|
115
52
|
|
|
116
53
|
export class InMemoryStorage extends AbstractStorage {
|
|
117
54
|
protected resources: {
|
|
@@ -142,13 +79,15 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
142
79
|
'order-edit': new Map<string, any>(),
|
|
143
80
|
payment: new Map<string, Payment>(),
|
|
144
81
|
product: new Map<string, Product>(),
|
|
82
|
+
quote: new Map<string, Quote>(),
|
|
83
|
+
'quote-request': new Map<string, QuoteRequest>(),
|
|
145
84
|
'product-discount': new Map<string, ProductDiscount>(),
|
|
146
|
-
'product-price': new Map<string, any>(),
|
|
147
85
|
'product-selection': new Map<string, any>(),
|
|
148
86
|
'product-type': new Map<string, ProductType>(),
|
|
149
87
|
'product-projection': new Map<string, ProductProjection>(),
|
|
150
88
|
review: new Map<string, any>(),
|
|
151
89
|
'shipping-method': new Map<string, ShippingMethod>(),
|
|
90
|
+
'staged-quote': new Map<string, StagedQuote>(),
|
|
152
91
|
state: new Map<string, State>(),
|
|
153
92
|
store: new Map<string, Store>(),
|
|
154
93
|
'shopping-list': new Map<string, ShoppingList>(),
|
|
@@ -170,7 +109,7 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
170
109
|
}
|
|
171
110
|
}
|
|
172
111
|
|
|
173
|
-
all<RT extends
|
|
112
|
+
all<RT extends ResourceType>(
|
|
174
113
|
projectKey: string,
|
|
175
114
|
typeId: RT
|
|
176
115
|
): ResourceMap[RT][] {
|
|
@@ -181,7 +120,7 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
181
120
|
return []
|
|
182
121
|
}
|
|
183
122
|
|
|
184
|
-
add<RT extends
|
|
123
|
+
add<RT extends ResourceType>(
|
|
185
124
|
projectKey: string,
|
|
186
125
|
typeId: RT,
|
|
187
126
|
obj: ResourceMap[RT],
|
|
@@ -195,7 +134,7 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
195
134
|
return cloneObject(resource)
|
|
196
135
|
}
|
|
197
136
|
|
|
198
|
-
get<RT extends
|
|
137
|
+
get<RT extends ResourceType>(
|
|
199
138
|
projectKey: string,
|
|
200
139
|
typeId: RT,
|
|
201
140
|
id: string,
|
|
@@ -209,7 +148,7 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
209
148
|
return null
|
|
210
149
|
}
|
|
211
150
|
|
|
212
|
-
getByKey<RT extends
|
|
151
|
+
getByKey<RT extends ResourceType>(
|
|
213
152
|
projectKey: string,
|
|
214
153
|
typeId: RT,
|
|
215
154
|
key: string,
|
|
@@ -230,32 +169,32 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
230
169
|
return null
|
|
231
170
|
}
|
|
232
171
|
|
|
233
|
-
delete<RT extends
|
|
172
|
+
delete<RT extends ResourceType>(
|
|
234
173
|
projectKey: string,
|
|
235
174
|
typeId: RT,
|
|
236
175
|
id: string,
|
|
237
176
|
params: GetParams = {}
|
|
238
|
-
):
|
|
177
|
+
): ResourceMap[RT] | null {
|
|
239
178
|
const resource = this.get(projectKey, typeId, id)
|
|
240
179
|
|
|
241
180
|
if (resource) {
|
|
242
181
|
this.forProjectKey(projectKey)[typeId]?.delete(id)
|
|
243
|
-
return this.expand(projectKey, resource, params.expand)
|
|
182
|
+
return this.expand(projectKey, resource, params.expand)
|
|
244
183
|
}
|
|
245
184
|
return resource
|
|
246
185
|
}
|
|
247
186
|
|
|
248
|
-
query(
|
|
187
|
+
query<RT extends ResourceType>(
|
|
249
188
|
projectKey: string,
|
|
250
|
-
typeId:
|
|
189
|
+
typeId: RT,
|
|
251
190
|
params: QueryParams
|
|
252
|
-
):
|
|
191
|
+
): PagedQueryResponseMap[RT] {
|
|
253
192
|
const store = this.forProjectKey(projectKey)[typeId]
|
|
254
193
|
if (!store) {
|
|
255
194
|
throw new Error('No type')
|
|
256
195
|
}
|
|
257
196
|
|
|
258
|
-
let resources =
|
|
197
|
+
let resources = this.all<RT>(projectKey, typeId)
|
|
259
198
|
|
|
260
199
|
// Apply predicates
|
|
261
200
|
if (params.where) {
|
|
@@ -294,12 +233,12 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
294
233
|
offset: offset,
|
|
295
234
|
limit: limit,
|
|
296
235
|
results: resources.map(cloneObject),
|
|
297
|
-
}
|
|
236
|
+
} as PagedQueryResponseMap[RT]
|
|
298
237
|
}
|
|
299
238
|
|
|
300
239
|
search(
|
|
301
240
|
projectKey: string,
|
|
302
|
-
typeId:
|
|
241
|
+
typeId: ResourceType,
|
|
303
242
|
params: QueryParams
|
|
304
243
|
): PagedQueryResponse {
|
|
305
244
|
let resources = this.all(projectKey, typeId)
|
|
@@ -344,10 +283,10 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
344
283
|
}
|
|
345
284
|
}
|
|
346
285
|
|
|
347
|
-
getByResourceIdentifier<RT extends
|
|
286
|
+
getByResourceIdentifier<RT extends ResourceType>(
|
|
348
287
|
projectKey: string,
|
|
349
288
|
identifier: ResourceIdentifier
|
|
350
|
-
): ResourceMap[RT] |
|
|
289
|
+
): ResourceMap[RT] | null {
|
|
351
290
|
if (identifier.id) {
|
|
352
291
|
const resource = this.get(projectKey, identifier.typeId, identifier.id)
|
|
353
292
|
if (resource) {
|
|
@@ -356,7 +295,7 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
356
295
|
console.error(
|
|
357
296
|
`No resource found with typeId=${identifier.typeId}, id=${identifier.id}`
|
|
358
297
|
)
|
|
359
|
-
return
|
|
298
|
+
return null
|
|
360
299
|
}
|
|
361
300
|
|
|
362
301
|
if (identifier.key) {
|
|
@@ -378,7 +317,7 @@ export class InMemoryStorage extends AbstractStorage {
|
|
|
378
317
|
)
|
|
379
318
|
}
|
|
380
319
|
}
|
|
381
|
-
return
|
|
320
|
+
return null
|
|
382
321
|
}
|
|
383
322
|
|
|
384
323
|
addProject = (projectKey: string): Project => {
|
package/src/types.ts
CHANGED
|
@@ -1,33 +1,13 @@
|
|
|
1
|
-
import { ProductProjectionRepository } from './repositories/product-projection'
|
|
2
|
-
import { ShoppingListRepository } from './repositories/shopping-list'
|
|
3
1
|
import * as ctp from '@commercetools/platform-sdk'
|
|
4
|
-
import {
|
|
5
|
-
ReferenceTypeId,
|
|
6
|
-
} from '@commercetools/platform-sdk'
|
|
2
|
+
import { RepositoryMap } from './repositories'
|
|
7
3
|
import AbstractService from './services/abstract'
|
|
8
|
-
import { CartRepository } from './repositories/cart'
|
|
9
|
-
import { CustomerRepository } from './repositories/customer'
|
|
10
|
-
import { CustomObjectRepository } from './repositories/custom-object'
|
|
11
|
-
import { InventoryEntryRepository } from './repositories/inventory-entry'
|
|
12
|
-
import { OrderRepository } from './repositories/order'
|
|
13
|
-
import { PaymentRepository } from './repositories/payment'
|
|
14
|
-
import { ProductRepository } from './repositories/product'
|
|
15
|
-
import { ProductTypeRepository } from './repositories/product-type'
|
|
16
|
-
import { ShippingMethodRepository } from './repositories/shipping-method'
|
|
17
|
-
import { StateRepository } from './repositories/state'
|
|
18
|
-
import { TaxCategoryRepository } from './repositories/tax-category'
|
|
19
|
-
import { ProductDiscountRepository } from 'repositories/product-discount'
|
|
20
|
-
import { AbstractRepository } from 'repositories/abstract'
|
|
21
4
|
|
|
22
5
|
export type Writable<T> = { -readonly [P in keyof T]: Writable<T[P]> }
|
|
23
|
-
|
|
24
|
-
export type RepositoryTypes =
|
|
25
|
-
| ReferenceTypeId
|
|
26
|
-
| 'standalone-price'
|
|
27
|
-
| 'product-projection'
|
|
6
|
+
export type ShallowWritable<T> = { -readonly [P in keyof T]: T[P] }
|
|
28
7
|
|
|
29
8
|
export type ServiceTypes =
|
|
30
|
-
|
|
|
9
|
+
| ctp.ReferenceTypeId
|
|
10
|
+
| 'product-projection'
|
|
31
11
|
| 'my-cart'
|
|
32
12
|
| 'my-order'
|
|
33
13
|
| 'my-payment'
|
|
@@ -38,67 +18,36 @@ export type Services = Partial<{
|
|
|
38
18
|
[index in ServiceTypes]: AbstractService
|
|
39
19
|
}>
|
|
40
20
|
|
|
41
|
-
export type
|
|
42
|
-
[index in RepositoryTypes | 'project']: AbstractRepository
|
|
43
|
-
}>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export type Resource =
|
|
47
|
-
| ctp.BaseResource
|
|
48
|
-
| ctp.Cart
|
|
49
|
-
| ctp.CartDiscount
|
|
50
|
-
| ctp.Category
|
|
51
|
-
| ctp.Channel
|
|
52
|
-
| ctp.Customer
|
|
53
|
-
| ctp.CustomerGroup
|
|
54
|
-
| ctp.DiscountCode
|
|
55
|
-
| ctp.Extension
|
|
56
|
-
| ctp.InventoryEntry
|
|
57
|
-
| ctp.CustomObject
|
|
58
|
-
| ctp.Order
|
|
59
|
-
| ctp.OrderEdit
|
|
60
|
-
| ctp.Payment
|
|
61
|
-
| ctp.Product
|
|
62
|
-
| ctp.Project
|
|
63
|
-
| ctp.ProductDiscount
|
|
64
|
-
| ctp.ProductProjection
|
|
65
|
-
| ctp.ProductSelection
|
|
66
|
-
| ctp.StandalonePrice
|
|
67
|
-
| ctp.ProductType
|
|
68
|
-
| ctp.Review
|
|
69
|
-
| ctp.ShippingMethod
|
|
70
|
-
| ctp.ShoppingList
|
|
71
|
-
| ctp.StandalonePrice
|
|
72
|
-
| ctp.State
|
|
73
|
-
| ctp.Store
|
|
74
|
-
| ctp.Subscription
|
|
75
|
-
| ctp.TaxCategory
|
|
76
|
-
| ctp.Type
|
|
77
|
-
| ctp.Zone
|
|
21
|
+
export type ResourceType = keyof ResourceMap & keyof RepositoryMap
|
|
78
22
|
|
|
79
23
|
export type ResourceMap = {
|
|
80
|
-
cart: ctp.Cart
|
|
81
24
|
'cart-discount': ctp.CartDiscount
|
|
25
|
+
cart: ctp.Cart
|
|
82
26
|
category: ctp.Category
|
|
83
27
|
channel: ctp.Channel
|
|
84
|
-
customer:
|
|
28
|
+
'customer-email-token': never
|
|
85
29
|
'customer-group': ctp.CustomerGroup
|
|
30
|
+
'customer-password-token': never
|
|
31
|
+
customer: ctp.Customer
|
|
86
32
|
'discount-code': ctp.DiscountCode
|
|
87
33
|
extension: ctp.Extension
|
|
88
34
|
'inventory-entry': ctp.InventoryEntry
|
|
89
35
|
'key-value-document': ctp.CustomObject
|
|
90
|
-
order: ctp.Order
|
|
91
36
|
'order-edit': ctp.OrderEdit
|
|
37
|
+
order: ctp.Order
|
|
92
38
|
payment: ctp.Payment
|
|
93
|
-
product: ctp.Product
|
|
94
39
|
'product-discount': ctp.ProductDiscount
|
|
40
|
+
'product-price': ctp.StandalonePrice
|
|
95
41
|
'product-projection': ctp.ProductProjection
|
|
96
42
|
'product-selection': ctp.ProductSelection
|
|
97
|
-
'product-price': ctp.StandalonePrice
|
|
98
43
|
'product-type': ctp.ProductType
|
|
44
|
+
product: ctp.Product
|
|
45
|
+
'quote-request': ctp.QuoteRequest
|
|
46
|
+
quote: ctp.Quote
|
|
99
47
|
review: ctp.Review
|
|
100
48
|
'shipping-method': ctp.ShippingMethod
|
|
101
49
|
'shopping-list': ctp.ShoppingList
|
|
50
|
+
'staged-quote': ctp.StagedQuote
|
|
102
51
|
'standalone-price': ctp.StandalonePrice
|
|
103
52
|
state: ctp.State
|
|
104
53
|
store: ctp.Store
|
|
@@ -106,61 +55,41 @@ export type ResourceMap = {
|
|
|
106
55
|
'tax-category': ctp.TaxCategory
|
|
107
56
|
type: ctp.Type
|
|
108
57
|
zone: ctp.Zone
|
|
109
|
-
'customer-email-token': never
|
|
110
|
-
'customer-password-token': never
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export type ResourceIdentifierMap = {
|
|
114
|
-
cart: ctp.CartDiscountResourceIdentifier
|
|
115
|
-
// 'cart': ctp.CartResourceIdentifier,
|
|
116
|
-
// 'category': ctp.CategoryResourceIdentifier,
|
|
117
|
-
channel: ctp.ChannelResourceIdentifier
|
|
118
|
-
// 'foobar': ctp.CustomerResourceIdentifier,
|
|
119
|
-
// 'foobar': ctp.DiscountCodeResourceIdentifier,
|
|
120
|
-
// 'foobar': ctp.InventoryEntryResourceIdentifier,
|
|
121
|
-
// 'foobar': ctp.OrderEditResourceIdentifier,
|
|
122
|
-
// 'foobar': ctp.OrderResourceIdentifier,
|
|
123
|
-
// 'foobar': ctp.PaymentResourceIdentifier,
|
|
124
|
-
// 'foobar': ctp.ProductDiscountResourceIdentifier,
|
|
125
|
-
// 'foobar': ctp.ProductResourceIdentifier,
|
|
126
|
-
// 'foobar': ctp.ProductTypeResourceIdentifier,
|
|
127
|
-
// 'foobar': ctp.ReviewResourceIdentifier,
|
|
128
|
-
// 'foobar': ctp.ShippingMethodResourceIdentifier,
|
|
129
|
-
// 'foobar': ctp.ShoppingListResourceIdentifier,
|
|
130
|
-
// 'foobar': ctp.StateResourceIdentifier,
|
|
131
|
-
// 'foobar': ctp.StoreResourceIdentifier,
|
|
132
|
-
// 'foobar': ctp.TaxCategoryResourceIdentifier,
|
|
133
|
-
// 'foobar': ctp.TypeResourceIdentifier,
|
|
134
|
-
// 'foobar': ctp.ZoneResourceIdentifier,
|
|
135
58
|
}
|
|
136
59
|
|
|
137
|
-
export type
|
|
138
|
-
cart:
|
|
139
|
-
|
|
140
|
-
category:
|
|
141
|
-
channel:
|
|
142
|
-
customer: CustomerRepository
|
|
60
|
+
export type PagedQueryResponseMap = {
|
|
61
|
+
'cart-discount': ctp.CartDiscountPagedQueryResponse
|
|
62
|
+
cart: ctp.CartPagedQueryResponse
|
|
63
|
+
category: ctp.CategoryPagedQueryResponse
|
|
64
|
+
channel: ctp.ChannelPagedQueryResponse
|
|
143
65
|
'customer-email-token': never
|
|
144
|
-
'customer-group':
|
|
66
|
+
'customer-group': ctp.CustomerGroupPagedQueryResponse
|
|
145
67
|
'customer-password-token': never
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
'
|
|
150
|
-
|
|
151
|
-
'order-edit':
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
'product-
|
|
155
|
-
'product-
|
|
156
|
-
'product-
|
|
157
|
-
|
|
158
|
-
'
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
'
|
|
164
|
-
|
|
165
|
-
|
|
68
|
+
customer: ctp.CustomerPagedQueryResponse
|
|
69
|
+
'discount-code': ctp.DiscountCodePagedQueryResponse
|
|
70
|
+
extension: ctp.ExtensionPagedQueryResponse
|
|
71
|
+
'inventory-entry': ctp.InventoryPagedQueryResponse
|
|
72
|
+
'key-value-document': ctp.CustomObjectPagedQueryResponse
|
|
73
|
+
'order-edit': ctp.OrderEditPagedQueryResponse
|
|
74
|
+
order: ctp.OrderPagedQueryResponse
|
|
75
|
+
payment: ctp.PaymentPagedQueryResponse
|
|
76
|
+
'product-discount': ctp.ProductDiscountPagedQueryResponse
|
|
77
|
+
'product-price': ctp.StandalonePricePagedQueryResponse
|
|
78
|
+
'product-projection': ctp.ProductProjectionPagedQueryResponse
|
|
79
|
+
'product-selection': ctp.ProductSelectionPagedQueryResponse
|
|
80
|
+
'product-type': ctp.ProductTypePagedQueryResponse
|
|
81
|
+
product: ctp.ProductPagedQueryResponse
|
|
82
|
+
'quote-request': ctp.QuoteRequestPagedQueryResponse
|
|
83
|
+
quote: ctp.QuotePagedQueryResponse
|
|
84
|
+
review: ctp.ReviewPagedQueryResponse
|
|
85
|
+
'shipping-method': ctp.ShippingMethodPagedQueryResponse
|
|
86
|
+
'shopping-list': ctp.ShoppingListPagedQueryResponse
|
|
87
|
+
'staged-quote': ctp.StagedQuotePagedQueryResponse
|
|
88
|
+
'standalone-price': ctp.StandalonePricePagedQueryResponse
|
|
89
|
+
state: ctp.StatePagedQueryResponse
|
|
90
|
+
store: ctp.StorePagedQueryResponse
|
|
91
|
+
subscription: ctp.SubscriptionPagedQueryResponse
|
|
92
|
+
'tax-category': ctp.TaxCategoryPagedQueryResponse
|
|
93
|
+
type: ctp.TypePagedQueryResponse
|
|
94
|
+
zone: ctp.ZonePagedQueryResponse
|
|
166
95
|
}
|