@labdigital/commercetools-mock 1.2.0 → 1.3.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.
- package/dist/index.d.mts +602 -0
- package/dist/index.d.ts +43 -26
- package/dist/index.global.js +6319 -6084
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +344 -163
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +340 -163
- package/dist/index.mjs.map +1 -1
- package/package.json +33 -39
- package/src/index.test.ts +2 -1
- package/src/lib/haversine.test.ts +1 -0
- package/src/lib/predicateParser.test.ts +2 -1
- package/src/lib/projectionSearchFilter.test.ts +2 -1
- package/src/lib/projectionSearchFilter.ts +2 -2
- package/src/oauth/server.ts +3 -4
- package/src/priceSelector.test.ts +2 -1
- package/src/priceSelector.ts +2 -2
- package/src/product-projection-search.ts +8 -8
- package/src/projectAPI.test.ts +1 -0
- package/src/repositories/abstract.ts +1 -1
- package/src/repositories/associate-role.ts +11 -0
- package/src/repositories/attribute-group.ts +11 -0
- package/src/repositories/business-unit.ts +11 -0
- package/src/repositories/cart-discount.ts +11 -4
- package/src/repositories/cart.ts +91 -9
- package/src/repositories/category.ts +3 -3
- package/src/repositories/channel.ts +3 -3
- package/src/repositories/custom-object.ts +3 -3
- package/src/repositories/customer-group.ts +3 -3
- package/src/repositories/customer.ts +4 -3
- package/src/repositories/discount-code.ts +3 -3
- package/src/repositories/errors.ts +1 -1
- package/src/repositories/extension.ts +3 -3
- package/src/repositories/helpers.ts +49 -6
- package/src/repositories/index.ts +6 -0
- package/src/repositories/inventory-entry.ts +4 -4
- package/src/repositories/my-order.ts +2 -2
- package/src/repositories/order-edit.ts +2 -2
- package/src/repositories/order.test.ts +10 -39
- package/src/repositories/order.ts +31 -16
- package/src/repositories/payment.ts +8 -7
- package/src/repositories/product-discount.ts +2 -2
- package/src/repositories/product-projection.ts +5 -5
- package/src/repositories/product-selection.ts +3 -2
- package/src/repositories/product-type.ts +2 -2
- package/src/repositories/product.ts +4 -9
- package/src/repositories/project.ts +2 -2
- package/src/repositories/quote-request.ts +2 -2
- package/src/repositories/quote.ts +2 -2
- package/src/repositories/review.ts +2 -2
- package/src/repositories/shipping-method.ts +2 -2
- package/src/repositories/shopping-list.ts +19 -13
- package/src/repositories/staged-quote.ts +2 -2
- package/src/repositories/standalone-price.ts +3 -3
- package/src/repositories/state.ts +2 -2
- package/src/repositories/store.ts +3 -2
- package/src/repositories/subscription.ts +1 -1
- package/src/repositories/tax-category.ts +2 -2
- package/src/repositories/type.ts +2 -2
- package/src/repositories/zone.ts +2 -2
- package/src/services/abstract.ts +2 -2
- package/src/services/cart.test.ts +2 -1
- package/src/services/cart.ts +4 -4
- package/src/services/category.test.ts +2 -1
- package/src/services/custom-object.test.ts +2 -1
- package/src/services/custom-object.ts +3 -3
- package/src/services/customer.test.ts +1 -0
- package/src/services/inventory-entry.test.ts +2 -1
- package/src/services/my-cart.test.ts +7 -3
- package/src/services/my-customer.test.ts +4 -2
- package/src/services/my-payment.test.ts +2 -1
- package/src/services/order.test.ts +2 -1
- package/src/services/payment.test.ts +2 -1
- package/src/services/product-projection.test.ts +3 -2
- package/src/services/product-type.test.ts +2 -1
- package/src/services/product.test.ts +2 -1
- package/src/services/project.ts +1 -1
- package/src/services/shipping-method.test.ts +2 -1
- package/src/services/standalone-price.test.ts +255 -244
- package/src/services/state.test.ts +2 -1
- package/src/services/store.test.ts +6 -1
- package/src/services/tax-category.test.ts +2 -1
- package/src/storage/abstract.ts +1 -1
- package/src/storage/in-memory.ts +7 -1
- package/src/types.ts +7 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
CustomerReference,
|
|
3
3
|
ShoppingList,
|
|
4
4
|
ShoppingListDraft,
|
|
@@ -8,6 +8,7 @@ import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
|
8
8
|
import {
|
|
9
9
|
createCustomFields,
|
|
10
10
|
getReferenceFromResourceIdentifier,
|
|
11
|
+
getStoreKeyReference,
|
|
11
12
|
} from './helpers'
|
|
12
13
|
|
|
13
14
|
export class ShoppingListRepository extends AbstractResourceRepository<'shopping-list'> {
|
|
@@ -27,16 +28,21 @@ export class ShoppingListRepository extends AbstractResourceRepository<'shopping
|
|
|
27
28
|
this._storage
|
|
28
29
|
),
|
|
29
30
|
textLineItems: [],
|
|
30
|
-
lineItems:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
lineItems:
|
|
32
|
+
draft.lineItems?.map((e) => ({
|
|
33
|
+
...getBaseResourceProperties(),
|
|
34
|
+
...e,
|
|
35
|
+
addedAt: e.addedAt ?? '',
|
|
36
|
+
productId: e.productId ?? '',
|
|
37
|
+
name: {},
|
|
38
|
+
quantity: e.quantity ?? 1,
|
|
39
|
+
productType: { typeId: 'product-type', id: '' },
|
|
40
|
+
custom: createCustomFields(
|
|
41
|
+
e.custom,
|
|
42
|
+
context.projectKey,
|
|
43
|
+
this._storage
|
|
44
|
+
),
|
|
45
|
+
})) ?? [],
|
|
40
46
|
customer: draft.customer
|
|
41
47
|
? getReferenceFromResourceIdentifier<CustomerReference>(
|
|
42
48
|
draft.customer,
|
|
@@ -44,8 +50,8 @@ export class ShoppingListRepository extends AbstractResourceRepository<'shopping
|
|
|
44
50
|
this._storage
|
|
45
51
|
)
|
|
46
52
|
: undefined,
|
|
47
|
-
store: draft.store
|
|
48
|
-
?
|
|
53
|
+
store: draft.store
|
|
54
|
+
? getStoreKeyReference(draft.store, context.projectKey, this._storage)
|
|
49
55
|
: undefined,
|
|
50
56
|
}
|
|
51
57
|
this.saveNew(context, resource)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
Quote,
|
|
3
3
|
StagedQuote,
|
|
4
4
|
StagedQuoteDraft,
|
|
5
5
|
StagedQuoteUpdateAction,
|
|
6
6
|
} from '@commercetools/platform-sdk'
|
|
7
|
-
import { Writable } from '../types'
|
|
7
|
+
import type { Writable } from '../types'
|
|
8
8
|
import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
9
9
|
|
|
10
10
|
export class StagedQuoteRepository extends AbstractResourceRepository<'staged-quote'> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
ChannelReference,
|
|
3
3
|
ChannelResourceIdentifier,
|
|
4
4
|
DiscountedPriceDraft,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
StandalonePriceSetDiscountedPriceAction,
|
|
10
10
|
} from '@commercetools/platform-sdk'
|
|
11
11
|
import { getBaseResourceProperties } from '../helpers'
|
|
12
|
-
import { Writable } from '../types'
|
|
12
|
+
import type { Writable } from '../types'
|
|
13
13
|
import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
14
14
|
import { createTypedMoney } from './helpers'
|
|
15
15
|
|
|
@@ -63,7 +63,7 @@ export class StandAlonePriceRepository extends AbstractResourceRepository<'stand
|
|
|
63
63
|
) => {
|
|
64
64
|
resource.value = createTypedMoney(action.value)
|
|
65
65
|
},
|
|
66
|
-
setDiscountedPrice: (
|
|
66
|
+
setDiscountedPrice: (
|
|
67
67
|
context: RepositoryContext,
|
|
68
68
|
resource: Writable<StandalonePrice>,
|
|
69
69
|
action: StandalonePriceSetDiscountedPriceAction
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
State,
|
|
3
3
|
StateChangeInitialAction,
|
|
4
4
|
StateChangeKeyAction,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
StateUpdateAction,
|
|
12
12
|
} from '@commercetools/platform-sdk'
|
|
13
13
|
import { getBaseResourceProperties } from '../helpers'
|
|
14
|
-
import { Writable } from '../types'
|
|
14
|
+
import type { Writable } from '../types'
|
|
15
15
|
import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
16
16
|
import { getReferenceFromResourceIdentifier } from './helpers'
|
|
17
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
ChannelReference,
|
|
3
3
|
ChannelResourceIdentifier,
|
|
4
4
|
Store,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
StoreUpdateAction,
|
|
12
12
|
} from '@commercetools/platform-sdk'
|
|
13
13
|
import { getBaseResourceProperties } from '../helpers'
|
|
14
|
-
import { Writable } from '../types'
|
|
14
|
+
import type { Writable } from '../types'
|
|
15
15
|
import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
16
16
|
import {
|
|
17
17
|
createCustomFields,
|
|
@@ -29,6 +29,7 @@ export class StoreRepository extends AbstractResourceRepository<'store'> {
|
|
|
29
29
|
key: draft.key,
|
|
30
30
|
name: draft.name,
|
|
31
31
|
languages: draft.languages ?? [],
|
|
32
|
+
countries: draft.countries ?? [],
|
|
32
33
|
distributionChannels: this.transformChannels(
|
|
33
34
|
context,
|
|
34
35
|
draft.distributionChannels
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
TaxCategory,
|
|
3
3
|
TaxCategoryAddTaxRateAction,
|
|
4
4
|
TaxCategoryChangeNameAction,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@commercetools/platform-sdk'
|
|
14
14
|
import { v4 as uuidv4 } from 'uuid'
|
|
15
15
|
import { getBaseResourceProperties } from '../helpers'
|
|
16
|
-
import { Writable } from '../types'
|
|
16
|
+
import type { Writable } from '../types'
|
|
17
17
|
import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
18
18
|
|
|
19
19
|
export class TaxCategoryRepository extends AbstractResourceRepository<'tax-category'> {
|
package/src/repositories/type.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
FieldDefinition,
|
|
3
3
|
InvalidOperationError,
|
|
4
4
|
Type,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import isEqual from 'lodash.isequal'
|
|
16
16
|
import { CommercetoolsError } from '../exceptions'
|
|
17
17
|
import { getBaseResourceProperties } from '../helpers'
|
|
18
|
-
import { Writable } from '../types'
|
|
18
|
+
import type { Writable } from '../types'
|
|
19
19
|
import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
20
20
|
|
|
21
21
|
export class TypeRepository extends AbstractResourceRepository<'type'> {
|
package/src/repositories/zone.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
Zone,
|
|
3
3
|
ZoneAddLocationAction,
|
|
4
4
|
ZoneChangeNameAction,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ZoneUpdateAction,
|
|
10
10
|
} from '@commercetools/platform-sdk'
|
|
11
11
|
import { getBaseResourceProperties } from '../helpers'
|
|
12
|
-
import { Writable } from '../types'
|
|
12
|
+
import type { Writable } from '../types'
|
|
13
13
|
import { AbstractResourceRepository, RepositoryContext } from './abstract'
|
|
14
14
|
|
|
15
15
|
export class ZoneRepository extends AbstractResourceRepository<'zone'> {
|
package/src/services/abstract.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Update } from '@commercetools/platform-sdk'
|
|
2
|
-
import { Request, Response, Router } from 'express'
|
|
1
|
+
import type { Update } from '@commercetools/platform-sdk'
|
|
2
|
+
import { type Request, type Response, Router } from 'express'
|
|
3
3
|
import { ParsedQs } from 'qs'
|
|
4
4
|
import { AbstractResourceRepository } from '../repositories/abstract'
|
|
5
5
|
import { getRepositoryContext } from '../repositories/helpers'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
Address,
|
|
3
3
|
Cart,
|
|
4
4
|
CentPrecisionMoney,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from '@commercetools/platform-sdk'
|
|
7
7
|
import assert from 'assert'
|
|
8
8
|
import supertest from 'supertest'
|
|
9
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
9
10
|
import { CommercetoolsMock } from '../index'
|
|
10
11
|
|
|
11
12
|
describe('Carts Query', () => {
|
package/src/services/cart.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Cart, CartDraft, Order } from '@commercetools/platform-sdk'
|
|
2
|
-
import { Request, Response, Router } from 'express'
|
|
3
|
-
import { CartRepository } from '../repositories/cart'
|
|
1
|
+
import type { Cart, CartDraft, Order } from '@commercetools/platform-sdk'
|
|
2
|
+
import type { Request, Response, Router } from 'express'
|
|
3
|
+
import type { CartRepository } from '../repositories/cart'
|
|
4
4
|
import { getRepositoryContext } from '../repositories/helpers'
|
|
5
|
-
import { OrderRepository } from '../repositories/order'
|
|
5
|
+
import type { OrderRepository } from '../repositories/order'
|
|
6
6
|
import AbstractService from './abstract'
|
|
7
7
|
|
|
8
8
|
export class CartService extends AbstractService {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Category } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { Category } from '@commercetools/platform-sdk'
|
|
2
2
|
import supertest from 'supertest'
|
|
3
|
+
import { beforeEach, describe, expect, test } from 'vitest'
|
|
3
4
|
import { CommercetoolsMock } from '../index'
|
|
4
5
|
|
|
5
6
|
describe('Categories Query', () => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CustomObject } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { CustomObject } from '@commercetools/platform-sdk'
|
|
2
2
|
import supertest from 'supertest'
|
|
3
3
|
import { getBaseResourceProperties } from '../helpers'
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
4
5
|
import { CommercetoolsMock } from '../index'
|
|
5
6
|
|
|
6
7
|
describe('CustomObject create', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CustomObjectDraft } from '@commercetools/platform-sdk'
|
|
2
|
-
import { Request, Response, Router } from 'express'
|
|
3
|
-
import { CustomObjectRepository } from '../repositories/custom-object'
|
|
1
|
+
import type { CustomObjectDraft } from '@commercetools/platform-sdk'
|
|
2
|
+
import type { Request, Response, Router } from 'express'
|
|
3
|
+
import type { CustomObjectRepository } from '../repositories/custom-object'
|
|
4
4
|
import { getRepositoryContext } from '../repositories/helpers'
|
|
5
5
|
import AbstractService from './abstract'
|
|
6
6
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Customer } from '@commercetools/platform-sdk'
|
|
2
2
|
import assert from 'assert'
|
|
3
3
|
import supertest from 'supertest'
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
4
5
|
import { CommercetoolsMock, getBaseResourceProperties } from '../index'
|
|
5
6
|
|
|
6
7
|
describe('Customer Update Actions', () => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { InventoryEntry, Type } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { InventoryEntry, Type } from '@commercetools/platform-sdk'
|
|
2
2
|
import assert from 'assert'
|
|
3
3
|
import supertest from 'supertest'
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
4
5
|
import { CommercetoolsMock } from '../index'
|
|
5
6
|
|
|
6
7
|
describe('Inventory Entry Query', () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MyCartDraft } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { Cart, MyCartDraft } from '@commercetools/platform-sdk'
|
|
2
2
|
import supertest from 'supertest'
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
3
4
|
import { CommercetoolsMock } from '../index'
|
|
4
5
|
|
|
5
6
|
const ctMock = new CommercetoolsMock()
|
|
@@ -38,6 +39,10 @@ describe('MyCart', () => {
|
|
|
38
39
|
lastModifiedAt: expect.anything(),
|
|
39
40
|
version: 1,
|
|
40
41
|
cartState: 'Active',
|
|
42
|
+
discountCodes: [],
|
|
43
|
+
directDiscounts: [],
|
|
44
|
+
inventoryMode: 'None',
|
|
45
|
+
itemShippingAddresses: [],
|
|
41
46
|
lineItems: [],
|
|
42
47
|
customLineItems: [],
|
|
43
48
|
shipping: [],
|
|
@@ -51,10 +56,9 @@ describe('MyCart', () => {
|
|
|
51
56
|
taxMode: 'Platform',
|
|
52
57
|
taxRoundingMode: 'HalfEven',
|
|
53
58
|
taxCalculationMode: 'LineItemLevel',
|
|
54
|
-
|
|
55
59
|
refusedGifts: [],
|
|
56
60
|
origin: 'Customer',
|
|
57
|
-
})
|
|
61
|
+
} as Cart)
|
|
58
62
|
})
|
|
59
63
|
|
|
60
64
|
test('Get my cart by ID', async () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MyCustomerDraft } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { MyCustomerDraft } from '@commercetools/platform-sdk'
|
|
2
2
|
import supertest from 'supertest'
|
|
3
|
+
import { afterEach, describe, expect, test } from 'vitest'
|
|
3
4
|
import { CommercetoolsMock } from '../index'
|
|
4
5
|
|
|
5
6
|
const ctMock = new CommercetoolsMock()
|
|
@@ -24,13 +25,14 @@ describe('Me', () => {
|
|
|
24
25
|
customer: {
|
|
25
26
|
...draft,
|
|
26
27
|
password: 'cDRzc3cwcmQ=',
|
|
28
|
+
authenticationMode: 'Password',
|
|
27
29
|
version: 1,
|
|
28
30
|
isEmailVerified: false,
|
|
29
31
|
addresses: [],
|
|
30
32
|
id: expect.anything(),
|
|
31
33
|
createdAt: expect.anything(),
|
|
32
34
|
lastModifiedAt: expect.anything(),
|
|
33
|
-
}
|
|
35
|
+
}
|
|
34
36
|
})
|
|
35
37
|
})
|
|
36
38
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MyPaymentDraft } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { MyPaymentDraft } from '@commercetools/platform-sdk'
|
|
2
2
|
import supertest from 'supertest'
|
|
3
|
+
import { beforeEach, describe, expect, test } from 'vitest'
|
|
3
4
|
import { CommercetoolsMock } from '../index'
|
|
4
5
|
|
|
5
6
|
const ctMock = new CommercetoolsMock()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import assert from 'assert'
|
|
2
|
-
import { Order, Payment, State } from '@commercetools/platform-sdk'
|
|
2
|
+
import type { Order, Payment, State } from '@commercetools/platform-sdk'
|
|
3
3
|
import supertest from 'supertest'
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
4
5
|
import { CommercetoolsMock, getBaseResourceProperties } from '../index'
|
|
5
6
|
|
|
6
7
|
describe('Order Query', () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PaymentDraft } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { PaymentDraft } from '@commercetools/platform-sdk'
|
|
2
2
|
import supertest from 'supertest'
|
|
3
|
+
import { beforeEach, describe, expect, test } from 'vitest'
|
|
3
4
|
import { CommercetoolsMock } from '../index'
|
|
4
5
|
|
|
5
6
|
const ctMock = new CommercetoolsMock()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
Product,
|
|
3
3
|
ProductDraft,
|
|
4
4
|
ProductProjection,
|
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
} from '@commercetools/platform-sdk'
|
|
9
9
|
import supertest from 'supertest'
|
|
10
10
|
import * as timekeeper from 'timekeeper'
|
|
11
|
-
import {
|
|
11
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
12
12
|
import { CommercetoolsMock } from '../index'
|
|
13
|
+
import { Writable } from '../types'
|
|
13
14
|
|
|
14
15
|
const ctMock = new CommercetoolsMock()
|
|
15
16
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ProductTypeDraft } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { ProductTypeDraft } from '@commercetools/platform-sdk'
|
|
2
2
|
import supertest from 'supertest'
|
|
3
|
+
import { describe, expect, test } from 'vitest'
|
|
3
4
|
import { CommercetoolsMock } from '../index'
|
|
4
5
|
|
|
5
6
|
const ctMock = new CommercetoolsMock()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
Image,
|
|
3
3
|
PriceDraft,
|
|
4
4
|
Product,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from '@commercetools/platform-sdk'
|
|
8
8
|
import assert from 'assert'
|
|
9
9
|
import supertest from 'supertest'
|
|
10
|
+
import { beforeEach, describe, expect, test } from 'vitest'
|
|
10
11
|
import { CommercetoolsMock } from '../index'
|
|
11
12
|
|
|
12
13
|
const ctMock = new CommercetoolsMock()
|
package/src/services/project.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Update } from '@commercetools/platform-sdk'
|
|
1
|
+
import type { Update } from '@commercetools/platform-sdk'
|
|
2
2
|
import { Request, Response, Router } from 'express'
|
|
3
3
|
import { getRepositoryContext } from '../repositories/helpers'
|
|
4
4
|
import { ProjectRepository } from '../repositories/project'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
ShippingMethodDraft,
|
|
3
3
|
TaxCategoryDraft,
|
|
4
4
|
} from '@commercetools/platform-sdk'
|
|
5
5
|
import supertest from 'supertest'
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest'
|
|
6
7
|
import { CommercetoolsMock } from '../index'
|
|
7
8
|
|
|
8
9
|
const ctMock = new CommercetoolsMock()
|