@labdigital/commercetools-mock 2.65.1 → 3.0.0-beta.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 (281) hide show
  1. package/README.md +31 -8
  2. package/dist/abstract-BKFcva6S.mjs +1044 -0
  3. package/dist/abstract-BKFcva6S.mjs.map +1 -0
  4. package/dist/config-BcNSzPZz.d.mts +1718 -0
  5. package/dist/index.d.mts +50 -1633
  6. package/dist/index.mjs +3771 -2654
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/storage/sqlite.d.mts +59 -0
  9. package/dist/storage/sqlite.mjs +234 -0
  10. package/dist/storage/sqlite.mjs.map +1 -0
  11. package/package.json +26 -29
  12. package/src/ctMock.ts +125 -136
  13. package/src/helpers.ts +14 -6
  14. package/src/index.ts +5 -0
  15. package/src/lib/masking.ts +4 -5
  16. package/src/lib/product-review-statistics.test.ts +257 -294
  17. package/src/lib/review-statistics.ts +17 -4
  18. package/src/oauth/helpers.ts +7 -4
  19. package/src/oauth/server.test.ts +102 -62
  20. package/src/oauth/server.ts +215 -213
  21. package/src/oauth/store.ts +20 -6
  22. package/src/orderSearch.ts +3 -3
  23. package/src/product-projection-search.ts +38 -20
  24. package/src/product-search-availability.test.ts +31 -52
  25. package/src/product-search.ts +19 -10
  26. package/src/projectAPI.ts +6 -22
  27. package/src/repositories/abstract.ts +182 -48
  28. package/src/repositories/as-associate.test.ts +19 -19
  29. package/src/repositories/associate-role.ts +12 -23
  30. package/src/repositories/attribute-group.test.ts +23 -23
  31. package/src/repositories/attribute-group.ts +6 -4
  32. package/src/repositories/business-unit.test.ts +63 -57
  33. package/src/repositories/business-unit.ts +107 -55
  34. package/src/repositories/cart/actions.ts +96 -65
  35. package/src/repositories/cart/helpers.ts +15 -11
  36. package/src/repositories/cart/index.test.ts +136 -30
  37. package/src/repositories/cart/index.ts +76 -59
  38. package/src/repositories/cart-discount/actions.ts +12 -44
  39. package/src/repositories/cart-discount/index.ts +20 -8
  40. package/src/repositories/category/actions.ts +27 -27
  41. package/src/repositories/category/index.test.ts +13 -9
  42. package/src/repositories/category/index.ts +40 -23
  43. package/src/repositories/channel.test.ts +53 -51
  44. package/src/repositories/channel.ts +12 -22
  45. package/src/repositories/custom-object.ts +34 -25
  46. package/src/repositories/customer/actions.ts +47 -25
  47. package/src/repositories/customer/index.test.ts +11 -11
  48. package/src/repositories/customer/index.ts +65 -35
  49. package/src/repositories/customer-group.test.ts +44 -42
  50. package/src/repositories/customer-group.ts +12 -22
  51. package/src/repositories/discount-code/actions.ts +3 -19
  52. package/src/repositories/discount-code/index.ts +9 -4
  53. package/src/repositories/discount-group/index.ts +8 -3
  54. package/src/repositories/extension.test.ts +27 -27
  55. package/src/repositories/extension.ts +10 -5
  56. package/src/repositories/helpers.ts +126 -47
  57. package/src/repositories/inventory-entry/actions.ts +3 -24
  58. package/src/repositories/inventory-entry/index.ts +19 -11
  59. package/src/repositories/my-customer.ts +13 -12
  60. package/src/repositories/my-order.ts +5 -2
  61. package/src/repositories/order/actions.ts +89 -56
  62. package/src/repositories/order/index.test.ts +36 -31
  63. package/src/repositories/order/index.ts +83 -49
  64. package/src/repositories/order-edit.ts +8 -3
  65. package/src/repositories/payment/actions.ts +64 -44
  66. package/src/repositories/payment/helpers.ts +3 -3
  67. package/src/repositories/payment/index.ts +28 -12
  68. package/src/repositories/product/actions.ts +133 -98
  69. package/src/repositories/product/helpers.ts +29 -16
  70. package/src/repositories/product/index.ts +42 -25
  71. package/src/repositories/product-discount.ts +6 -4
  72. package/src/repositories/product-projection.ts +41 -21
  73. package/src/repositories/product-selection.ts +8 -15
  74. package/src/repositories/product-tailoring.ts +22 -3
  75. package/src/repositories/product-type.ts +45 -4
  76. package/src/repositories/project.ts +57 -13
  77. package/src/repositories/quote/actions.ts +5 -28
  78. package/src/repositories/quote/index.ts +29 -6
  79. package/src/repositories/quote-request/actions.ts +5 -28
  80. package/src/repositories/quote-request/index.test.ts +3 -3
  81. package/src/repositories/quote-request/index.ts +31 -11
  82. package/src/repositories/quote-staged/actions.ts +5 -28
  83. package/src/repositories/quote-staged/index.ts +22 -8
  84. package/src/repositories/recurrence-policy/index.ts +6 -4
  85. package/src/repositories/recurring-order/actions.ts +7 -32
  86. package/src/repositories/recurring-order/index.ts +8 -6
  87. package/src/repositories/review.test.ts +147 -142
  88. package/src/repositories/review.ts +31 -37
  89. package/src/repositories/shipping-method/actions.ts +11 -28
  90. package/src/repositories/shipping-method/index.ts +26 -15
  91. package/src/repositories/shopping-list/actions.ts +21 -31
  92. package/src/repositories/shopping-list/index.ts +44 -22
  93. package/src/repositories/standalone-price.ts +6 -4
  94. package/src/repositories/state.ts +15 -9
  95. package/src/repositories/store.ts +21 -32
  96. package/src/repositories/subscription.test.ts +22 -22
  97. package/src/repositories/subscription.ts +8 -3
  98. package/src/repositories/tax-category/index.ts +8 -3
  99. package/src/repositories/type/actions.ts +21 -3
  100. package/src/repositories/type/index.ts +5 -3
  101. package/src/repositories/zone.test.ts +112 -77
  102. package/src/repositories/zone.ts +5 -3
  103. package/src/schemas/generated/associate-role.ts +13 -0
  104. package/src/schemas/generated/attribute-group.ts +12 -0
  105. package/src/schemas/generated/business-unit.ts +38 -0
  106. package/src/schemas/generated/cart-discount.ts +33 -0
  107. package/src/schemas/generated/cart.ts +61 -0
  108. package/src/schemas/generated/category.ts +25 -0
  109. package/src/schemas/generated/channel.ts +21 -0
  110. package/src/schemas/generated/common.ts +1372 -0
  111. package/src/schemas/generated/custom-object.ts +11 -0
  112. package/src/schemas/generated/customer-group.ts +11 -0
  113. package/src/schemas/generated/customer.ts +47 -0
  114. package/src/schemas/generated/discount-code.ts +25 -0
  115. package/src/schemas/generated/discount-group.ts +13 -0
  116. package/src/schemas/generated/extension.ts +15 -0
  117. package/src/schemas/generated/index.ts +42 -0
  118. package/src/schemas/generated/inventory-entry.ts +20 -0
  119. package/src/schemas/generated/my-quote-request.ts +10 -0
  120. package/src/schemas/generated/order-edit.ts +18 -0
  121. package/src/schemas/generated/order-from-cart.ts +25 -0
  122. package/src/schemas/generated/payment.ts +30 -0
  123. package/src/schemas/generated/product-discount.ts +20 -0
  124. package/src/schemas/generated/product-selection.ts +18 -0
  125. package/src/schemas/generated/product-tailoring.ts +26 -0
  126. package/src/schemas/generated/product-type.ts +12 -0
  127. package/src/schemas/generated/product.ts +37 -0
  128. package/src/schemas/generated/quote-request.ts +19 -0
  129. package/src/schemas/generated/quote.ts +18 -0
  130. package/src/schemas/generated/recurrence-policy.ts +15 -0
  131. package/src/schemas/generated/recurring-order.ts +19 -0
  132. package/src/schemas/generated/review.ts +24 -0
  133. package/src/schemas/generated/shipping-method.ts +24 -0
  134. package/src/schemas/generated/shopping-list.ts +28 -0
  135. package/src/schemas/generated/staged-quote.ts +18 -0
  136. package/src/schemas/generated/standalone-price.ts +32 -0
  137. package/src/schemas/generated/state.ts +20 -0
  138. package/src/schemas/generated/store.ts +23 -0
  139. package/src/schemas/generated/subscription.ts +20 -0
  140. package/src/schemas/generated/tax-category.ts +12 -0
  141. package/src/schemas/generated/type.ts +17 -0
  142. package/src/schemas/generated/zone.ts +12 -0
  143. package/src/schemas/update-request.ts +3 -5
  144. package/src/server.ts +32 -4
  145. package/src/services/abstract.ts +207 -101
  146. package/src/services/as-associate-cart.test.ts +28 -36
  147. package/src/services/as-associate-cart.ts +15 -12
  148. package/src/services/as-associate-order.test.ts +33 -40
  149. package/src/services/as-associate-order.ts +15 -12
  150. package/src/services/as-associate-quote-request.ts +15 -12
  151. package/src/services/as-associate-shopping-list.test.ts +25 -35
  152. package/src/services/as-associate-shopping-list.ts +15 -12
  153. package/src/services/as-associate.test.ts +21 -15
  154. package/src/services/as-associate.ts +23 -22
  155. package/src/services/associate-roles.test.ts +16 -22
  156. package/src/services/associate-roles.ts +2 -2
  157. package/src/services/attribute-group.test.ts +40 -44
  158. package/src/services/attribute-group.ts +2 -2
  159. package/src/services/business-units.test.ts +227 -163
  160. package/src/services/business-units.ts +2 -2
  161. package/src/services/cart-discount.test.ts +253 -187
  162. package/src/services/cart-discount.ts +2 -2
  163. package/src/services/cart.test.ts +833 -832
  164. package/src/services/cart.ts +31 -12
  165. package/src/services/category.test.ts +208 -130
  166. package/src/services/category.ts +2 -2
  167. package/src/services/channel.test.ts +39 -44
  168. package/src/services/channel.ts +2 -2
  169. package/src/services/custom-object.test.ts +103 -79
  170. package/src/services/custom-object.ts +106 -38
  171. package/src/services/customer-group.test.ts +39 -44
  172. package/src/services/customer-group.ts +2 -2
  173. package/src/services/customer.test.ts +357 -292
  174. package/src/services/customer.ts +70 -23
  175. package/src/services/discount-code.test.ts +57 -68
  176. package/src/services/discount-code.ts +2 -2
  177. package/src/services/discount-group.test.ts +111 -134
  178. package/src/services/discount-group.ts +2 -2
  179. package/src/services/draft-validation.test.ts +255 -0
  180. package/src/services/extension.test.ts +39 -44
  181. package/src/services/extension.ts +2 -2
  182. package/src/services/inventory-entry.test.ts +106 -87
  183. package/src/services/inventory-entry.ts +2 -2
  184. package/src/services/my-business-unit.test.ts +82 -112
  185. package/src/services/my-business-unit.ts +25 -19
  186. package/src/services/my-cart.test.ts +46 -41
  187. package/src/services/my-cart.ts +32 -28
  188. package/src/services/my-customer.test.ts +153 -88
  189. package/src/services/my-customer.ts +130 -61
  190. package/src/services/my-order.ts +15 -12
  191. package/src/services/my-payment.test.ts +30 -24
  192. package/src/services/my-payment.ts +2 -2
  193. package/src/services/my-shopping-list.ts +2 -2
  194. package/src/services/order.test.ts +332 -276
  195. package/src/services/order.ts +45 -27
  196. package/src/services/payment.test.ts +31 -29
  197. package/src/services/payment.ts +2 -2
  198. package/src/services/product-discount.test.ts +39 -46
  199. package/src/services/product-discount.ts +2 -2
  200. package/src/services/product-projection.test.ts +176 -166
  201. package/src/services/product-projection.ts +31 -15
  202. package/src/services/product-selection.test.ts +17 -9
  203. package/src/services/product-selection.ts +2 -2
  204. package/src/services/product-type.test.ts +80 -21
  205. package/src/services/product-type.ts +2 -2
  206. package/src/services/product.test.ts +569 -534
  207. package/src/services/product.ts +14 -7
  208. package/src/services/project.test.ts +22 -12
  209. package/src/services/project.ts +28 -13
  210. package/src/services/quote-request.test.ts +36 -39
  211. package/src/services/quote-request.ts +2 -2
  212. package/src/services/quote-staged.ts +2 -2
  213. package/src/services/quote.ts +2 -2
  214. package/src/services/recurrence-policy.test.ts +114 -139
  215. package/src/services/recurrence-policy.ts +2 -2
  216. package/src/services/recurring-order.test.ts +149 -194
  217. package/src/services/recurring-order.ts +2 -2
  218. package/src/services/reviews.test.ts +127 -106
  219. package/src/services/reviews.ts +2 -2
  220. package/src/services/shipping-method.test.ts +96 -125
  221. package/src/services/shipping-method.ts +24 -12
  222. package/src/services/shopping-list.test.ts +183 -141
  223. package/src/services/shopping-list.ts +2 -2
  224. package/src/services/standalone-price.test.ts +60 -46
  225. package/src/services/standalone-price.ts +2 -2
  226. package/src/services/state.test.ts +20 -25
  227. package/src/services/state.ts +2 -2
  228. package/src/services/store.test.ts +26 -45
  229. package/src/services/store.ts +2 -2
  230. package/src/services/subscription.test.ts +39 -44
  231. package/src/services/subscription.ts +2 -2
  232. package/src/services/tax-category.test.ts +33 -36
  233. package/src/services/tax-category.ts +2 -2
  234. package/src/services/type.test.ts +45 -44
  235. package/src/services/type.ts +2 -2
  236. package/src/services/zone.test.ts +40 -44
  237. package/src/services/zone.ts +2 -2
  238. package/src/shipping.ts +41 -11
  239. package/src/storage/abstract.ts +248 -17
  240. package/src/storage/in-memory.ts +147 -290
  241. package/src/storage/sqlite.ts +429 -0
  242. package/src/storage/storage-map.ts +75 -0
  243. package/src/storage/storage.test-helpers.ts +97 -0
  244. package/src/storage/storage.test.ts +802 -0
  245. package/src/testing/associate-role.ts +28 -0
  246. package/src/testing/attribute-group.ts +27 -0
  247. package/src/testing/business-unit.ts +9 -8
  248. package/src/testing/cart-discount.ts +34 -0
  249. package/src/testing/cart.ts +20 -0
  250. package/src/testing/category.ts +25 -0
  251. package/src/testing/channel.ts +23 -0
  252. package/src/testing/custom-object.ts +27 -0
  253. package/src/testing/customer-group.ts +26 -0
  254. package/src/testing/customer.ts +36 -33
  255. package/src/testing/discount-code.ts +29 -0
  256. package/src/testing/discount-group.ts +27 -0
  257. package/src/testing/extension.ts +32 -0
  258. package/src/testing/index.ts +33 -0
  259. package/src/testing/inventory-entry.ts +26 -0
  260. package/src/testing/order.ts +27 -0
  261. package/src/testing/payment.ts +23 -0
  262. package/src/testing/product-discount.ts +33 -0
  263. package/src/testing/product-selection.ts +28 -0
  264. package/src/testing/product-type.ts +27 -0
  265. package/src/testing/product.ts +38 -0
  266. package/src/testing/quote-request.ts +29 -0
  267. package/src/testing/recurrence-policy.ts +33 -0
  268. package/src/testing/recurring-order.ts +32 -0
  269. package/src/testing/review.ts +24 -0
  270. package/src/testing/shipping-method.ts +31 -0
  271. package/src/testing/shopping-list.ts +25 -0
  272. package/src/testing/standalone-price.ts +31 -0
  273. package/src/testing/state.ts +21 -0
  274. package/src/testing/store.ts +26 -0
  275. package/src/testing/subscription.ts +38 -0
  276. package/src/testing/tax-category.ts +27 -0
  277. package/src/testing/type.ts +9 -6
  278. package/src/testing/zone.ts +22 -0
  279. package/src/validate.test.ts +122 -0
  280. package/src/validate.ts +78 -7
  281. package/src/.env +0 -0
@@ -0,0 +1,1718 @@
1
+ import { z } from "zod";
2
+ import * as _commercetools_platform_sdk0 from "@commercetools/platform-sdk";
3
+ import { Address, AssociateRole, AssociateRoleDraft, AttributeGroup, AttributeGroupDraft, BaseResource, BusinessUnit, BusinessUnitDraft, Cart, CartDiscount, CartDiscountDraft, CartDraft, CartReference, Category, CategoryDraft, Channel, ChannelDraft, ChannelReference, ChannelResourceIdentifier, CustomFields, CustomObject, CustomObjectDraft, Customer, CustomerCreatePasswordResetToken, CustomerDraft, CustomerGroup, CustomerGroupDraft, CustomerResetPassword, CustomerToken, DiscountCode, DiscountCodeDraft, DiscountGroup, DiscountGroupDraft, Extension, ExtensionDraft, FacetResults, FieldContainer, FilteredFacetResult, InventoryEntry, InventoryEntryDraft, LineItem, LineItemDraft, MyCustomerChangePassword, MyCustomerEmailVerify, MyCustomerResetPassword, MyOrderFromCartDraft, MyQuoteRequestDraft, Order, OrderEdit, OrderEditDraft, OrderFromCartDraft, OrderImportDraft, OrderPagedSearchResponse, OrderSearchRequest, PagedQueryResponse, Payment, PaymentDraft, Product, ProductDiscount, ProductDiscountDraft, ProductDraft, ProductPagedSearchResponse, ProductProjection, ProductProjectionPagedSearchResponse, ProductSearchRequest, ProductSelection, ProductSelectionDraft, ProductTailoring, ProductType, ProductTypeDraft, Project, QueryParam, Quote, QuoteDraft, QuoteRequest, QuoteRequestDraft, RangeFacetResult, RecurrencePolicy, RecurrencePolicyDraft, RecurringOrder, RecurringOrderDraft, ResourceIdentifier, Review, ReviewDraft, ReviewRatingStatistics, ShippingInfo, ShippingMethod, ShippingMethodDraft, ShippingMethodReference, ShoppingList, ShoppingListDraft, ShoppingListLineItem, StagedQuote, StagedQuoteDraft, StandalonePrice, StandalonePriceDraft, State, StateDraft, Store, StoreDraft, StoreKeyReference, Subscription, SubscriptionDraft, TaxCategory, TaxCategoryDraft, TermFacetResult, Type, TypeDraft, TypeResourceIdentifier, UpdateAction, Zone, ZoneDraft, ZoneReference } from "@commercetools/platform-sdk";
4
+
5
+ //#region src/repositories/abstract.d.ts
6
+ type QueryParams$1 = {
7
+ expand?: string[];
8
+ where?: string[];
9
+ offset?: number;
10
+ limit?: number;
11
+ [key: string]: QueryParam;
12
+ };
13
+ type GetParams$1 = {
14
+ expand?: string[];
15
+ };
16
+ type RepositoryContext = {
17
+ projectKey: string;
18
+ storeKey?: string;
19
+ clientId?: string;
20
+ };
21
+ declare abstract class AbstractRepository<R extends BaseResource | Project> {
22
+ protected _storage: AbstractStorage;
23
+ protected config: Config;
24
+ protected actions: AbstractUpdateHandler | undefined;
25
+ constructor(config: Config);
26
+ saveNew({
27
+ projectKey
28
+ }: RepositoryContext, resource: R): Promise<R>;
29
+ saveUpdate({
30
+ projectKey
31
+ }: RepositoryContext, version: number, resource: R): Promise<R>;
32
+ postProcessResource(context: RepositoryContext, resource: any): Promise<any>;
33
+ processUpdateActions(context: RepositoryContext, resource: R, version: number, actions: UpdateAction[]): Promise<R>;
34
+ }
35
+ declare abstract class AbstractResourceRepository<T extends ResourceType> extends AbstractRepository<ResourceMap[T]> {
36
+ protected _typeId: T;
37
+ /**
38
+ * Optional Zod schema for validating creation drafts.
39
+ * When set and strict mode is enabled, the service layer will
40
+ * validate incoming request bodies against this schema before
41
+ * passing them to create().
42
+ */
43
+ draftSchema?: z.ZodType;
44
+ constructor(typeId: T, config: Config);
45
+ /**
46
+ * Whether strict validation is enabled.
47
+ */
48
+ get strict(): boolean;
49
+ abstract create(context: RepositoryContext, draft: any): Promise<ResourceMap[T]>;
50
+ protected getTypeId(): T;
51
+ /**
52
+ * Apply expand clauses to a resource without re-fetching from storage.
53
+ */
54
+ expand(context: RepositoryContext, resource: ResourceMap[T], expand: string[] | undefined): Promise<ResourceMap[T]>;
55
+ delete(context: RepositoryContext, id: string, params?: GetParams$1): Promise<ResourceMap[T] | null>;
56
+ get(context: RepositoryContext, id: string, params?: GetParams$1): Promise<ResourceMap[T] | null>;
57
+ getByKey(context: RepositoryContext, key: string, params?: GetParams$1): Promise<ResourceMap[T] | null>;
58
+ postProcessResource(context: RepositoryContext, resource: ResourceMap[T], params?: GetParams$1): Promise<ResourceMap[T]>;
59
+ query(context: RepositoryContext, params?: QueryParams$1): Promise<PagedQueryResponseMap[T] & {
60
+ results: Awaited<ResourceMap[T]>[];
61
+ }>;
62
+ saveNew(context: RepositoryContext, resource: ShallowWritable<ResourceMap[T]>): Promise<ResourceMap[T]>;
63
+ saveUpdate(context: RepositoryContext, version: number, resource: ShallowWritable<ResourceMap[T]>): Promise<ResourceMap[T]>;
64
+ }
65
+ declare class AbstractUpdateHandler {
66
+ _storage: AbstractStorage;
67
+ constructor(_storage: AbstractStorage);
68
+ /**
69
+ * Shared implementation for setCustomField update actions.
70
+ *
71
+ * Throws InvalidOperation if the resource has no custom type set.
72
+ * When `value` is `null`, the field is removed; otherwise it is set.
73
+ */
74
+ protected _setCustomFieldValues(resource: {
75
+ custom?: CustomFields;
76
+ }, {
77
+ name,
78
+ value
79
+ }: {
80
+ name: string;
81
+ value?: unknown;
82
+ }): void;
83
+ /**
84
+ * Shared implementation for setCustomType update actions.
85
+ *
86
+ * When `type` is provided, resolves the type reference and sets the
87
+ * custom fields on the resource. When `type` is not provided, removes
88
+ * the custom fields entirely.
89
+ */
90
+ protected _setCustomType(context: RepositoryContext, resource: {
91
+ custom?: CustomFields;
92
+ }, {
93
+ type,
94
+ fields
95
+ }: {
96
+ type?: TypeResourceIdentifier;
97
+ fields?: FieldContainer;
98
+ }): Promise<void>;
99
+ apply<R extends BaseResource | Project>(context: RepositoryContext, resource: R, version: number, actions: UpdateAction[]): Promise<R>;
100
+ }
101
+ //#endregion
102
+ //#region src/repositories/product-tailoring.d.ts
103
+ declare class ProductTailoringRepository extends AbstractResourceRepository<"product-tailoring"> {
104
+ constructor(config: Config);
105
+ create(context: RepositoryContext, draft: any): Promise<ProductTailoring>;
106
+ }
107
+ //#endregion
108
+ //#region src/repositories/cart/index.d.ts
109
+ declare class CartRepository extends AbstractResourceRepository<"cart"> {
110
+ constructor(config: Config);
111
+ create(context: RepositoryContext, draft: CartDraft): Promise<Cart>;
112
+ getActiveCart(projectKey: string): Promise<Cart | undefined>;
113
+ draftLineItemtoLineItem: (projectKey: string, draftLineItem: LineItemDraft, currency: string, country: string | undefined) => Promise<LineItem>;
114
+ createShippingInfo(context: RepositoryContext, resource: Writable<Cart>, shippingMethodRef: NonNullable<CartDraft["shippingMethod"]>): Promise<NonNullable<Cart["shippingInfo"]>>;
115
+ }
116
+ //#endregion
117
+ //#region src/orderSearch.d.ts
118
+ declare class OrderSearch {
119
+ protected _storage: AbstractStorage;
120
+ constructor(config: Config);
121
+ search(projectKey: string, params: OrderSearchRequest): Promise<OrderPagedSearchResponse>;
122
+ }
123
+ //#endregion
124
+ //#region src/repositories/order/index.d.ts
125
+ declare class OrderRepository extends AbstractResourceRepository<"order"> {
126
+ protected _searchService: OrderSearch;
127
+ constructor(config: Config);
128
+ create(context: RepositoryContext, draft: OrderFromCartDraft): Promise<Order>;
129
+ createFromCart(context: RepositoryContext, cartReference: CartReference, orderNumber?: string): Promise<Order>;
130
+ import(context: RepositoryContext, draft: OrderImportDraft): Promise<Order>;
131
+ private lineItemFromImportDraft;
132
+ private customLineItemFromImportDraft;
133
+ getWithOrderNumber(context: RepositoryContext, orderNumber: string, params?: QueryParams$1): Promise<Order | undefined>;
134
+ createShippingInfo(context: RepositoryContext, resource: Writable<Order>, shippingMethodRef: ShippingMethodReference): Promise<ShippingInfo>;
135
+ search(context: RepositoryContext, searchRequest: OrderSearchRequest): Promise<OrderPagedSearchResponse>;
136
+ }
137
+ //#endregion
138
+ //#region src/repositories/quote-request/index.d.ts
139
+ declare class QuoteRequestRepository extends AbstractResourceRepository<"quote-request"> {
140
+ constructor(config: Config);
141
+ create(context: RepositoryContext, draft: QuoteRequestDraft | MyQuoteRequestDraft): Promise<QuoteRequest>;
142
+ createFromCart(context: RepositoryContext, cartReference: CartReference): Promise<QuoteRequest>;
143
+ }
144
+ //#endregion
145
+ //#region src/repositories/shopping-list/index.d.ts
146
+ declare class ShoppingListRepository extends AbstractResourceRepository<"shopping-list"> {
147
+ constructor(config: Config);
148
+ create(context: RepositoryContext, draft: ShoppingListDraft): Promise<ShoppingList>;
149
+ draftLineItemtoLineItem: (projectKey: string, draftLineItem: LineItemDraft) => Promise<ShoppingListLineItem>;
150
+ }
151
+ //#endregion
152
+ //#region src/repositories/as-associate.d.ts
153
+ declare class AsAssociateOrderRepository extends OrderRepository {}
154
+ declare class AsAssociateCartRepository extends CartRepository {}
155
+ declare class AsAssociateQuoteRequestRepository extends QuoteRequestRepository {}
156
+ declare class AsAssociateShoppingListRepository extends ShoppingListRepository {}
157
+ //#endregion
158
+ //#region src/repositories/associate-role.d.ts
159
+ declare class AssociateRoleRepository extends AbstractResourceRepository<"associate-role"> {
160
+ constructor(config: Config);
161
+ create(context: RepositoryContext, draft: AssociateRoleDraft): Promise<AssociateRole>;
162
+ }
163
+ //#endregion
164
+ //#region src/repositories/attribute-group.d.ts
165
+ declare class AttributeGroupRepository extends AbstractResourceRepository<"attribute-group"> {
166
+ constructor(config: Config);
167
+ create(context: RepositoryContext, draft: AttributeGroupDraft): Promise<AttributeGroup>;
168
+ }
169
+ //#endregion
170
+ //#region src/repositories/business-unit.d.ts
171
+ declare class BusinessUnitRepository extends AbstractResourceRepository<"business-unit"> {
172
+ constructor(config: Config);
173
+ create(context: RepositoryContext, draft: BusinessUnitDraft): Promise<BusinessUnit>;
174
+ private _isCompanyDraft;
175
+ private _isDivisionDraft;
176
+ }
177
+ //#endregion
178
+ //#region src/repositories/cart-discount/index.d.ts
179
+ declare class CartDiscountRepository extends AbstractResourceRepository<"cart-discount"> {
180
+ constructor(config: Config);
181
+ create(context: RepositoryContext, draft: CartDiscountDraft): Promise<CartDiscount>;
182
+ private transformValueDraft;
183
+ }
184
+ //#endregion
185
+ //#region src/repositories/category/index.d.ts
186
+ declare class CategoryRepository extends AbstractResourceRepository<"category"> {
187
+ constructor(config: Config);
188
+ create(context: RepositoryContext, draft: CategoryDraft): Promise<Category>;
189
+ postProcessResource(context: RepositoryContext, resource: Writable<Category>, params?: GetParams$1): Promise<Category>;
190
+ }
191
+ //#endregion
192
+ //#region src/repositories/channel.d.ts
193
+ declare class ChannelRepository extends AbstractResourceRepository<"channel"> {
194
+ constructor(config: Config);
195
+ create(context: RepositoryContext, draft: ChannelDraft): Promise<Channel>;
196
+ }
197
+ //#endregion
198
+ //#region src/repositories/custom-object.d.ts
199
+ declare class CustomObjectRepository extends AbstractResourceRepository<"key-value-document"> {
200
+ constructor(config: Config);
201
+ create(context: RepositoryContext, draft: Writable<CustomObjectDraft>): Promise<CustomObject>;
202
+ getWithContainerAndKey(context: RepositoryContext, container: string, key: string): Promise<CustomObject | null>;
203
+ queryWithContainer(context: RepositoryContext, container: string, params?: QueryParams$1): Promise<_commercetools_platform_sdk0.CustomObjectPagedQueryResponse>;
204
+ }
205
+ //#endregion
206
+ //#region src/repositories/customer/index.d.ts
207
+ declare class CustomerRepository extends AbstractResourceRepository<"customer"> {
208
+ constructor(config: Config);
209
+ create(context: RepositoryContext, draft: CustomerDraft): Promise<Customer>;
210
+ saveUpdate(context: RepositoryContext, version: number, resource: ShallowWritable<ResourceMap["customer"]>): Promise<ShallowWritable<ResourceMap["customer"]>>;
211
+ passwordResetToken(context: RepositoryContext, request: CustomerCreatePasswordResetToken): Promise<CustomerToken>;
212
+ passwordReset(context: RepositoryContext, resetPassword: CustomerResetPassword | MyCustomerResetPassword): Promise<{
213
+ id: string;
214
+ version: number;
215
+ key?: string | undefined;
216
+ customerNumber?: string | undefined;
217
+ externalId?: string | undefined;
218
+ createdAt: string;
219
+ lastModifiedAt: string;
220
+ lastModifiedBy?: {
221
+ clientId?: string | undefined;
222
+ externalUserId?: string | undefined;
223
+ customer?: {
224
+ typeId: "customer";
225
+ id: string;
226
+ obj?: /*elided*/any | undefined;
227
+ } | undefined;
228
+ anonymousId?: string | undefined;
229
+ attributedTo?: {
230
+ clientId?: string | undefined;
231
+ source: _commercetools_platform_sdk0.AttributionSource;
232
+ } | undefined;
233
+ associate?: {
234
+ typeId: "customer";
235
+ id: string;
236
+ obj?: /*elided*/any | undefined;
237
+ } | undefined;
238
+ } | undefined;
239
+ createdBy?: {
240
+ clientId?: string | undefined;
241
+ externalUserId?: string | undefined;
242
+ customer?: {
243
+ typeId: "customer";
244
+ id: string;
245
+ obj?: /*elided*/any | undefined;
246
+ } | undefined;
247
+ anonymousId?: string | undefined;
248
+ attributedTo?: {
249
+ clientId?: string | undefined;
250
+ source: _commercetools_platform_sdk0.AttributionSource;
251
+ } | undefined;
252
+ associate?: {
253
+ typeId: "customer";
254
+ id: string;
255
+ obj?: /*elided*/any | undefined;
256
+ } | undefined;
257
+ } | undefined;
258
+ email: string;
259
+ password?: string | undefined;
260
+ firstName?: string | undefined;
261
+ lastName?: string | undefined;
262
+ middleName?: string | undefined;
263
+ title?: string | undefined;
264
+ dateOfBirth?: string | undefined;
265
+ companyName?: string | undefined;
266
+ vatId?: string | undefined;
267
+ addresses: WritableArray<Address>;
268
+ defaultShippingAddressId?: string | undefined;
269
+ shippingAddressIds: WritableArray<string>;
270
+ defaultBillingAddressId?: string | undefined;
271
+ billingAddressIds: WritableArray<string>;
272
+ isEmailVerified: boolean;
273
+ customerGroup?: {
274
+ typeId: "customer-group";
275
+ id: string;
276
+ obj?: {
277
+ id: string;
278
+ version: number;
279
+ createdAt: string;
280
+ lastModifiedAt: string;
281
+ lastModifiedBy?: {
282
+ clientId?: string | undefined;
283
+ externalUserId?: string | undefined;
284
+ customer?: {
285
+ typeId: "customer";
286
+ id: string;
287
+ obj?: /*elided*/any | undefined;
288
+ } | undefined;
289
+ anonymousId?: string | undefined;
290
+ attributedTo?: {
291
+ clientId?: string | undefined;
292
+ source: _commercetools_platform_sdk0.AttributionSource;
293
+ } | undefined;
294
+ associate?: {
295
+ typeId: "customer";
296
+ id: string;
297
+ obj?: /*elided*/any | undefined;
298
+ } | undefined;
299
+ } | undefined;
300
+ createdBy?: {
301
+ clientId?: string | undefined;
302
+ externalUserId?: string | undefined;
303
+ customer?: {
304
+ typeId: "customer";
305
+ id: string;
306
+ obj?: /*elided*/any | undefined;
307
+ } | undefined;
308
+ anonymousId?: string | undefined;
309
+ attributedTo?: {
310
+ clientId?: string | undefined;
311
+ source: _commercetools_platform_sdk0.AttributionSource;
312
+ } | undefined;
313
+ associate?: {
314
+ typeId: "customer";
315
+ id: string;
316
+ obj?: /*elided*/any | undefined;
317
+ } | undefined;
318
+ } | undefined;
319
+ key?: string | undefined;
320
+ name: string;
321
+ custom?: {
322
+ type: {
323
+ typeId: "type";
324
+ id: string;
325
+ obj?: {
326
+ id: string;
327
+ version: number;
328
+ createdAt: string;
329
+ lastModifiedAt: string;
330
+ lastModifiedBy?: {
331
+ clientId?: string | undefined;
332
+ externalUserId?: string | undefined;
333
+ customer?: {
334
+ typeId: "customer";
335
+ id: string;
336
+ obj?: /*elided*/any | undefined;
337
+ } | undefined;
338
+ anonymousId?: string | undefined;
339
+ attributedTo?: {
340
+ clientId?: string | undefined;
341
+ source: _commercetools_platform_sdk0.AttributionSource;
342
+ } | undefined;
343
+ associate?: {
344
+ typeId: "customer";
345
+ id: string;
346
+ obj?: /*elided*/any | undefined;
347
+ } | undefined;
348
+ } | undefined;
349
+ createdBy?: {
350
+ clientId?: string | undefined;
351
+ externalUserId?: string | undefined;
352
+ customer?: {
353
+ typeId: "customer";
354
+ id: string;
355
+ obj?: /*elided*/any | undefined;
356
+ } | undefined;
357
+ anonymousId?: string | undefined;
358
+ attributedTo?: {
359
+ clientId?: string | undefined;
360
+ source: _commercetools_platform_sdk0.AttributionSource;
361
+ } | undefined;
362
+ associate?: {
363
+ typeId: "customer";
364
+ id: string;
365
+ obj?: /*elided*/any | undefined;
366
+ } | undefined;
367
+ } | undefined;
368
+ key: string;
369
+ name: {
370
+ [x: string]: string;
371
+ };
372
+ description?: {
373
+ [x: string]: string;
374
+ } | undefined;
375
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
376
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
377
+ } | undefined;
378
+ };
379
+ fields: {
380
+ [x: string]: any;
381
+ };
382
+ } | undefined;
383
+ } | undefined;
384
+ } | undefined;
385
+ customerGroupAssignments: WritableArray<_commercetools_platform_sdk0.CustomerGroupAssignment>;
386
+ custom?: {
387
+ type: {
388
+ typeId: "type";
389
+ id: string;
390
+ obj?: {
391
+ id: string;
392
+ version: number;
393
+ createdAt: string;
394
+ lastModifiedAt: string;
395
+ lastModifiedBy?: {
396
+ clientId?: string | undefined;
397
+ externalUserId?: string | undefined;
398
+ customer?: {
399
+ typeId: "customer";
400
+ id: string;
401
+ obj?: /*elided*/any | undefined;
402
+ } | undefined;
403
+ anonymousId?: string | undefined;
404
+ attributedTo?: {
405
+ clientId?: string | undefined;
406
+ source: _commercetools_platform_sdk0.AttributionSource;
407
+ } | undefined;
408
+ associate?: {
409
+ typeId: "customer";
410
+ id: string;
411
+ obj?: /*elided*/any | undefined;
412
+ } | undefined;
413
+ } | undefined;
414
+ createdBy?: {
415
+ clientId?: string | undefined;
416
+ externalUserId?: string | undefined;
417
+ customer?: {
418
+ typeId: "customer";
419
+ id: string;
420
+ obj?: /*elided*/any | undefined;
421
+ } | undefined;
422
+ anonymousId?: string | undefined;
423
+ attributedTo?: {
424
+ clientId?: string | undefined;
425
+ source: _commercetools_platform_sdk0.AttributionSource;
426
+ } | undefined;
427
+ associate?: {
428
+ typeId: "customer";
429
+ id: string;
430
+ obj?: /*elided*/any | undefined;
431
+ } | undefined;
432
+ } | undefined;
433
+ key: string;
434
+ name: {
435
+ [x: string]: string;
436
+ };
437
+ description?: {
438
+ [x: string]: string;
439
+ } | undefined;
440
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
441
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
442
+ } | undefined;
443
+ };
444
+ fields: {
445
+ [x: string]: any;
446
+ };
447
+ } | undefined;
448
+ locale?: string | undefined;
449
+ salutation?: string | undefined;
450
+ stores: WritableArray<StoreKeyReference>;
451
+ authenticationMode: _commercetools_platform_sdk0.AuthenticationMode;
452
+ }>;
453
+ emailToken(context: RepositoryContext, id: string): Promise<CustomerToken>;
454
+ emailTokenConfirm(context: RepositoryContext, request: {
455
+ tokenValue: string;
456
+ }): Promise<{
457
+ id: string;
458
+ version: number;
459
+ key?: string | undefined;
460
+ customerNumber?: string | undefined;
461
+ externalId?: string | undefined;
462
+ createdAt: string;
463
+ lastModifiedAt: string;
464
+ lastModifiedBy?: {
465
+ clientId?: string | undefined;
466
+ externalUserId?: string | undefined;
467
+ customer?: {
468
+ typeId: "customer";
469
+ id: string;
470
+ obj?: /*elided*/any | undefined;
471
+ } | undefined;
472
+ anonymousId?: string | undefined;
473
+ attributedTo?: {
474
+ clientId?: string | undefined;
475
+ source: _commercetools_platform_sdk0.AttributionSource;
476
+ } | undefined;
477
+ associate?: {
478
+ typeId: "customer";
479
+ id: string;
480
+ obj?: /*elided*/any | undefined;
481
+ } | undefined;
482
+ } | undefined;
483
+ createdBy?: {
484
+ clientId?: string | undefined;
485
+ externalUserId?: string | undefined;
486
+ customer?: {
487
+ typeId: "customer";
488
+ id: string;
489
+ obj?: /*elided*/any | undefined;
490
+ } | undefined;
491
+ anonymousId?: string | undefined;
492
+ attributedTo?: {
493
+ clientId?: string | undefined;
494
+ source: _commercetools_platform_sdk0.AttributionSource;
495
+ } | undefined;
496
+ associate?: {
497
+ typeId: "customer";
498
+ id: string;
499
+ obj?: /*elided*/any | undefined;
500
+ } | undefined;
501
+ } | undefined;
502
+ email: string;
503
+ password?: string | undefined;
504
+ firstName?: string | undefined;
505
+ lastName?: string | undefined;
506
+ middleName?: string | undefined;
507
+ title?: string | undefined;
508
+ dateOfBirth?: string | undefined;
509
+ companyName?: string | undefined;
510
+ vatId?: string | undefined;
511
+ addresses: WritableArray<Address>;
512
+ defaultShippingAddressId?: string | undefined;
513
+ shippingAddressIds: WritableArray<string>;
514
+ defaultBillingAddressId?: string | undefined;
515
+ billingAddressIds: WritableArray<string>;
516
+ isEmailVerified: boolean;
517
+ customerGroup?: {
518
+ typeId: "customer-group";
519
+ id: string;
520
+ obj?: {
521
+ id: string;
522
+ version: number;
523
+ createdAt: string;
524
+ lastModifiedAt: string;
525
+ lastModifiedBy?: {
526
+ clientId?: string | undefined;
527
+ externalUserId?: string | undefined;
528
+ customer?: {
529
+ typeId: "customer";
530
+ id: string;
531
+ obj?: /*elided*/any | undefined;
532
+ } | undefined;
533
+ anonymousId?: string | undefined;
534
+ attributedTo?: {
535
+ clientId?: string | undefined;
536
+ source: _commercetools_platform_sdk0.AttributionSource;
537
+ } | undefined;
538
+ associate?: {
539
+ typeId: "customer";
540
+ id: string;
541
+ obj?: /*elided*/any | undefined;
542
+ } | undefined;
543
+ } | undefined;
544
+ createdBy?: {
545
+ clientId?: string | undefined;
546
+ externalUserId?: string | undefined;
547
+ customer?: {
548
+ typeId: "customer";
549
+ id: string;
550
+ obj?: /*elided*/any | undefined;
551
+ } | undefined;
552
+ anonymousId?: string | undefined;
553
+ attributedTo?: {
554
+ clientId?: string | undefined;
555
+ source: _commercetools_platform_sdk0.AttributionSource;
556
+ } | undefined;
557
+ associate?: {
558
+ typeId: "customer";
559
+ id: string;
560
+ obj?: /*elided*/any | undefined;
561
+ } | undefined;
562
+ } | undefined;
563
+ key?: string | undefined;
564
+ name: string;
565
+ custom?: {
566
+ type: {
567
+ typeId: "type";
568
+ id: string;
569
+ obj?: {
570
+ id: string;
571
+ version: number;
572
+ createdAt: string;
573
+ lastModifiedAt: string;
574
+ lastModifiedBy?: {
575
+ clientId?: string | undefined;
576
+ externalUserId?: string | undefined;
577
+ customer?: {
578
+ typeId: "customer";
579
+ id: string;
580
+ obj?: /*elided*/any | undefined;
581
+ } | undefined;
582
+ anonymousId?: string | undefined;
583
+ attributedTo?: {
584
+ clientId?: string | undefined;
585
+ source: _commercetools_platform_sdk0.AttributionSource;
586
+ } | undefined;
587
+ associate?: {
588
+ typeId: "customer";
589
+ id: string;
590
+ obj?: /*elided*/any | undefined;
591
+ } | undefined;
592
+ } | undefined;
593
+ createdBy?: {
594
+ clientId?: string | undefined;
595
+ externalUserId?: string | undefined;
596
+ customer?: {
597
+ typeId: "customer";
598
+ id: string;
599
+ obj?: /*elided*/any | undefined;
600
+ } | undefined;
601
+ anonymousId?: string | undefined;
602
+ attributedTo?: {
603
+ clientId?: string | undefined;
604
+ source: _commercetools_platform_sdk0.AttributionSource;
605
+ } | undefined;
606
+ associate?: {
607
+ typeId: "customer";
608
+ id: string;
609
+ obj?: /*elided*/any | undefined;
610
+ } | undefined;
611
+ } | undefined;
612
+ key: string;
613
+ name: {
614
+ [x: string]: string;
615
+ };
616
+ description?: {
617
+ [x: string]: string;
618
+ } | undefined;
619
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
620
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
621
+ } | undefined;
622
+ };
623
+ fields: {
624
+ [x: string]: any;
625
+ };
626
+ } | undefined;
627
+ } | undefined;
628
+ } | undefined;
629
+ customerGroupAssignments: WritableArray<_commercetools_platform_sdk0.CustomerGroupAssignment>;
630
+ custom?: {
631
+ type: {
632
+ typeId: "type";
633
+ id: string;
634
+ obj?: {
635
+ id: string;
636
+ version: number;
637
+ createdAt: string;
638
+ lastModifiedAt: string;
639
+ lastModifiedBy?: {
640
+ clientId?: string | undefined;
641
+ externalUserId?: string | undefined;
642
+ customer?: {
643
+ typeId: "customer";
644
+ id: string;
645
+ obj?: /*elided*/any | undefined;
646
+ } | undefined;
647
+ anonymousId?: string | undefined;
648
+ attributedTo?: {
649
+ clientId?: string | undefined;
650
+ source: _commercetools_platform_sdk0.AttributionSource;
651
+ } | undefined;
652
+ associate?: {
653
+ typeId: "customer";
654
+ id: string;
655
+ obj?: /*elided*/any | undefined;
656
+ } | undefined;
657
+ } | undefined;
658
+ createdBy?: {
659
+ clientId?: string | undefined;
660
+ externalUserId?: string | undefined;
661
+ customer?: {
662
+ typeId: "customer";
663
+ id: string;
664
+ obj?: /*elided*/any | undefined;
665
+ } | undefined;
666
+ anonymousId?: string | undefined;
667
+ attributedTo?: {
668
+ clientId?: string | undefined;
669
+ source: _commercetools_platform_sdk0.AttributionSource;
670
+ } | undefined;
671
+ associate?: {
672
+ typeId: "customer";
673
+ id: string;
674
+ obj?: /*elided*/any | undefined;
675
+ } | undefined;
676
+ } | undefined;
677
+ key: string;
678
+ name: {
679
+ [x: string]: string;
680
+ };
681
+ description?: {
682
+ [x: string]: string;
683
+ } | undefined;
684
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
685
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
686
+ } | undefined;
687
+ };
688
+ fields: {
689
+ [x: string]: any;
690
+ };
691
+ } | undefined;
692
+ locale?: string | undefined;
693
+ salutation?: string | undefined;
694
+ stores: WritableArray<StoreKeyReference>;
695
+ authenticationMode: _commercetools_platform_sdk0.AuthenticationMode;
696
+ }>;
697
+ private storeReferenceToStoreKeyReference;
698
+ }
699
+ //#endregion
700
+ //#region src/repositories/customer-group.d.ts
701
+ declare class CustomerGroupRepository extends AbstractResourceRepository<"customer-group"> {
702
+ constructor(config: Config);
703
+ create(context: RepositoryContext, draft: CustomerGroupDraft): Promise<CustomerGroup>;
704
+ }
705
+ //#endregion
706
+ //#region src/repositories/discount-code/index.d.ts
707
+ declare class DiscountCodeRepository extends AbstractResourceRepository<"discount-code"> {
708
+ constructor(config: Config);
709
+ create(context: RepositoryContext, draft: DiscountCodeDraft): Promise<DiscountCode>;
710
+ }
711
+ //#endregion
712
+ //#region src/repositories/discount-group/index.d.ts
713
+ declare class DiscountGroupRepository extends AbstractResourceRepository<"discount-group"> {
714
+ constructor(config: Config);
715
+ create(context: RepositoryContext, draft: DiscountGroupDraft): Promise<DiscountGroup>;
716
+ }
717
+ //#endregion
718
+ //#region src/repositories/extension.d.ts
719
+ declare class ExtensionRepository extends AbstractResourceRepository<"extension"> {
720
+ constructor(config: Config);
721
+ create(context: RepositoryContext, draft: ExtensionDraft): Promise<Extension>;
722
+ postProcessResource(context: RepositoryContext, resource: Extension): Promise<Extension>;
723
+ }
724
+ //#endregion
725
+ //#region src/repositories/inventory-entry/index.d.ts
726
+ declare class InventoryEntryRepository extends AbstractResourceRepository<"inventory-entry"> {
727
+ constructor(config: Config);
728
+ create(context: RepositoryContext, draft: InventoryEntryDraft): Promise<InventoryEntry>;
729
+ }
730
+ //#endregion
731
+ //#region src/repositories/my-customer.d.ts
732
+ declare class MyCustomerRepository extends CustomerRepository {
733
+ changePassword(context: RepositoryContext, changePassword: MyCustomerChangePassword): Promise<{
734
+ id: string;
735
+ version: number;
736
+ key?: string | undefined;
737
+ customerNumber?: string | undefined;
738
+ externalId?: string | undefined;
739
+ createdAt: string;
740
+ lastModifiedAt: string;
741
+ lastModifiedBy?: {
742
+ clientId?: string | undefined;
743
+ externalUserId?: string | undefined;
744
+ customer?: {
745
+ typeId: "customer";
746
+ id: string;
747
+ obj?: /*elided*/any | undefined;
748
+ } | undefined;
749
+ anonymousId?: string | undefined;
750
+ attributedTo?: {
751
+ clientId?: string | undefined;
752
+ source: _commercetools_platform_sdk0.AttributionSource;
753
+ } | undefined;
754
+ associate?: {
755
+ typeId: "customer";
756
+ id: string;
757
+ obj?: /*elided*/any | undefined;
758
+ } | undefined;
759
+ } | undefined;
760
+ createdBy?: {
761
+ clientId?: string | undefined;
762
+ externalUserId?: string | undefined;
763
+ customer?: {
764
+ typeId: "customer";
765
+ id: string;
766
+ obj?: /*elided*/any | undefined;
767
+ } | undefined;
768
+ anonymousId?: string | undefined;
769
+ attributedTo?: {
770
+ clientId?: string | undefined;
771
+ source: _commercetools_platform_sdk0.AttributionSource;
772
+ } | undefined;
773
+ associate?: {
774
+ typeId: "customer";
775
+ id: string;
776
+ obj?: /*elided*/any | undefined;
777
+ } | undefined;
778
+ } | undefined;
779
+ email: string;
780
+ password?: string | undefined;
781
+ firstName?: string | undefined;
782
+ lastName?: string | undefined;
783
+ middleName?: string | undefined;
784
+ title?: string | undefined;
785
+ dateOfBirth?: string | undefined;
786
+ companyName?: string | undefined;
787
+ vatId?: string | undefined;
788
+ addresses: WritableArray<_commercetools_platform_sdk0.Address>;
789
+ defaultShippingAddressId?: string | undefined;
790
+ shippingAddressIds: WritableArray<string>;
791
+ defaultBillingAddressId?: string | undefined;
792
+ billingAddressIds: WritableArray<string>;
793
+ isEmailVerified: boolean;
794
+ customerGroup?: {
795
+ typeId: "customer-group";
796
+ id: string;
797
+ obj?: {
798
+ id: string;
799
+ version: number;
800
+ createdAt: string;
801
+ lastModifiedAt: string;
802
+ lastModifiedBy?: {
803
+ clientId?: string | undefined;
804
+ externalUserId?: string | undefined;
805
+ customer?: {
806
+ typeId: "customer";
807
+ id: string;
808
+ obj?: /*elided*/any | undefined;
809
+ } | undefined;
810
+ anonymousId?: string | undefined;
811
+ attributedTo?: {
812
+ clientId?: string | undefined;
813
+ source: _commercetools_platform_sdk0.AttributionSource;
814
+ } | undefined;
815
+ associate?: {
816
+ typeId: "customer";
817
+ id: string;
818
+ obj?: /*elided*/any | undefined;
819
+ } | undefined;
820
+ } | undefined;
821
+ createdBy?: {
822
+ clientId?: string | undefined;
823
+ externalUserId?: string | undefined;
824
+ customer?: {
825
+ typeId: "customer";
826
+ id: string;
827
+ obj?: /*elided*/any | undefined;
828
+ } | undefined;
829
+ anonymousId?: string | undefined;
830
+ attributedTo?: {
831
+ clientId?: string | undefined;
832
+ source: _commercetools_platform_sdk0.AttributionSource;
833
+ } | undefined;
834
+ associate?: {
835
+ typeId: "customer";
836
+ id: string;
837
+ obj?: /*elided*/any | undefined;
838
+ } | undefined;
839
+ } | undefined;
840
+ key?: string | undefined;
841
+ name: string;
842
+ custom?: {
843
+ type: {
844
+ typeId: "type";
845
+ id: string;
846
+ obj?: {
847
+ id: string;
848
+ version: number;
849
+ createdAt: string;
850
+ lastModifiedAt: string;
851
+ lastModifiedBy?: {
852
+ clientId?: string | undefined;
853
+ externalUserId?: string | undefined;
854
+ customer?: {
855
+ typeId: "customer";
856
+ id: string;
857
+ obj?: /*elided*/any | undefined;
858
+ } | undefined;
859
+ anonymousId?: string | undefined;
860
+ attributedTo?: {
861
+ clientId?: string | undefined;
862
+ source: _commercetools_platform_sdk0.AttributionSource;
863
+ } | undefined;
864
+ associate?: {
865
+ typeId: "customer";
866
+ id: string;
867
+ obj?: /*elided*/any | undefined;
868
+ } | undefined;
869
+ } | undefined;
870
+ createdBy?: {
871
+ clientId?: string | undefined;
872
+ externalUserId?: string | undefined;
873
+ customer?: {
874
+ typeId: "customer";
875
+ id: string;
876
+ obj?: /*elided*/any | undefined;
877
+ } | undefined;
878
+ anonymousId?: string | undefined;
879
+ attributedTo?: {
880
+ clientId?: string | undefined;
881
+ source: _commercetools_platform_sdk0.AttributionSource;
882
+ } | undefined;
883
+ associate?: {
884
+ typeId: "customer";
885
+ id: string;
886
+ obj?: /*elided*/any | undefined;
887
+ } | undefined;
888
+ } | undefined;
889
+ key: string;
890
+ name: {
891
+ [x: string]: string;
892
+ };
893
+ description?: {
894
+ [x: string]: string;
895
+ } | undefined;
896
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
897
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
898
+ } | undefined;
899
+ };
900
+ fields: {
901
+ [x: string]: any;
902
+ };
903
+ } | undefined;
904
+ } | undefined;
905
+ } | undefined;
906
+ customerGroupAssignments: WritableArray<_commercetools_platform_sdk0.CustomerGroupAssignment>;
907
+ custom?: {
908
+ type: {
909
+ typeId: "type";
910
+ id: string;
911
+ obj?: {
912
+ id: string;
913
+ version: number;
914
+ createdAt: string;
915
+ lastModifiedAt: string;
916
+ lastModifiedBy?: {
917
+ clientId?: string | undefined;
918
+ externalUserId?: string | undefined;
919
+ customer?: {
920
+ typeId: "customer";
921
+ id: string;
922
+ obj?: /*elided*/any | undefined;
923
+ } | undefined;
924
+ anonymousId?: string | undefined;
925
+ attributedTo?: {
926
+ clientId?: string | undefined;
927
+ source: _commercetools_platform_sdk0.AttributionSource;
928
+ } | undefined;
929
+ associate?: {
930
+ typeId: "customer";
931
+ id: string;
932
+ obj?: /*elided*/any | undefined;
933
+ } | undefined;
934
+ } | undefined;
935
+ createdBy?: {
936
+ clientId?: string | undefined;
937
+ externalUserId?: string | undefined;
938
+ customer?: {
939
+ typeId: "customer";
940
+ id: string;
941
+ obj?: /*elided*/any | undefined;
942
+ } | undefined;
943
+ anonymousId?: string | undefined;
944
+ attributedTo?: {
945
+ clientId?: string | undefined;
946
+ source: _commercetools_platform_sdk0.AttributionSource;
947
+ } | undefined;
948
+ associate?: {
949
+ typeId: "customer";
950
+ id: string;
951
+ obj?: /*elided*/any | undefined;
952
+ } | undefined;
953
+ } | undefined;
954
+ key: string;
955
+ name: {
956
+ [x: string]: string;
957
+ };
958
+ description?: {
959
+ [x: string]: string;
960
+ } | undefined;
961
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
962
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
963
+ } | undefined;
964
+ };
965
+ fields: {
966
+ [x: string]: any;
967
+ };
968
+ } | undefined;
969
+ locale?: string | undefined;
970
+ salutation?: string | undefined;
971
+ stores: WritableArray<_commercetools_platform_sdk0.StoreKeyReference>;
972
+ authenticationMode: _commercetools_platform_sdk0.AuthenticationMode;
973
+ }>;
974
+ confirmEmail(context: RepositoryContext, resetPassword: MyCustomerEmailVerify): Promise<{
975
+ id: string;
976
+ version: number;
977
+ key?: string | undefined;
978
+ customerNumber?: string | undefined;
979
+ externalId?: string | undefined;
980
+ createdAt: string;
981
+ lastModifiedAt: string;
982
+ lastModifiedBy?: {
983
+ clientId?: string | undefined;
984
+ externalUserId?: string | undefined;
985
+ customer?: {
986
+ typeId: "customer";
987
+ id: string;
988
+ obj?: /*elided*/any | undefined;
989
+ } | undefined;
990
+ anonymousId?: string | undefined;
991
+ attributedTo?: {
992
+ clientId?: string | undefined;
993
+ source: _commercetools_platform_sdk0.AttributionSource;
994
+ } | undefined;
995
+ associate?: {
996
+ typeId: "customer";
997
+ id: string;
998
+ obj?: /*elided*/any | undefined;
999
+ } | undefined;
1000
+ } | undefined;
1001
+ createdBy?: {
1002
+ clientId?: string | undefined;
1003
+ externalUserId?: string | undefined;
1004
+ customer?: {
1005
+ typeId: "customer";
1006
+ id: string;
1007
+ obj?: /*elided*/any | undefined;
1008
+ } | undefined;
1009
+ anonymousId?: string | undefined;
1010
+ attributedTo?: {
1011
+ clientId?: string | undefined;
1012
+ source: _commercetools_platform_sdk0.AttributionSource;
1013
+ } | undefined;
1014
+ associate?: {
1015
+ typeId: "customer";
1016
+ id: string;
1017
+ obj?: /*elided*/any | undefined;
1018
+ } | undefined;
1019
+ } | undefined;
1020
+ email: string;
1021
+ password?: string | undefined;
1022
+ firstName?: string | undefined;
1023
+ lastName?: string | undefined;
1024
+ middleName?: string | undefined;
1025
+ title?: string | undefined;
1026
+ dateOfBirth?: string | undefined;
1027
+ companyName?: string | undefined;
1028
+ vatId?: string | undefined;
1029
+ addresses: WritableArray<_commercetools_platform_sdk0.Address>;
1030
+ defaultShippingAddressId?: string | undefined;
1031
+ shippingAddressIds: WritableArray<string>;
1032
+ defaultBillingAddressId?: string | undefined;
1033
+ billingAddressIds: WritableArray<string>;
1034
+ isEmailVerified: boolean;
1035
+ customerGroup?: {
1036
+ typeId: "customer-group";
1037
+ id: string;
1038
+ obj?: {
1039
+ id: string;
1040
+ version: number;
1041
+ createdAt: string;
1042
+ lastModifiedAt: string;
1043
+ lastModifiedBy?: {
1044
+ clientId?: string | undefined;
1045
+ externalUserId?: string | undefined;
1046
+ customer?: {
1047
+ typeId: "customer";
1048
+ id: string;
1049
+ obj?: /*elided*/any | undefined;
1050
+ } | undefined;
1051
+ anonymousId?: string | undefined;
1052
+ attributedTo?: {
1053
+ clientId?: string | undefined;
1054
+ source: _commercetools_platform_sdk0.AttributionSource;
1055
+ } | undefined;
1056
+ associate?: {
1057
+ typeId: "customer";
1058
+ id: string;
1059
+ obj?: /*elided*/any | undefined;
1060
+ } | undefined;
1061
+ } | undefined;
1062
+ createdBy?: {
1063
+ clientId?: string | undefined;
1064
+ externalUserId?: string | undefined;
1065
+ customer?: {
1066
+ typeId: "customer";
1067
+ id: string;
1068
+ obj?: /*elided*/any | undefined;
1069
+ } | undefined;
1070
+ anonymousId?: string | undefined;
1071
+ attributedTo?: {
1072
+ clientId?: string | undefined;
1073
+ source: _commercetools_platform_sdk0.AttributionSource;
1074
+ } | undefined;
1075
+ associate?: {
1076
+ typeId: "customer";
1077
+ id: string;
1078
+ obj?: /*elided*/any | undefined;
1079
+ } | undefined;
1080
+ } | undefined;
1081
+ key?: string | undefined;
1082
+ name: string;
1083
+ custom?: {
1084
+ type: {
1085
+ typeId: "type";
1086
+ id: string;
1087
+ obj?: {
1088
+ id: string;
1089
+ version: number;
1090
+ createdAt: string;
1091
+ lastModifiedAt: string;
1092
+ lastModifiedBy?: {
1093
+ clientId?: string | undefined;
1094
+ externalUserId?: string | undefined;
1095
+ customer?: {
1096
+ typeId: "customer";
1097
+ id: string;
1098
+ obj?: /*elided*/any | undefined;
1099
+ } | undefined;
1100
+ anonymousId?: string | undefined;
1101
+ attributedTo?: {
1102
+ clientId?: string | undefined;
1103
+ source: _commercetools_platform_sdk0.AttributionSource;
1104
+ } | undefined;
1105
+ associate?: {
1106
+ typeId: "customer";
1107
+ id: string;
1108
+ obj?: /*elided*/any | undefined;
1109
+ } | undefined;
1110
+ } | undefined;
1111
+ createdBy?: {
1112
+ clientId?: string | undefined;
1113
+ externalUserId?: string | undefined;
1114
+ customer?: {
1115
+ typeId: "customer";
1116
+ id: string;
1117
+ obj?: /*elided*/any | undefined;
1118
+ } | undefined;
1119
+ anonymousId?: string | undefined;
1120
+ attributedTo?: {
1121
+ clientId?: string | undefined;
1122
+ source: _commercetools_platform_sdk0.AttributionSource;
1123
+ } | undefined;
1124
+ associate?: {
1125
+ typeId: "customer";
1126
+ id: string;
1127
+ obj?: /*elided*/any | undefined;
1128
+ } | undefined;
1129
+ } | undefined;
1130
+ key: string;
1131
+ name: {
1132
+ [x: string]: string;
1133
+ };
1134
+ description?: {
1135
+ [x: string]: string;
1136
+ } | undefined;
1137
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
1138
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
1139
+ } | undefined;
1140
+ };
1141
+ fields: {
1142
+ [x: string]: any;
1143
+ };
1144
+ } | undefined;
1145
+ } | undefined;
1146
+ } | undefined;
1147
+ customerGroupAssignments: WritableArray<_commercetools_platform_sdk0.CustomerGroupAssignment>;
1148
+ custom?: {
1149
+ type: {
1150
+ typeId: "type";
1151
+ id: string;
1152
+ obj?: {
1153
+ id: string;
1154
+ version: number;
1155
+ createdAt: string;
1156
+ lastModifiedAt: string;
1157
+ lastModifiedBy?: {
1158
+ clientId?: string | undefined;
1159
+ externalUserId?: string | undefined;
1160
+ customer?: {
1161
+ typeId: "customer";
1162
+ id: string;
1163
+ obj?: /*elided*/any | undefined;
1164
+ } | undefined;
1165
+ anonymousId?: string | undefined;
1166
+ attributedTo?: {
1167
+ clientId?: string | undefined;
1168
+ source: _commercetools_platform_sdk0.AttributionSource;
1169
+ } | undefined;
1170
+ associate?: {
1171
+ typeId: "customer";
1172
+ id: string;
1173
+ obj?: /*elided*/any | undefined;
1174
+ } | undefined;
1175
+ } | undefined;
1176
+ createdBy?: {
1177
+ clientId?: string | undefined;
1178
+ externalUserId?: string | undefined;
1179
+ customer?: {
1180
+ typeId: "customer";
1181
+ id: string;
1182
+ obj?: /*elided*/any | undefined;
1183
+ } | undefined;
1184
+ anonymousId?: string | undefined;
1185
+ attributedTo?: {
1186
+ clientId?: string | undefined;
1187
+ source: _commercetools_platform_sdk0.AttributionSource;
1188
+ } | undefined;
1189
+ associate?: {
1190
+ typeId: "customer";
1191
+ id: string;
1192
+ obj?: /*elided*/any | undefined;
1193
+ } | undefined;
1194
+ } | undefined;
1195
+ key: string;
1196
+ name: {
1197
+ [x: string]: string;
1198
+ };
1199
+ description?: {
1200
+ [x: string]: string;
1201
+ } | undefined;
1202
+ resourceTypeIds: WritableArray<_commercetools_platform_sdk0.ResourceTypeId>;
1203
+ fieldDefinitions: WritableArray<_commercetools_platform_sdk0.FieldDefinition>;
1204
+ } | undefined;
1205
+ };
1206
+ fields: {
1207
+ [x: string]: any;
1208
+ };
1209
+ } | undefined;
1210
+ locale?: string | undefined;
1211
+ salutation?: string | undefined;
1212
+ stores: WritableArray<_commercetools_platform_sdk0.StoreKeyReference>;
1213
+ authenticationMode: _commercetools_platform_sdk0.AuthenticationMode;
1214
+ }>;
1215
+ deleteMe(context: RepositoryContext): Promise<Customer | undefined>;
1216
+ getMe(context: RepositoryContext): Promise<Customer | undefined>;
1217
+ }
1218
+ //#endregion
1219
+ //#region src/repositories/my-order.d.ts
1220
+ declare class MyOrderRepository extends OrderRepository {
1221
+ create(context: RepositoryContext, draft: MyOrderFromCartDraft): Promise<Order>;
1222
+ }
1223
+ //#endregion
1224
+ //#region src/repositories/order-edit.d.ts
1225
+ declare class OrderEditRepository extends AbstractResourceRepository<"order-edit"> {
1226
+ constructor(config: Config);
1227
+ create(context: RepositoryContext, draft: OrderEditDraft): Promise<OrderEdit>;
1228
+ }
1229
+ //#endregion
1230
+ //#region src/repositories/payment/index.d.ts
1231
+ declare class PaymentRepository extends AbstractResourceRepository<"payment"> {
1232
+ constructor(config: Config);
1233
+ create(context: RepositoryContext, draft: PaymentDraft): Promise<Payment>;
1234
+ }
1235
+ //#endregion
1236
+ //#region src/lib/review-statistics.d.ts
1237
+ declare class ReviewStatisticsService {
1238
+ private _storage;
1239
+ constructor(_storage: AbstractStorage);
1240
+ calculateProductReviewStatistics(projectKey: string, productId: string): Promise<ReviewRatingStatistics | undefined>;
1241
+ }
1242
+ //#endregion
1243
+ //#region src/product-search.d.ts
1244
+ interface ProductSearchVariantAvailability {
1245
+ isOnStock: boolean;
1246
+ availableQuantity: number;
1247
+ isOnStockForChannel: string | undefined;
1248
+ }
1249
+ declare class ProductSearch {
1250
+ protected _storage: AbstractStorage;
1251
+ constructor(config: Config);
1252
+ search(projectKey: string, params: ProductSearchRequest): Promise<ProductPagedSearchResponse>;
1253
+ transformProduct(product: Product, staged: boolean, availabilityBySku: Map<string, ProductSearchVariantAvailability>): ProductProjection;
1254
+ }
1255
+ //#endregion
1256
+ //#region src/repositories/product/index.d.ts
1257
+ declare class ProductRepository extends AbstractResourceRepository<"product"> {
1258
+ protected _searchService: ProductSearch;
1259
+ protected _reviewStatisticsService: ReviewStatisticsService;
1260
+ constructor(config: Config);
1261
+ create(context: RepositoryContext, draft: ProductDraft): Promise<Product>;
1262
+ postProcessResource(context: RepositoryContext, resource: Product, params?: GetParams$1): Promise<Product>;
1263
+ search(context: RepositoryContext, searchRequest: ProductSearchRequest): Promise<ProductPagedSearchResponse>;
1264
+ }
1265
+ //#endregion
1266
+ //#region src/repositories/product-discount.d.ts
1267
+ declare class ProductDiscountRepository extends AbstractResourceRepository<"product-discount"> {
1268
+ constructor(config: Config);
1269
+ create(context: RepositoryContext, draft: ProductDiscountDraft): Promise<ProductDiscount>;
1270
+ }
1271
+ //#endregion
1272
+ //#region src/lib/projectionSearchFilter.d.ts
1273
+ type RangeExpression = {
1274
+ type: "RangeExpression";
1275
+ start?: number;
1276
+ stop?: number;
1277
+ match: (obj: any) => boolean;
1278
+ };
1279
+ type FilterExpression = {
1280
+ type: "FilterExpression";
1281
+ match: (obj: any) => boolean;
1282
+ };
1283
+ //#endregion
1284
+ //#region src/product-projection-search.d.ts
1285
+ type ProductProjectionSearchParams = {
1286
+ fuzzy?: boolean;
1287
+ fuzzyLevel?: number;
1288
+ markMatchingVariants?: boolean;
1289
+ staged?: boolean;
1290
+ filter?: string[];
1291
+ "filter.facets"?: string[];
1292
+ "filter.query"?: string[];
1293
+ facet?: string | string[];
1294
+ sort?: string | string[];
1295
+ limit?: number;
1296
+ offset?: number;
1297
+ withTotal?: boolean;
1298
+ priceCurrency?: string;
1299
+ priceCountry?: string;
1300
+ priceCustomerGroup?: string;
1301
+ priceChannel?: string;
1302
+ localeProjection?: string;
1303
+ storeProjection?: string;
1304
+ expand?: string | string[];
1305
+ [key: string]: QueryParam;
1306
+ };
1307
+ declare class ProductProjectionSearch {
1308
+ protected _storage: AbstractStorage;
1309
+ protected _reviewStatisticsService: ReviewStatisticsService;
1310
+ constructor(config: Config);
1311
+ search(projectKey: string, params: ProductProjectionSearchParams): Promise<ProductProjectionPagedSearchResponse>;
1312
+ transform(product: Product, staged: boolean, projectKey: string): Promise<ProductProjection>;
1313
+ getFacets(params: ProductProjectionSearchParams, products: ProductProjection[]): FacetResults;
1314
+ /**
1315
+ * TODO: This implemention needs the following additional features:
1316
+ * - counting products
1317
+ * - correct dataType
1318
+ */
1319
+ termFacet(facet: string, products: ProductProjection[], countProducts: boolean): TermFacetResult;
1320
+ filterFacet(source: string, filters: FilterExpression[] | undefined, products: ProductProjection[], countProducts: boolean): FilteredFacetResult;
1321
+ rangeFacet(source: string, ranges: RangeExpression[] | undefined, products: ProductProjection[], countProducts: boolean): RangeFacetResult;
1322
+ }
1323
+ //#endregion
1324
+ //#region src/repositories/product-projection.d.ts
1325
+ type ProductProjectionQueryParams = {
1326
+ staged?: boolean;
1327
+ priceCurrency?: string;
1328
+ priceCountry?: string;
1329
+ priceCustomerGroup?: string;
1330
+ priceChannel?: string;
1331
+ localeProjection?: string;
1332
+ storeProjection?: string;
1333
+ expand?: string | string[];
1334
+ sort?: string | string[];
1335
+ limit?: number;
1336
+ offset?: number;
1337
+ withTotal?: boolean;
1338
+ where?: string | string[];
1339
+ [key: string]: QueryParam;
1340
+ };
1341
+ declare class ProductProjectionRepository extends AbstractResourceRepository<"product-projection"> {
1342
+ protected _searchService: ProductProjectionSearch;
1343
+ constructor(config: Config);
1344
+ create(context: RepositoryContext, draft: ProductDraft): Promise<ProductProjection>;
1345
+ get(context: RepositoryContext, id: string, params?: GetParams$1): Promise<ProductProjection | null>;
1346
+ query(context: RepositoryContext, params?: ProductProjectionQueryParams): Promise<{
1347
+ count: number;
1348
+ total: number;
1349
+ offset: number;
1350
+ limit: number;
1351
+ results: ProductProjection[];
1352
+ }>;
1353
+ search(context: RepositoryContext, query: ProductProjectionQueryParams): Promise<_commercetools_platform_sdk0.ProductProjectionPagedSearchResponse>;
1354
+ }
1355
+ //#endregion
1356
+ //#region src/repositories/product-selection.d.ts
1357
+ declare class ProductSelectionRepository extends AbstractResourceRepository<"product-selection"> {
1358
+ constructor(config: Config);
1359
+ create(context: RepositoryContext, draft: ProductSelectionDraft): Promise<ProductSelection>;
1360
+ }
1361
+ //#endregion
1362
+ //#region src/repositories/product-type.d.ts
1363
+ declare class ProductTypeRepository extends AbstractResourceRepository<"product-type"> {
1364
+ constructor(config: Config);
1365
+ create(context: RepositoryContext, draft: ProductTypeDraft): Promise<ProductType>;
1366
+ }
1367
+ //#endregion
1368
+ //#region src/repositories/project.d.ts
1369
+ declare class ProjectRepository extends AbstractRepository<Project> {
1370
+ constructor(config: Config);
1371
+ get(context: RepositoryContext): Promise<Project | null>;
1372
+ postProcessResource(context: RepositoryContext, resource: Project | null): Promise<Project | null>;
1373
+ saveNew(context: RepositoryContext, resource: Writable<Project>): Promise<Project>;
1374
+ saveUpdate(context: RepositoryContext, version: number, resource: Project): Promise<Project>;
1375
+ }
1376
+ //#endregion
1377
+ //#region src/repositories/quote/index.d.ts
1378
+ declare class QuoteRepository extends AbstractResourceRepository<"quote"> {
1379
+ constructor(config: Config);
1380
+ create(context: RepositoryContext, draft: QuoteDraft): Promise<Quote>;
1381
+ }
1382
+ //#endregion
1383
+ //#region src/repositories/quote-staged/index.d.ts
1384
+ declare class StagedQuoteRepository extends AbstractResourceRepository<"staged-quote"> {
1385
+ constructor(config: Config);
1386
+ create(context: RepositoryContext, draft: StagedQuoteDraft): Promise<StagedQuote>;
1387
+ }
1388
+ //#endregion
1389
+ //#region src/repositories/recurrence-policy/index.d.ts
1390
+ declare class RecurrencePolicyRepository extends AbstractResourceRepository<"recurrence-policy"> {
1391
+ constructor(config: Config);
1392
+ create(context: RepositoryContext, draft: RecurrencePolicyDraft): Promise<RecurrencePolicy>;
1393
+ }
1394
+ //#endregion
1395
+ //#region src/repositories/recurring-order/index.d.ts
1396
+ declare class RecurringOrderRepository extends AbstractResourceRepository<"recurring-order"> {
1397
+ constructor(config: Config);
1398
+ create(context: RepositoryContext, draft: RecurringOrderDraft): Promise<RecurringOrder>;
1399
+ }
1400
+ //#endregion
1401
+ //#region src/repositories/review.d.ts
1402
+ declare class ReviewRepository extends AbstractResourceRepository<"review"> {
1403
+ constructor(config: Config);
1404
+ create(context: RepositoryContext, draft: ReviewDraft): Promise<Review>;
1405
+ }
1406
+ //#endregion
1407
+ //#region src/repositories/shipping-method/index.d.ts
1408
+ declare class ShippingMethodRepository extends AbstractResourceRepository<"shipping-method"> {
1409
+ constructor(config: Config);
1410
+ create(context: RepositoryContext, draft: ShippingMethodDraft): Promise<ShippingMethod>;
1411
+ matchingCart(context: RepositoryContext, cartId: string, params?: GetParams$1): Promise<{
1412
+ results: {
1413
+ zoneRates: {
1414
+ zone: ZoneReference;
1415
+ shippingRates: _commercetools_platform_sdk0.ShippingRate[];
1416
+ }[];
1417
+ id: string;
1418
+ version: number;
1419
+ createdAt: string;
1420
+ lastModifiedAt: string;
1421
+ lastModifiedBy?: _commercetools_platform_sdk0.LastModifiedBy;
1422
+ createdBy?: _commercetools_platform_sdk0.CreatedBy;
1423
+ key?: string;
1424
+ name: string;
1425
+ localizedName?: _commercetools_platform_sdk0.LocalizedString;
1426
+ description?: string;
1427
+ localizedDescription?: _commercetools_platform_sdk0.LocalizedString;
1428
+ taxCategory: _commercetools_platform_sdk0.TaxCategoryReference;
1429
+ active: boolean;
1430
+ isDefault: boolean;
1431
+ predicate?: string;
1432
+ custom?: _commercetools_platform_sdk0.CustomFields;
1433
+ }[];
1434
+ limit?: number;
1435
+ count: number;
1436
+ total?: number;
1437
+ offset?: number;
1438
+ } | undefined>;
1439
+ private _transformZoneRateDraft;
1440
+ }
1441
+ //#endregion
1442
+ //#region src/repositories/standalone-price.d.ts
1443
+ declare class StandAlonePriceRepository extends AbstractResourceRepository<"standalone-price"> {
1444
+ constructor(config: Config);
1445
+ create(context: RepositoryContext, draft: StandalonePriceDraft): Promise<StandalonePrice>;
1446
+ transformChannelReferenceDraft(channel: ChannelResourceIdentifier): ChannelReference;
1447
+ }
1448
+ //#endregion
1449
+ //#region src/repositories/state.d.ts
1450
+ declare class StateRepository extends AbstractResourceRepository<"state"> {
1451
+ constructor(config: Config);
1452
+ create(context: RepositoryContext, draft: StateDraft): Promise<State>;
1453
+ }
1454
+ //#endregion
1455
+ //#region src/repositories/store.d.ts
1456
+ declare class StoreRepository extends AbstractResourceRepository<"store"> {
1457
+ constructor(config: Config);
1458
+ create(context: RepositoryContext, draft: StoreDraft): Promise<Store>;
1459
+ }
1460
+ //#endregion
1461
+ //#region src/repositories/subscription.d.ts
1462
+ declare class SubscriptionRepository extends AbstractResourceRepository<"subscription"> {
1463
+ constructor(config: Config);
1464
+ create(context: RepositoryContext, draft: SubscriptionDraft): Promise<Subscription>;
1465
+ }
1466
+ //#endregion
1467
+ //#region src/repositories/tax-category/index.d.ts
1468
+ declare class TaxCategoryRepository extends AbstractResourceRepository<"tax-category"> {
1469
+ constructor(config: Config);
1470
+ create(context: RepositoryContext, draft: TaxCategoryDraft): Promise<TaxCategory>;
1471
+ }
1472
+ //#endregion
1473
+ //#region src/repositories/type/index.d.ts
1474
+ declare class TypeRepository extends AbstractResourceRepository<"type"> {
1475
+ constructor(config: Config);
1476
+ create(context: RepositoryContext, draft: TypeDraft): Promise<Type>;
1477
+ }
1478
+ //#endregion
1479
+ //#region src/repositories/zone.d.ts
1480
+ declare class ZoneRepository extends AbstractResourceRepository<"zone"> {
1481
+ constructor(config: Config);
1482
+ create(context: RepositoryContext, draft: ZoneDraft): Promise<Zone>;
1483
+ }
1484
+ //#endregion
1485
+ //#region src/repositories/index.d.ts
1486
+ type RepositoryMap = ReturnType<typeof createRepositories>;
1487
+ declare const createRepositories: (config: Config) => {
1488
+ "as-associate": {
1489
+ cart: AsAssociateCartRepository;
1490
+ order: AsAssociateOrderRepository;
1491
+ "quote-request": AsAssociateQuoteRequestRepository;
1492
+ "shopping-list": AsAssociateShoppingListRepository;
1493
+ };
1494
+ "associate-role": AssociateRoleRepository;
1495
+ "attribute-group": AttributeGroupRepository;
1496
+ "business-unit": BusinessUnitRepository;
1497
+ category: CategoryRepository;
1498
+ cart: CartRepository;
1499
+ "cart-discount": CartDiscountRepository;
1500
+ customer: CustomerRepository;
1501
+ channel: ChannelRepository;
1502
+ "customer-group": CustomerGroupRepository;
1503
+ "discount-code": DiscountCodeRepository;
1504
+ "discount-group": DiscountGroupRepository;
1505
+ extension: ExtensionRepository;
1506
+ "inventory-entry": InventoryEntryRepository;
1507
+ "key-value-document": CustomObjectRepository;
1508
+ order: OrderRepository;
1509
+ "order-edit": OrderEditRepository;
1510
+ payment: PaymentRepository;
1511
+ "my-cart": CartRepository;
1512
+ "my-order": MyOrderRepository;
1513
+ "my-customer": MyCustomerRepository;
1514
+ "my-payment": PaymentRepository;
1515
+ "my-shopping-list": ShoppingListRepository;
1516
+ product: ProductRepository;
1517
+ "product-type": ProductTypeRepository;
1518
+ "product-discount": ProductDiscountRepository;
1519
+ "product-projection": ProductProjectionRepository;
1520
+ "product-selection": ProductSelectionRepository;
1521
+ "product-tailoring": ProductTailoringRepository;
1522
+ project: ProjectRepository;
1523
+ "recurring-order": RecurringOrderRepository;
1524
+ "recurrence-policy": RecurrencePolicyRepository;
1525
+ review: ReviewRepository;
1526
+ quote: QuoteRepository;
1527
+ "quote-request": QuoteRequestRepository;
1528
+ "shipping-method": ShippingMethodRepository;
1529
+ "shopping-list": ShoppingListRepository;
1530
+ "staged-quote": StagedQuoteRepository;
1531
+ "standalone-price": StandAlonePriceRepository;
1532
+ state: StateRepository;
1533
+ store: StoreRepository;
1534
+ subscription: SubscriptionRepository;
1535
+ "tax-category": TaxCategoryRepository;
1536
+ type: TypeRepository;
1537
+ zone: ZoneRepository;
1538
+ };
1539
+ //#endregion
1540
+ //#region src/types.d.ts
1541
+ type Builtin = string | number | boolean | undefined | null | symbol | bigint | Date | RegExp;
1542
+ type Writable<T> = T extends Builtin ? T : T extends ReadonlyArray<infer U> ? WritableArray<U> : T extends object ? { -readonly [P in keyof T]: Writable<T[P]> } : T;
1543
+ interface WritableArray<T> extends Array<Writable<T>> {}
1544
+ type ShallowWritable<T> = { -readonly [P in keyof T]: T[P] };
1545
+ type ResourceType = keyof ResourceMap & keyof RepositoryMap;
1546
+ type ResourceMap = {
1547
+ "attribute-group": _commercetools_platform_sdk0.AttributeGroup;
1548
+ "associate-role": _commercetools_platform_sdk0.AssociateRole;
1549
+ "business-unit": _commercetools_platform_sdk0.BusinessUnit;
1550
+ "cart-discount": _commercetools_platform_sdk0.CartDiscount;
1551
+ cart: _commercetools_platform_sdk0.Cart;
1552
+ category: _commercetools_platform_sdk0.Category;
1553
+ channel: _commercetools_platform_sdk0.Channel;
1554
+ "customer-email-token": never;
1555
+ "customer-group": _commercetools_platform_sdk0.CustomerGroup;
1556
+ "customer-password-token": never;
1557
+ customer: _commercetools_platform_sdk0.Customer;
1558
+ "discount-code": _commercetools_platform_sdk0.DiscountCode;
1559
+ "discount-group": _commercetools_platform_sdk0.DiscountGroup;
1560
+ extension: _commercetools_platform_sdk0.Extension;
1561
+ "inventory-entry": _commercetools_platform_sdk0.InventoryEntry;
1562
+ "key-value-document": _commercetools_platform_sdk0.CustomObject;
1563
+ "order-edit": _commercetools_platform_sdk0.OrderEdit;
1564
+ order: _commercetools_platform_sdk0.Order;
1565
+ payment: _commercetools_platform_sdk0.Payment;
1566
+ "product-discount": _commercetools_platform_sdk0.ProductDiscount;
1567
+ "product-price": _commercetools_platform_sdk0.StandalonePrice;
1568
+ "product-projection": _commercetools_platform_sdk0.ProductProjection;
1569
+ "product-selection": _commercetools_platform_sdk0.ProductSelection;
1570
+ "product-tailoring": _commercetools_platform_sdk0.ProductTailoring;
1571
+ "product-type": _commercetools_platform_sdk0.ProductType;
1572
+ product: _commercetools_platform_sdk0.Product;
1573
+ "quote-request": _commercetools_platform_sdk0.QuoteRequest;
1574
+ quote: _commercetools_platform_sdk0.Quote;
1575
+ review: _commercetools_platform_sdk0.Review;
1576
+ "shipping-method": _commercetools_platform_sdk0.ShippingMethod;
1577
+ "shopping-list": _commercetools_platform_sdk0.ShoppingList;
1578
+ "staged-quote": _commercetools_platform_sdk0.StagedQuote;
1579
+ "standalone-price": _commercetools_platform_sdk0.StandalonePrice;
1580
+ state: _commercetools_platform_sdk0.State;
1581
+ store: _commercetools_platform_sdk0.Store;
1582
+ subscription: _commercetools_platform_sdk0.Subscription;
1583
+ "recurring-order": _commercetools_platform_sdk0.RecurringOrder;
1584
+ "recurrence-policy": _commercetools_platform_sdk0.RecurrencePolicy;
1585
+ "tax-category": _commercetools_platform_sdk0.TaxCategory;
1586
+ type: _commercetools_platform_sdk0.Type;
1587
+ zone: _commercetools_platform_sdk0.Zone;
1588
+ };
1589
+ type PagedQueryResponseMap = {
1590
+ "attribute-group": _commercetools_platform_sdk0.AttributeGroupPagedQueryResponse;
1591
+ "associate-role": _commercetools_platform_sdk0.AssociateRolePagedQueryResponse;
1592
+ "business-unit": _commercetools_platform_sdk0.BusinessUnitPagedQueryResponse;
1593
+ "cart-discount": _commercetools_platform_sdk0.CartDiscountPagedQueryResponse;
1594
+ cart: _commercetools_platform_sdk0.CartPagedQueryResponse;
1595
+ category: _commercetools_platform_sdk0.CategoryPagedQueryResponse;
1596
+ channel: _commercetools_platform_sdk0.ChannelPagedQueryResponse;
1597
+ "customer-email-token": never;
1598
+ "customer-group": _commercetools_platform_sdk0.CustomerGroupPagedQueryResponse;
1599
+ "customer-password-token": never;
1600
+ customer: _commercetools_platform_sdk0.CustomerPagedQueryResponse;
1601
+ "discount-code": _commercetools_platform_sdk0.DiscountCodePagedQueryResponse;
1602
+ "discount-group": _commercetools_platform_sdk0.DiscountGroupPagedQueryResponse;
1603
+ extension: _commercetools_platform_sdk0.ExtensionPagedQueryResponse;
1604
+ "inventory-entry": _commercetools_platform_sdk0.InventoryPagedQueryResponse;
1605
+ "key-value-document": _commercetools_platform_sdk0.CustomObjectPagedQueryResponse;
1606
+ "order-edit": _commercetools_platform_sdk0.OrderEditPagedQueryResponse;
1607
+ order: _commercetools_platform_sdk0.OrderPagedQueryResponse;
1608
+ payment: _commercetools_platform_sdk0.PaymentPagedQueryResponse;
1609
+ "product-discount": _commercetools_platform_sdk0.ProductDiscountPagedQueryResponse;
1610
+ "product-price": _commercetools_platform_sdk0.StandalonePricePagedQueryResponse;
1611
+ "product-projection": _commercetools_platform_sdk0.ProductProjectionPagedQueryResponse;
1612
+ "product-selection": _commercetools_platform_sdk0.ProductSelectionPagedQueryResponse;
1613
+ "product-tailoring": _commercetools_platform_sdk0.ProductTailoringPagedQueryResponse;
1614
+ "product-type": _commercetools_platform_sdk0.ProductTypePagedQueryResponse;
1615
+ product: _commercetools_platform_sdk0.ProductPagedQueryResponse;
1616
+ "quote-request": _commercetools_platform_sdk0.QuoteRequestPagedQueryResponse;
1617
+ quote: _commercetools_platform_sdk0.QuotePagedQueryResponse;
1618
+ review: _commercetools_platform_sdk0.ReviewPagedQueryResponse;
1619
+ "shipping-method": _commercetools_platform_sdk0.ShippingMethodPagedQueryResponse;
1620
+ "shopping-list": _commercetools_platform_sdk0.ShoppingListPagedQueryResponse;
1621
+ "staged-quote": _commercetools_platform_sdk0.StagedQuotePagedQueryResponse;
1622
+ "standalone-price": _commercetools_platform_sdk0.StandalonePricePagedQueryResponse;
1623
+ state: _commercetools_platform_sdk0.StatePagedQueryResponse;
1624
+ store: _commercetools_platform_sdk0.StorePagedQueryResponse;
1625
+ subscription: _commercetools_platform_sdk0.SubscriptionPagedQueryResponse;
1626
+ "recurring-order": _commercetools_platform_sdk0.RecurringOrderPagedQueryResponse;
1627
+ "recurrence-policy": _commercetools_platform_sdk0.RecurrencePolicyPagedQueryResponse;
1628
+ "tax-category": _commercetools_platform_sdk0.TaxCategoryPagedQueryResponse;
1629
+ type: _commercetools_platform_sdk0.TypePagedQueryResponse;
1630
+ zone: _commercetools_platform_sdk0.ZonePagedQueryResponse;
1631
+ };
1632
+ //#endregion
1633
+ //#region src/storage/storage-map.d.ts
1634
+ /**
1635
+ * A Map wrapper that deep-clones values on insertion and retrieval.
1636
+ *
1637
+ * This ensures that the stored data is fully isolated from external
1638
+ * mutations: callers cannot accidentally corrupt the store by modifying
1639
+ * an object after inserting it, and retrieved objects are independent
1640
+ * copies that can be freely mutated without affecting the store.
1641
+ */
1642
+ declare class StorageMap<K, V> {
1643
+ private _map;
1644
+ constructor();
1645
+ get size(): number;
1646
+ set(key: K, value: V): this;
1647
+ get(key: K): V | undefined;
1648
+ has(key: K): boolean;
1649
+ delete(key: K): boolean;
1650
+ clear(): void;
1651
+ /**
1652
+ * Returns cloned values. Each value is a deep copy.
1653
+ */
1654
+ values(): IterableIterator<V>;
1655
+ /**
1656
+ * Returns cloned entries. Each value is a deep copy, keys are returned as-is.
1657
+ */
1658
+ entries(): IterableIterator<[K, V]>;
1659
+ [Symbol.iterator](): IterableIterator<[K, V]>;
1660
+ }
1661
+ //#endregion
1662
+ //#region src/storage/abstract.d.ts
1663
+ type GetParams = {
1664
+ expand?: string[];
1665
+ };
1666
+ type QueryParams = {
1667
+ expand?: string | string[];
1668
+ sort?: string | string[];
1669
+ limit?: number;
1670
+ offset?: number;
1671
+ withTotal?: boolean;
1672
+ where?: string | string[];
1673
+ [key: string]: QueryParam;
1674
+ };
1675
+ declare abstract class AbstractStorage {
1676
+ /**
1677
+ * Close the storage backend and release any resources.
1678
+ * Override this in subclasses that hold external resources (e.g. database connections).
1679
+ */
1680
+ close(): void;
1681
+ abstract clear(): Promise<void>;
1682
+ abstract all<RT extends ResourceType>(projectKey: string, typeId: RT): Promise<Array<ResourceMap[RT]>>;
1683
+ /**
1684
+ * Return the number of resources of the given type.
1685
+ * This is more efficient than loading all resources and counting them.
1686
+ */
1687
+ abstract count(projectKey: string, typeId: ResourceType): Promise<number>;
1688
+ abstract add<RT extends ResourceType>(projectKey: string, typeId: RT, obj: ResourceMap[RT], params?: GetParams): Promise<ResourceMap[RT]>;
1689
+ abstract get<RT extends ResourceType>(projectKey: string, typeId: RT, id: string, params?: GetParams): Promise<ResourceMap[RT] | null>;
1690
+ abstract getByKey<RT extends ResourceType>(projectKey: string, typeId: RT, key: string, params?: GetParams): Promise<ResourceMap[RT] | null>;
1691
+ abstract addProject(projectKey: string): Promise<Project>;
1692
+ abstract getProject(projectKey: string): Promise<Project>;
1693
+ abstract saveProject(project: Project): Promise<Project>;
1694
+ abstract delete<RT extends ResourceType>(projectKey: string, typeId: RT, id: string, params: GetParams): Promise<ResourceMap[RT] | null>;
1695
+ abstract query<RT extends ResourceType>(projectKey: string, typeId: RT, params: QueryParams): Promise<PagedQueryResponseMap[RT]>;
1696
+ /**
1697
+ * Look up a custom object by its container and key.
1698
+ * This is an O(1) operation for storage backends that maintain
1699
+ * a secondary index on (container, key).
1700
+ */
1701
+ abstract getByContainerAndKey(projectKey: string, container: string, key: string): Promise<CustomObject | null>;
1702
+ expand<T>(projectKey: string, obj: T, clause: undefined | string | string[]): Promise<T>;
1703
+ getByResourceIdentifier<RT extends ResourceType>(projectKey: string, identifier: ResourceIdentifier): Promise<ResourceMap[RT]>;
1704
+ search(projectKey: string, typeId: ResourceType, params: QueryParams): Promise<PagedQueryResponse>;
1705
+ private _resolveResource;
1706
+ private _resolveReference;
1707
+ private _resolveShoppingListLineItemVariant;
1708
+ }
1709
+ type ProjectStorage = { [index in ResourceType]: StorageMap<string, BaseResource> };
1710
+ //#endregion
1711
+ //#region src/config.d.ts
1712
+ type Config = {
1713
+ strict: boolean;
1714
+ storage: AbstractStorage;
1715
+ };
1716
+ //#endregion
1717
+ export { QueryParams as a, ResourceType as c, ProjectStorage as i, RepositoryMap as l, AbstractStorage as n, PagedQueryResponseMap as o, GetParams as r, ResourceMap as s, Config as t, GetParams$1 as u };
1718
+ //# sourceMappingURL=config-BcNSzPZz.d.mts.map