Skip to content

Commit

Permalink
Update tsconfig (#23)
Browse files Browse the repository at this point in the history
* build: update settings in tsconfig

* chore: fix errors due to new tsconfig

* chore: update express dependency

* chore: use fulfillmenttools SDK 0.1.12

* build: update GH action
  • Loading branch information
arnoerpenbeck authored Apr 12, 2024
1 parent f59ef3b commit eae15a1
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "release-version=${NEW_VERSION}" >> $GITHUB_OUTPUT
- name: Create GH release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.version.outputs.release-version }}
Expand Down
29 changes: 15 additions & 14 deletions event/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
"@commercetools-backend/loggers": "22.19.0",
"@commercetools/platform-sdk": "7.4.0",
"@commercetools/sdk-client-v2": "2.3.0",
"@fulfillmenttools/fulfillmenttools-sdk-typescript": "0.1.10",
"@fulfillmenttools/fulfillmenttools-sdk-typescript": "0.1.12",
"body-parser": "1.20.2",
"date-fns": "2.30.0",
"dotenv": "16.4.5",
"express": "4.18.3",
"express": "4.19.2",
"jsonwebtoken": "9.0.2",
"msw": "1.3.2",
"shared": "file:../shared",
Expand Down
8 changes: 4 additions & 4 deletions event/src/connector/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function createOrderStateChangedSubscription(
.withKey({ key: ORDER_STATE_CHANGED_SUBSCRIPTION_KEY })
.delete({
queryArgs: {
version: subscription.version,
version: subscription?.version || 0,
},
})
.execute();
Expand Down Expand Up @@ -74,7 +74,7 @@ export async function deleteOrderStateChangedSubscription(apiRoot: ByProjectKeyR
.withKey({ key: ORDER_STATE_CHANGED_SUBSCRIPTION_KEY })
.delete({
queryArgs: {
version: subscription.version,
version: subscription?.version || 0,
},
})
.execute();
Expand Down Expand Up @@ -105,7 +105,7 @@ export async function createChannelResourceSubscription(
.withKey({ key: CHANNEL_RESOURCE_SUBSCRIPTION_KEY })
.delete({
queryArgs: {
version: subscription.version,
version: subscription?.version || 0,
},
})
.execute();
Expand Down Expand Up @@ -151,7 +151,7 @@ export async function deleteChannelResourceSubscription(apiRoot: ByProjectKeyReq
.withKey({ key: CHANNEL_RESOURCE_SUBSCRIPTION_KEY })
.delete({
queryArgs: {
version: subscription.version,
version: subscription?.version || 0,
},
})
.execute();
Expand Down
2 changes: 1 addition & 1 deletion event/src/services/channelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ChannelService {
defaultName: string,
countries: string[]
): FacilityAddressForCreation {
const defaultCountry = countries && countries.length > 0 ? countries[0] : 'DE';
const defaultCountry = countries?.[0] || 'DE';
if (address) {
return {
street: address.streetName?.trim() || 'not set',
Expand Down
2 changes: 2 additions & 0 deletions event/tests/orderMapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('OrderMapper', () => {
expect(fulfillmenttoolsOrder.consumer.email).toEqual('max.mustermann@fulfillmenttools.com');
expect(fulfillmenttoolsOrder.consumer.addresses).toHaveLength(1);
const consumerAddress = fulfillmenttoolsOrder.consumer.addresses[0];
expect(consumerAddress).toBeDefined();
expect(consumerAddress.city).toEqual('Köln');
expect(consumerAddress.street).toEqual('Schanzenstraße');
expect(consumerAddress.houseNumber).toEqual('30');
Expand All @@ -43,6 +44,7 @@ describe('OrderMapper', () => {

expect(fulfillmenttoolsOrder.orderLineItems).toHaveLength(1);
const orderLineItem = fulfillmenttoolsOrder.orderLineItems[0];
expect(orderLineItem).toBeDefined();
expect(orderLineItem.quantity).toEqual(1);
expect(orderLineItem.article).toBeDefined();
const article = orderLineItem.article;
Expand Down
20 changes: 15 additions & 5 deletions event/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
"exclude": ["node_modules", "tmp", "**/*.spec.ts", "**/*.test.ts"],
"exclude": [
"node_modules",
"tmp",
"**/*.spec.ts",
"**/*.test.ts"
],
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"lib": [
"es2021"
],
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
// "noUncheckedIndexedAccess": true,
"outDir": "./build",
"resolveJsonModule": true,
"rootDir": "./src",
"inlineSourceMap": true
"target": "es2021",
}
}
29 changes: 15 additions & 14 deletions service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
"@commercetools-backend/loggers": "22.19.0",
"@commercetools/platform-sdk": "7.4.0",
"@commercetools/sdk-client-v2": "2.3.0",
"@fulfillmenttools/fulfillmenttools-sdk-typescript": "0.1.10",
"@fulfillmenttools/fulfillmenttools-sdk-typescript": "0.1.12",
"body-parser": "1.20.2",
"date-fns": "2.30.0",
"dotenv": "16.4.5",
"express": "4.18.3",
"express": "4.19.2",
"jsonwebtoken": "9.0.2",
"msw": "1.3.2",
"shared": "file:../shared",
Expand Down
46 changes: 27 additions & 19 deletions service/src/routes/serviceRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,33 @@ export class ServiceRouter {
middleware.push(checkJwt);
}

this.serviceRouter.post(fftEvents.ORDER_CREATED, middleware, asyncHandler(orderController.orderCreated));

this.serviceRouter.post(fftEvents.PICK_JOB_CREATED, middleware, asyncHandler(pickJobController.pickJobCreated));
this.serviceRouter.post(
fftEvents.PICK_JOB_PICKING_FINISHED,
middleware,
asyncHandler(pickJobController.pickJobFinished)
);

this.serviceRouter.post(
fftEvents.HANDOVERJOB_CREATED,
middleware,
asyncHandler(handoverJobController.handoverJobCreated)
);
this.serviceRouter.post(
fftEvents.HANDOVERJOB_HANDED_OVER,
middleware,
asyncHandler(handoverJobController.handoverJobHandedOver)
);
if (fftEvents.ORDER_CREATED) {
this.serviceRouter.post(fftEvents.ORDER_CREATED, middleware, asyncHandler(orderController.orderCreated));
}
if (fftEvents.PICK_JOB_CREATED) {
this.serviceRouter.post(fftEvents.PICK_JOB_CREATED, middleware, asyncHandler(pickJobController.pickJobCreated));
}
if (fftEvents.PICK_JOB_PICKING_FINISHED) {
this.serviceRouter.post(
fftEvents.PICK_JOB_PICKING_FINISHED,
middleware,
asyncHandler(pickJobController.pickJobFinished)
);
}
if (fftEvents.HANDOVERJOB_CREATED) {
this.serviceRouter.post(
fftEvents.HANDOVERJOB_CREATED,
middleware,
asyncHandler(handoverJobController.handoverJobCreated)
);
}
if (fftEvents.HANDOVERJOB_HANDED_OVER) {
this.serviceRouter.post(
fftEvents.HANDOVERJOB_HANDED_OVER,
middleware,
asyncHandler(handoverJobController.handoverJobHandedOver)
);
}
}

public getRouter(): Router {
Expand Down
20 changes: 15 additions & 5 deletions service/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
"exclude": ["node_modules", "tmp", "**/*.spec.ts", "**/*.test.ts"],
"exclude": [
"node_modules",
"tmp",
"**/*.spec.ts",
"**/*.test.ts"
],
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"lib": [
"es2021"
],
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"outDir": "./build",
"resolveJsonModule": true,
"rootDir": "./src",
"inlineSourceMap": true
"target": "es2021",
}
}
10 changes: 5 additions & 5 deletions shared/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eae15a1

Please sign in to comment.