Skip to content

Commit e29f6e1

Browse files
authored
chore: update CT package and implement required changes (#323)
1 parent 1136f8f commit e29f6e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1734
-139
lines changed

.changeset/better-loops-sneeze.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@labdigital/commercetools-mock": minor
3+
---
4+
5+
Add support for attributes at Product level
6+
Add DiscountGroup, RecurrencePolicy, and RecurringOrder services
7+
Add PaymentUpdateAction methods
8+
Add invalidateOlderTokens to customer token creation
9+

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"publish:version": "pnpm changeset version && pnpm format",
2525
"start": "tsdown src/server.ts --watch --onSuccess 'node dist/server'",
2626
"test": "vitest run",
27-
"test:ci": "vitest run --coverage"
27+
"test:ci": "vitest run --coverage",
28+
"test:watch": "vitest --watch"
2829
},
2930
"dependencies": {
3031
"basic-auth": "2.0.1",
@@ -43,7 +44,7 @@
4344
"@types/express": "^5.0.1",
4445
"@changesets/changelog-github": "0.5.1",
4546
"@changesets/cli": "2.28.1",
46-
"@commercetools/platform-sdk": "8.8.0",
47+
"@commercetools/platform-sdk": "8.14.0",
4748
"@types/basic-auth": "1.1.8",
4849
"@types/body-parser": "1.19.5",
4950
"@types/express-serve-static-core": "^5.0.6",
@@ -69,4 +70,4 @@
6970
"publishConfig": {
7071
"access": "public"
7172
}
72-
}
73+
}

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/productSearchFilter.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe("Product search filter", () => {
2525
"nl-NL": "test",
2626
"en-US": "test",
2727
},
28+
attributes: [],
2829
variants: [],
2930
searchKeywords: {},
3031
categories: [],

src/lib/projectionSearchFilter.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe("Search filter", () => {
2424
variants: [],
2525
searchKeywords: {},
2626
categories: [],
27+
attributes: [],
2728
masterVariant: {
2829
id: 1,
2930
sku: "MYSKU",

src/priceSelector.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe("priceSelector", () => {
2424
variants: [],
2525
searchKeywords: {},
2626
categories: [],
27+
attributes: [],
2728
masterVariant: {
2829
id: 1,
2930
sku: "MYSKU",

src/product-projection-search.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
FilteredFacetResult,
44
InvalidInputError,
55
Product,
6+
ProductData,
67
ProductProjection,
78
ProductProjectionPagedSearchResponse,
89
QueryParam,
@@ -169,6 +170,7 @@ export class ProductProjectionSearch {
169170
return {
170171
id: product.id,
171172
createdAt: product.createdAt,
173+
attributes: obj.attributes,
172174
lastModifiedAt: product.lastModifiedAt,
173175
version: product.version,
174176
name: obj.name,

src/product-search.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export class ProductSearch {
176176
metaDescription: obj.metaDescription,
177177
slug: obj.slug,
178178
categories: obj.categories,
179+
attributes: obj.attributes,
179180
masterVariant: {
180181
...obj.masterVariant,
181182
availability: getVariantAvailability(obj.masterVariant.sku),

src/repositories/cart-discount/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class CartDiscountRepository extends AbstractResourceRepository<"cart-dis
4141
references: [],
4242
target: draft.target,
4343
requiresDiscountCode: draft.requiresDiscountCode || false,
44-
sortOrder: draft.sortOrder,
44+
sortOrder: draft.sortOrder ?? "0.1",
4545
stackingMode: draft.stackingMode || "Stacking",
4646
validFrom: draft.validFrom,
4747
validUntil: draft.validUntil,

src/repositories/cart/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe("Cart repository", () => {
3333
current: {
3434
name: { "nl-NL": "Dummy" },
3535
slug: { "nl-NL": "Dummy" },
36+
attributes: [],
3637
categories: [],
3738
masterVariant: {
3839
sku: "MYSKU",
@@ -57,6 +58,7 @@ describe("Cart repository", () => {
5758
staged: {
5859
name: { "nl-NL": "Dummy" },
5960
slug: { "nl-NL": "Dummy" },
61+
attributes: [],
6062
categories: [],
6163
masterVariant: {
6264
sku: "MYSKU",

0 commit comments

Comments
 (0)