@lucaapp/service-utils 1.62.6 → 1.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,31 @@
1
1
  ## service-utils
2
2
 
3
- `service-utils` aims at swapping common functionality for most/all backend services in order to reduce code duplication.
4
- Future use-cases should include logging, inter-service communication, metrics etc.
3
+ `service-utils` is a shared package that provides functionality for backend
4
+ services to reduce code duplication. It includes utilities for:
5
5
 
6
- #### Development
6
+ - Logging and monitoring
7
+ - API validation and OpenAPI documentation
8
+ - Error handling
9
+ - Database operations
10
+ - Authentication and authorization
11
+ - Kafka messaging
12
+ - HTTP client operations
13
+ - And more
7
14
 
8
- Development of service-utils package will take place in your local machine, not within the docker context.
9
- Therefore, some adoptions and preparations are necessary.
10
- Follow these steps for initial setup:
15
+ ### Development Setup
11
16
 
12
- * Navigate to `packages/service-utils`
13
- * Run `yarn link`
14
- * Navigate to `services/backend`
15
- * Run `yarn link @lucaapp/service-utils`
17
+ 1. Navigate to `packages/service-utils`
18
+ 2. Run `yarn link`
19
+ 3. Navigate to `services/backend`
20
+ 4. Run `yarn link @lucaapp/service-utils`
16
21
 
17
- This will connect your local sources for `@lucaapp/service-utils`.
18
- When making changes within the package, make sure to run the `build` target within `packages/service-utils/package.json` to have the changes available to backend web.
22
+ This will connect your local sources for `@lucaapp/service-utils`. When making
23
+ changes:
19
24
 
20
- After this preparations run `package-development` from `services/backend/package.json`.
21
- The following environment should be at least in place when running the target to make sure your local `backend` setup uses the proper endpoints:
25
+ 1. Run `yarn build` in `packages/service-utils` to compile changes
26
+ 2. Run `yarn package-development` in `services/backend` to test changes
27
+
28
+ Required environment variables for local development:
22
29
 
23
30
  ```shell
24
31
  export DB_HOSTNAME=localhost
@@ -26,16 +33,34 @@ export KAFKA_BROKER=localhost:9094
26
33
  export REDIS_HOSTNAME=localhost
27
34
  ```
28
35
 
29
- It will utilize the linked package and run `backend` locally.
30
- Make sure your docker stack has at least `database`, `kafka` and `redis`, but *not* `backend` up and running.
36
+ Ensure your docker stack has `database`, `kafka`, and `redis` running (but not
37
+ `backend`).
38
+
39
+ ### Available Scripts
40
+
41
+ - `yarn build` - Compile TypeScript to JavaScript
42
+ - `yarn ts:check` - Type check without emitting files
43
+ - `yarn lint` - Run ESLint
44
+ - `yarn test` - Run tests with Vitest
45
+ - `yarn test:coverage` - Run tests with coverage report
46
+ - `yarn test:ci` - Run tests in CI environment
47
+ - `yarn audit` - Run security audit (ignoring dev dependencies)
48
+
49
+ ### Publishing
31
50
 
32
- You should now be able to develop changes for `@lucaapp/service-utils`.
51
+ The package is automatically published when changes are merged to `dev`. Follow
52
+ [semantic-release](https://www.npmjs.com/package/semantic-release) conventions
53
+ in commit messages to trigger appropriate versioning.
33
54
 
34
- #### Packaging
55
+ ### Dependencies
35
56
 
36
- Packaging of `@lucaapp/service-utils` will be automatically published, when run in `dev`.
37
- See `./gitlab-ci/publish[.template].yml` for reference.
57
+ The package uses modern versions of key dependencies:
38
58
 
39
- Make sure to follow [semantic-release](https://www.npmjs.com/package/semantic-release) conventions when writing commit messages.
59
+ - TypeScript 5.5.3
60
+ - Node.js 18
61
+ - Express 4.21.2
62
+ - Sequelize 6.32.0
63
+ - Zod 3.22.3
64
+ - Vitest 3.0.5 for testing
40
65
 
41
- Depending on the used semantic-release indicators a new version of `@lucaapp/service-utils` will be made available and tagged within the luca-web repository.
66
+ See `package.json` for a complete list of dependencies.
@@ -5,4 +5,9 @@ export type Reservation = {
5
5
  startsAt: Date;
6
6
  createdAt: Date;
7
7
  updatedAt: Date;
8
+ tables?: Array<{
9
+ id: string;
10
+ internalNumber: number;
11
+ customName: string | null;
12
+ }>;
8
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "1.62.6",
3
+ "version": "1.63.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  "@types/node": "18.18.2",
28
28
  "@types/response-time": "^2.3.8",
29
29
  "@types/swagger-ui-express": "4.1.3",
30
- "axios": "^1.7.4",
30
+ "axios": "^1.8.2",
31
31
  "busboy": "^1.6.0",
32
32
  "cls-rtracer": "^2.6.2",
33
33
  "express": "4.21.2",
@@ -47,7 +47,8 @@
47
47
  "swagger-ui-express": "5.0.1",
48
48
  "url-value-parser": "^2.2.0",
49
49
  "uuid": "^9.0.0",
50
- "zod": "3.22.3"
50
+ "zod": "3.22.3",
51
+ "@apidevtools/swagger-parser": "10.0.3"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@types/busboy": "^1.5.3",
@@ -82,6 +83,7 @@
82
83
  "cookie": ">= 0.7.0",
83
84
  "string-width": "4.2.3",
84
85
  "@types/express": "4.17.15",
85
- "esbuild": "^0.25.0"
86
+ "esbuild": "^0.25.0",
87
+ "axios": "^1.8.2"
86
88
  }
87
89
  }