@labdigital/commercetools-mock 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/{index.mjs → index.cjs} +2423 -1905
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.js +2385 -1943
  4. package/dist/index.js.map +1 -1
  5. package/package.json +6 -7
  6. package/src/ctMock.ts +11 -11
  7. package/src/index.test.ts +1 -1
  8. package/src/index.ts +2 -2
  9. package/src/lib/haversine.test.ts +1 -1
  10. package/src/lib/masking.ts +1 -1
  11. package/src/lib/parser.ts +2 -0
  12. package/src/lib/predicateParser.test.ts +1 -1
  13. package/src/lib/predicateParser.ts +3 -4
  14. package/src/lib/projectionSearchFilter.test.ts +3 -3
  15. package/src/lib/projectionSearchFilter.ts +5 -6
  16. package/src/oauth/server.ts +4 -4
  17. package/src/priceSelector.test.ts +1 -1
  18. package/src/priceSelector.ts +2 -2
  19. package/src/product-projection-search.ts +6 -6
  20. package/src/projectAPI.test.ts +1 -1
  21. package/src/projectAPI.ts +5 -5
  22. package/src/repositories/abstract.ts +5 -5
  23. package/src/repositories/associate-role.ts +1 -1
  24. package/src/repositories/attribute-group.ts +1 -1
  25. package/src/repositories/business-unit.ts +1 -1
  26. package/src/repositories/cart-discount.ts +4 -4
  27. package/src/repositories/cart.ts +5 -5
  28. package/src/repositories/category.ts +4 -4
  29. package/src/repositories/channel.ts +4 -4
  30. package/src/repositories/custom-object.ts +5 -5
  31. package/src/repositories/customer-group.ts +4 -4
  32. package/src/repositories/customer.ts +4 -4
  33. package/src/repositories/discount-code.ts +4 -4
  34. package/src/repositories/errors.ts +1 -1
  35. package/src/repositories/extension.ts +4 -4
  36. package/src/repositories/helpers.ts +3 -3
  37. package/src/repositories/index.ts +37 -37
  38. package/src/repositories/inventory-entry.ts +4 -4
  39. package/src/repositories/my-order.ts +2 -2
  40. package/src/repositories/order-edit.ts +3 -3
  41. package/src/repositories/order.test.ts +2 -2
  42. package/src/repositories/order.ts +5 -5
  43. package/src/repositories/payment.ts +4 -4
  44. package/src/repositories/product-discount.ts +4 -4
  45. package/src/repositories/product-projection.ts +4 -4
  46. package/src/repositories/product-selection.ts +3 -3
  47. package/src/repositories/product-type.ts +3 -3
  48. package/src/repositories/product.ts +4 -4
  49. package/src/repositories/project.ts +3 -3
  50. package/src/repositories/quote-request.ts +2 -2
  51. package/src/repositories/quote.ts +2 -2
  52. package/src/repositories/review.ts +3 -3
  53. package/src/repositories/shipping-method.ts +4 -4
  54. package/src/repositories/shopping-list.ts +3 -3
  55. package/src/repositories/staged-quote.ts +2 -2
  56. package/src/repositories/standalone-price.ts +4 -4
  57. package/src/repositories/state.ts +4 -4
  58. package/src/repositories/store.ts +4 -4
  59. package/src/repositories/subscription.ts +3 -3
  60. package/src/repositories/tax-category.ts +3 -3
  61. package/src/repositories/type.ts +4 -4
  62. package/src/repositories/zone.ts +3 -3
  63. package/src/server.ts +1 -1
  64. package/src/services/abstract.ts +2 -2
  65. package/src/services/cart-discount.ts +2 -2
  66. package/src/services/cart.test.ts +1 -1
  67. package/src/services/cart.ts +4 -4
  68. package/src/services/category.test.ts +1 -1
  69. package/src/services/category.ts +2 -2
  70. package/src/services/channel.ts +2 -2
  71. package/src/services/custom-object.test.ts +2 -2
  72. package/src/services/custom-object.ts +3 -3
  73. package/src/services/customer-group.ts +2 -2
  74. package/src/services/customer.test.ts +1 -1
  75. package/src/services/customer.ts +4 -4
  76. package/src/services/discount-code.ts +2 -2
  77. package/src/services/extension.ts +2 -2
  78. package/src/services/index.ts +29 -29
  79. package/src/services/inventory-entry.test.ts +1 -1
  80. package/src/services/inventory-entry.ts +2 -2
  81. package/src/services/my-cart.test.ts +1 -1
  82. package/src/services/my-cart.ts +2 -2
  83. package/src/services/my-customer.test.ts +1 -1
  84. package/src/services/my-customer.ts +3 -3
  85. package/src/services/my-order.ts +2 -2
  86. package/src/services/my-payment.test.ts +1 -1
  87. package/src/services/my-payment.ts +2 -2
  88. package/src/services/order.test.ts +1 -1
  89. package/src/services/order.ts +3 -3
  90. package/src/services/payment.test.ts +1 -1
  91. package/src/services/payment.ts +2 -2
  92. package/src/services/product-discount.ts +2 -2
  93. package/src/services/product-projection.test.ts +2 -2
  94. package/src/services/product-projection.ts +3 -3
  95. package/src/services/product-type.test.ts +1 -1
  96. package/src/services/product-type.ts +2 -2
  97. package/src/services/product.test.ts +1 -1
  98. package/src/services/product.ts +2 -2
  99. package/src/services/project.ts +2 -2
  100. package/src/services/shipping-method.test.ts +1 -1
  101. package/src/services/shipping-method.ts +2 -2
  102. package/src/services/shopping-list.ts +2 -2
  103. package/src/services/standalone-price.test.ts +1 -1
  104. package/src/services/standalone-price.ts +3 -3
  105. package/src/services/state.test.ts +1 -1
  106. package/src/services/state.ts +2 -2
  107. package/src/services/store.test.ts +1 -1
  108. package/src/services/store.ts +2 -2
  109. package/src/services/subscription.ts +2 -2
  110. package/src/services/tax-category.test.ts +1 -1
  111. package/src/services/tax-category.ts +2 -2
  112. package/src/services/type.ts +2 -2
  113. package/src/services/zone.ts +2 -2
  114. package/src/storage/abstract.ts +1 -1
  115. package/src/storage/in-memory.ts +6 -6
  116. package/src/storage/index.ts +2 -2
  117. package/src/types.ts +2 -2
  118. package/dist/index.mjs.map +0 -1
  119. /package/dist/{index.d.mts → index.d.cts} +0 -0
@@ -28,14 +28,14 @@ import type {
28
28
  Store,
29
29
  } from '@commercetools/platform-sdk'
30
30
  import assert from 'assert'
31
- import { CommercetoolsError } from '../exceptions'
32
- import { getBaseResourceProperties } from '../helpers'
33
- import type { Writable } from '../types'
31
+ import { CommercetoolsError } from '../exceptions.js'
32
+ import { getBaseResourceProperties } from '../helpers.js'
33
+ import type { Writable } from '../types.js'
34
34
  import {
35
35
  AbstractResourceRepository,
36
36
  type QueryParams,
37
37
  RepositoryContext,
38
- } from './abstract'
38
+ } from './abstract.js'
39
39
  import {
40
40
  createAddress,
41
41
  createCentPrecisionMoney,
@@ -43,7 +43,7 @@ import {
43
43
  createPrice,
44
44
  createTypedMoney,
45
45
  resolveStoreReference,
46
- } from './helpers'
46
+ } from './helpers.js'
47
47
 
48
48
  export class OrderRepository extends AbstractResourceRepository<'order'> {
49
49
  getTypeId() {
@@ -12,14 +12,14 @@ import type {
12
12
  TransactionDraft,
13
13
  } from '@commercetools/platform-sdk'
14
14
  import { v4 as uuidv4 } from 'uuid'
15
- import { getBaseResourceProperties } from '../helpers'
16
- import type { Writable } from '../types'
17
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
15
+ import { getBaseResourceProperties } from '../helpers.js'
16
+ import type { Writable } from '../types.js'
17
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
18
18
  import {
19
19
  createCentPrecisionMoney,
20
20
  createCustomFields,
21
21
  getReferenceFromResourceIdentifier,
22
- } from './helpers'
22
+ } from './helpers.js'
23
23
 
24
24
  export class PaymentRepository extends AbstractResourceRepository<'payment'> {
25
25
  getTypeId() {
@@ -18,10 +18,10 @@ import type {
18
18
  ProductDiscountValueExternal,
19
19
  ProductDiscountValueRelative,
20
20
  } from '@commercetools/platform-sdk'
21
- import { getBaseResourceProperties } from '../helpers'
22
- import type { Writable } from '../types'
23
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
24
- import { createTypedMoney } from './helpers'
21
+ import { getBaseResourceProperties } from '../helpers.js'
22
+ import type { Writable } from '../types.js'
23
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
24
+ import { createTypedMoney } from './helpers.js'
25
25
 
26
26
  export class ProductDiscountRepository extends AbstractResourceRepository<'product-discount'> {
27
27
  getTypeId() {
@@ -1,13 +1,13 @@
1
1
  import type { ProductDraft, ProductProjection } from '@commercetools/platform-sdk'
2
2
  import { ParsedQs } from 'qs'
3
- import { QueryParamsAsArray } from '../helpers'
4
- import { ProductProjectionSearch } from '../product-projection-search'
5
- import { type AbstractStorage } from '../storage'
3
+ import { QueryParamsAsArray } from '../helpers.js'
4
+ import { ProductProjectionSearch } from '../product-projection-search.js'
5
+ import { type AbstractStorage } from '../storage/index.js'
6
6
  import {
7
7
  AbstractResourceRepository,
8
8
  type QueryParams,
9
9
  RepositoryContext,
10
- } from './abstract'
10
+ } from './abstract.js'
11
11
 
12
12
  export class ProductProjectionRepository extends AbstractResourceRepository<'product-projection'> {
13
13
  protected _searchService: ProductProjectionSearch
@@ -4,9 +4,9 @@ import type {
4
4
  Review,
5
5
  ReviewUpdateAction,
6
6
  } from '@commercetools/platform-sdk'
7
- import { getBaseResourceProperties } from '../helpers'
8
- import type { Writable } from '../types'
9
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
7
+ import { getBaseResourceProperties } from '../helpers.js'
8
+ import type { Writable } from '../types.js'
9
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
10
10
 
11
11
  export class ProductSelectionRepository extends AbstractResourceRepository<'product-selection'> {
12
12
  getTypeId() {
@@ -12,9 +12,9 @@ import type {
12
12
  ProductTypeRemoveEnumValuesAction,
13
13
  ProductTypeUpdateAction,
14
14
  } from '@commercetools/platform-sdk'
15
- import { getBaseResourceProperties } from '../helpers'
16
- import type { Writable } from '../types'
17
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
15
+ import { getBaseResourceProperties } from '../helpers.js'
16
+ import type { Writable } from '../types.js'
17
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
18
18
 
19
19
  export class ProductTypeRepository extends AbstractResourceRepository<'product-type'> {
20
20
  getTypeId() {
@@ -20,10 +20,10 @@ import type {
20
20
  ProductRemovePriceAction,
21
21
  } from '@commercetools/platform-sdk'
22
22
  import { v4 as uuidv4 } from 'uuid'
23
- import type { Writable } from '../types'
24
- import { getBaseResourceProperties } from '../helpers'
25
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
26
- import { createTypedMoney, getReferenceFromResourceIdentifier } from './helpers'
23
+ import type { Writable } from '../types.js'
24
+ import { getBaseResourceProperties } from '../helpers.js'
25
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
26
+ import { createTypedMoney, getReferenceFromResourceIdentifier } from './helpers.js'
27
27
  import deepEqual from 'deep-equal'
28
28
 
29
29
  export class ProductRepository extends AbstractResourceRepository<'product'> {
@@ -13,9 +13,9 @@ import type {
13
13
  ProjectSetShippingRateInputTypeAction,
14
14
  ProjectUpdateAction,
15
15
  } from '@commercetools/platform-sdk'
16
- import { maskSecretValue } from '../lib/masking'
17
- import type { Writable } from '../types'
18
- import { AbstractRepository, RepositoryContext } from './abstract'
16
+ import { maskSecretValue } from '../lib/masking.js'
17
+ import type { Writable } from '../types.js'
18
+ import { AbstractRepository, RepositoryContext } from './abstract.js'
19
19
 
20
20
  export class ProjectRepository extends AbstractRepository<Project> {
21
21
  get(context: RepositoryContext): Project | null {
@@ -3,8 +3,8 @@ import type {
3
3
  QuoteRequestDraft,
4
4
  QuoteRequestUpdateAction,
5
5
  } from '@commercetools/platform-sdk'
6
- import type { Writable } from '../types'
7
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
6
+ import type { Writable } from '../types.js'
7
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
8
8
 
9
9
  export class QuoteRequestRepository extends AbstractResourceRepository<'quote-request'> {
10
10
  getTypeId() {
@@ -3,8 +3,8 @@ import type {
3
3
  QuoteDraft,
4
4
  QuoteUpdateAction,
5
5
  } from '@commercetools/platform-sdk'
6
- import type { Writable } from '../types'
7
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
6
+ import type { Writable } from '../types.js'
7
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
8
8
 
9
9
  export class QuoteRepository extends AbstractResourceRepository<'quote'> {
10
10
  getTypeId() {
@@ -3,9 +3,9 @@ import type {
3
3
  ReviewDraft,
4
4
  ReviewUpdateAction,
5
5
  } from '@commercetools/platform-sdk'
6
- import { getBaseResourceProperties } from '../helpers'
7
- import type { Writable } from '../types'
8
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
6
+ import { getBaseResourceProperties } from '../helpers.js'
7
+ import type { Writable } from '../types.js'
8
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
9
9
 
10
10
  export class ReviewRepository extends AbstractResourceRepository<'review'> {
11
11
  getTypeId() {
@@ -21,14 +21,14 @@ import type {
21
21
  ZoneReference,
22
22
  } from '@commercetools/platform-sdk'
23
23
  import deepEqual from 'deep-equal'
24
- import { getBaseResourceProperties } from '../helpers'
25
- import type { Writable } from '../types'
26
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
24
+ import { getBaseResourceProperties } from '../helpers.js'
25
+ import type { Writable } from '../types.js'
26
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
27
27
  import {
28
28
  createCustomFields,
29
29
  createTypedMoney,
30
30
  getReferenceFromResourceIdentifier,
31
- } from './helpers'
31
+ } from './helpers.js'
32
32
 
33
33
  export class ShippingMethodRepository extends AbstractResourceRepository<'shipping-method'> {
34
34
  getTypeId() {
@@ -3,13 +3,13 @@ import type {
3
3
  ShoppingList,
4
4
  ShoppingListDraft,
5
5
  } from '@commercetools/platform-sdk'
6
- import { getBaseResourceProperties } from '../helpers'
7
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
6
+ import { getBaseResourceProperties } from '../helpers.js'
7
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
8
8
  import {
9
9
  createCustomFields,
10
10
  getReferenceFromResourceIdentifier,
11
11
  getStoreKeyReference,
12
- } from './helpers'
12
+ } from './helpers.js'
13
13
 
14
14
  export class ShoppingListRepository extends AbstractResourceRepository<'shopping-list'> {
15
15
  getTypeId() {
@@ -4,8 +4,8 @@ import type {
4
4
  StagedQuoteDraft,
5
5
  StagedQuoteUpdateAction,
6
6
  } from '@commercetools/platform-sdk'
7
- import type { Writable } from '../types'
8
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
7
+ import type { Writable } from '../types.js'
8
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
9
9
 
10
10
  export class StagedQuoteRepository extends AbstractResourceRepository<'staged-quote'> {
11
11
  getTypeId() {
@@ -8,10 +8,10 @@ import type {
8
8
  StandalonePriceDraft,
9
9
  StandalonePriceSetDiscountedPriceAction,
10
10
  } from '@commercetools/platform-sdk'
11
- import { getBaseResourceProperties } from '../helpers'
12
- import type { Writable } from '../types'
13
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
14
- import { createTypedMoney } from './helpers'
11
+ import { getBaseResourceProperties } from '../helpers.js'
12
+ import type { Writable } from '../types.js'
13
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
14
+ import { createTypedMoney } from './helpers.js'
15
15
 
16
16
  export class StandAlonePriceRepository extends AbstractResourceRepository<'standalone-price'> {
17
17
  getTypeId() {
@@ -10,10 +10,10 @@ import type {
10
10
  StateSetTransitionsAction,
11
11
  StateUpdateAction,
12
12
  } from '@commercetools/platform-sdk'
13
- import { getBaseResourceProperties } from '../helpers'
14
- import type { Writable } from '../types'
15
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
16
- import { getReferenceFromResourceIdentifier } from './helpers'
13
+ import { getBaseResourceProperties } from '../helpers.js'
14
+ import type { Writable } from '../types.js'
15
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
16
+ import { getReferenceFromResourceIdentifier } from './helpers.js'
17
17
 
18
18
  export class StateRepository extends AbstractResourceRepository<'state'> {
19
19
  getTypeId() {
@@ -10,13 +10,13 @@ import type {
10
10
  StoreSetNameAction,
11
11
  StoreUpdateAction,
12
12
  } from '@commercetools/platform-sdk'
13
- import { getBaseResourceProperties } from '../helpers'
14
- import type { Writable } from '../types'
15
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
13
+ import { getBaseResourceProperties } from '../helpers.js'
14
+ import type { Writable } from '../types.js'
15
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
16
16
  import {
17
17
  createCustomFields,
18
18
  getReferenceFromResourceIdentifier,
19
- } from './helpers'
19
+ } from './helpers.js'
20
20
 
21
21
  export class StoreRepository extends AbstractResourceRepository<'store'> {
22
22
  getTypeId() {
@@ -3,9 +3,9 @@ import type {
3
3
  Subscription,
4
4
  SubscriptionDraft,
5
5
  } from '@commercetools/platform-sdk'
6
- import { CommercetoolsError } from '../exceptions'
7
- import { getBaseResourceProperties } from '../helpers'
8
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
6
+ import { CommercetoolsError } from '../exceptions.js'
7
+ import { getBaseResourceProperties } from '../helpers.js'
8
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
9
9
 
10
10
  export class SubscriptionRepository extends AbstractResourceRepository<'subscription'> {
11
11
  getTypeId() {
@@ -12,9 +12,9 @@ import type {
12
12
  TaxRateDraft,
13
13
  } from '@commercetools/platform-sdk'
14
14
  import { v4 as uuidv4 } from 'uuid'
15
- import { getBaseResourceProperties } from '../helpers'
16
- import type { Writable } from '../types'
17
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
15
+ import { getBaseResourceProperties } from '../helpers.js'
16
+ import type { Writable } from '../types.js'
17
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
18
18
 
19
19
  export class TaxCategoryRepository extends AbstractResourceRepository<'tax-category'> {
20
20
  getTypeId() {
@@ -13,10 +13,10 @@ import type {
13
13
  TypeUpdateAction,
14
14
  } from '@commercetools/platform-sdk'
15
15
  import isEqual from 'lodash.isequal'
16
- import { CommercetoolsError } from '../exceptions'
17
- import { getBaseResourceProperties } from '../helpers'
18
- import type { Writable } from '../types'
19
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
16
+ import { CommercetoolsError } from '../exceptions.js'
17
+ import { getBaseResourceProperties } from '../helpers.js'
18
+ import type { Writable } from '../types.js'
19
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
20
20
 
21
21
  export class TypeRepository extends AbstractResourceRepository<'type'> {
22
22
  getTypeId() {
@@ -8,9 +8,9 @@ import type {
8
8
  ZoneSetKeyAction,
9
9
  ZoneUpdateAction,
10
10
  } from '@commercetools/platform-sdk'
11
- import { getBaseResourceProperties } from '../helpers'
12
- import type { Writable } from '../types'
13
- import { AbstractResourceRepository, RepositoryContext } from './abstract'
11
+ import { getBaseResourceProperties } from '../helpers.js'
12
+ import type { Writable } from '../types.js'
13
+ import { AbstractResourceRepository, RepositoryContext } from './abstract.js'
14
14
 
15
15
  export class ZoneRepository extends AbstractResourceRepository<'zone'> {
16
16
  getTypeId() {
package/src/server.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CommercetoolsMock } from './index'
1
+ import { CommercetoolsMock } from './index.js'
2
2
 
3
3
  process.on('SIGINT', function () {
4
4
  console.info('Stopping server...')
@@ -1,8 +1,8 @@
1
1
  import type { Update } from '@commercetools/platform-sdk'
2
2
  import { type Request, type Response, Router } from 'express'
3
3
  import { ParsedQs } from 'qs'
4
- import { AbstractResourceRepository } from '../repositories/abstract'
5
- import { getRepositoryContext } from '../repositories/helpers'
4
+ import { AbstractResourceRepository } from '../repositories/abstract.js'
5
+ import { getRepositoryContext } from '../repositories/helpers.js'
6
6
 
7
7
  export default abstract class AbstractService {
8
8
  protected abstract getBasePath(): string
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express'
2
- import { CartDiscountRepository } from '../repositories/cart-discount'
3
- import AbstractService from './abstract'
2
+ import { CartDiscountRepository } from '../repositories/cart-discount.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class CartDiscountService extends AbstractService {
6
6
  public repository: CartDiscountRepository
@@ -7,7 +7,7 @@ import type {
7
7
  import assert from 'assert'
8
8
  import supertest from 'supertest'
9
9
  import { afterEach, beforeEach, describe, expect, test } from 'vitest'
10
- import { CommercetoolsMock } from '../index'
10
+ import { CommercetoolsMock } from '../index.js'
11
11
 
12
12
  describe('Carts Query', () => {
13
13
  const ctMock = new CommercetoolsMock()
@@ -1,9 +1,9 @@
1
1
  import type { Cart, CartDraft, Order } from '@commercetools/platform-sdk'
2
2
  import type { Request, Response, Router } from 'express'
3
- import type { CartRepository } from '../repositories/cart'
4
- import { getRepositoryContext } from '../repositories/helpers'
5
- import type { OrderRepository } from '../repositories/order'
6
- import AbstractService from './abstract'
3
+ import type { CartRepository } from '../repositories/cart.js'
4
+ import { getRepositoryContext } from '../repositories/helpers.js'
5
+ import type { OrderRepository } from '../repositories/order.js'
6
+ import AbstractService from './abstract.js'
7
7
 
8
8
  export class CartService extends AbstractService {
9
9
  public repository: CartRepository
@@ -1,7 +1,7 @@
1
1
  import type { Category } from '@commercetools/platform-sdk'
2
2
  import supertest from 'supertest'
3
3
  import { beforeEach, describe, expect, test } from 'vitest'
4
- import { CommercetoolsMock } from '../index'
4
+ import { CommercetoolsMock } from '../index.js'
5
5
 
6
6
  describe('Categories Query', () => {
7
7
  const ctMock = new CommercetoolsMock()
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express'
2
- import { CategoryRepository } from '../repositories/category'
3
- import AbstractService from './abstract'
2
+ import { CategoryRepository } from '../repositories/category.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class CategoryServices extends AbstractService {
6
6
  public repository: CategoryRepository
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express'
2
- import { ChannelRepository } from '../repositories/channel'
3
- import AbstractService from './abstract'
2
+ import { ChannelRepository } from '../repositories/channel.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class ChannelService extends AbstractService {
6
6
  public repository: ChannelRepository
@@ -1,8 +1,8 @@
1
1
  import type { CustomObject } from '@commercetools/platform-sdk'
2
2
  import supertest from 'supertest'
3
- import { getBaseResourceProperties } from '../helpers'
3
+ import { getBaseResourceProperties } from '../helpers.js'
4
4
  import { afterEach, beforeEach, describe, expect, test } from 'vitest'
5
- import { CommercetoolsMock } from '../index'
5
+ import { CommercetoolsMock } from '../index.js'
6
6
 
7
7
  describe('CustomObject create', () => {
8
8
  const ctMock = new CommercetoolsMock()
@@ -1,8 +1,8 @@
1
1
  import type { CustomObjectDraft } from '@commercetools/platform-sdk'
2
2
  import type { Request, Response, Router } from 'express'
3
- import type { CustomObjectRepository } from '../repositories/custom-object'
4
- import { getRepositoryContext } from '../repositories/helpers'
5
- import AbstractService from './abstract'
3
+ import type { CustomObjectRepository } from '../repositories/custom-object.js'
4
+ import { getRepositoryContext } from '../repositories/helpers.js'
5
+ import AbstractService from './abstract.js'
6
6
 
7
7
  export class CustomObjectService extends AbstractService {
8
8
  public repository: CustomObjectRepository
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express'
2
- import { CustomerGroupRepository } from '../repositories/customer-group'
3
- import AbstractService from './abstract'
2
+ import { CustomerGroupRepository } from '../repositories/customer-group.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class CustomerGroupService extends AbstractService {
6
6
  public repository: CustomerGroupRepository
@@ -2,7 +2,7 @@ import { Customer } from '@commercetools/platform-sdk'
2
2
  import assert from 'assert'
3
3
  import supertest from 'supertest'
4
4
  import { afterEach, beforeEach, describe, expect, test } from 'vitest'
5
- import { CommercetoolsMock, getBaseResourceProperties } from '../index'
5
+ import { CommercetoolsMock, getBaseResourceProperties } from '../index.js'
6
6
 
7
7
  describe('Customer Update Actions', () => {
8
8
  const ctMock = new CommercetoolsMock()
@@ -1,9 +1,9 @@
1
1
  import { Router } from 'express'
2
2
  import { v4 as uuidv4 } from 'uuid'
3
- import { getBaseResourceProperties } from '../helpers'
4
- import { CustomerRepository } from '../repositories/customer'
5
- import { getRepositoryContext } from '../repositories/helpers'
6
- import AbstractService from './abstract'
3
+ import { getBaseResourceProperties } from '../helpers.js'
4
+ import { CustomerRepository } from '../repositories/customer.js'
5
+ import { getRepositoryContext } from '../repositories/helpers.js'
6
+ import AbstractService from './abstract.js'
7
7
 
8
8
  export class CustomerService extends AbstractService {
9
9
  public repository: CustomerRepository
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express'
2
- import { DiscountCodeRepository } from '../repositories/discount-code'
3
- import AbstractService from './abstract'
2
+ import { DiscountCodeRepository } from '../repositories/discount-code.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class DiscountCodeService extends AbstractService {
6
6
  public repository: DiscountCodeRepository
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express'
2
- import { ExtensionRepository } from '../repositories/extension'
3
- import AbstractService from './abstract'
2
+ import { ExtensionRepository } from '../repositories/extension.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class ExtensionServices extends AbstractService {
6
6
  public repository: ExtensionRepository
@@ -1,32 +1,32 @@
1
- import { CartService } from './cart'
2
- import { CartDiscountService } from './cart-discount'
3
- import { CategoryServices } from './category'
4
- import { ChannelService } from './channel'
5
- import { CustomObjectService } from './custom-object'
6
- import { CustomerService } from './customer'
7
- import { CustomerGroupService } from './customer-group'
8
- import { DiscountCodeService } from './discount-code'
9
- import { ExtensionServices } from './extension'
10
- import { InventoryEntryService } from './inventory-entry'
11
- import { MyCartService } from './my-cart'
12
- import { MyCustomerService } from './my-customer'
13
- import { MyOrderService } from './my-order'
14
- import { MyPaymentService } from './my-payment'
15
- import { OrderService } from './order'
16
- import { PaymentService } from './payment'
17
- import { ProductService } from './product'
18
- import { ProductDiscountService } from './product-discount'
19
- import { ProductProjectionService } from './product-projection'
20
- import { ProductTypeService } from './product-type'
21
- import { ShippingMethodService } from './shipping-method'
22
- import { ShoppingListService } from './shopping-list'
23
- import { StandAlonePriceService } from './standalone-price'
24
- import { StateService } from './state'
25
- import { StoreService } from './store'
26
- import { SubscriptionService } from './subscription'
27
- import { TaxCategoryService } from './tax-category'
28
- import { TypeService } from './type'
29
- import { ZoneService } from './zone'
1
+ import { CartService } from './cart.js'
2
+ import { CartDiscountService } from './cart-discount.js'
3
+ import { CategoryServices } from './category.js'
4
+ import { ChannelService } from './channel.js'
5
+ import { CustomObjectService } from './custom-object.js'
6
+ import { CustomerService } from './customer.js'
7
+ import { CustomerGroupService } from './customer-group.js'
8
+ import { DiscountCodeService } from './discount-code.js'
9
+ import { ExtensionServices } from './extension.js'
10
+ import { InventoryEntryService } from './inventory-entry.js'
11
+ import { MyCartService } from './my-cart.js'
12
+ import { MyCustomerService } from './my-customer.js'
13
+ import { MyOrderService } from './my-order.js'
14
+ import { MyPaymentService } from './my-payment.js'
15
+ import { OrderService } from './order.js'
16
+ import { PaymentService } from './payment.js'
17
+ import { ProductService } from './product.js'
18
+ import { ProductDiscountService } from './product-discount.js'
19
+ import { ProductProjectionService } from './product-projection.js'
20
+ import { ProductTypeService } from './product-type.js'
21
+ import { ShippingMethodService } from './shipping-method.js'
22
+ import { ShoppingListService } from './shopping-list.js'
23
+ import { StandAlonePriceService } from './standalone-price.js'
24
+ import { StateService } from './state.js'
25
+ import { StoreService } from './store.js'
26
+ import { SubscriptionService } from './subscription.js'
27
+ import { TaxCategoryService } from './tax-category.js'
28
+ import { TypeService } from './type.js'
29
+ import { ZoneService } from './zone.js'
30
30
 
31
31
  export const createServices = (router: any, repos: any) => ({
32
32
  category: new CategoryServices(router, repos['category']),
@@ -2,7 +2,7 @@ import type { InventoryEntry, Type } from '@commercetools/platform-sdk'
2
2
  import assert from 'assert'
3
3
  import supertest from 'supertest'
4
4
  import { afterEach, beforeEach, describe, expect, test } from 'vitest'
5
- import { CommercetoolsMock } from '../index'
5
+ import { CommercetoolsMock } from '../index.js'
6
6
 
7
7
  describe('Inventory Entry Query', () => {
8
8
  const ctMock = new CommercetoolsMock()
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express'
2
- import { InventoryEntryRepository } from '../repositories/inventory-entry'
3
- import AbstractService from './abstract'
2
+ import { InventoryEntryRepository } from '../repositories/inventory-entry.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class InventoryEntryService extends AbstractService {
6
6
  public repository: InventoryEntryRepository
@@ -1,7 +1,7 @@
1
1
  import type { Cart, MyCartDraft } from '@commercetools/platform-sdk'
2
2
  import supertest from 'supertest'
3
3
  import { afterEach, beforeEach, describe, expect, test } from 'vitest'
4
- import { CommercetoolsMock } from '../index'
4
+ import { CommercetoolsMock } from '../index.js'
5
5
 
6
6
  const ctMock = new CommercetoolsMock()
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { Request, Response, Router } from 'express'
2
- import { CartRepository } from '../repositories/cart'
3
- import AbstractService from './abstract'
2
+ import { CartRepository } from '../repositories/cart.js'
3
+ import AbstractService from './abstract.js'
4
4
 
5
5
  export class MyCartService extends AbstractService {
6
6
  public repository: CartRepository
@@ -1,7 +1,7 @@
1
1
  import type { MyCustomerDraft } from '@commercetools/platform-sdk'
2
2
  import supertest from 'supertest'
3
3
  import { afterEach, describe, expect, test } from 'vitest'
4
- import { CommercetoolsMock } from '../index'
4
+ import { CommercetoolsMock } from '../index.js'
5
5
 
6
6
  const ctMock = new CommercetoolsMock()
7
7